From f0f4ea935ad4cf6a2d6142e049007cd2bf0cd6f9 Mon Sep 17 00:00:00 2001 From: David Keri Date: Fri, 28 Oct 2016 17:29:16 +0200 Subject: [PATCH 001/870] Initial commit of the Annotation tool --- Scripts/EditorVR.cs | 13 +- Scripts/Interfaces/IOtherRay.cs | 8 + Scripts/Interfaces/IOtherRay.cs.meta | 12 + .../Intersection/IntersectionModule.cs | 5 +- Tools/AnnotationTool.meta | 9 + Tools/AnnotationTool/AnnotationInput.asset | 90 +++ .../AnnotationTool/AnnotationInput.asset.meta | 8 + Tools/AnnotationTool/AnnotationInput.cs | 13 + Tools/AnnotationTool/AnnotationInput.cs.meta | 12 + Tools/AnnotationTool/AnnotationTool.cs | 388 +++++++++++ Tools/AnnotationTool/AnnotationTool.cs.meta | 18 + Tools/AnnotationTool/ColorPickerSquareUI.cs | 18 + .../ColorPickerSquareUI.cs.meta | 12 + Tools/AnnotationTool/ColorPickerUI.cs | 142 ++++ Tools/AnnotationTool/ColorPickerUI.cs.meta | 12 + Tools/AnnotationTool/Materials.meta | 9 + .../Materials/AnnotationMaterial.mat | 127 ++++ .../Materials/AnnotationMaterial.mat.meta | 8 + Tools/AnnotationTool/Prefabs.meta | 9 + .../Prefabs/ColorPickerUI.prefab | 644 ++++++++++++++++++ .../Prefabs/ColorPickerUI.prefab.meta | 8 + 21 files changed, 1562 insertions(+), 3 deletions(-) create mode 100644 Scripts/Interfaces/IOtherRay.cs create mode 100644 Scripts/Interfaces/IOtherRay.cs.meta create mode 100644 Tools/AnnotationTool.meta create mode 100644 Tools/AnnotationTool/AnnotationInput.asset create mode 100644 Tools/AnnotationTool/AnnotationInput.asset.meta create mode 100644 Tools/AnnotationTool/AnnotationInput.cs create mode 100644 Tools/AnnotationTool/AnnotationInput.cs.meta create mode 100644 Tools/AnnotationTool/AnnotationTool.cs create mode 100644 Tools/AnnotationTool/AnnotationTool.cs.meta create mode 100644 Tools/AnnotationTool/ColorPickerSquareUI.cs create mode 100644 Tools/AnnotationTool/ColorPickerSquareUI.cs.meta create mode 100644 Tools/AnnotationTool/ColorPickerUI.cs create mode 100644 Tools/AnnotationTool/ColorPickerUI.cs.meta create mode 100644 Tools/AnnotationTool/Materials.meta create mode 100644 Tools/AnnotationTool/Materials/AnnotationMaterial.mat create mode 100644 Tools/AnnotationTool/Materials/AnnotationMaterial.mat.meta create mode 100644 Tools/AnnotationTool/Prefabs.meta create mode 100644 Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab create mode 100644 Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab.meta diff --git a/Scripts/EditorVR.cs b/Scripts/EditorVR.cs index d1fc11246..45179344d 100644 --- a/Scripts/EditorVR.cs +++ b/Scripts/EditorVR.cs @@ -930,6 +930,17 @@ private void ConnectInterfaces(object obj, InputDevice device = null) continueSearching = false; } + var otherRay = obj as IOtherRay; + if (otherRay != null) + { + Node otherNode = (Node)(1 - (int)node.Value); + Transform otherRayOrigin; + if (proxy.rayOrigins.TryGetValue(otherNode, out otherRayOrigin)) + { + otherRay.otherRayOrigin = otherRayOrigin; + } + } + if (mainMenu != null) { Transform mainMenuOrigin; @@ -1808,4 +1819,4 @@ private static void OnEVRDisabled() U.Object.Destroy(s_InputManager.gameObject); } #endif -} \ No newline at end of file +} diff --git a/Scripts/Interfaces/IOtherRay.cs b/Scripts/Interfaces/IOtherRay.cs new file mode 100644 index 000000000..c14cacfb2 --- /dev/null +++ b/Scripts/Interfaces/IOtherRay.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +interface IOtherRay +{ + + Transform otherRayOrigin { set; } + +} diff --git a/Scripts/Interfaces/IOtherRay.cs.meta b/Scripts/Interfaces/IOtherRay.cs.meta new file mode 100644 index 000000000..853178588 --- /dev/null +++ b/Scripts/Interfaces/IOtherRay.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3de23ab833530fd44965614ec4fbae32 +timeCreated: 1477643387 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/Intersection/IntersectionModule.cs b/Scripts/Modules/Intersection/IntersectionModule.cs index 0c4872104..517253dca 100644 --- a/Scripts/Modules/Intersection/IntersectionModule.cs +++ b/Scripts/Modules/Intersection/IntersectionModule.cs @@ -124,8 +124,9 @@ void OnIntersectionExit(IntersectionTester tester, Renderer obj) public Renderer GetIntersectedObjectForTester(IntersectionTester tester) { - Renderer obj; - m_IntersectedObjects.TryGetValue(tester, out obj); + Renderer obj = null; + if (tester) + m_IntersectedObjects.TryGetValue(tester, out obj); return obj; } } diff --git a/Tools/AnnotationTool.meta b/Tools/AnnotationTool.meta new file mode 100644 index 000000000..2973ba689 --- /dev/null +++ b/Tools/AnnotationTool.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: da4faa7602ad6ab4e8a7bf7571253606 +folderAsset: yes +timeCreated: 1477667449 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/AnnotationInput.asset b/Tools/AnnotationTool/AnnotationInput.asset new file mode 100644 index 000000000..d09feefc3 --- /dev/null +++ b/Tools/AnnotationTool/AnnotationInput.asset @@ -0,0 +1,90 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} + m_Name: AnnotationInput + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Actions: + - {fileID: 114000013162093460} + - {fileID: 114000010589948208} + m_ControlSchemes: + - m_Name: AnnotationInput + m_DeviceSlots: + - m_Key: 1 + m_Type: + m_TypeName: UnityEngine.InputNew.VRInputDevice, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_TagIndex: -1 + m_ActionMap: {fileID: 11400000} + m_Bindings: + - sources: + - controlIndex: 2 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 0 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + m_MapTypeName: AnnotationInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + m_CustomNamespace: +--- !u!114 &114000010589948208 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: ChangeBrushSize + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 1 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: ChangeBrushSize + defaultValue: 0 +--- !u!114 &114000013162093460 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Draw + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 0 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Draw + defaultValue: 0 diff --git a/Tools/AnnotationTool/AnnotationInput.asset.meta b/Tools/AnnotationTool/AnnotationInput.asset.meta new file mode 100644 index 000000000..ca12eec5e --- /dev/null +++ b/Tools/AnnotationTool/AnnotationInput.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6615fd7d8b165fe43bc85867850097e5 +timeCreated: 1477573784 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/AnnotationInput.cs b/Tools/AnnotationTool/AnnotationInput.cs new file mode 100644 index 000000000..77764c2fd --- /dev/null +++ b/Tools/AnnotationTool/AnnotationInput.cs @@ -0,0 +1,13 @@ +using UnityEngine; +using UnityEngine.InputNew; + +// GENERATED FILE - DO NOT EDIT MANUALLY +namespace UnityEngine.InputNew +{ + public class AnnotationInput : ActionMapInput { + public AnnotationInput (ActionMap actionMap) : base (actionMap) { } + + public ButtonInputControl @draw { get { return (ButtonInputControl)this[0]; } } + public AxisInputControl @changeBrushSize { get { return (AxisInputControl)this[1]; } } + } +} diff --git a/Tools/AnnotationTool/AnnotationInput.cs.meta b/Tools/AnnotationTool/AnnotationInput.cs.meta new file mode 100644 index 000000000..856a2ee2e --- /dev/null +++ b/Tools/AnnotationTool/AnnotationInput.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 83fa42dc324cf7c49a8d82bf1d1f262b +timeCreated: 1477573798 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs new file mode 100644 index 000000000..47c56b12a --- /dev/null +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -0,0 +1,388 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.VR.Tools; +using System; +using UnityEngine.InputNew; +using System.Linq; +using System.Collections.Generic; +using UnityEngine.VR.Utilities; + +[MainMenuItem("Annotation", "Tools", "Draw in da spaaaaaace")] +public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IRay, ICustomRay, IOtherRay, IInstantiateUI +{ + public Transform rayOrigin { private get; set; } + public Transform otherRayOrigin { private get; set; } + + public Action showDefaultRay { get; set; } + public Action hideDefaultRay { get; set; } + + public ActionMap actionMap + { + get { return m_ActionMap; } + } + [SerializeField] + private ActionMap m_ActionMap; + + public ActionMapInput actionMapInput { get { return m_AnnotationInput; } set { m_AnnotationInput = (AnnotationInput)value; } } + + public Func instantiateUI { private get; set; } + + private AnnotationInput m_AnnotationInput; + + private const int kInitialListSize = 65535; + + private List m_Points = new List(kInitialListSize); + private List m_Forwards = new List(kInitialListSize); + + private MeshFilter m_CurrentMeshFilter; + private Color m_ColorToUse = Color.white; + private Mesh m_CurrentMesh; + private Matrix4x4 m_WorldToLocalMesh; + + [SerializeField] + Material m_AnnotationMaterial; + + [SerializeField] + Material m_ConeMaterial; + + [SerializeField] + GameObject m_ColorPickerPrefab; + GameObject m_ColorPicker; + + Transform m_AnnotationHolder; + + bool m_RayHidden; + + Mesh m_CustomPointer; + + const float kTopMinRadius = 0.001f; + const float kTopMaxRadius = 0.05f; + const float kBottomRadius = 0.01f; + const float kTipDistance = 0.05f; + const int kSides = 16; + + float m_CurrentRadius = kTopMinRadius; + + void OnDestroy() + { + if (m_RayHidden && showDefaultRay != null) + { + // HACK: In the previous dev version, hideDefaultRay also disabled the cone. + var proxyRay = rayOrigin.GetComponentInChildren(); + if (proxyRay) + proxyRay.transform.Find("Cone").gameObject.SetActive(true); + + showDefaultRay(); + } + + U.Object.Destroy(m_ColorPicker); + } + + void Update() + { + if (!m_RayHidden) + { + if (hideDefaultRay != null) + { + hideDefaultRay(); + + // HACK: In the previous dev version, hideDefaultRay also disabled the cone. + var proxyRay = rayOrigin.GetComponentInChildren(); + if (proxyRay) + proxyRay.transform.Find("Cone").gameObject.SetActive(false); + + m_RayHidden = true; + } + } + + if (rayOrigin != null) + { + GenerateCustomPointer(); + + if (otherRayOrigin != null) + CheckColorPicker(); + } + + if (m_AnnotationInput.draw.wasJustPressed) + SetupAnnotation(); + if (m_AnnotationInput.draw.isHeld) + UpdateAnnotation(); + + if (m_AnnotationInput.changeBrushSize.value != 0) + HandleBrushSize(); + } + + private void CheckColorPicker() + { + var distance = Vector3.Distance(rayOrigin.position, otherRayOrigin.position); + float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); + if (distance < .325f && dot > 0) + { + if (m_ColorPicker == null) + { + m_ColorPicker = instantiateUI(m_ColorPickerPrefab); + var colorPicker = m_ColorPicker.GetComponent(); + colorPicker.toolRayOrigin = rayOrigin; + colorPicker.onColorPicked = HandleColoring; + + var pickerTransform = m_ColorPicker.transform; + pickerTransform.SetParent(otherRayOrigin); + pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; + pickerTransform.localRotation = Quaternion.identity; + } + + if (!m_ColorPicker.activeSelf) + m_ColorPicker.SetActive(true); + } + else if (m_ColorPicker && m_ColorPicker.activeSelf) + { + m_ColorPicker.SetActive(false); + } + } + + private void HandleColoring(Color newColor) + { + m_ColorToUse = newColor; + } + + private void HandleBrushSize() + { + if (m_CustomPointer != null) + { + var sign = m_AnnotationInput.changeBrushSize.value; + m_CurrentRadius += sign * Time.unscaledDeltaTime * .1f; + m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); + + var vertices = m_CustomPointer.vertices; + for (int i = kSides; i < kSides * 2; i++) + { + float xPos = Mathf.Cos(i / 16f * Mathf.PI * 2) * m_CurrentRadius; + float yPos = Mathf.Sin(i / 16f * Mathf.PI * 2) * m_CurrentRadius; + Vector3 point = new Vector3(xPos, yPos, kTipDistance); + vertices[i] = point; + } + m_CustomPointer.vertices = vertices; + } + } + + private void GenerateCustomPointer() + { + if (m_CustomPointer != null) + return; + + m_CustomPointer = new Mesh(); + m_CustomPointer.vertices = GenerateVertices(); + m_CustomPointer.triangles = GenerateTriangles(); + + var customPointer = new GameObject("CustomPointer"); + + customPointer.AddComponent().sharedMesh = m_CustomPointer; + customPointer.AddComponent().sharedMaterial = m_ConeMaterial; + + var pointerTrans = customPointer.transform; + pointerTrans.SetParent(rayOrigin); + + pointerTrans.localPosition = Vector3.zero; + pointerTrans.localScale = Vector3.one; + pointerTrans.localRotation = Quaternion.identity; + } + + private Vector3[] GenerateVertices() + { + List points = new List(); + + for (int capIndex = 0; capIndex < 2; capIndex++) + { + float radius = capIndex == 0 ? kBottomRadius : Mathf.Lerp(kTopMaxRadius, kTopMinRadius, capIndex); + + for (int i = 0; i < kSides; i++) + { + float xPos = Mathf.Cos(i / 16f * Mathf.PI * 2) * radius; + float yPos = Mathf.Sin(i / 16f * Mathf.PI * 2) * radius; + Vector3 point = new Vector3(xPos, yPos, capIndex * kTipDistance); + points.Add(point); + } + } + points.Add(new Vector3(0, 0, 0)); + points.Add(new Vector3(0, 0, kTipDistance)); + + return points.ToArray(); + } + + private int[] GenerateTriangles() + { + List triangles = new List(); + + GenerateSide(triangles); + GenerateCaps(triangles); + + return triangles.ToArray(); + } + + private void GenerateSide(List triangles) + { + for (int i = 1; i < kSides; i++) + { + int lowerLeft = i - 1; + int lowerRight = i; + int upperLeft = i + kSides - 1; + int upperRight = i + kSides; + + triangles.Add(lowerLeft); + triangles.Add(lowerRight); + triangles.Add(upperLeft); + + triangles.Add(lowerRight); + triangles.Add(upperRight); + triangles.Add(upperLeft); + } + + // Finish the side with a polygon that loops around from the end to the start vertices. + triangles.Add(kSides - 1); + triangles.Add(0); + triangles.Add(kSides * 2 - 1); + + triangles.Add(0); + triangles.Add(kSides); + triangles.Add(kSides * 2 - 1); + } + + private void GenerateCaps(List triangles) + { + // Generate the bottom circle cap. + for (int i = 1; i < kSides; i++) + { + int lowLeft = i - 1; + int lowRight = i; + int upLeft = kSides * 2; + + triangles.Add(upLeft); + triangles.Add(lowRight); + triangles.Add(lowLeft); + } + + // Close the bottom circle cap with a start-end loop triangle. + triangles.Add(kSides * 2); + triangles.Add(0); + triangles.Add(kSides - 1); + + // Generate the top circle cap. + for (int i = kSides + 1; i < kSides * 2; i++) + { + int lowLeft = i - 1; + int lowRight = i; + int upLeft = kSides * 2 + 1; + + triangles.Add(lowLeft); + triangles.Add(lowRight); + triangles.Add(upLeft); + } + + // Close the top circle cap with a start-end loop triangle. + triangles.Add(kSides * 2 - 1); + triangles.Add(kSides); + triangles.Add(kSides * 2 + 1); + } + + private void SetupAnnotation() + { + SetupHolder(); + + m_Points.Clear(); + m_Forwards.Clear(); + + GameObject go = new GameObject("Annotation " + m_AnnotationHolder.childCount); + + Transform goTrans = go.transform; + goTrans.SetParent(m_AnnotationHolder); + goTrans.position = rayOrigin.position; + + m_CurrentMeshFilter = go.AddComponent(); + MeshRenderer mRenderer = go.AddComponent(); + var matToUse = Instantiate(m_AnnotationMaterial); + matToUse.SetColor("_EmissionColor", m_ColorToUse); + mRenderer.sharedMaterial = matToUse; + + m_WorldToLocalMesh = goTrans.worldToLocalMatrix; + + m_CurrentMesh = new Mesh(); + PointsToMesh(); + } + + private void SetupHolder() + { + if (m_AnnotationHolder == null) + { + var mainHolder = GameObject.Find("Annotations"); + if (!mainHolder) + mainHolder = new GameObject("Annotations"); + + var newSession = new GameObject("Session " + DateTime.Now.ToString()); + m_AnnotationHolder = newSession.transform; + m_AnnotationHolder.SetParent(mainHolder.transform); + } + } + + private void UpdateAnnotation() + { + Vector3 rayForward = rayOrigin.forward; + Vector3 worldPoint = rayOrigin.position + rayForward * kTipDistance; + Vector3 localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); + + if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * .25f)) + { + m_Points.Add(localPoint); + m_Forwards.Add(rayForward); + + PointsToMesh(); + } + } + + private void PointsToMesh() + { + if (m_Points.Count < 2) + return; + + if (m_CurrentMesh == null) + m_CurrentMesh = new Mesh(); + + List newVertices = new List(m_CurrentMesh.vertices); + List newTriangles = new List(m_CurrentMesh.triangles); + + for (int i = m_CurrentMesh.vertexCount / 2 + 1; i < m_Points.Count; i++) + { + Vector3 direction = (m_Points[i - 1] - m_Points[i]).normalized; + Vector3 cross = Vector3.Cross(direction, m_Forwards[i - 1]) * m_CurrentRadius; + + newVertices.Add(m_Points[i - 1] - cross); + newVertices.Add(m_Points[i - 1] + cross); + } + + for (int i = Mathf.Max(3, m_CurrentMesh.vertexCount - 1); i < newVertices.Count; i += 2) + { + newTriangles.Add(i - 1); + newTriangles.Add(i - 2); + newTriangles.Add(i - 3); + + newTriangles.Add(i - 2); + newTriangles.Add(i - 1); + newTriangles.Add(i); + + // Add the same triangles in reverse to get a two-sided mesh. + newTriangles.Add(i - 3); + newTriangles.Add(i - 2); + newTriangles.Add(i - 1); + + newTriangles.Add(i); + newTriangles.Add(i - 1); + newTriangles.Add(i - 2); + } + + m_CurrentMesh.vertices = newVertices.ToArray(); + m_CurrentMesh.triangles = newTriangles.ToArray(); + m_CurrentMesh.UploadMeshData(false); + + m_CurrentMeshFilter.sharedMesh = m_CurrentMesh; + } + +} diff --git a/Tools/AnnotationTool/AnnotationTool.cs.meta b/Tools/AnnotationTool/AnnotationTool.cs.meta new file mode 100644 index 000000000..d65a4b097 --- /dev/null +++ b/Tools/AnnotationTool/AnnotationTool.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ecba8b13e3259e14eab642c0d0657d5c +timeCreated: 1477664370 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_ActionMap: {fileID: 11400000, guid: 6615fd7d8b165fe43bc85867850097e5, type: 2} + - m_AnnotationMaterial: {fileID: 2100000, guid: 252a12e5980ef5b438bcc0dbc0d35529, + type: 2} + - m_ConeMaterial: {fileID: 2100000, guid: 0372357aa9e962f47a35f6b6350ae99c, type: 2} + - m_ColorPickerPrefab: {fileID: 1000014053269536, guid: da56ed8b2b72e414589b2938af94c498, + type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/ColorPickerSquareUI.cs b/Tools/AnnotationTool/ColorPickerSquareUI.cs new file mode 100644 index 000000000..f90287419 --- /dev/null +++ b/Tools/AnnotationTool/ColorPickerSquareUI.cs @@ -0,0 +1,18 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; +using UnityEngine.EventSystems; +using System; + +public class ColorPickerSquareUI : Selectable, IDragHandler +{ + + public Action onDrag { private get; set; } + + public void OnDrag(PointerEventData eventData) + { + if (onDrag != null) + onDrag(); + } + +} diff --git a/Tools/AnnotationTool/ColorPickerSquareUI.cs.meta b/Tools/AnnotationTool/ColorPickerSquareUI.cs.meta new file mode 100644 index 000000000..fc6f62e06 --- /dev/null +++ b/Tools/AnnotationTool/ColorPickerSquareUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d26287cff9f94b448a1b36ffa9eccd4e +timeCreated: 1477661287 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/ColorPickerUI.cs b/Tools/AnnotationTool/ColorPickerUI.cs new file mode 100644 index 000000000..f30202c61 --- /dev/null +++ b/Tools/AnnotationTool/ColorPickerUI.cs @@ -0,0 +1,142 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; +using System; +using UnityEngine.EventSystems; + +public class ColorPickerUI : MonoBehaviour +{ + + public Transform toolRayOrigin { private get; set; } + + public Action onColorPicked { private get; set; } + + [SerializeField] + RawImage m_ColorPicker; + + [SerializeField] + Slider m_BrightnessSlider; + + [SerializeField] + RawImage m_SliderBackground; + + [SerializeField] + RectTransform m_Picker; + + Vector3 m_PickerTargetPosition; + + [SerializeField] + ColorPickerSquareUI m_ColorPickerSquare; + + Texture2D m_BrightnessBarTexture; + Texture2D m_ColorPickerTexture; + + void Start() + { + m_ColorPickerSquare.onDrag = OnDrag; + + GenerateColorPicker(); + GenerateBrightnessBar(); + } + + void OnDestroy() + { + DestroyImmediate(m_BrightnessBarTexture); + DestroyImmediate(m_ColorPickerTexture); + } + + void Update() + { + m_Picker.localPosition = m_PickerTargetPosition; + } + + public void OnSliderChanged(float val) + { + m_ColorPicker.color = Color.Lerp(Color.black, Color.white, val); + PositionToColor(); + } + + void OnDrag() + { + if (toolRayOrigin) + { + var worldToLocal = m_ColorPicker.rectTransform.worldToLocalMatrix; + var rect = m_ColorPicker.rectTransform.rect; + + var localRayPos = worldToLocal.MultiplyPoint3x4(toolRayOrigin.position); + var localRayForward = worldToLocal.MultiplyVector(toolRayOrigin.forward).normalized; + + float height = localRayPos.z; + float angle = Vector3.Angle(new Vector3(0, 0, height), localRayForward); + float sine = Mathf.Sin((90 - angle) * Mathf.Deg2Rad); + + float distance = Mathf.Abs(height / sine); + Vector2 point = localRayPos + localRayForward * distance; + point.x = Mathf.Clamp(point.x, -rect.width / 2f, rect.width / 2f); + point.y = Mathf.Clamp(point.y, -rect.height / 2f, rect.height / 2f); + + m_PickerTargetPosition = point; + GenerateBrightnessBar(); + PositionToColor(); + } + } + + private void GenerateBrightnessBar() + { + var rect = m_SliderBackground.rectTransform.rect; + if (!m_BrightnessBarTexture) + m_BrightnessBarTexture = new Texture2D((int)rect.width, 1); + + var squareRect = m_ColorPicker.rectTransform.rect; + var pickerPos = m_Picker.localPosition; + + float hue = (pickerPos.x + squareRect.width / 2f) / squareRect.width; + float saturation = (pickerPos.y + squareRect.height / 2f) / squareRect.height; + + for (int y = 0; y < m_BrightnessBarTexture.height; y++) + { + for (int x = 0; x < m_BrightnessBarTexture.width; x++) + { + float brightness = x / rect.width; + m_BrightnessBarTexture.SetPixel(x, y, Color.HSVToRGB(hue, saturation, brightness)); + } + } + m_BrightnessBarTexture.Apply(); + + m_SliderBackground.texture = m_BrightnessBarTexture; + } + + private void GenerateColorPicker() + { + var rect = m_ColorPicker.rectTransform.rect; + if (!m_ColorPickerTexture) + m_ColorPickerTexture = new Texture2D((int)rect.width, (int)rect.height); + + for (int y = 0; y < m_ColorPickerTexture.height; y++) + { + for (int x = 0; x < m_ColorPickerTexture.width; x++) + { + float hue = x / rect.width; + float saturation = y / rect.height; + m_ColorPickerTexture.SetPixel(x, y, Color.HSVToRGB(hue, saturation, 1)); + } + } + m_ColorPickerTexture.Apply(); + + m_ColorPicker.texture = m_ColorPickerTexture; + } + + private void PositionToColor() + { + var rect = m_ColorPicker.rectTransform.rect; + + float hue = (m_PickerTargetPosition.x + rect.width / 2f) / rect.width; + float saturation = (m_PickerTargetPosition.y + rect.height / 2f) / rect.height; + float brightness = m_BrightnessSlider.value; + + Color col = Color.HSVToRGB(hue, saturation, brightness); + if (onColorPicked != null) + onColorPicked(col); + } + +} diff --git a/Tools/AnnotationTool/ColorPickerUI.cs.meta b/Tools/AnnotationTool/ColorPickerUI.cs.meta new file mode 100644 index 000000000..02ad84300 --- /dev/null +++ b/Tools/AnnotationTool/ColorPickerUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ab372430e8c50ee47b774cdb4ac79e18 +timeCreated: 1477640926 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Materials.meta b/Tools/AnnotationTool/Materials.meta new file mode 100644 index 000000000..cc6965419 --- /dev/null +++ b/Tools/AnnotationTool/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b3a4b2db883213c48b590af3db6be349 +folderAsset: yes +timeCreated: 1477667593 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Materials/AnnotationMaterial.mat b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat new file mode 100644 index 000000000..384aa1115 --- /dev/null +++ b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat @@ -0,0 +1,127 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: AnnotationMaterial + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: _BumpScale + second: 1 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 0 + - first: + name: _GlossMapScale + second: 1 + - first: + name: _Glossiness + second: 0.25 + - first: + name: _GlossyReflections + second: 1 + - first: + name: _Metallic + second: 0 + - first: + name: _Mode + second: 0 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _SmoothnessTextureChannel + second: 0 + - first: + name: _SpecularHighlights + second: 1 + - first: + name: _SrcBlend + second: 1 + - first: + name: _UVSec + second: 0 + - first: + name: _ZWrite + second: 1 + m_Colors: + - first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} + - first: + name: _EmissionColor + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tools/AnnotationTool/Materials/AnnotationMaterial.mat.meta b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat.meta new file mode 100644 index 000000000..8c0ca3eea --- /dev/null +++ b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 252a12e5980ef5b438bcc0dbc0d35529 +timeCreated: 1477664312 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Prefabs.meta b/Tools/AnnotationTool/Prefabs.meta new file mode 100644 index 000000000..23a388775 --- /dev/null +++ b/Tools/AnnotationTool/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 36021c4df8de75f449062f96937c0d40 +folderAsset: yes +timeCreated: 1477667598 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab new file mode 100644 index 000000000..4c1872af8 --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab @@ -0,0 +1,644 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000014053269536} + m_IsPrefabParent: 1 +--- !u!1 &1000010858889288 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013185230874} + - 222: {fileID: 222000010561662458} + - 114: {fileID: 114000012897558622} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010971963212 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011175436320} + - 222: {fileID: 222000012511099340} + - 114: {fileID: 114000010107362308} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011497691126 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011329703258} + - 222: {fileID: 222000013522047514} + - 114: {fileID: 114000010921122496} + m_Layer: 5 + m_Name: ColorPicker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011703522768 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011490740336} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012895587350 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011527980190} + - 114: {fileID: 114000012700991384} + m_Layer: 5 + m_Name: BrightnessSlider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013245418944 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013645424882} + - 222: {fileID: 222000012581356688} + - 114: {fileID: 114000012154235052} + - 114: {fileID: 114000011102508162} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013398886292 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013852143400} + - 222: {fileID: 222000011226943598} + - 114: {fileID: 114000011520655588} + m_Layer: 5 + m_Name: Picker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014053269536 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000010585279630} + - 223: {fileID: 223000011449390414} + - 114: {fileID: 114000012075775966} + - 114: {fileID: 114000010288221908} + - 114: {fileID: 114000013470492078} + m_Layer: 5 + m_Name: ColorPickerUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &114000010107362308 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010971963212} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &114000010288221908 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014053269536} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114000010921122496 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011497691126} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Content: {fileID: 224000013852143400} + m_Horizontal: 1 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 0 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 224000013645424882} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 0 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000011102508162 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013245418944} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d26287cff9f94b448a1b36ffa9eccd4e, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000012154235052} +--- !u!114 &114000011520655588 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013398886292} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 054f8016e5e85e745a11230d51f0ca2b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012075775966 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014053269536} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &114000012154235052 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013245418944} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &114000012700991384 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012895587350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000012897558622} + m_FillRect: {fileID: 0} + m_HandleRect: {fileID: 224000013185230874} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 1 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000013470492078} + m_MethodName: OnSliderChanged + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000012897558622 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010858889288} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 0 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013470492078 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014053269536} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ab372430e8c50ee47b774cdb4ac79e18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ColorPicker: {fileID: 114000012154235052} + m_BrightnessSlider: {fileID: 114000012700991384} + m_SliderBackground: {fileID: 114000010107362308} + m_Picker: {fileID: 224000013852143400} + m_ColorPickerSquare: {fileID: 114000011102508162} +--- !u!222 &222000010561662458 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010858889288} +--- !u!222 &222000011226943598 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013398886292} +--- !u!222 &222000012511099340 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010971963212} +--- !u!222 &222000012581356688 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013245418944} +--- !u!222 &222000013522047514 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011497691126} +--- !u!223 &223000011449390414 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014053269536} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &224000010585279630 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014053269536} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.0005, y: 0.0005, z: 0.0005} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000011329703258} + - {fileID: 224000011527980190} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0.17, y: 0} + m_SizeDelta: {x: 512, y: 640} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011175436320 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010971963212} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011527980190} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011329703258 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011497691126} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000013645424882} + m_Father: {fileID: 224000010585279630} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 512} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &224000011490740336 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011703522768} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000013185230874} + m_Father: {fileID: 224000011527980190} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -48} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011527980190 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012895587350} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000011175436320} + - {fileID: 224000011490740336} + m_Father: {fileID: 224000010585279630} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 128} + m_Pivot: {x: 0.5, y: 0} +--- !u!224 &224000013185230874 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010858889288} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011490740336} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 4.1, y: 0} + m_SizeDelta: {x: 28.3, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013645424882 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013245418944} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000013852143400} + m_Father: {fileID: 224000011329703258} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013852143400 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013398886292} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000013645424882} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 50, y: 50} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab.meta b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab.meta new file mode 100644 index 000000000..c8b111ed0 --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da56ed8b2b72e414589b2938af94c498 +timeCreated: 1477642301 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From 7846af37943763c609661f543d8d5ddda0846efb Mon Sep 17 00:00:00 2001 From: David Keri Date: Fri, 28 Oct 2016 17:32:47 +0200 Subject: [PATCH 002/870] Fix line-endings of the auto-generated input class --- Tools/AnnotationTool/AnnotationInput.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/AnnotationTool/AnnotationInput.cs b/Tools/AnnotationTool/AnnotationInput.cs index 77764c2fd..97fffc5f4 100644 --- a/Tools/AnnotationTool/AnnotationInput.cs +++ b/Tools/AnnotationTool/AnnotationInput.cs @@ -10,4 +10,4 @@ public AnnotationInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @draw { get { return (ButtonInputControl)this[0]; } } public AxisInputControl @changeBrushSize { get { return (AxisInputControl)this[1]; } } } -} +} From 37d4267517fb73e44ae69768c34ad5d574f75ddb Mon Sep 17 00:00:00 2001 From: David Keri Date: Thu, 3 Nov 2016 16:00:19 +0100 Subject: [PATCH 003/870] add undo to annotation tool optimize generated mesh handling --- Tools/AnnotationTool/AnnotationInput.asset | 33 +- Tools/AnnotationTool/AnnotationInput.cs | 1 + Tools/AnnotationTool/AnnotationTool.cs | 310 ++++++++++++------ Tools/AnnotationTool/AnnotationTool.cs.meta | 2 +- Tools/AnnotationTool/ColorPickerUI.cs | 65 +++- .../Prefabs/ColorPickerUI.prefab | 13 + 6 files changed, 318 insertions(+), 106 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationInput.asset b/Tools/AnnotationTool/AnnotationInput.asset index d09feefc3..b1c171015 100644 --- a/Tools/AnnotationTool/AnnotationInput.asset +++ b/Tools/AnnotationTool/AnnotationInput.asset @@ -15,6 +15,7 @@ MonoBehaviour: m_Actions: - {fileID: 114000013162093460} - {fileID: 114000010589948208} + - {fileID: 114000012503875562} m_ControlSchemes: - m_Name: AnnotationInput m_DeviceSlots: @@ -35,7 +36,16 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 0 + - controlIndex: 1 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 3 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -67,6 +77,27 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: ChangeBrushSize defaultValue: 0 +--- !u!114 &114000012503875562 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Undo + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 2 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Undo + defaultValue: 0 --- !u!114 &114000013162093460 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Tools/AnnotationTool/AnnotationInput.cs b/Tools/AnnotationTool/AnnotationInput.cs index 97fffc5f4..30c34db45 100644 --- a/Tools/AnnotationTool/AnnotationInput.cs +++ b/Tools/AnnotationTool/AnnotationInput.cs @@ -9,5 +9,6 @@ public AnnotationInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @draw { get { return (ButtonInputControl)this[0]; } } public AxisInputControl @changeBrushSize { get { return (AxisInputControl)this[1]; } } + public ButtonInputControl @undo { get { return (ButtonInputControl)this[2]; } } } } diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 47c56b12a..a656a30f6 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Collections.Generic; using UnityEngine.VR.Utilities; +using UnityEditor.VR; [MainMenuItem("Annotation", "Tools", "Draw in da spaaaaaace")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IRay, ICustomRay, IOtherRay, IInstantiateUI @@ -33,6 +34,7 @@ public ActionMap actionMap private List m_Points = new List(kInitialListSize); private List m_Forwards = new List(kInitialListSize); + private List m_Widths = new List(kInitialListSize); private MeshFilter m_CurrentMeshFilter; private Color m_ColorToUse = Color.white; @@ -40,28 +42,30 @@ public ActionMap actionMap private Matrix4x4 m_WorldToLocalMesh; [SerializeField] - Material m_AnnotationMaterial; + private Material m_AnnotationMaterial; [SerializeField] - Material m_ConeMaterial; + private Material m_ConeMaterial; [SerializeField] - GameObject m_ColorPickerPrefab; - GameObject m_ColorPicker; + private GameObject m_ColorPickerPrefab; + private ColorPickerUI m_ColorPicker; - Transform m_AnnotationHolder; + private Transform m_AnnotationHolder; - bool m_RayHidden; + private bool m_RayHidden; - Mesh m_CustomPointer; + private Mesh m_CustomPointer; - const float kTopMinRadius = 0.001f; - const float kTopMaxRadius = 0.05f; - const float kBottomRadius = 0.01f; - const float kTipDistance = 0.05f; - const int kSides = 16; + private const float kTopMinRadius = 0.001f; + private const float kTopMaxRadius = 0.05f; + private const float kBottomRadius = 0.01f; + private const float kTipDistance = 0.05f; + private const int kSides = 16; - float m_CurrentRadius = kTopMinRadius; + private float m_CurrentRadius = kTopMinRadius; + + private List m_UndoList = new List(); void OnDestroy() { @@ -102,16 +106,40 @@ void Update() if (otherRayOrigin != null) CheckColorPicker(); } - + if (m_AnnotationInput.draw.wasJustPressed) SetupAnnotation(); - if (m_AnnotationInput.draw.isHeld) + else if (m_AnnotationInput.draw.isHeld) UpdateAnnotation(); + else if (m_AnnotationInput.undo.wasJustPressed) + UndoLast(); + else if (m_AnnotationInput.draw.wasJustReleased) + m_CurrentMesh.Optimize(); if (m_AnnotationInput.changeBrushSize.value != 0) HandleBrushSize(); } + private void UndoLast() + { + if (m_UndoList.Count > 0) + { + var first = m_UndoList.Last(); + DestroyImmediate(first); + m_UndoList.RemoveAt(m_UndoList.Count - 1); + + // Clean up after the removed annotations if necessary. + if (m_UndoList.Count == 0 && m_AnnotationHolder.childCount == 0) + { + var root = m_AnnotationHolder.parent; + DestroyImmediate(m_AnnotationHolder.gameObject); + + if (root.childCount == 0) + DestroyImmediate(root.gameObject); + } + } + } + private void CheckColorPicker() { var distance = Vector3.Distance(rayOrigin.position, otherRayOrigin.position); @@ -120,10 +148,10 @@ private void CheckColorPicker() { if (m_ColorPicker == null) { - m_ColorPicker = instantiateUI(m_ColorPickerPrefab); - var colorPicker = m_ColorPicker.GetComponent(); - colorPicker.toolRayOrigin = rayOrigin; - colorPicker.onColorPicked = HandleColoring; + var colorPickerObj = instantiateUI(m_ColorPickerPrefab); + m_ColorPicker = colorPickerObj.GetComponent(); + m_ColorPicker.toolRayOrigin = rayOrigin; + m_ColorPicker.onColorPicked = HandleColoring; var pickerTransform = m_ColorPicker.transform; pickerTransform.SetParent(otherRayOrigin); @@ -131,13 +159,11 @@ private void CheckColorPicker() pickerTransform.localRotation = Quaternion.identity; } - if (!m_ColorPicker.activeSelf) - m_ColorPicker.SetActive(true); - } - else if (m_ColorPicker && m_ColorPicker.activeSelf) - { - m_ColorPicker.SetActive(false); + if (!m_ColorPicker.enabled) + m_ColorPicker.Show(); } + else if (m_ColorPicker && m_ColorPicker.enabled) + m_ColorPicker.Hide(); } private void HandleColoring(Color newColor) @@ -156,8 +182,10 @@ private void HandleBrushSize() var vertices = m_CustomPointer.vertices; for (int i = kSides; i < kSides * 2; i++) { - float xPos = Mathf.Cos(i / 16f * Mathf.PI * 2) * m_CurrentRadius; - float yPos = Mathf.Sin(i / 16f * Mathf.PI * 2) * m_CurrentRadius; + float angle = (i / (float)kSides) * Mathf.PI * 2f; + float xPos = Mathf.Cos(angle) * m_CurrentRadius; + float yPos = Mathf.Sin(angle) * m_CurrentRadius; + Vector3 point = new Vector3(xPos, yPos, kTipDistance); vertices[i] = point; } @@ -197,8 +225,10 @@ private Vector3[] GenerateVertices() for (int i = 0; i < kSides; i++) { - float xPos = Mathf.Cos(i / 16f * Mathf.PI * 2) * radius; - float yPos = Mathf.Sin(i / 16f * Mathf.PI * 2) * radius; + float angle = (i / (float)kSides) * Mathf.PI * 2f; + float xPos = Mathf.Cos(angle) * radius; + float yPos = Mathf.Sin(angle) * radius; + Vector3 point = new Vector3(xPos, yPos, capIndex * kTipDistance); points.Add(point); } @@ -213,13 +243,13 @@ private int[] GenerateTriangles() { List triangles = new List(); - GenerateSide(triangles); - GenerateCaps(triangles); + GenerateSideTriangles(triangles); + GenerateCapsTriangles(triangles); return triangles.ToArray(); } - private void GenerateSide(List triangles) + private void GenerateSideTriangles(List triangles) { for (int i = 1; i < kSides; i++) { @@ -228,37 +258,27 @@ private void GenerateSide(List triangles) int upperLeft = i + kSides - 1; int upperRight = i + kSides; - triangles.Add(lowerLeft); - triangles.Add(lowerRight); - triangles.Add(upperLeft); - - triangles.Add(lowerRight); - triangles.Add(upperRight); - triangles.Add(upperLeft); + int[] sideTriangles = VerticesToPolygon(upperRight, upperLeft, lowerRight, lowerLeft, false); + triangles.AddRange(sideTriangles); } // Finish the side with a polygon that loops around from the end to the start vertices. - triangles.Add(kSides - 1); - triangles.Add(0); - triangles.Add(kSides * 2 - 1); - - triangles.Add(0); - triangles.Add(kSides); - triangles.Add(kSides * 2 - 1); + int[] finishTriangles = VerticesToPolygon(kSides, kSides * 2 - 1, 0, kSides - 1, false); + triangles.AddRange(finishTriangles); } - private void GenerateCaps(List triangles) + private void GenerateCapsTriangles(List triangles) { // Generate the bottom circle cap. for (int i = 1; i < kSides; i++) { - int lowLeft = i - 1; - int lowRight = i; - int upLeft = kSides * 2; - - triangles.Add(upLeft); - triangles.Add(lowRight); - triangles.Add(lowLeft); + int lowerLeft = i - 1; + int lowerRight = i; + int upperLeft = kSides * 2; + + triangles.Add(upperLeft); + triangles.Add(lowerRight); + triangles.Add(lowerLeft); } // Close the bottom circle cap with a start-end loop triangle. @@ -269,13 +289,13 @@ private void GenerateCaps(List triangles) // Generate the top circle cap. for (int i = kSides + 1; i < kSides * 2; i++) { - int lowLeft = i - 1; - int lowRight = i; - int upLeft = kSides * 2 + 1; + int lowerLeft = i - 1; + int lowerRight = i; + int upperLeft = kSides * 2 + 1; - triangles.Add(lowLeft); - triangles.Add(lowRight); - triangles.Add(upLeft); + triangles.Add(lowerLeft); + triangles.Add(lowerRight); + triangles.Add(upperLeft); } // Close the top circle cap with a start-end loop triangle. @@ -290,8 +310,10 @@ private void SetupAnnotation() m_Points.Clear(); m_Forwards.Clear(); + m_Widths.Clear(); GameObject go = new GameObject("Annotation " + m_AnnotationHolder.childCount); + m_UndoList.Add(go); Transform goTrans = go.transform; goTrans.SetParent(m_AnnotationHolder); @@ -299,6 +321,7 @@ private void SetupAnnotation() m_CurrentMeshFilter = go.AddComponent(); MeshRenderer mRenderer = go.AddComponent(); + var matToUse = Instantiate(m_AnnotationMaterial); matToUse.SetColor("_EmissionColor", m_ColorToUse); mRenderer.sharedMaterial = matToUse; @@ -311,16 +334,48 @@ private void SetupAnnotation() private void SetupHolder() { - if (m_AnnotationHolder == null) + var mainHolder = GameObject.Find("Annotations") ?? new GameObject("Annotations"); + var mainHolderTrans = mainHolder.transform; + + GameObject newSession = GetNewSessionHolder(mainHolderTrans); + if (!newSession) + newSession = new GameObject("Group " + mainHolderTrans.childCount); + + m_AnnotationHolder = newSession.transform; + m_AnnotationHolder.SetParent(mainHolder.transform); + } + + private GameObject GetNewSessionHolder(Transform mainHolderTrans) + { + const float kGroupingDistance = .3f; + GameObject newSession = null; + + for (int i = 0; i < mainHolderTrans.childCount; i++) { - var mainHolder = GameObject.Find("Annotations"); - if (!mainHolder) - mainHolder = new GameObject("Annotations"); + var child = mainHolderTrans.GetChild(i); + child.name = "Group " + i; - var newSession = new GameObject("Session " + DateTime.Now.ToString()); - m_AnnotationHolder = newSession.transform; - m_AnnotationHolder.SetParent(mainHolder.transform); + if (!newSession) + { + var renderers = child.GetComponentsInChildren(); + if (renderers.Length > 0) + { + Bounds bound = renderers[0].bounds; + for (int r = 1; r < renderers.Length; r++) + bound.Encapsulate(renderers[r].bounds); + + if (bound.Contains(rayOrigin.position)) + newSession = child.gameObject; + else if (bound.SqrDistance(rayOrigin.position) < kGroupingDistance) + newSession = child.gameObject; + + if (newSession) + break; + } + } } + + return newSession; } private void UpdateAnnotation() @@ -333,6 +388,7 @@ private void UpdateAnnotation() { m_Points.Add(localPoint); m_Forwards.Add(rayForward); + m_Widths.Add(m_CurrentRadius); PointsToMesh(); } @@ -346,43 +402,105 @@ private void PointsToMesh() if (m_CurrentMesh == null) m_CurrentMesh = new Mesh(); - List newVertices = new List(m_CurrentMesh.vertices); - List newTriangles = new List(m_CurrentMesh.triangles); - - for (int i = m_CurrentMesh.vertexCount / 2 + 1; i < m_Points.Count; i++) - { - Vector3 direction = (m_Points[i - 1] - m_Points[i]).normalized; - Vector3 cross = Vector3.Cross(direction, m_Forwards[i - 1]) * m_CurrentRadius; + List newVertices = new List(); + List newTriangles = new List(); + List newUvs = new List(); - newVertices.Add(m_Points[i - 1] - cross); - newVertices.Add(m_Points[i - 1] + cross); - } + LineToPlane(newVertices); + TriangulatePlane(newTriangles, newVertices.Count); + CalculateUvs(newUvs, newVertices.Count); - for (int i = Mathf.Max(3, m_CurrentMesh.vertexCount - 1); i < newVertices.Count; i += 2) - { - newTriangles.Add(i - 1); - newTriangles.Add(i - 2); - newTriangles.Add(i - 3); - - newTriangles.Add(i - 2); - newTriangles.Add(i - 1); - newTriangles.Add(i); - - // Add the same triangles in reverse to get a two-sided mesh. - newTriangles.Add(i - 3); - newTriangles.Add(i - 2); - newTriangles.Add(i - 1); - - newTriangles.Add(i); - newTriangles.Add(i - 1); - newTriangles.Add(i - 2); - } + m_CurrentMesh.Clear(); m_CurrentMesh.vertices = newVertices.ToArray(); m_CurrentMesh.triangles = newTriangles.ToArray(); + m_CurrentMesh.uv = newUvs.ToArray(); + m_CurrentMesh.UploadMeshData(false); m_CurrentMeshFilter.sharedMesh = m_CurrentMesh; } + private void LineToPlane(List newVertices) + { + Vector3 prevDirection = (m_Points[1] - m_Points[0]).normalized; + + for (int i = 1; i < m_Points.Count; i++) + { + Vector3 nextPoint = m_Points[i]; + Vector3 thisPoint = m_Points[i - 1]; + Vector3 direction = (nextPoint - thisPoint).normalized; + Vector3 smoothNormal = (m_Forwards[i - 1] + m_Forwards[i] + m_Forwards[Mathf.Min(m_Points.Count - 1, i + 1)]) / 3f; + + // For optimization, ignore inner points of an almost straight line. + // The last point is an exception, it is required for a smooth drawing experience. + if (Vector3.Angle(prevDirection, direction) < 1f && i < m_Points.Count - 1) + continue; + + Vector3 cross = Vector3.Cross(direction, smoothNormal); + cross.Normalize(); + + float width = m_Widths[i - 1]; + Vector3 left = thisPoint - cross * width; + Vector3 right = thisPoint + cross * width; + + newVertices.Add(left); + newVertices.Add(right); + + prevDirection = direction; + } + } + + private void TriangulatePlane(List newTriangles, int vertexCount) + { + for (int i = 3; i < vertexCount; i += 2) + { + int upperLeft = i - 1; + int upperRight = i; + int lowerLeft = i - 3; + int lowerRight = i - 2; + + int[] triangles = VerticesToPolygon(upperLeft, upperRight, lowerLeft, lowerRight); + newTriangles.AddRange(triangles); + } + } + + private void CalculateUvs(List newUvs, int vertexCount) + { + for (int i = 0; i < vertexCount; i += 2) + { + float ratio = 1 - i / (float)vertexCount; + newUvs.Add(new Vector2(0, ratio)); + newUvs.Add(new Vector2(1, ratio)); + } + } + + private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = true) + { + int triangleCount = doubleSided ? 12 : 6; + int[] triangles = new int[triangleCount]; + int index = 0; + + triangles[index++] = upperLeft; + triangles[index++] = lowerRight; + triangles[index++] = lowerLeft; + + triangles[index++] = lowerRight; + triangles[index++] = upperLeft; + triangles[index++] = upperRight; + + if (doubleSided) + { + triangles[index++] = lowerLeft; + triangles[index++] = lowerRight; + triangles[index++] = upperLeft; + + triangles[index++] = upperRight; + triangles[index++] = upperLeft; + triangles[index++] = lowerRight; + } + + return triangles; + } + } diff --git a/Tools/AnnotationTool/AnnotationTool.cs.meta b/Tools/AnnotationTool/AnnotationTool.cs.meta index d65a4b097..71b378122 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs.meta +++ b/Tools/AnnotationTool/AnnotationTool.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: ecba8b13e3259e14eab642c0d0657d5c -timeCreated: 1477664370 +timeCreated: 1478181815 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Tools/AnnotationTool/ColorPickerUI.cs b/Tools/AnnotationTool/ColorPickerUI.cs index f30202c61..3b62b7434 100644 --- a/Tools/AnnotationTool/ColorPickerUI.cs +++ b/Tools/AnnotationTool/ColorPickerUI.cs @@ -12,24 +12,29 @@ public class ColorPickerUI : MonoBehaviour public Action onColorPicked { private get; set; } [SerializeField] - RawImage m_ColorPicker; + private float m_FadeTime; [SerializeField] - Slider m_BrightnessSlider; + private RawImage m_ColorPicker; [SerializeField] - RawImage m_SliderBackground; + private Slider m_BrightnessSlider; [SerializeField] - RectTransform m_Picker; + private RawImage m_SliderBackground; - Vector3 m_PickerTargetPosition; + [SerializeField] + private RectTransform m_Picker; + + private Vector3 m_PickerTargetPosition; [SerializeField] - ColorPickerSquareUI m_ColorPickerSquare; + private ColorPickerSquareUI m_ColorPickerSquare; + + private Texture2D m_BrightnessBarTexture; + private Texture2D m_ColorPickerTexture; - Texture2D m_BrightnessBarTexture; - Texture2D m_ColorPickerTexture; + private Coroutine m_FadeCoroutine; void Start() { @@ -50,12 +55,56 @@ void Update() m_Picker.localPosition = m_PickerTargetPosition; } + public void Show() + { + if (m_FadeCoroutine != null) + StopCoroutine(m_FadeCoroutine); + + m_FadeCoroutine = StartCoroutine(FadeCanvas(false)); + } + + public void Hide() + { + if (m_FadeCoroutine != null) + StopCoroutine(m_FadeCoroutine); + + m_FadeCoroutine = StartCoroutine(FadeCanvas(true)); + } + public void OnSliderChanged(float val) { m_ColorPicker.color = Color.Lerp(Color.black, Color.white, val); PositionToColor(); } + private IEnumerator FadeCanvas(bool fadeOut) + { + enabled = !fadeOut; + m_Picker.localPosition = m_PickerTargetPosition; + + var canvasGroup = GetComponent(); + float current = canvasGroup.alpha; + float start = fadeOut ? 1 : 0; + float target = 1 - start; + + if (current == target) + { + m_FadeCoroutine = null; + yield break; + } + + float ratio = fadeOut ? 1 - current : current; + while (ratio < 1) + { + canvasGroup.alpha = Mathf.Lerp(start, target, ratio); + ratio += Time.unscaledDeltaTime / m_FadeTime; + yield return null; + } + + canvasGroup.alpha = target; + m_FadeCoroutine = null; + } + void OnDrag() { if (toolRayOrigin) diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab index 4c1872af8..59c15bb83 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab @@ -140,6 +140,7 @@ GameObject: - 114: {fileID: 114000012075775966} - 114: {fileID: 114000010288221908} - 114: {fileID: 114000013470492078} + - 225: {fileID: 225000011919119404} m_Layer: 5 m_Name: ColorPickerUI m_TagString: Untagged @@ -437,6 +438,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 + m_FadeTime: 0.25 m_ColorPicker: {fileID: 114000012154235052} m_BrightnessSlider: {fileID: 114000012700991384} m_SliderBackground: {fileID: 114000010107362308} @@ -642,3 +644,14 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 50, y: 50} m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &225000011919119404 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014053269536} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 From 399fe8c2cdcca07c8d59ffc618a13316f3aa1511 Mon Sep 17 00:00:00 2001 From: David Keri Date: Mon, 7 Nov 2016 10:34:49 +0100 Subject: [PATCH 004/870] improve generated mesh --- Tools/AnnotationTool/AnnotationTool.cs | 72 ++++++++++++++++++-------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index a656a30f6..c3e4bb472 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -8,7 +8,7 @@ using UnityEngine.VR.Utilities; using UnityEditor.VR; -[MainMenuItem("Annotation", "Tools", "Draw in da spaaaaaace")] +[MainMenuItem("Annotation", "Tools", "Draw in the space")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IRay, ICustomRay, IOtherRay, IInstantiateUI { public Transform rayOrigin { private get; set; } @@ -55,7 +55,8 @@ public ActionMap actionMap private bool m_RayHidden; - private Mesh m_CustomPointer; + private Mesh m_CustomPointerMesh; + private GameObject m_CustomPointerObject; private const float kTopMinRadius = 0.001f; private const float kTopMaxRadius = 0.05f; @@ -67,6 +68,8 @@ public ActionMap actionMap private List m_UndoList = new List(); + private Quaternion m_InitialRotation; + void OnDestroy() { if (m_RayHidden && showDefaultRay != null) @@ -80,6 +83,7 @@ void OnDestroy() } U.Object.Destroy(m_ColorPicker); + DestroyImmediate(m_CustomPointerObject); } void Update() @@ -143,8 +147,7 @@ private void UndoLast() private void CheckColorPicker() { var distance = Vector3.Distance(rayOrigin.position, otherRayOrigin.position); - float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); - if (distance < .325f && dot > 0) + if (distance < .325f) { if (m_ColorPicker == null) { @@ -159,6 +162,11 @@ private void CheckColorPicker() pickerTransform.localRotation = Quaternion.identity; } + float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); + Vector3 localPos = m_ColorPicker.transform.localPosition; + localPos.x = Mathf.Abs(localPos.x) * Mathf.Sign(dot); + m_ColorPicker.transform.localPosition = localPos; + if (!m_ColorPicker.enabled) m_ColorPicker.Show(); } @@ -173,13 +181,13 @@ private void HandleColoring(Color newColor) private void HandleBrushSize() { - if (m_CustomPointer != null) + if (m_CustomPointerMesh != null) { var sign = m_AnnotationInput.changeBrushSize.value; m_CurrentRadius += sign * Time.unscaledDeltaTime * .1f; m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); - var vertices = m_CustomPointer.vertices; + var vertices = m_CustomPointerMesh.vertices; for (int i = kSides; i < kSides * 2; i++) { float angle = (i / (float)kSides) * Mathf.PI * 2f; @@ -189,25 +197,25 @@ private void HandleBrushSize() Vector3 point = new Vector3(xPos, yPos, kTipDistance); vertices[i] = point; } - m_CustomPointer.vertices = vertices; + m_CustomPointerMesh.vertices = vertices; } } private void GenerateCustomPointer() { - if (m_CustomPointer != null) + if (m_CustomPointerMesh != null) return; - m_CustomPointer = new Mesh(); - m_CustomPointer.vertices = GenerateVertices(); - m_CustomPointer.triangles = GenerateTriangles(); + m_CustomPointerMesh = new Mesh(); + m_CustomPointerMesh.vertices = GenerateVertices(); + m_CustomPointerMesh.triangles = GenerateTriangles(); - var customPointer = new GameObject("CustomPointer"); + m_CustomPointerObject = new GameObject("CustomPointer"); - customPointer.AddComponent().sharedMesh = m_CustomPointer; - customPointer.AddComponent().sharedMaterial = m_ConeMaterial; + m_CustomPointerObject.AddComponent().sharedMesh = m_CustomPointerMesh; + m_CustomPointerObject.AddComponent().sharedMaterial = m_ConeMaterial; - var pointerTrans = customPointer.transform; + var pointerTrans = m_CustomPointerObject.transform; pointerTrans.SetParent(rayOrigin); pointerTrans.localPosition = Vector3.zero; @@ -329,7 +337,6 @@ private void SetupAnnotation() m_WorldToLocalMesh = goTrans.worldToLocalMatrix; m_CurrentMesh = new Mesh(); - PointsToMesh(); } private void SetupHolder() @@ -377,7 +384,7 @@ private GameObject GetNewSessionHolder(Transform mainHolderTrans) return newSession; } - + private void UpdateAnnotation() { Vector3 rayForward = rayOrigin.forward; @@ -393,7 +400,7 @@ private void UpdateAnnotation() PointsToMesh(); } } - + private void PointsToMesh() { if (m_Points.Count < 2) @@ -402,11 +409,21 @@ private void PointsToMesh() if (m_CurrentMesh == null) m_CurrentMesh = new Mesh(); + if (m_Points.Count == 2) + { + Vector3 initialDir = m_Points[1] - m_Points[0]; + Vector3 initialNormalDir = -rayOrigin.forward; + m_InitialRotation = Quaternion.FromToRotation(initialDir, initialNormalDir); + } + List newVertices = new List(); List newTriangles = new List(); List newUvs = new List(); - + LineToPlane(newVertices); + SmoothPlane(newVertices); + if (newVertices.Count > 6) + newVertices.RemoveRange(newVertices.Count - 5, 4); TriangulatePlane(newTriangles, newVertices.Count); CalculateUvs(newUvs, newVertices.Count); @@ -430,15 +447,14 @@ private void LineToPlane(List newVertices) Vector3 nextPoint = m_Points[i]; Vector3 thisPoint = m_Points[i - 1]; Vector3 direction = (nextPoint - thisPoint).normalized; - Vector3 smoothNormal = (m_Forwards[i - 1] + m_Forwards[i] + m_Forwards[Mathf.Min(m_Points.Count - 1, i + 1)]) / 3f; // For optimization, ignore inner points of an almost straight line. // The last point is an exception, it is required for a smooth drawing experience. if (Vector3.Angle(prevDirection, direction) < 1f && i < m_Points.Count - 1) continue; - Vector3 cross = Vector3.Cross(direction, smoothNormal); - cross.Normalize(); + Vector3 localCross = Vector3.Cross(direction, m_Forwards[i - 1]); + Vector3 cross = localCross.normalized; float width = m_Widths[i - 1]; Vector3 left = thisPoint - cross * width; @@ -450,6 +466,18 @@ private void LineToPlane(List newVertices) prevDirection = direction; } } + + private void SmoothPlane(List newVertices) + { + for (int side = 0; side < 2; side++) + { + for (int i = 4; i < newVertices.Count - 4 - side; i++) + { + Vector3 average = (newVertices[i - 4 + side] + newVertices[i - 2 + side] + newVertices[i + 2 + side] + newVertices[i + 4 + side]) / 4f; + newVertices[i + side] = average; + } + } + } private void TriangulatePlane(List newTriangles, int vertexCount) { From 7cb4af624d06b20327c71a1e9fc633f084b97fca Mon Sep 17 00:00:00 2001 From: David Keri Date: Tue, 8 Nov 2016 13:37:51 +0100 Subject: [PATCH 005/870] add brush size controller ui --- Tools/AnnotationTool/AnnotationTool.cs | 128 ++- Tools/AnnotationTool/AnnotationTool.cs.meta | 4 +- Tools/AnnotationTool/BrushSizeUI.cs | 33 + Tools/AnnotationTool/BrushSizeUI.cs.meta | 12 + .../AnnotationTool/Prefabs/BrushSizeUI.prefab | 796 ++++++++++++++++++ .../Prefabs/BrushSizeUI.prefab.meta | 8 + 6 files changed, 947 insertions(+), 34 deletions(-) create mode 100644 Tools/AnnotationTool/BrushSizeUI.cs create mode 100644 Tools/AnnotationTool/BrushSizeUI.cs.meta create mode 100644 Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab create mode 100644 Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab.meta diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index c3e4bb472..832778651 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -51,6 +51,12 @@ public ActionMap actionMap private GameObject m_ColorPickerPrefab; private ColorPickerUI m_ColorPicker; + [SerializeField] + private GameObject m_BrushSizePrefab; + private BrushSizeUI m_BrushSizeUi; + + private Action onBrushSizeChanged { set; get; } + private Transform m_AnnotationHolder; private bool m_RayHidden; @@ -68,8 +74,6 @@ public ActionMap actionMap private List m_UndoList = new List(); - private Quaternion m_InitialRotation; - void OnDestroy() { if (m_RayHidden && showDefaultRay != null) @@ -82,10 +86,11 @@ void OnDestroy() showDefaultRay(); } - U.Object.Destroy(m_ColorPicker); + U.Object.Destroy(m_ColorPicker.gameObject); + U.Object.Destroy(m_BrushSizeUi.gameObject); DestroyImmediate(m_CustomPointerObject); } - + void Update() { if (!m_RayHidden) @@ -109,8 +114,10 @@ void Update() if (otherRayOrigin != null) CheckColorPicker(); + + CheckBrushSizeUi(); } - + if (m_AnnotationInput.draw.wasJustPressed) SetupAnnotation(); else if (m_AnnotationInput.draw.isHeld) @@ -118,7 +125,10 @@ void Update() else if (m_AnnotationInput.undo.wasJustPressed) UndoLast(); else if (m_AnnotationInput.draw.wasJustReleased) + { m_CurrentMesh.Optimize(); + m_CurrentMesh.UploadMeshData(true); + } if (m_AnnotationInput.changeBrushSize.value != 0) HandleBrushSize(); @@ -133,20 +143,51 @@ private void UndoLast() m_UndoList.RemoveAt(m_UndoList.Count - 1); // Clean up after the removed annotations if necessary. - if (m_UndoList.Count == 0 && m_AnnotationHolder.childCount == 0) + if (m_AnnotationHolder.childCount == 0) { var root = m_AnnotationHolder.parent; + int index = m_AnnotationHolder.GetSiblingIndex(); DestroyImmediate(m_AnnotationHolder.gameObject); if (root.childCount == 0) DestroyImmediate(root.gameObject); + else + { + if (index > 0) + m_AnnotationHolder = root.GetChild(index - 1); + else if (index < root.childCount) + m_AnnotationHolder = root.GetChild(index); + } } } } + private void CheckBrushSizeUi() + { + if (m_BrushSizeUi == null) + { + var bsuiObj = instantiateUI(m_BrushSizePrefab); + m_BrushSizeUi = bsuiObj.GetComponent(); + var trans = bsuiObj.transform; + trans.SetParent(rayOrigin); + trans.localPosition = m_BrushSizePrefab.transform.localPosition; + trans.localRotation = m_BrushSizePrefab.transform.localRotation; + + m_BrushSizeUi.onValueChanged = (val) => + { + m_CurrentRadius = Mathf.Lerp(kTopMinRadius, kTopMaxRadius, val); + ResizePointer(); + }; + onBrushSizeChanged = m_BrushSizeUi.ChangeSliderValue; + } + } + private void CheckColorPicker() { - var distance = Vector3.Distance(rayOrigin.position, otherRayOrigin.position); + var otherRayMatrix = otherRayOrigin.worldToLocalMatrix; + var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); + var distance = Mathf.Abs(rayLocalPos.x); + if (distance < .325f) { if (m_ColorPicker == null) @@ -187,20 +228,32 @@ private void HandleBrushSize() m_CurrentRadius += sign * Time.unscaledDeltaTime * .1f; m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); - var vertices = m_CustomPointerMesh.vertices; - for (int i = kSides; i < kSides * 2; i++) + if (m_BrushSizeUi) { - float angle = (i / (float)kSides) * Mathf.PI * 2f; - float xPos = Mathf.Cos(angle) * m_CurrentRadius; - float yPos = Mathf.Sin(angle) * m_CurrentRadius; - - Vector3 point = new Vector3(xPos, yPos, kTipDistance); - vertices[i] = point; + var ratio = Mathf.InverseLerp(kTopMinRadius, kTopMaxRadius, m_CurrentRadius); + if (onBrushSizeChanged != null) + onBrushSizeChanged(ratio); } - m_CustomPointerMesh.vertices = vertices; + + ResizePointer(); } } + private void ResizePointer() + { + var vertices = m_CustomPointerMesh.vertices; + for (int i = kSides; i < kSides * 2; i++) + { + float angle = (i / (float)kSides) * Mathf.PI * 2f; + float xPos = Mathf.Cos(angle) * m_CurrentRadius; + float yPos = Mathf.Sin(angle) * m_CurrentRadius; + + Vector3 point = new Vector3(xPos, yPos, kTipDistance); + vertices[i] = point; + } + m_CustomPointerMesh.vertices = vertices; + } + private void GenerateCustomPointer() { if (m_CustomPointerMesh != null) @@ -337,6 +390,7 @@ private void SetupAnnotation() m_WorldToLocalMesh = goTrans.worldToLocalMatrix; m_CurrentMesh = new Mesh(); + m_CurrentMesh.name = "Annotation"; } private void SetupHolder() @@ -390,8 +444,8 @@ private void UpdateAnnotation() Vector3 rayForward = rayOrigin.forward; Vector3 worldPoint = rayOrigin.position + rayForward * kTipDistance; Vector3 localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); - - if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * .25f)) + + if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * 0.25f)) { m_Points.Add(localPoint); m_Forwards.Add(rayForward); @@ -403,27 +457,23 @@ private void UpdateAnnotation() private void PointsToMesh() { - if (m_Points.Count < 2) + if (m_Points.Count < 4) return; if (m_CurrentMesh == null) m_CurrentMesh = new Mesh(); - if (m_Points.Count == 2) - { - Vector3 initialDir = m_Points[1] - m_Points[0]; - Vector3 initialNormalDir = -rayOrigin.forward; - m_InitialRotation = Quaternion.FromToRotation(initialDir, initialNormalDir); - } - List newVertices = new List(); List newTriangles = new List(); List newUvs = new List(); - + LineToPlane(newVertices); SmoothPlane(newVertices); - if (newVertices.Count > 6) - newVertices.RemoveRange(newVertices.Count - 5, 4); + + newVertices.RemoveRange(0, Mathf.Min(newVertices.Count, 4)); + if (newVertices.Count > 4) + newVertices.RemoveRange(newVertices.Count - 4, 4); + TriangulatePlane(newTriangles, newVertices.Count); CalculateUvs(newUvs, newVertices.Count); @@ -441,6 +491,7 @@ private void PointsToMesh() private void LineToPlane(List newVertices) { Vector3 prevDirection = (m_Points[1] - m_Points[0]).normalized; + Vector3 prevCross = Vector3.Cross(prevDirection, m_Forwards[0]); for (int i = 1; i < m_Points.Count; i++) { @@ -453,9 +504,19 @@ private void LineToPlane(List newVertices) if (Vector3.Angle(prevDirection, direction) < 1f && i < m_Points.Count - 1) continue; - Vector3 localCross = Vector3.Cross(direction, m_Forwards[i - 1]); - Vector3 cross = localCross.normalized; + Vector3 cross; + float drawAngle = Vector3.Angle(direction, m_Forwards[i - 1]); + if (drawAngle < 10 || drawAngle > 170) + cross = prevCross; + else + { + cross = Vector3.Cross(direction, m_Forwards[i - 1]).normalized; + // Prevent sudden spins in the spline. + if (Vector3.Angle(prevCross, cross) > 90f) + cross = prevCross; + } + float width = m_Widths[i - 1]; Vector3 left = thisPoint - cross * width; Vector3 right = thisPoint + cross * width; @@ -464,9 +525,10 @@ private void LineToPlane(List newVertices) newVertices.Add(right); prevDirection = direction; + prevCross = cross; } } - + private void SmoothPlane(List newVertices) { for (int side = 0; side < 2; side++) @@ -474,7 +536,7 @@ private void SmoothPlane(List newVertices) for (int i = 4; i < newVertices.Count - 4 - side; i++) { Vector3 average = (newVertices[i - 4 + side] + newVertices[i - 2 + side] + newVertices[i + 2 + side] + newVertices[i + 4 + side]) / 4f; - newVertices[i + side] = average; + newVertices[i + side] = average;//Vector3.Lerp(newVertices[i + side], average, .33f); } } } diff --git a/Tools/AnnotationTool/AnnotationTool.cs.meta b/Tools/AnnotationTool/AnnotationTool.cs.meta index 71b378122..fd7055541 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs.meta +++ b/Tools/AnnotationTool/AnnotationTool.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: ecba8b13e3259e14eab642c0d0657d5c -timeCreated: 1478181815 +timeCreated: 1478604970 licenseType: Free MonoImporter: serializedVersion: 2 @@ -11,6 +11,8 @@ MonoImporter: - m_ConeMaterial: {fileID: 2100000, guid: 0372357aa9e962f47a35f6b6350ae99c, type: 2} - m_ColorPickerPrefab: {fileID: 1000014053269536, guid: da56ed8b2b72e414589b2938af94c498, type: 2} + - m_BrushSizePrefab: {fileID: 1000012251850158, guid: 76909d1f493d664469c9e0f4726790a3, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Tools/AnnotationTool/BrushSizeUI.cs b/Tools/AnnotationTool/BrushSizeUI.cs new file mode 100644 index 000000000..4cd621b57 --- /dev/null +++ b/Tools/AnnotationTool/BrushSizeUI.cs @@ -0,0 +1,33 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; +using System; + +public class BrushSizeUI : MonoBehaviour +{ + + public Action onValueChanged { private get; set; } + + [SerializeField] + private RectTransform m_SliderHandle; + + [SerializeField] + private Slider m_Slider; + + private const float kMinSize = 0.25f; + private const float kMaxSize = 12.5f; + + public void OnSliderValueChanged(float value) + { + m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(kMinSize, kMaxSize, value); + + if (onValueChanged != null) + onValueChanged(value); + } + + public void ChangeSliderValue(float newValue) + { + m_Slider.value = newValue; + } + +} diff --git a/Tools/AnnotationTool/BrushSizeUI.cs.meta b/Tools/AnnotationTool/BrushSizeUI.cs.meta new file mode 100644 index 000000000..a948fc4d0 --- /dev/null +++ b/Tools/AnnotationTool/BrushSizeUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e7f7403e35cc7f54489fcfaaebc3aa83 +timeCreated: 1478598678 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab new file mode 100644 index 000000000..db18f7081 --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab @@ -0,0 +1,796 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000012251850158} + m_IsPrefabParent: 1 +--- !u!1 &1000011542462532 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012429854860} + - 222: {fileID: 222000011738690670} + - 114: {fileID: 114000011659273912} + m_Layer: 5 + m_Name: SmallSizeImage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011570876986 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013958544464} + - 222: {fileID: 222000010512651690} + - 114: {fileID: 114000013227729880} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012251850158 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000010313966380} + - 223: {fileID: 223000013517572560} + - 114: {fileID: 114000012280541332} + - 114: {fileID: 114000011439948932} + - 114: {fileID: 114000010188600316} + m_Layer: 5 + m_Name: BrushSizeUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012479274904 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000010302154246} + - 114: {fileID: 114000012898989976} + m_Layer: 5 + m_Name: Slider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013490968792 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012952319812} + - 222: {fileID: 222000012566840462} + - 114: {fileID: 114000012817225156} + m_Layer: 5 + m_Name: Slider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013640950356 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012965305110} + - 222: {fileID: 222000011049661008} + - 114: {fileID: 114000010590218436} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013978588906 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012602292052} + - 222: {fileID: 222000011346353818} + - 114: {fileID: 114000012234307126} + m_Layer: 5 + m_Name: LargeSizeImage + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013993980200 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000010282135770} + - 222: {fileID: 222000013985520966} + - 114: {fileID: 114000011610748400} + - 114: {fileID: 114000010580475510} + m_Layer: 5 + m_Name: SliderMask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014094231656 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013752871822} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014133429920 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011445143916} + - 222: {fileID: 222000010361401928} + m_Layer: 5 + m_Name: EndPoints + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014180682236 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013742708240} + - 222: {fileID: 222000012902449500} + - 114: {fileID: 114000011019955918} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &114000010188600316 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012251850158} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e7f7403e35cc7f54489fcfaaebc3aa83, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_SliderHandle: {fileID: 224000012965305110} + m_Slider: {fileID: 114000012898989976} +--- !u!114 &114000010580475510 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013993980200} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ShowMaskGraphic: 0 +--- !u!114 &114000010590218436 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013640950356} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300012, guid: d8618b0721ef74becb6df0458ac4c21e, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011019955918 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014180682236} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011439948932 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012251850158} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_IgnoreReversedGraphics: 0 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114000011610748400 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013993980200} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011659273912 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011542462532} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 0.27205884, g: 0.63853973, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300012, guid: d8618b0721ef74becb6df0458ac4c21e, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012234307126 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013978588906} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 0.27205884, g: 0.63853973, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300012, guid: d8618b0721ef74becb6df0458ac4c21e, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012280541332 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012251850158} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &114000012817225156 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013490968792} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 0.45588237, g: 0.75233275, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: e0d8f5bd0038af04688271cdc2557e18, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012898989976 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012479274904} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000010590218436} + m_FillRect: {fileID: 0} + m_HandleRect: {fileID: 224000012965305110} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010188600316} + m_MethodName: OnSliderValueChanged + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000013227729880 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011570876986} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300012, guid: d8618b0721ef74becb6df0458ac4c21e, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &222000010361401928 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014133429920} +--- !u!222 &222000010512651690 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011570876986} +--- !u!222 &222000011049661008 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013640950356} +--- !u!222 &222000011346353818 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013978588906} +--- !u!222 &222000011738690670 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011542462532} +--- !u!222 &222000012566840462 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013490968792} +--- !u!222 &222000012902449500 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014180682236} +--- !u!222 &222000013985520966 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013993980200} +--- !u!223 &223000013517572560 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012251850158} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &224000010282135770 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013993980200} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000012952319812} + m_Father: {fileID: 224000010313966380} + m_RootOrder: 1 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -57.89, y: 1} + m_SizeDelta: {x: 382, y: 240} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010302154246 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012479274904} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000013742708240} + - {fileID: 224000013752871822} + m_Father: {fileID: 224000010313966380} + m_RootOrder: 3 + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 250} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010313966380 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012251850158} + m_LocalRotation: {x: 0.7071012, y: -0.000000029802322, z: -0.000000702632, w: 0.70711243} + m_LocalPosition: {x: 0, y: 0, z: -0.03} + m_LocalScale: {x: 0.0001, y: 0.0001, z: 0.0001} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} + m_Children: + - {fileID: 224000013958544464} + - {fileID: 224000010282135770} + - {fileID: 224000011445143916} + - {fileID: 224000010302154246} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0.02} + m_SizeDelta: {x: 512, y: 512} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011445143916 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014133429920} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000012429854860} + - {fileID: 224000012602292052} + m_Father: {fileID: 224000010313966380} + m_RootOrder: 2 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012429854860 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011542462532} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.05, y: 0.05, z: 0.05} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011445143916} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 5, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0, y: 0.5} +--- !u!224 &224000012602292052 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013978588906} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2.5, y: 2.5, z: 2.5} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011445143916} + m_RootOrder: 1 + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -5, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 1, y: 0.5} +--- !u!224 &224000012952319812 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013490968792} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} + m_Children: [] + m_Father: {fileID: 224000010282135770} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 13.589985, y: -1} + m_SizeDelta: {x: 247.2, y: 419.91} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012965305110 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013640950356} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.25, y: 0.25, z: 0.25} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000013752871822} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: -0, y: 0} + m_SizeDelta: {x: 20, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013742708240 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014180682236} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000010302154246} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013752871822 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014094231656} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000012965305110} + m_Father: {fileID: 224000010302154246} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -61.25, y: 0} + m_SizeDelta: {x: -137.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013958544464 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011570876986} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000010313966380} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab.meta b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab.meta new file mode 100644 index 000000000..664105dbe --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76909d1f493d664469c9e0f4726790a3 +timeCreated: 1478598995 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From 9235f7d6aed82bfa545df73bd6f56ea4c65da2ca Mon Sep 17 00:00:00 2001 From: David Keri Date: Tue, 8 Nov 2016 16:10:58 +0100 Subject: [PATCH 006/870] change annotation material to transparent --- Tools/AnnotationTool/AnnotationTool.cs | 8 +-- .../Materials/AnnotationMaterial.mat | 23 ++++---- .../Materials/AnnotationTexture.png | 3 + .../Materials/AnnotationTexture.png.meta | 59 +++++++++++++++++++ 4 files changed, 78 insertions(+), 15 deletions(-) create mode 100644 Tools/AnnotationTool/Materials/AnnotationTexture.png create mode 100644 Tools/AnnotationTool/Materials/AnnotationTexture.png.meta diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 832778651..6d784cf0f 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -531,12 +531,13 @@ private void LineToPlane(List newVertices) private void SmoothPlane(List newVertices) { + const float kSmoothRatio = .5f; for (int side = 0; side < 2; side++) { for (int i = 4; i < newVertices.Count - 4 - side; i++) { Vector3 average = (newVertices[i - 4 + side] + newVertices[i - 2 + side] + newVertices[i + 2 + side] + newVertices[i + 4 + side]) / 4f; - newVertices[i + side] = average;//Vector3.Lerp(newVertices[i + side], average, .33f); + newVertices[i + side] = Vector3.Lerp(newVertices[i + side], average, kSmoothRatio); } } } @@ -559,9 +560,8 @@ private void CalculateUvs(List newUvs, int vertexCount) { for (int i = 0; i < vertexCount; i += 2) { - float ratio = 1 - i / (float)vertexCount; - newUvs.Add(new Vector2(0, ratio)); - newUvs.Add(new Vector2(1, ratio)); + for (int side = 0; side < 2; side++) + newUvs.Add(new Vector2(side, i / 2)); } } diff --git a/Tools/AnnotationTool/Materials/AnnotationMaterial.mat b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat index 384aa1115..8aa59f621 100644 --- a/Tools/AnnotationTool/Materials/AnnotationMaterial.mat +++ b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat @@ -8,10 +8,11 @@ Material: m_PrefabInternal: {fileID: 0} m_Name: AnnotationMaterial m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _EMISSION + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION m_LightmapFlags: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent m_SavedProperties: serializedVersion: 2 m_TexEnvs: @@ -42,13 +43,13 @@ Material: - first: name: _EmissionMap second: - m_Texture: {fileID: 0} + m_Texture: {fileID: 2800000, guid: 831efcd782cc31c4493674a90523630a, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: name: _MainTex second: - m_Texture: {fileID: 0} + m_Texture: {fileID: 2800000, guid: 831efcd782cc31c4493674a90523630a, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - first: @@ -75,19 +76,19 @@ Material: second: 1 - first: name: _Cutoff - second: 0.5 + second: 0.831 - first: name: _DetailNormalMapScale second: 1 - first: name: _DstBlend - second: 0 + second: 10 - first: name: _GlossMapScale second: 1 - first: name: _Glossiness - second: 0.25 + second: 0 - first: name: _GlossyReflections second: 1 @@ -96,7 +97,7 @@ Material: second: 0 - first: name: _Mode - second: 0 + second: 3 - first: name: _OcclusionStrength second: 1 @@ -117,11 +118,11 @@ Material: second: 0 - first: name: _ZWrite - second: 1 + second: 0 m_Colors: - first: name: _Color - second: {r: 1, g: 1, b: 1, a: 1} + second: {r: 1, g: 1, b: 1, a: 0.5019608} - first: name: _EmissionColor second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tools/AnnotationTool/Materials/AnnotationTexture.png b/Tools/AnnotationTool/Materials/AnnotationTexture.png new file mode 100644 index 000000000..fbf5b7afb --- /dev/null +++ b/Tools/AnnotationTool/Materials/AnnotationTexture.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b384dbcf37d3e64f90ca3b2563e23496e29e699a9e0f2334e3df288d8e0fc32 +size 59343 diff --git a/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta b/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta new file mode 100644 index 000000000..6cb2f3020 --- /dev/null +++ b/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 831efcd782cc31c4493674a90523630a +timeCreated: 1478614738 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 1 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 0 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: From 4e181d25328c8514b80171b8f7f685984e676a81 Mon Sep 17 00:00:00 2001 From: David Keri Date: Wed, 9 Nov 2016 17:18:06 +0100 Subject: [PATCH 007/870] improve generated mesh --- Tools/AnnotationTool/AnnotationTool.cs | 36 ++++++++++++-------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 6d784cf0f..a0ff4b4f0 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -86,11 +86,14 @@ void OnDestroy() showDefaultRay(); } - U.Object.Destroy(m_ColorPicker.gameObject); - U.Object.Destroy(m_BrushSizeUi.gameObject); - DestroyImmediate(m_CustomPointerObject); + if (m_ColorPicker) + U.Object.Destroy(m_ColorPicker.gameObject); + if (m_BrushSizeUi) + U.Object.Destroy(m_BrushSizeUi.gameObject); + if (m_CustomPointerObject) + DestroyImmediate(m_CustomPointerObject); } - + void Update() { if (!m_RayHidden) @@ -444,7 +447,7 @@ private void UpdateAnnotation() Vector3 rayForward = rayOrigin.forward; Vector3 worldPoint = rayOrigin.position + rayForward * kTipDistance; Vector3 localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); - + if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * 0.25f)) { m_Points.Add(localPoint); @@ -475,7 +478,7 @@ private void PointsToMesh() newVertices.RemoveRange(newVertices.Count - 4, 4); TriangulatePlane(newTriangles, newVertices.Count); - CalculateUvs(newUvs, newVertices.Count); + CalculateUvs(newUvs, newVertices); m_CurrentMesh.Clear(); @@ -491,7 +494,6 @@ private void PointsToMesh() private void LineToPlane(List newVertices) { Vector3 prevDirection = (m_Points[1] - m_Points[0]).normalized; - Vector3 prevCross = Vector3.Cross(prevDirection, m_Forwards[0]); for (int i = 1; i < m_Points.Count; i++) { @@ -507,15 +509,9 @@ private void LineToPlane(List newVertices) Vector3 cross; float drawAngle = Vector3.Angle(direction, m_Forwards[i - 1]); if (drawAngle < 10 || drawAngle > 170) - cross = prevCross; + cross = Vector3.Cross(direction, Quaternion.Euler(-180, 0, 0) * m_Forwards[i - 1]).normalized; else - { cross = Vector3.Cross(direction, m_Forwards[i - 1]).normalized; - - // Prevent sudden spins in the spline. - if (Vector3.Angle(prevCross, cross) > 90f) - cross = prevCross; - } float width = m_Widths[i - 1]; Vector3 left = thisPoint - cross * width; @@ -525,7 +521,6 @@ private void LineToPlane(List newVertices) newVertices.Add(right); prevDirection = direction; - prevCross = cross; } } @@ -555,13 +550,16 @@ private void TriangulatePlane(List newTriangles, int vertexCount) newTriangles.AddRange(triangles); } } - - private void CalculateUvs(List newUvs, int vertexCount) + + private void CalculateUvs(List newUvs, List newVertices) { - for (int i = 0; i < vertexCount; i += 2) + for (int i = 0; i < newVertices.Count; i += 2) { for (int side = 0; side < 2; side++) - newUvs.Add(new Vector2(side, i / 2)); + { + float distance = i > 0 ? Vector3.Distance(newVertices[i - 2 + side], newVertices[i + side]) : 0; + newUvs.Add(new Vector2(side, distance)); + } } } From 15903ec9e39e0d41f250e9b9a430919a333b6c17 Mon Sep 17 00:00:00 2001 From: David Keri Date: Thu, 10 Nov 2016 16:56:27 +0100 Subject: [PATCH 008/870] cleanup after merge --- Scripts/EditorVR.cs | 1 + Tools/AnnotationTool/AnnotationTool.cs | 22 ++++------------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/Scripts/EditorVR.cs b/Scripts/EditorVR.cs index b86922ebc..221e4463c 100644 --- a/Scripts/EditorVR.cs +++ b/Scripts/EditorVR.cs @@ -1180,6 +1180,7 @@ void ConnectInterfaces(object obj, Transform rayOrigin = null) Transform alternateMenuOrigin; if (proxy.alternateMenuOrigins.TryGetValue(rayOrigin, out alternateMenuOrigin)) menuOrigins.alternateMenuOrigin = alternateMenuOrigin; + var otherRay = obj as IOtherRay; if (otherRay != null) { diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index a0ff4b4f0..4d31bab4f 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -77,14 +77,7 @@ public ActionMap actionMap void OnDestroy() { if (m_RayHidden && showDefaultRay != null) - { - // HACK: In the previous dev version, hideDefaultRay also disabled the cone. - var proxyRay = rayOrigin.GetComponentInChildren(); - if (proxyRay) - proxyRay.transform.Find("Cone").gameObject.SetActive(true); - showDefaultRay(); - } if (m_ColorPicker) U.Object.Destroy(m_ColorPicker.gameObject); @@ -101,12 +94,6 @@ void Update() if (hideDefaultRay != null) { hideDefaultRay(); - - // HACK: In the previous dev version, hideDefaultRay also disabled the cone. - var proxyRay = rayOrigin.GetComponentInChildren(); - if (proxyRay) - proxyRay.transform.Find("Cone").gameObject.SetActive(false); - m_RayHidden = true; } } @@ -231,11 +218,10 @@ private void HandleBrushSize() m_CurrentRadius += sign * Time.unscaledDeltaTime * .1f; m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); - if (m_BrushSizeUi) + if (m_BrushSizeUi && onBrushSizeChanged != null) { var ratio = Mathf.InverseLerp(kTopMinRadius, kTopMaxRadius, m_CurrentRadius); - if (onBrushSizeChanged != null) - onBrushSizeChanged(ratio); + onBrushSizeChanged(ratio); } ResizePointer(); @@ -448,7 +434,7 @@ private void UpdateAnnotation() Vector3 worldPoint = rayOrigin.position + rayForward * kTipDistance; Vector3 localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); - if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * 0.25f)) + //if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * 0.25f)) { m_Points.Add(localPoint); m_Forwards.Add(rayForward); @@ -509,7 +495,7 @@ private void LineToPlane(List newVertices) Vector3 cross; float drawAngle = Vector3.Angle(direction, m_Forwards[i - 1]); if (drawAngle < 10 || drawAngle > 170) - cross = Vector3.Cross(direction, Quaternion.Euler(-180, 0, 0) * m_Forwards[i - 1]).normalized; + cross = Vector3.Cross(direction, Quaternion.Euler(-90, 0, 0) * m_Forwards[i - 1]).normalized; else cross = Vector3.Cross(direction, m_Forwards[i - 1]).normalized; From 2400b83fefe0b40617c2f6ef81771a910dfe9050 Mon Sep 17 00:00:00 2001 From: David Keri Date: Thu, 10 Nov 2016 17:14:26 +0100 Subject: [PATCH 009/870] fix IOtherRay setup bug in ConnectInterfaces --- Scripts/EditorVR.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Scripts/EditorVR.cs b/Scripts/EditorVR.cs index 221e4463c..fb670e81b 100644 --- a/Scripts/EditorVR.cs +++ b/Scripts/EditorVR.cs @@ -1167,6 +1167,16 @@ void ConnectInterfaces(object obj, Transform rayOrigin = null) lockableRay.lockRay = dpr.LockRay; lockableRay.unlockRay = dpr.UnlockRay; } + + var otherRay = obj as IOtherRay; + if (otherRay != null) + { + Node otherNode = (Node)(1 - (int)GetNodeForRayOrigin(rayOrigin).Value); + Transform otherRayOrigin; + var proxy = GetProxyForRayOrigin(rayOrigin); + if (proxy != null && proxy.rayOrigins.TryGetValue(otherNode, out otherRayOrigin)) + otherRay.otherRayOrigin = otherRayOrigin; + } } var menuOrigins = obj as IMenuOrigins; @@ -1180,15 +1190,6 @@ void ConnectInterfaces(object obj, Transform rayOrigin = null) Transform alternateMenuOrigin; if (proxy.alternateMenuOrigins.TryGetValue(rayOrigin, out alternateMenuOrigin)) menuOrigins.alternateMenuOrigin = alternateMenuOrigin; - - var otherRay = obj as IOtherRay; - if (otherRay != null) - { - Node otherNode = (Node)(1 - (int)GetNodeForRayOrigin(rayOrigin).Value); - Transform otherRayOrigin; - if (proxy.rayOrigins.TryGetValue(otherNode, out otherRayOrigin)) - otherRay.otherRayOrigin = otherRayOrigin; - } } } } From a1a6742f68591611e410122452367baf5c39900e Mon Sep 17 00:00:00 2001 From: David Keri Date: Mon, 14 Nov 2016 16:18:20 +0100 Subject: [PATCH 010/870] modify IOtherRay and rename it to IUsesRayOrigins --- Scripts/EditorVR.cs | 16 +++-- Scripts/Interfaces/IOtherRay.cs | 8 --- Scripts/Interfaces/IUsesRayOrigins.cs | 9 +++ ...herRay.cs.meta => IUsesRayOrigins.cs.meta} | 0 Tools/AnnotationTool/AnnotationTool.cs | 64 +++++++++++-------- 5 files changed, 55 insertions(+), 42 deletions(-) delete mode 100644 Scripts/Interfaces/IOtherRay.cs create mode 100644 Scripts/Interfaces/IUsesRayOrigins.cs rename Scripts/Interfaces/{IOtherRay.cs.meta => IUsesRayOrigins.cs.meta} (100%) diff --git a/Scripts/EditorVR.cs b/Scripts/EditorVR.cs index e762522e1..34bd023a3 100644 --- a/Scripts/EditorVR.cs +++ b/Scripts/EditorVR.cs @@ -1169,14 +1169,16 @@ void ConnectInterfaces(object obj, Transform rayOrigin = null) lockableRay.unlockRay = dpr.UnlockRay; } - var otherRay = obj as IOtherRay; - if (otherRay != null) + var rayOrigins = obj as IUsesRayOrigins; + if (rayOrigins != null) { - Node otherNode = (Node)(1 - (int)GetNodeForRayOrigin(rayOrigin).Value); - Transform otherRayOrigin; - var proxy = GetProxyForRayOrigin(rayOrigin); - if (proxy != null && proxy.rayOrigins.TryGetValue(otherNode, out otherRayOrigin)) - otherRay.otherRayOrigin = otherRayOrigin; + List otherRayOrigins = new List(); + ForEachRayOrigin((proxy, rayOriginPair, rayOriginDevice, deviceData) => + { + if (rayOriginPair.Value != rayOrigin) + otherRayOrigins.Add(rayOriginPair.Value); + }, true); + rayOrigins.otherRayOrigins = otherRayOrigins; } } diff --git a/Scripts/Interfaces/IOtherRay.cs b/Scripts/Interfaces/IOtherRay.cs deleted file mode 100644 index c14cacfb2..000000000 --- a/Scripts/Interfaces/IOtherRay.cs +++ /dev/null @@ -1,8 +0,0 @@ -using UnityEngine; - -interface IOtherRay -{ - - Transform otherRayOrigin { set; } - -} diff --git a/Scripts/Interfaces/IUsesRayOrigins.cs b/Scripts/Interfaces/IUsesRayOrigins.cs new file mode 100644 index 000000000..3528fed67 --- /dev/null +++ b/Scripts/Interfaces/IUsesRayOrigins.cs @@ -0,0 +1,9 @@ +using UnityEngine; +using System.Collections.Generic; + +interface IUsesRayOrigins +{ + + List otherRayOrigins { set; } + +} diff --git a/Scripts/Interfaces/IOtherRay.cs.meta b/Scripts/Interfaces/IUsesRayOrigins.cs.meta similarity index 100% rename from Scripts/Interfaces/IOtherRay.cs.meta rename to Scripts/Interfaces/IUsesRayOrigins.cs.meta diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 4d31bab4f..b82f8042e 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -9,10 +9,10 @@ using UnityEditor.VR; [MainMenuItem("Annotation", "Tools", "Draw in the space")] -public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IRay, ICustomRay, IOtherRay, IInstantiateUI +public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI { public Transform rayOrigin { private get; set; } - public Transform otherRayOrigin { private get; set; } + public List otherRayOrigins { private get; set; } public Action showDefaultRay { get; set; } public Action hideDefaultRay { get; set; } @@ -102,7 +102,7 @@ void Update() { GenerateCustomPointer(); - if (otherRayOrigin != null) + if (otherRayOrigins != null) CheckColorPicker(); CheckBrushSizeUi(); @@ -174,35 +174,45 @@ private void CheckBrushSizeUi() private void CheckColorPicker() { - var otherRayMatrix = otherRayOrigin.worldToLocalMatrix; - var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); - var distance = Mathf.Abs(rayLocalPos.x); - - if (distance < .325f) + foreach (var otherRayOrigin in otherRayOrigins) { - if (m_ColorPicker == null) + var otherRayMatrix = otherRayOrigin.worldToLocalMatrix; + var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); + var distance = Mathf.Abs(rayLocalPos.x); + + if (distance < .325f) { - var colorPickerObj = instantiateUI(m_ColorPickerPrefab); - m_ColorPicker = colorPickerObj.GetComponent(); - m_ColorPicker.toolRayOrigin = rayOrigin; - m_ColorPicker.onColorPicked = HandleColoring; - - var pickerTransform = m_ColorPicker.transform; - pickerTransform.SetParent(otherRayOrigin); - pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; - pickerTransform.localRotation = Quaternion.identity; - } + if (m_ColorPicker == null) + { + var colorPickerObj = instantiateUI(m_ColorPickerPrefab); + m_ColorPicker = colorPickerObj.GetComponent(); + m_ColorPicker.toolRayOrigin = rayOrigin; + m_ColorPicker.onColorPicked = HandleColoring; + + var pickerTransform = m_ColorPicker.transform; + pickerTransform.SetParent(otherRayOrigin); + pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; + pickerTransform.localRotation = Quaternion.identity; + } + else if (m_ColorPicker.transform.parent != otherRayOrigin) + { + var pickerTransform = m_ColorPicker.transform; + pickerTransform.SetParent(otherRayOrigin); + pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; + pickerTransform.localRotation = Quaternion.identity; + } - float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); - Vector3 localPos = m_ColorPicker.transform.localPosition; - localPos.x = Mathf.Abs(localPos.x) * Mathf.Sign(dot); - m_ColorPicker.transform.localPosition = localPos; + float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); + Vector3 localPos = m_ColorPicker.transform.localPosition; + localPos.x = Mathf.Abs(localPos.x) * Mathf.Sign(dot); + m_ColorPicker.transform.localPosition = localPos; - if (!m_ColorPicker.enabled) - m_ColorPicker.Show(); + if (!m_ColorPicker.enabled) + m_ColorPicker.Show(); + } + else if (m_ColorPicker && m_ColorPicker.enabled) + m_ColorPicker.Hide(); } - else if (m_ColorPicker && m_ColorPicker.enabled) - m_ColorPicker.Hide(); } private void HandleColoring(Color newColor) From dcb3c649061a18ded4444d0ad8164f1793df0a58 Mon Sep 17 00:00:00 2001 From: David Keri Date: Tue, 15 Nov 2016 16:15:31 +0100 Subject: [PATCH 011/870] reduce the size of the color picker and the proximity check for it --- Tools/AnnotationTool/AnnotationTool.cs | 13 ++++--------- Tools/AnnotationTool/ColorPickerUI.cs | 16 +++++++++------- .../AnnotationTool/Prefabs/ColorPickerUI.prefab | 12 ++++++------ 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index b82f8042e..b28d82849 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -180,26 +180,26 @@ private void CheckColorPicker() var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); var distance = Mathf.Abs(rayLocalPos.x); - if (distance < .325f) + if (distance < .1625f) { if (m_ColorPicker == null) { var colorPickerObj = instantiateUI(m_ColorPickerPrefab); m_ColorPicker = colorPickerObj.GetComponent(); m_ColorPicker.toolRayOrigin = rayOrigin; - m_ColorPicker.onColorPicked = HandleColoring; + m_ColorPicker.onColorPicked = (col) => { m_ColorToUse = col; }; var pickerTransform = m_ColorPicker.transform; pickerTransform.SetParent(otherRayOrigin); pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; - pickerTransform.localRotation = Quaternion.identity; + pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; } else if (m_ColorPicker.transform.parent != otherRayOrigin) { var pickerTransform = m_ColorPicker.transform; pickerTransform.SetParent(otherRayOrigin); pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; - pickerTransform.localRotation = Quaternion.identity; + pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; } float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); @@ -215,11 +215,6 @@ private void CheckColorPicker() } } - private void HandleColoring(Color newColor) - { - m_ColorToUse = newColor; - } - private void HandleBrushSize() { if (m_CustomPointerMesh != null) diff --git a/Tools/AnnotationTool/ColorPickerUI.cs b/Tools/AnnotationTool/ColorPickerUI.cs index 3b62b7434..18416dfac 100644 --- a/Tools/AnnotationTool/ColorPickerUI.cs +++ b/Tools/AnnotationTool/ColorPickerUI.cs @@ -177,15 +177,17 @@ private void GenerateColorPicker() private void PositionToColor() { - var rect = m_ColorPicker.rectTransform.rect; - - float hue = (m_PickerTargetPosition.x + rect.width / 2f) / rect.width; - float saturation = (m_PickerTargetPosition.y + rect.height / 2f) / rect.height; - float brightness = m_BrightnessSlider.value; - - Color col = Color.HSVToRGB(hue, saturation, brightness); if (onColorPicked != null) + { + var rect = m_ColorPicker.rectTransform.rect; + + float hue = (m_PickerTargetPosition.x + rect.width / 2f) / rect.width; + float saturation = (m_PickerTargetPosition.y + rect.height / 2f) / rect.height; + float brightness = m_BrightnessSlider.value; + + Color col = Color.HSVToRGB(hue, saturation, brightness); onColorPicked(col); + } } } diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab index 59c15bb83..233e4f0ac 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab @@ -499,10 +499,10 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014053269536} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.0005, y: 0.0005, z: 0.0005} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: 0.64278877, y: 0.00000082701445, z: 0.00000012293458, w: 0.76604354} + m_LocalPosition: {x: 0, y: 0, z: -0.03} + m_LocalScale: {x: 0.00024999998, y: 0.00025, z: 0.00025} + m_LocalEulerAnglesHint: {x: 80, y: 0, z: 0} m_Children: - {fileID: 224000011329703258} - {fileID: 224000011527980190} @@ -510,7 +510,7 @@ RectTransform: m_RootOrder: 0 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0.17, y: 0} + m_AnchoredPosition: {x: 0.08, y: 0.0225} m_SizeDelta: {x: 512, y: 640} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011175436320 @@ -641,7 +641,7 @@ RectTransform: m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: -256} m_SizeDelta: {x: 50, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000011919119404 From c09cd0da3f279b9065ed78206d2c7cf0bdffc85b Mon Sep 17 00:00:00 2001 From: David Keri Date: Wed, 16 Nov 2016 16:06:38 +0100 Subject: [PATCH 012/870] improve generated mesh --- Tools/AnnotationTool/AnnotationTool.cs | 33 +++++++++++-------- .../Materials/AnnotationTexture.png | 4 +-- .../Materials/AnnotationTexture.png.meta | 4 +-- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index b28d82849..b4a563721 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -30,11 +30,12 @@ public ActionMap actionMap private AnnotationInput m_AnnotationInput; - private const int kInitialListSize = 65535; + private const int kInitialListSize = 32767; private List m_Points = new List(kInitialListSize); private List m_Forwards = new List(kInitialListSize); private List m_Widths = new List(kInitialListSize); + private List m_Rights = new List(); private MeshFilter m_CurrentMeshFilter; private Color m_ColorToUse = Color.white; @@ -366,6 +367,7 @@ private void SetupAnnotation() m_Points.Clear(); m_Forwards.Clear(); m_Widths.Clear(); + m_Rights.Clear(); GameObject go = new GameObject("Annotation " + m_AnnotationHolder.childCount); m_UndoList.Add(go); @@ -439,11 +441,12 @@ private void UpdateAnnotation() Vector3 worldPoint = rayOrigin.position + rayForward * kTipDistance; Vector3 localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); - //if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * 0.25f)) + if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * 0.1f)) { m_Points.Add(localPoint); m_Forwards.Add(rayForward); m_Widths.Add(m_CurrentRadius); + m_Rights.Add(rayOrigin.right); PointsToMesh(); } @@ -470,7 +473,7 @@ private void PointsToMesh() TriangulatePlane(newTriangles, newVertices.Count); CalculateUvs(newUvs, newVertices); - + m_CurrentMesh.Clear(); m_CurrentMesh.vertices = newVertices.ToArray(); @@ -494,17 +497,18 @@ private void LineToPlane(List newVertices) // For optimization, ignore inner points of an almost straight line. // The last point is an exception, it is required for a smooth drawing experience. - if (Vector3.Angle(prevDirection, direction) < 1f && i < m_Points.Count - 1) + if (Vector3.Angle(prevDirection, direction) < 1f && i < m_Points.Count - 1 && i > 1) continue; - Vector3 cross; - float drawAngle = Vector3.Angle(direction, m_Forwards[i - 1]); - if (drawAngle < 10 || drawAngle > 170) - cross = Vector3.Cross(direction, Quaternion.Euler(-90, 0, 0) * m_Forwards[i - 1]).normalized; - else - cross = Vector3.Cross(direction, m_Forwards[i - 1]).normalized; - - float width = m_Widths[i - 1]; + var ratio = Mathf.Abs(Vector3.Dot(direction, m_Forwards[i - 1])); + var cross1 = m_Rights[i - 1].normalized; + var cross2 = Vector3.Cross(direction, m_Forwards[i - 1]).normalized; + var cross = Vector3.Lerp(cross1, cross2, 1 - ratio).normalized; + + float lowWidth = Mathf.Min((i - 3) * 0.1f, 1); + float highWidth = Mathf.Min((m_Points.Count - (i + 2)) * 0.25f, 1); + float unclampedWidth = m_Widths[i - 1] * Mathf.Clamp01(i < m_Points.Count / 2f ? lowWidth : highWidth); + float width = Mathf.Clamp(unclampedWidth, kTopMinRadius, kTopMaxRadius); Vector3 left = thisPoint - cross * width; Vector3 right = thisPoint + cross * width; @@ -517,13 +521,14 @@ private void LineToPlane(List newVertices) private void SmoothPlane(List newVertices) { - const float kSmoothRatio = .5f; + const float kSmoothRatio = .75f; for (int side = 0; side < 2; side++) { for (int i = 4; i < newVertices.Count - 4 - side; i++) { Vector3 average = (newVertices[i - 4 + side] + newVertices[i - 2 + side] + newVertices[i + 2 + side] + newVertices[i + 4 + side]) / 4f; - newVertices[i + side] = Vector3.Lerp(newVertices[i + side], average, kSmoothRatio); + float dynamicSmooth = 1 / Vector3.Distance(newVertices[i + side], average); + newVertices[i + side] = Vector3.Lerp(newVertices[i + side], average, kSmoothRatio * dynamicSmooth); } } } diff --git a/Tools/AnnotationTool/Materials/AnnotationTexture.png b/Tools/AnnotationTool/Materials/AnnotationTexture.png index fbf5b7afb..95b70d63a 100644 --- a/Tools/AnnotationTool/Materials/AnnotationTexture.png +++ b/Tools/AnnotationTool/Materials/AnnotationTexture.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b384dbcf37d3e64f90ca3b2563e23496e29e699a9e0f2334e3df288d8e0fc32 -size 59343 +oid sha256:f1419814709f63527d40765bde5a29ddf57e876bf0de3923fb31ccfddd25f770 +size 34902 diff --git a/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta b/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta index 6cb2f3020..55a8e8453 100644 --- a/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta +++ b/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta @@ -20,7 +20,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 isReadable: 0 - grayScaleToAlpha: 1 + grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 7 @@ -32,7 +32,7 @@ TextureImporter: filterMode: 1 aniso: 1 mipBias: -1 - wrapMode: 0 + wrapMode: 1 nPOTScale: 1 lightmap: 0 rGBM: 0 From e59047817f58699ed71c86cb989e84baeeb5c04a Mon Sep 17 00:00:00 2001 From: David Keri Date: Thu, 17 Nov 2016 17:24:27 +0100 Subject: [PATCH 013/870] fix guis improve generated mesh uv/material improve brush cone mesh/material --- Manipulators/Materials/SelectionCone.mat | 2 +- Tools/AnnotationTool/AnnotationInput.asset | 2 + Tools/AnnotationTool/AnnotationTool.cs | 66 +++++++-- Tools/AnnotationTool/AnnotationTool.cs.meta | 4 +- Tools/AnnotationTool/BrushSizeUI.cs | 12 ++ .../Materials/AnnotationMaterial.mat | 17 ++- .../Materials/AnnotationTexture.png | 4 +- .../Materials/AnnotationTexture.png.meta | 6 +- Tools/AnnotationTool/Materials/BrushCone.mat | 128 ++++++++++++++++++ .../Materials/BrushCone.mat.meta | 8 ++ .../AnnotationTool/Prefabs/BrushSizeUI.prefab | 6 +- .../Prefabs/ColorPickerUI.prefab | 2 +- 12 files changed, 226 insertions(+), 31 deletions(-) create mode 100644 Tools/AnnotationTool/Materials/BrushCone.mat create mode 100644 Tools/AnnotationTool/Materials/BrushCone.mat.meta diff --git a/Manipulators/Materials/SelectionCone.mat b/Manipulators/Materials/SelectionCone.mat index 1f276fd3c..040993902 100644 --- a/Manipulators/Materials/SelectionCone.mat +++ b/Manipulators/Materials/SelectionCone.mat @@ -10,7 +10,7 @@ Material: m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A m_LightmapFlags: 1 - m_CustomRenderQueue: 3001 + m_CustomRenderQueue: 3000 stringTagMap: RenderType: Transparent m_SavedProperties: diff --git a/Tools/AnnotationTool/AnnotationInput.asset b/Tools/AnnotationTool/AnnotationInput.asset index b1c171015..c083c0664 100644 --- a/Tools/AnnotationTool/AnnotationInput.asset +++ b/Tools/AnnotationTool/AnnotationInput.asset @@ -38,6 +38,8 @@ MonoBehaviour: - sources: - controlIndex: 1 deviceKey: 1 + - controlIndex: 0 + deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] gravity: 1000 diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index b4a563721..8a3c68ecf 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -47,6 +47,7 @@ public ActionMap actionMap [SerializeField] private Material m_ConeMaterial; + private Material m_ConeMaterialInstance; [SerializeField] private GameObject m_ColorPickerPrefab; @@ -113,13 +114,13 @@ void Update() SetupAnnotation(); else if (m_AnnotationInput.draw.isHeld) UpdateAnnotation(); - else if (m_AnnotationInput.undo.wasJustPressed) - UndoLast(); else if (m_AnnotationInput.draw.wasJustReleased) { m_CurrentMesh.Optimize(); m_CurrentMesh.UploadMeshData(true); } + else if (m_AnnotationInput.undo.wasJustPressed) + UndoLast(); if (m_AnnotationInput.changeBrushSize.value != 0) HandleBrushSize(); @@ -188,7 +189,7 @@ private void CheckColorPicker() var colorPickerObj = instantiateUI(m_ColorPickerPrefab); m_ColorPicker = colorPickerObj.GetComponent(); m_ColorPicker.toolRayOrigin = rayOrigin; - m_ColorPicker.onColorPicked = (col) => { m_ColorToUse = col; }; + m_ColorPicker.onColorPicked = OnColorPickerValueChanged; var pickerTransform = m_ColorPicker.transform; pickerTransform.SetParent(otherRayOrigin); @@ -216,11 +217,22 @@ private void CheckColorPicker() } } + private void OnColorPickerValueChanged(Color newColor) + { + m_ColorToUse = newColor; + + newColor.a = .75f; + m_ConeMaterialInstance.SetColor("_Color", newColor); + m_ConeMaterialInstance.SetColor("_EmissionColor", newColor); + + m_BrushSizeUi.OnBrushColorChanged(newColor); + } + private void HandleBrushSize() { if (m_CustomPointerMesh != null) { - var sign = m_AnnotationInput.changeBrushSize.value; + var sign = Mathf.Sign(m_AnnotationInput.changeBrushSize.value); m_CurrentRadius += sign * Time.unscaledDeltaTime * .1f; m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); @@ -261,7 +273,9 @@ private void GenerateCustomPointer() m_CustomPointerObject = new GameObject("CustomPointer"); m_CustomPointerObject.AddComponent().sharedMesh = m_CustomPointerMesh; - m_CustomPointerObject.AddComponent().sharedMaterial = m_ConeMaterial; + + m_ConeMaterialInstance = Instantiate(m_ConeMaterial); + m_CustomPointerObject.AddComponent().sharedMaterial = m_ConeMaterialInstance; var pointerTrans = m_CustomPointerObject.transform; pointerTrans.SetParent(rayOrigin); @@ -438,17 +452,41 @@ private GameObject GetNewSessionHolder(Transform mainHolderTrans) private void UpdateAnnotation() { Vector3 rayForward = rayOrigin.forward; + Vector3 rayRight = rayOrigin.right; Vector3 worldPoint = rayOrigin.position + rayForward * kTipDistance; Vector3 localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); - if (m_Points.Count < 1 || Vector3.Distance(m_Points.Last(), localPoint) >= (m_CurrentRadius * 0.1f)) + InterpolatePointsIfNeeded(localPoint, rayForward, rayRight); + + m_Points.Add(localPoint); + m_Forwards.Add(rayForward); + m_Widths.Add(m_CurrentRadius); + m_Rights.Add(rayRight); + + PointsToMesh(); + } + + private void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, Vector3 rayRight) + { + if (m_Points.Count > 1) { - m_Points.Add(localPoint); - m_Forwards.Add(rayForward); - m_Widths.Add(m_CurrentRadius); - m_Rights.Add(rayOrigin.right); + var lastPoint = m_Points.Last(); + var distance = Vector3.Distance(lastPoint, localPoint); + + if (distance > m_CurrentRadius * .5f) + { + var halfPoint = (lastPoint + localPoint) / 2f; + m_Points.Add(halfPoint); + + var halfForward = (m_Forwards.Last() + rayForward) / 2f; + m_Forwards.Add(halfForward); - PointsToMesh(); + var halfRadius = (m_Widths.Last() + m_CurrentRadius) / 2f; + m_Widths.Add(halfRadius); + + var halfRight = (m_Rights.Last() + rayRight) / 2f; + m_Rights.Add(halfRight); + } } } @@ -509,6 +547,7 @@ private void LineToPlane(List newVertices) float highWidth = Mathf.Min((m_Points.Count - (i + 2)) * 0.25f, 1); float unclampedWidth = m_Widths[i - 1] * Mathf.Clamp01(i < m_Points.Count / 2f ? lowWidth : highWidth); float width = Mathf.Clamp(unclampedWidth, kTopMinRadius, kTopMaxRadius); + Vector3 left = thisPoint - cross * width; Vector3 right = thisPoint + cross * width; @@ -552,10 +591,7 @@ private void CalculateUvs(List newUvs, List newVertices) for (int i = 0; i < newVertices.Count; i += 2) { for (int side = 0; side < 2; side++) - { - float distance = i > 0 ? Vector3.Distance(newVertices[i - 2 + side], newVertices[i + side]) : 0; - newUvs.Add(new Vector2(side, distance)); - } + newUvs.Add(new Vector2(side, i / 2)); } } diff --git a/Tools/AnnotationTool/AnnotationTool.cs.meta b/Tools/AnnotationTool/AnnotationTool.cs.meta index fd7055541..eef73c906 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs.meta +++ b/Tools/AnnotationTool/AnnotationTool.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: ecba8b13e3259e14eab642c0d0657d5c -timeCreated: 1478604970 +timeCreated: 1479382887 licenseType: Free MonoImporter: serializedVersion: 2 @@ -8,7 +8,7 @@ MonoImporter: - m_ActionMap: {fileID: 11400000, guid: 6615fd7d8b165fe43bc85867850097e5, type: 2} - m_AnnotationMaterial: {fileID: 2100000, guid: 252a12e5980ef5b438bcc0dbc0d35529, type: 2} - - m_ConeMaterial: {fileID: 2100000, guid: 0372357aa9e962f47a35f6b6350ae99c, type: 2} + - m_ConeMaterial: {fileID: 2100000, guid: facc16e9d19b3b84e9110a7805dfa457, type: 2} - m_ColorPickerPrefab: {fileID: 1000014053269536, guid: da56ed8b2b72e414589b2938af94c498, type: 2} - m_BrushSizePrefab: {fileID: 1000012251850158, guid: 76909d1f493d664469c9e0f4726790a3, diff --git a/Tools/AnnotationTool/BrushSizeUI.cs b/Tools/AnnotationTool/BrushSizeUI.cs index 4cd621b57..9cb72f72e 100644 --- a/Tools/AnnotationTool/BrushSizeUI.cs +++ b/Tools/AnnotationTool/BrushSizeUI.cs @@ -14,9 +14,16 @@ public class BrushSizeUI : MonoBehaviour [SerializeField] private Slider m_Slider; + private Image m_SliderHandleImage; + private const float kMinSize = 0.25f; private const float kMaxSize = 12.5f; + void Start() + { + m_SliderHandleImage = m_SliderHandle.GetComponent(); + } + public void OnSliderValueChanged(float value) { m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(kMinSize, kMaxSize, value); @@ -30,4 +37,9 @@ public void ChangeSliderValue(float newValue) m_Slider.value = newValue; } + public void OnBrushColorChanged(Color newColor) + { + m_SliderHandleImage.color = newColor; + } + } diff --git a/Tools/AnnotationTool/Materials/AnnotationMaterial.mat b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat index 8aa59f621..ef603e1b2 100644 --- a/Tools/AnnotationTool/Materials/AnnotationMaterial.mat +++ b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat @@ -8,7 +8,7 @@ Material: m_PrefabInternal: {fileID: 0} m_Name: AnnotationMaterial m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION + m_ShaderKeywords: _ALPHABLEND_ON _EMISSION m_LightmapFlags: 0 m_CustomRenderQueue: 3000 stringTagMap: @@ -46,6 +46,12 @@ Material: m_Texture: {fileID: 2800000, guid: 831efcd782cc31c4493674a90523630a, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - first: + name: _Illum + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - first: name: _MainTex second: @@ -83,6 +89,9 @@ Material: - first: name: _DstBlend second: 10 + - first: + name: _Emission + second: 1 - first: name: _GlossMapScale second: 1 @@ -97,7 +106,7 @@ Material: second: 0 - first: name: _Mode - second: 3 + second: 2 - first: name: _OcclusionStrength second: 1 @@ -112,7 +121,7 @@ Material: second: 1 - first: name: _SrcBlend - second: 1 + second: 5 - first: name: _UVSec second: 0 @@ -122,7 +131,7 @@ Material: m_Colors: - first: name: _Color - second: {r: 1, g: 1, b: 1, a: 0.5019608} + second: {r: 1, g: 1, b: 1, a: 1} - first: name: _EmissionColor second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tools/AnnotationTool/Materials/AnnotationTexture.png b/Tools/AnnotationTool/Materials/AnnotationTexture.png index 95b70d63a..2ccd8b07f 100644 --- a/Tools/AnnotationTool/Materials/AnnotationTexture.png +++ b/Tools/AnnotationTool/Materials/AnnotationTexture.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f1419814709f63527d40765bde5a29ddf57e876bf0de3923fb31ccfddd25f770 -size 34902 +oid sha256:68d936a33e71b0ea49261d6f2ad8ef5b979e6aa4155a96bce6be2ba32d265c8a +size 233254 diff --git a/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta b/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta index 55a8e8453..41083d8d7 100644 --- a/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta +++ b/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta @@ -26,11 +26,11 @@ TextureImporter: cubemapConvolutionSteps: 7 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 - textureFormat: -1 + textureFormat: -3 maxTextureSize: 2048 textureSettings: - filterMode: 1 - aniso: 1 + filterMode: 2 + aniso: 16 mipBias: -1 wrapMode: 1 nPOTScale: 1 diff --git a/Tools/AnnotationTool/Materials/BrushCone.mat b/Tools/AnnotationTool/Materials/BrushCone.mat new file mode 100644 index 000000000..a2b617fe1 --- /dev/null +++ b/Tools/AnnotationTool/Materials/BrushCone.mat @@ -0,0 +1,128 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: BrushCone + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + m_LightmapFlags: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: _BumpScale + second: 1 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 10 + - first: + name: _GlossMapScale + second: 0 + - first: + name: _Glossiness + second: 0 + - first: + name: _GlossyReflections + second: 1 + - first: + name: _Metallic + second: 0 + - first: + name: _Mode + second: 3 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _SmoothnessTextureChannel + second: 1 + - first: + name: _SpecularHighlights + second: 1 + - first: + name: _SrcBlend + second: 1 + - first: + name: _UVSec + second: 0 + - first: + name: _ZWrite + second: 0 + m_Colors: + - first: + name: _Color + second: {r: 0.95686275, g: 0.95686275, b: 0.95686275, a: 0.7529412} + - first: + name: _EmissionColor + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tools/AnnotationTool/Materials/BrushCone.mat.meta b/Tools/AnnotationTool/Materials/BrushCone.mat.meta new file mode 100644 index 000000000..fdb31694a --- /dev/null +++ b/Tools/AnnotationTool/Materials/BrushCone.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: facc16e9d19b3b84e9110a7805dfa457 +timeCreated: 1469753277 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab index db18f7081..54e67e109 100644 --- a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab +++ b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab @@ -338,7 +338,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_Material: {fileID: 0} - m_Color: {r: 0.27205884, g: 0.63853973, b: 1, a: 1} + m_Color: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: @@ -366,7 +366,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_Material: {fileID: 0} - m_Color: {r: 0.27205884, g: 0.63853973, b: 1, a: 1} + m_Color: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: @@ -416,7 +416,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_Material: {fileID: 0} - m_Color: {r: 0.45588237, g: 0.75233275, b: 1, a: 1} + m_Color: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab index 233e4f0ac..fc5214209 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab @@ -187,7 +187,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_IgnoreReversedGraphics: 1 + m_IgnoreReversedGraphics: 0 m_BlockingObjects: 0 m_BlockingMask: serializedVersion: 2 From d85204b31d9e6cf6ee868e6229be32bbaa5fc5a4 Mon Sep 17 00:00:00 2001 From: David Keri Date: Fri, 18 Nov 2016 14:40:30 +0100 Subject: [PATCH 014/870] improve annotation shaders and materials replace removed sprites for brush size gui --- Tools/AnnotationTool/AnnotationTool.cs | 46 ++++++++---- .../Materials/AnnotationMaterial.mat | 13 +++- .../Materials/AnnotationShader.shader | 75 +++++++++++++++++++ .../Materials/AnnotationShader.shader.meta | 9 +++ Tools/AnnotationTool/Materials/BrushCone.mat | 13 +++- .../Materials/BrushConeShader.shader | 70 +++++++++++++++++ .../Materials/BrushConeShader.shader.meta | 9 +++ .../Materials/BrushSizeCircle.png | 3 + .../Materials/BrushSizeCircle.png.meta | 59 +++++++++++++++ .../Materials/BrushSizeTriangle.png | 3 + .../Materials/BrushSizeTriangle.png.meta | 59 +++++++++++++++ .../AnnotationTool/Prefabs/BrushSizeUI.prefab | 16 ++-- 12 files changed, 346 insertions(+), 29 deletions(-) create mode 100644 Tools/AnnotationTool/Materials/AnnotationShader.shader create mode 100644 Tools/AnnotationTool/Materials/AnnotationShader.shader.meta create mode 100644 Tools/AnnotationTool/Materials/BrushConeShader.shader create mode 100644 Tools/AnnotationTool/Materials/BrushConeShader.shader.meta create mode 100644 Tools/AnnotationTool/Materials/BrushSizeCircle.png create mode 100644 Tools/AnnotationTool/Materials/BrushSizeCircle.png.meta create mode 100644 Tools/AnnotationTool/Materials/BrushSizeTriangle.png create mode 100644 Tools/AnnotationTool/Materials/BrushSizeTriangle.png.meta diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 8a3c68ecf..bc8129068 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -14,8 +14,8 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr public Transform rayOrigin { private get; set; } public List otherRayOrigins { private get; set; } - public Action showDefaultRay { get; set; } - public Action hideDefaultRay { get; set; } + public DefaultRayVisibilityDelegate showDefaultRay { get; set; } + public DefaultRayVisibilityDelegate hideDefaultRay { get; set; } public ActionMap actionMap { @@ -79,7 +79,7 @@ public ActionMap actionMap void OnDestroy() { if (m_RayHidden && showDefaultRay != null) - showDefaultRay(); + showDefaultRay(rayOrigin); if (m_ColorPicker) U.Object.Destroy(m_ColorPicker.gameObject); @@ -95,7 +95,7 @@ void Update() { if (hideDefaultRay != null) { - hideDefaultRay(); + hideDefaultRay(rayOrigin); m_RayHidden = true; } } @@ -180,9 +180,8 @@ private void CheckColorPicker() { var otherRayMatrix = otherRayOrigin.worldToLocalMatrix; var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); - var distance = Mathf.Abs(rayLocalPos.x); - - if (distance < .1625f) + + if (IsDistanceOkForColorPicker(rayLocalPos)) { if (m_ColorPicker == null) { @@ -195,6 +194,9 @@ private void CheckColorPicker() pickerTransform.SetParent(otherRayOrigin); pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; + + showDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(false); } else if (m_ColorPicker.transform.parent != otherRayOrigin) { @@ -210,19 +212,37 @@ private void CheckColorPicker() m_ColorPicker.transform.localPosition = localPos; if (!m_ColorPicker.enabled) + { m_ColorPicker.Show(); + showDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(false); + } } else if (m_ColorPicker && m_ColorPicker.enabled) + { m_ColorPicker.Hide(); + hideDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(true); + } } } + private bool IsDistanceOkForColorPicker(Vector3 rayLocalPosition) + { + var distanceX = Mathf.Abs(rayLocalPosition.x); + var distanceZ = Mathf.Abs(rayLocalPosition.z); + var distanceY = Mathf.Abs(rayLocalPosition.y); + + const float kSmallDistance = .1625f; + const float kLargeDistance = .33f; + return distanceX < kSmallDistance && distanceY < kLargeDistance && distanceZ < kSmallDistance; + } + private void OnColorPickerValueChanged(Color newColor) { m_ColorToUse = newColor; newColor.a = .75f; - m_ConeMaterialInstance.SetColor("_Color", newColor); m_ConeMaterialInstance.SetColor("_EmissionColor", newColor); m_BrushSizeUi.OnBrushColorChanged(newColor); @@ -328,12 +348,12 @@ private void GenerateSideTriangles(List triangles) int upperLeft = i + kSides - 1; int upperRight = i + kSides; - int[] sideTriangles = VerticesToPolygon(upperRight, upperLeft, lowerRight, lowerLeft, false); + int[] sideTriangles = VerticesToPolygon(upperRight, upperLeft, lowerRight, lowerLeft); triangles.AddRange(sideTriangles); } // Finish the side with a polygon that loops around from the end to the start vertices. - int[] finishTriangles = VerticesToPolygon(kSides, kSides * 2 - 1, 0, kSides - 1, false); + int[] finishTriangles = VerticesToPolygon(kSides, kSides * 2 - 1, 0, kSides - 1); triangles.AddRange(finishTriangles); } @@ -543,8 +563,8 @@ private void LineToPlane(List newVertices) var cross2 = Vector3.Cross(direction, m_Forwards[i - 1]).normalized; var cross = Vector3.Lerp(cross1, cross2, 1 - ratio).normalized; - float lowWidth = Mathf.Min((i - 3) * 0.1f, 1); - float highWidth = Mathf.Min((m_Points.Count - (i + 2)) * 0.25f, 1); + float lowWidth = Mathf.Min((newVertices.Count / 2) * 0.1f, 1); + float highWidth = Mathf.Min((m_Points.Count - (i + 3)) * 0.25f, 1); float unclampedWidth = m_Widths[i - 1] * Mathf.Clamp01(i < m_Points.Count / 2f ? lowWidth : highWidth); float width = Mathf.Clamp(unclampedWidth, kTopMinRadius, kTopMaxRadius); @@ -595,7 +615,7 @@ private void CalculateUvs(List newUvs, List newVertices) } } - private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = true) + private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) { int triangleCount = doubleSided ? 12 : 6; int[] triangles = new int[triangleCount]; diff --git a/Tools/AnnotationTool/Materials/AnnotationMaterial.mat b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat index ef603e1b2..cb82f2535 100644 --- a/Tools/AnnotationTool/Materials/AnnotationMaterial.mat +++ b/Tools/AnnotationTool/Materials/AnnotationMaterial.mat @@ -7,12 +7,11 @@ Material: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: AnnotationMaterial - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: b58d3c628700c3f409561bb1133396f4, type: 3} m_ShaderKeywords: _ALPHABLEND_ON _EMISSION m_LightmapFlags: 0 - m_CustomRenderQueue: 3000 - stringTagMap: - RenderType: Transparent + m_CustomRenderQueue: -1 + stringTagMap: {} m_SavedProperties: serializedVersion: 2 m_TexEnvs: @@ -76,6 +75,12 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - first: + name: _Texture + second: + m_Texture: {fileID: 2800000, guid: 831efcd782cc31c4493674a90523630a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Floats: - first: name: _BumpScale diff --git a/Tools/AnnotationTool/Materials/AnnotationShader.shader b/Tools/AnnotationTool/Materials/AnnotationShader.shader new file mode 100644 index 000000000..b492cbf82 --- /dev/null +++ b/Tools/AnnotationTool/Materials/AnnotationShader.shader @@ -0,0 +1,75 @@ +Shader "EditorVR/Annotation/Line" + { + + Properties + { + _Texture ("Texture", 2D) = "white" {} + _EmissionColor ("Emission Color", Color) = (0.5,0.5,0.5,1) + } + + SubShader + { + + Tags + { + "IgnoreProjector"="True" + "Queue"="Transparent" + "RenderType"="Transparent" + } + + Pass + { + Name "FORWARD" + + Tags + { + "LightMode"="ForwardBase" + } + + AlphaToMask On + Cull Off + + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + uniform float4 _EmissionColor; + uniform sampler2D _Texture; + uniform float4 _Texture_ST; + + struct VertexInput + { + float4 vertex : POSITION; + float2 texcoord0 : TEXCOORD0; + }; + + struct VertexOutput + { + float4 pos : SV_POSITION; + float2 uv0 : TEXCOORD0; + }; + + VertexOutput vert (VertexInput i) + { + VertexOutput o = (VertexOutput)0; + o.uv0 = i.texcoord0; + o.pos = mul(UNITY_MATRIX_MVP, i.vertex); + return o; + } + + float4 frag(VertexOutput i) : COLOR + { + float4 tex = tex2D(_Texture, TRANSFORM_TEX(i.uv0, _Texture)); + float3 finalColor = _EmissionColor.rgb * tex.rgb; + fixed4 finalRGBA = fixed4(finalColor, tex.a); + return finalRGBA; + } + + ENDCG + } + } + + FallBack "Diffuse" +} diff --git a/Tools/AnnotationTool/Materials/AnnotationShader.shader.meta b/Tools/AnnotationTool/Materials/AnnotationShader.shader.meta new file mode 100644 index 000000000..0cdbdac25 --- /dev/null +++ b/Tools/AnnotationTool/Materials/AnnotationShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b58d3c628700c3f409561bb1133396f4 +timeCreated: 1479463201 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Materials/BrushCone.mat b/Tools/AnnotationTool/Materials/BrushCone.mat index a2b617fe1..56f522d55 100644 --- a/Tools/AnnotationTool/Materials/BrushCone.mat +++ b/Tools/AnnotationTool/Materials/BrushCone.mat @@ -7,12 +7,11 @@ Material: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: BrushCone - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 4800000, guid: f7fe1f7ffeed9674ca410bcbf594597e, type: 3} m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A m_LightmapFlags: 1 - m_CustomRenderQueue: 3000 - stringTagMap: - RenderType: Transparent + m_CustomRenderQueue: -1 + stringTagMap: {} m_SavedProperties: serializedVersion: 2 m_TexEnvs: @@ -70,6 +69,12 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - first: + name: _Texture + second: + m_Texture: {fileID: 2800000, guid: 110aa29e0e52dae4a8f042dc6faca637, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Floats: - first: name: _BumpScale diff --git a/Tools/AnnotationTool/Materials/BrushConeShader.shader b/Tools/AnnotationTool/Materials/BrushConeShader.shader new file mode 100644 index 000000000..5ae5d986c --- /dev/null +++ b/Tools/AnnotationTool/Materials/BrushConeShader.shader @@ -0,0 +1,70 @@ +Shader "EditorVR/Annotation/Brush" + { + + Properties + { + _EmissionColor ("Emission Color", Color) = (0.5,0.5,0.5,1) + } + + SubShader + { + + Tags + { + "IgnoreProjector"="True" + "Queue"="Transparent" + "RenderType"="Transparent" + } + + Pass + { + Name "FORWARD" + + Tags + { + "LightMode"="ForwardBase" + } + + Blend SrcAlpha OneMinusSrcAlpha + Cull Front + + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + uniform float4 _EmissionColor; + + struct VertexInput + { + float4 vertex : POSITION; + float2 texcoord0 : TEXCOORD0; + }; + + struct VertexOutput + { + float4 pos : SV_POSITION; + float2 uv0 : TEXCOORD0; + }; + + VertexOutput vert (VertexInput i) + { + VertexOutput o = (VertexOutput)0; + o.uv0 = i.texcoord0; + o.pos = mul(UNITY_MATRIX_MVP, i.vertex); + return o; + } + + float4 frag(VertexOutput i) : COLOR + { + fixed4 finalRGBA = fixed4(_EmissionColor.rgb, _EmissionColor.a); + return finalRGBA; + } + + ENDCG + } + } + + FallBack "Diffuse" +} diff --git a/Tools/AnnotationTool/Materials/BrushConeShader.shader.meta b/Tools/AnnotationTool/Materials/BrushConeShader.shader.meta new file mode 100644 index 000000000..85dbd5d61 --- /dev/null +++ b/Tools/AnnotationTool/Materials/BrushConeShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f7fe1f7ffeed9674ca410bcbf594597e +timeCreated: 1479463201 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Materials/BrushSizeCircle.png b/Tools/AnnotationTool/Materials/BrushSizeCircle.png new file mode 100644 index 000000000..275724eeb --- /dev/null +++ b/Tools/AnnotationTool/Materials/BrushSizeCircle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ae5391beb96add0f6bec1f95efa58370488d072a287bdf9a44946bc50d0c12c +size 9309 diff --git a/Tools/AnnotationTool/Materials/BrushSizeCircle.png.meta b/Tools/AnnotationTool/Materials/BrushSizeCircle.png.meta new file mode 100644 index 000000000..313e5f2ab --- /dev/null +++ b/Tools/AnnotationTool/Materials/BrushSizeCircle.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 7804dd41905f9274a8199471a3015ce1 +timeCreated: 1479458511 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Materials/BrushSizeTriangle.png b/Tools/AnnotationTool/Materials/BrushSizeTriangle.png new file mode 100644 index 000000000..22822e612 --- /dev/null +++ b/Tools/AnnotationTool/Materials/BrushSizeTriangle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0aebacf8eec6514565ce27eed725c527f540c20509609b260bf404a81729f713 +size 11824 diff --git a/Tools/AnnotationTool/Materials/BrushSizeTriangle.png.meta b/Tools/AnnotationTool/Materials/BrushSizeTriangle.png.meta new file mode 100644 index 000000000..4228d4e45 --- /dev/null +++ b/Tools/AnnotationTool/Materials/BrushSizeTriangle.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 7923f80168fd7e6468eec1d653ed7cfd +timeCreated: 1479460629 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab index 54e67e109..d3401a074 100644 --- a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab +++ b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab @@ -244,7 +244,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300012, guid: d8618b0721ef74becb6df0458ac4c21e, type: 3} + m_Sprite: {fileID: 21300000, guid: 7804dd41905f9274a8199471a3015ce1, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -345,7 +345,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300012, guid: d8618b0721ef74becb6df0458ac4c21e, type: 3} + m_Sprite: {fileID: 21300000, guid: 7804dd41905f9274a8199471a3015ce1, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -373,7 +373,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300012, guid: d8618b0721ef74becb6df0458ac4c21e, type: 3} + m_Sprite: {fileID: 21300000, guid: 7804dd41905f9274a8199471a3015ce1, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -423,7 +423,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: e0d8f5bd0038af04688271cdc2557e18, type: 3} + m_Sprite: {fileID: 21300000, guid: 7923f80168fd7e6468eec1d653ed7cfd, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -511,7 +511,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300012, guid: d8618b0721ef74becb6df0458ac4c21e, type: 3} + m_Sprite: {fileID: 21300000, guid: 7804dd41905f9274a8199471a3015ce1, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -709,7 +709,7 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013490968792} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} @@ -718,8 +718,8 @@ RectTransform: m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 13.589985, y: -1} - m_SizeDelta: {x: 247.2, y: 419.91} + m_AnchoredPosition: {x: 14, y: -1} + m_SizeDelta: {x: 291, y: 420} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012965305110 RectTransform: From c14966e2da90435d22c50ef4e738406a91c43a87 Mon Sep 17 00:00:00 2001 From: David Keri Date: Mon, 21 Nov 2016 17:06:35 +0100 Subject: [PATCH 015/870] reorganize annotation tool related assets --- Tools/AnnotationTool/AnnotationTool.cs | 177 ++++++++++-------- Tools/AnnotationTool/ColorPickerSquareUI.cs | 18 -- Tools/AnnotationTool/Input.meta | 9 + .../{ => Input}/AnnotationInput.asset | 0 .../{ => Input}/AnnotationInput.asset.meta | 0 .../{ => Input}/AnnotationInput.cs | 0 .../{ => Input}/AnnotationInput.cs.meta | 0 Tools/AnnotationTool/Textures.meta | 9 + .../AnnotationTexture.png | 0 .../AnnotationTexture.png.meta | 0 .../BrushSizeCircle.png | 0 .../BrushSizeCircle.png.meta | 0 .../BrushSizeTriangle.png | 0 .../BrushSizeTriangle.png.meta | 0 Tools/AnnotationTool/UserInterface.meta | 9 + .../{ => UserInterface}/BrushSizeUI.cs | 0 .../{ => UserInterface}/BrushSizeUI.cs.meta | 0 .../UserInterface/ColorPickerSquareUI.cs | 29 +++ .../ColorPickerSquareUI.cs.meta | 0 .../{ => UserInterface}/ColorPickerUI.cs | 0 .../{ => UserInterface}/ColorPickerUI.cs.meta | 0 21 files changed, 157 insertions(+), 94 deletions(-) delete mode 100644 Tools/AnnotationTool/ColorPickerSquareUI.cs create mode 100644 Tools/AnnotationTool/Input.meta rename Tools/AnnotationTool/{ => Input}/AnnotationInput.asset (100%) rename Tools/AnnotationTool/{ => Input}/AnnotationInput.asset.meta (100%) rename Tools/AnnotationTool/{ => Input}/AnnotationInput.cs (100%) rename Tools/AnnotationTool/{ => Input}/AnnotationInput.cs.meta (100%) create mode 100644 Tools/AnnotationTool/Textures.meta rename Tools/AnnotationTool/{Materials => Textures}/AnnotationTexture.png (100%) rename Tools/AnnotationTool/{Materials => Textures}/AnnotationTexture.png.meta (100%) rename Tools/AnnotationTool/{Materials => Textures}/BrushSizeCircle.png (100%) rename Tools/AnnotationTool/{Materials => Textures}/BrushSizeCircle.png.meta (100%) rename Tools/AnnotationTool/{Materials => Textures}/BrushSizeTriangle.png (100%) rename Tools/AnnotationTool/{Materials => Textures}/BrushSizeTriangle.png.meta (100%) create mode 100644 Tools/AnnotationTool/UserInterface.meta rename Tools/AnnotationTool/{ => UserInterface}/BrushSizeUI.cs (100%) rename Tools/AnnotationTool/{ => UserInterface}/BrushSizeUI.cs.meta (100%) create mode 100644 Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs rename Tools/AnnotationTool/{ => UserInterface}/ColorPickerSquareUI.cs.meta (100%) rename Tools/AnnotationTool/{ => UserInterface}/ColorPickerUI.cs (100%) rename Tools/AnnotationTool/{ => UserInterface}/ColorPickerUI.cs.meta (100%) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index bc8129068..f6cbfffcb 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -9,8 +9,9 @@ using UnityEditor.VR; [MainMenuItem("Annotation", "Tools", "Draw in the space")] -public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI +public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IMenuOrigins { + public Transform rayOrigin { private get; set; } public List otherRayOrigins { private get; set; } @@ -25,17 +26,16 @@ public ActionMap actionMap private ActionMap m_ActionMap; public ActionMapInput actionMapInput { get { return m_AnnotationInput; } set { m_AnnotationInput = (AnnotationInput)value; } } + private AnnotationInput m_AnnotationInput; public Func instantiateUI { private get; set; } - private AnnotationInput m_AnnotationInput; - private const int kInitialListSize = 32767; private List m_Points = new List(kInitialListSize); private List m_Forwards = new List(kInitialListSize); private List m_Widths = new List(kInitialListSize); - private List m_Rights = new List(); + private List m_Rights = new List(kInitialListSize); private MeshFilter m_CurrentMeshFilter; private Color m_ColorToUse = Color.white; @@ -59,26 +59,32 @@ public ActionMap actionMap private Action onBrushSizeChanged { set; get; } + public Transform menuOrigin { set; private get; } + public Transform alternateMenuOrigin { set; private get; } + private Transform m_AnnotationHolder; - private bool m_RayHidden; + private bool m_IsRayHidden; + private bool m_IsValidStroke; private Mesh m_CustomPointerMesh; private GameObject m_CustomPointerObject; - + private const float kTopMinRadius = 0.001f; private const float kTopMaxRadius = 0.05f; private const float kBottomRadius = 0.01f; private const float kTipDistance = 0.05f; private const int kSides = 16; + private readonly Bounds m_ColorPickerRegion = new Bounds(Vector3.zero, Vector3.one * 0.35f); + private float m_CurrentRadius = kTopMinRadius; private List m_UndoList = new List(); void OnDestroy() { - if (m_RayHidden && showDefaultRay != null) + if (m_IsRayHidden && showDefaultRay != null) showDefaultRay(rayOrigin); if (m_ColorPicker) @@ -91,15 +97,39 @@ void OnDestroy() void Update() { - if (!m_RayHidden) + HideRay(); + HandleRayOrigins(); + + if (m_AnnotationInput.draw.wasJustPressed) + SetupAnnotation(); + else if (m_IsValidStroke) + { + if (m_AnnotationInput.draw.isHeld) + UpdateAnnotation(); + else if (m_AnnotationInput.draw.wasJustReleased) + FinalizeMesh(); + } + else if (m_AnnotationInput.undo.wasJustPressed) + UndoLast(); + + if (m_AnnotationInput.changeBrushSize.value != 0) + HandleBrushSize(); + } + + private void HideRay() + { + if (!m_IsRayHidden) { if (hideDefaultRay != null) { hideDefaultRay(rayOrigin); - m_RayHidden = true; + m_IsRayHidden = true; } } + } + private void HandleRayOrigins() + { if (rayOrigin != null) { GenerateCustomPointer(); @@ -109,21 +139,6 @@ void Update() CheckBrushSizeUi(); } - - if (m_AnnotationInput.draw.wasJustPressed) - SetupAnnotation(); - else if (m_AnnotationInput.draw.isHeld) - UpdateAnnotation(); - else if (m_AnnotationInput.draw.wasJustReleased) - { - m_CurrentMesh.Optimize(); - m_CurrentMesh.UploadMeshData(true); - } - else if (m_AnnotationInput.undo.wasJustPressed) - UndoLast(); - - if (m_AnnotationInput.changeBrushSize.value != 0) - HandleBrushSize(); } private void UndoLast() @@ -161,9 +176,9 @@ private void CheckBrushSizeUi() var bsuiObj = instantiateUI(m_BrushSizePrefab); m_BrushSizeUi = bsuiObj.GetComponent(); var trans = bsuiObj.transform; - trans.SetParent(rayOrigin); - trans.localPosition = m_BrushSizePrefab.transform.localPosition; - trans.localRotation = m_BrushSizePrefab.transform.localRotation; + trans.SetParent(alternateMenuOrigin); + trans.localPosition = Vector3.zero; + trans.localRotation = Quaternion.Euler(-90, 0, 0); m_BrushSizeUi.onValueChanged = (val) => { @@ -176,66 +191,61 @@ private void CheckBrushSizeUi() private void CheckColorPicker() { - foreach (var otherRayOrigin in otherRayOrigins) + if (!m_IsValidStroke) { - var otherRayMatrix = otherRayOrigin.worldToLocalMatrix; - var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); - - if (IsDistanceOkForColorPicker(rayLocalPos)) + foreach (var otherRayOrigin in otherRayOrigins) { - if (m_ColorPicker == null) + var otherRayMatrix = otherRayOrigin.worldToLocalMatrix; + var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); + + if (m_ColorPickerRegion.Contains(rayLocalPos)) { - var colorPickerObj = instantiateUI(m_ColorPickerPrefab); - m_ColorPicker = colorPickerObj.GetComponent(); - m_ColorPicker.toolRayOrigin = rayOrigin; - m_ColorPicker.onColorPicked = OnColorPickerValueChanged; - - var pickerTransform = m_ColorPicker.transform; - pickerTransform.SetParent(otherRayOrigin); - pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; - pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; - - showDefaultRay(rayOrigin); - m_CustomPointerObject.SetActive(false); + if (m_ColorPicker == null) + CreateColorPicker(otherRayOrigin); + else if (m_ColorPicker.transform.parent != otherRayOrigin) + { + var pickerTransform = m_ColorPicker.transform; + pickerTransform.SetParent(otherRayOrigin); + pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; + pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; + } + + float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); + Vector3 localPos = m_ColorPicker.transform.localPosition; + localPos.x = Mathf.Abs(localPos.x) * Mathf.Sign(dot); + m_ColorPicker.transform.localPosition = localPos; + + if (!m_ColorPicker.enabled) + { + m_ColorPicker.Show(); + showDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(false); + } } - else if (m_ColorPicker.transform.parent != otherRayOrigin) + else if (m_ColorPicker && m_ColorPicker.enabled) { - var pickerTransform = m_ColorPicker.transform; - pickerTransform.SetParent(otherRayOrigin); - pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; - pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; + m_ColorPicker.Hide(); + hideDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(true); } - - float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); - Vector3 localPos = m_ColorPicker.transform.localPosition; - localPos.x = Mathf.Abs(localPos.x) * Mathf.Sign(dot); - m_ColorPicker.transform.localPosition = localPos; - - if (!m_ColorPicker.enabled) - { - m_ColorPicker.Show(); - showDefaultRay(rayOrigin); - m_CustomPointerObject.SetActive(false); - } - } - else if (m_ColorPicker && m_ColorPicker.enabled) - { - m_ColorPicker.Hide(); - hideDefaultRay(rayOrigin); - m_CustomPointerObject.SetActive(true); } } } - private bool IsDistanceOkForColorPicker(Vector3 rayLocalPosition) + private void CreateColorPicker(Transform otherRayOrigin) { - var distanceX = Mathf.Abs(rayLocalPosition.x); - var distanceZ = Mathf.Abs(rayLocalPosition.z); - var distanceY = Mathf.Abs(rayLocalPosition.y); - - const float kSmallDistance = .1625f; - const float kLargeDistance = .33f; - return distanceX < kSmallDistance && distanceY < kLargeDistance && distanceZ < kSmallDistance; + var colorPickerObj = instantiateUI(m_ColorPickerPrefab); + m_ColorPicker = colorPickerObj.GetComponent(); + m_ColorPicker.toolRayOrigin = rayOrigin; + m_ColorPicker.onColorPicked = OnColorPickerValueChanged; + + var pickerTransform = m_ColorPicker.transform; + pickerTransform.SetParent(otherRayOrigin); + pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; + pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; + + showDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(false); } private void OnColorPickerValueChanged(Color newColor) @@ -396,6 +406,10 @@ private void GenerateCapsTriangles(List triangles) private void SetupAnnotation() { + m_IsValidStroke = m_CustomPointerObject.activeSelf; + if (!m_IsValidStroke) + return; + SetupHolder(); m_Points.Clear(); @@ -615,6 +629,17 @@ private void CalculateUvs(List newUvs, List newVertices) } } + private void FinalizeMesh() + { + m_IsValidStroke = false; + + m_CurrentMesh.RecalculateBounds(); + m_CurrentMesh.RecalculateNormals(); + m_CurrentMesh.Optimize(); + + m_CurrentMesh.UploadMeshData(true); + } + private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) { int triangleCount = doubleSided ? 12 : 6; diff --git a/Tools/AnnotationTool/ColorPickerSquareUI.cs b/Tools/AnnotationTool/ColorPickerSquareUI.cs deleted file mode 100644 index f90287419..000000000 --- a/Tools/AnnotationTool/ColorPickerSquareUI.cs +++ /dev/null @@ -1,18 +0,0 @@ -using UnityEngine; -using System.Collections; -using UnityEngine.UI; -using UnityEngine.EventSystems; -using System; - -public class ColorPickerSquareUI : Selectable, IDragHandler -{ - - public Action onDrag { private get; set; } - - public void OnDrag(PointerEventData eventData) - { - if (onDrag != null) - onDrag(); - } - -} diff --git a/Tools/AnnotationTool/Input.meta b/Tools/AnnotationTool/Input.meta new file mode 100644 index 000000000..7f3916a88 --- /dev/null +++ b/Tools/AnnotationTool/Input.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 55d364964ded02f4db710e852aa59c20 +folderAsset: yes +timeCreated: 1479732329 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/AnnotationInput.asset b/Tools/AnnotationTool/Input/AnnotationInput.asset similarity index 100% rename from Tools/AnnotationTool/AnnotationInput.asset rename to Tools/AnnotationTool/Input/AnnotationInput.asset diff --git a/Tools/AnnotationTool/AnnotationInput.asset.meta b/Tools/AnnotationTool/Input/AnnotationInput.asset.meta similarity index 100% rename from Tools/AnnotationTool/AnnotationInput.asset.meta rename to Tools/AnnotationTool/Input/AnnotationInput.asset.meta diff --git a/Tools/AnnotationTool/AnnotationInput.cs b/Tools/AnnotationTool/Input/AnnotationInput.cs similarity index 100% rename from Tools/AnnotationTool/AnnotationInput.cs rename to Tools/AnnotationTool/Input/AnnotationInput.cs diff --git a/Tools/AnnotationTool/AnnotationInput.cs.meta b/Tools/AnnotationTool/Input/AnnotationInput.cs.meta similarity index 100% rename from Tools/AnnotationTool/AnnotationInput.cs.meta rename to Tools/AnnotationTool/Input/AnnotationInput.cs.meta diff --git a/Tools/AnnotationTool/Textures.meta b/Tools/AnnotationTool/Textures.meta new file mode 100644 index 000000000..d999f247f --- /dev/null +++ b/Tools/AnnotationTool/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ea321fdada2515d4b97136b1cebaabd0 +folderAsset: yes +timeCreated: 1479732250 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Materials/AnnotationTexture.png b/Tools/AnnotationTool/Textures/AnnotationTexture.png similarity index 100% rename from Tools/AnnotationTool/Materials/AnnotationTexture.png rename to Tools/AnnotationTool/Textures/AnnotationTexture.png diff --git a/Tools/AnnotationTool/Materials/AnnotationTexture.png.meta b/Tools/AnnotationTool/Textures/AnnotationTexture.png.meta similarity index 100% rename from Tools/AnnotationTool/Materials/AnnotationTexture.png.meta rename to Tools/AnnotationTool/Textures/AnnotationTexture.png.meta diff --git a/Tools/AnnotationTool/Materials/BrushSizeCircle.png b/Tools/AnnotationTool/Textures/BrushSizeCircle.png similarity index 100% rename from Tools/AnnotationTool/Materials/BrushSizeCircle.png rename to Tools/AnnotationTool/Textures/BrushSizeCircle.png diff --git a/Tools/AnnotationTool/Materials/BrushSizeCircle.png.meta b/Tools/AnnotationTool/Textures/BrushSizeCircle.png.meta similarity index 100% rename from Tools/AnnotationTool/Materials/BrushSizeCircle.png.meta rename to Tools/AnnotationTool/Textures/BrushSizeCircle.png.meta diff --git a/Tools/AnnotationTool/Materials/BrushSizeTriangle.png b/Tools/AnnotationTool/Textures/BrushSizeTriangle.png similarity index 100% rename from Tools/AnnotationTool/Materials/BrushSizeTriangle.png rename to Tools/AnnotationTool/Textures/BrushSizeTriangle.png diff --git a/Tools/AnnotationTool/Materials/BrushSizeTriangle.png.meta b/Tools/AnnotationTool/Textures/BrushSizeTriangle.png.meta similarity index 100% rename from Tools/AnnotationTool/Materials/BrushSizeTriangle.png.meta rename to Tools/AnnotationTool/Textures/BrushSizeTriangle.png.meta diff --git a/Tools/AnnotationTool/UserInterface.meta b/Tools/AnnotationTool/UserInterface.meta new file mode 100644 index 000000000..9d9973666 --- /dev/null +++ b/Tools/AnnotationTool/UserInterface.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6775cf8f876c381458d8394ed5f6ff47 +folderAsset: yes +timeCreated: 1479732318 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/BrushSizeUI.cs b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs similarity index 100% rename from Tools/AnnotationTool/BrushSizeUI.cs rename to Tools/AnnotationTool/UserInterface/BrushSizeUI.cs diff --git a/Tools/AnnotationTool/BrushSizeUI.cs.meta b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs.meta similarity index 100% rename from Tools/AnnotationTool/BrushSizeUI.cs.meta rename to Tools/AnnotationTool/UserInterface/BrushSizeUI.cs.meta diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs new file mode 100644 index 000000000..01c534b46 --- /dev/null +++ b/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; +using UnityEngine.EventSystems; +using System; + +public class ColorPickerSquareUI : Selectable, IDragHandler, IBeginDragHandler, IEndDragHandler +{ + + private bool m_AllowDragEvents; + public Action onDrag { private get; set; } + + public void OnBeginDrag(PointerEventData eventData) + { + m_AllowDragEvents = true; + } + + public void OnDrag(PointerEventData eventData) + { + if (onDrag != null && m_AllowDragEvents) + onDrag(); + } + + public void OnEndDrag(PointerEventData eventData) + { + m_AllowDragEvents = false; + } + +} diff --git a/Tools/AnnotationTool/ColorPickerSquareUI.cs.meta b/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs.meta similarity index 100% rename from Tools/AnnotationTool/ColorPickerSquareUI.cs.meta rename to Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs.meta diff --git a/Tools/AnnotationTool/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs similarity index 100% rename from Tools/AnnotationTool/ColorPickerUI.cs rename to Tools/AnnotationTool/UserInterface/ColorPickerUI.cs diff --git a/Tools/AnnotationTool/ColorPickerUI.cs.meta b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs.meta similarity index 100% rename from Tools/AnnotationTool/ColorPickerUI.cs.meta rename to Tools/AnnotationTool/UserInterface/ColorPickerUI.cs.meta From 17f413df89c34a452eee2a9f47b56faba3a0cef7 Mon Sep 17 00:00:00 2001 From: David Keri Date: Tue, 22 Nov 2016 17:32:08 +0100 Subject: [PATCH 016/870] add color palette gui --- Tools/AnnotationTool/AnnotationTool.cs | 52 ++-- Tools/AnnotationTool/AnnotationTool.cs.meta | 4 +- .../AnnotationTool/Materials/ColorPalette.mat | 128 ++++++++ .../Materials/ColorPalette.mat.meta | 8 + .../Prefabs/ColorPickerActivator.prefab | 288 ++++++++++++++++++ .../Prefabs/ColorPickerActivator.prefab.meta | 8 + .../Prefabs/ColorPickerUI.prefab | 2 +- Tools/AnnotationTool/Textures/ColorWheel.png | 3 + .../Textures/ColorWheel.png.meta | 59 ++++ .../UserInterface/ColorPickerActivator.cs | 29 ++ .../ColorPickerActivator.cs.meta | 12 + .../UserInterface/ColorPickerUI.cs | 2 + 12 files changed, 574 insertions(+), 21 deletions(-) create mode 100644 Tools/AnnotationTool/Materials/ColorPalette.mat create mode 100644 Tools/AnnotationTool/Materials/ColorPalette.mat.meta create mode 100644 Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab create mode 100644 Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab.meta create mode 100644 Tools/AnnotationTool/Textures/ColorWheel.png create mode 100644 Tools/AnnotationTool/Textures/ColorWheel.png.meta create mode 100644 Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs create mode 100644 Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs.meta diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index f6cbfffcb..a27863f2e 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using UnityEngine.VR.Utilities; using UnityEditor.VR; +using UnityEngine.VR.Menus; [MainMenuItem("Annotation", "Tools", "Draw in the space")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IMenuOrigins @@ -69,7 +70,11 @@ public ActionMap actionMap private Mesh m_CustomPointerMesh; private GameObject m_CustomPointerObject; - + + [SerializeField] + private GameObject m_ColorPickerActivatorPrefab; + private GameObject m_ColorPickerActivator; + private const float kTopMinRadius = 0.001f; private const float kTopMaxRadius = 0.05f; private const float kBottomRadius = 0.01f; @@ -138,6 +143,13 @@ private void HandleRayOrigins() CheckColorPicker(); CheckBrushSizeUi(); + + if (m_ColorPickerActivator == null) + { + m_ColorPickerActivator = instantiateUI(m_ColorPickerActivatorPrefab); + m_ColorPickerActivator.GetComponentInChildren().alternateMenuOrigin = alternateMenuOrigin; + m_ColorPickerActivator.transform.localPosition += Vector3.right * 0.05f; + } } } @@ -175,6 +187,7 @@ private void CheckBrushSizeUi() { var bsuiObj = instantiateUI(m_BrushSizePrefab); m_BrushSizeUi = bsuiObj.GetComponent(); + var trans = bsuiObj.transform; trans.SetParent(alternateMenuOrigin); trans.localPosition = Vector3.zero; @@ -202,21 +215,11 @@ private void CheckColorPicker() { if (m_ColorPicker == null) CreateColorPicker(otherRayOrigin); - else if (m_ColorPicker.transform.parent != otherRayOrigin) - { - var pickerTransform = m_ColorPicker.transform; - pickerTransform.SetParent(otherRayOrigin); - pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; - pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; - } - - float dot = Vector3.Dot(otherRayOrigin.right, rayOrigin.position - otherRayOrigin.position); - Vector3 localPos = m_ColorPicker.transform.localPosition; - localPos.x = Mathf.Abs(localPos.x) * Mathf.Sign(dot); - m_ColorPicker.transform.localPosition = localPos; if (!m_ColorPicker.enabled) { + PositionColorPicker(otherRayOrigin); + m_ColorPicker.Show(); showDefaultRay(rayOrigin); m_CustomPointerObject.SetActive(false); @@ -239,15 +242,24 @@ private void CreateColorPicker(Transform otherRayOrigin) m_ColorPicker.toolRayOrigin = rayOrigin; m_ColorPicker.onColorPicked = OnColorPickerValueChanged; - var pickerTransform = m_ColorPicker.transform; - pickerTransform.SetParent(otherRayOrigin); - pickerTransform.localPosition = m_ColorPickerPrefab.transform.localPosition; - pickerTransform.localRotation = m_ColorPickerPrefab.transform.localRotation; + PositionColorPicker(otherRayOrigin); showDefaultRay(rayOrigin); m_CustomPointerObject.SetActive(false); } + private void PositionColorPicker(Transform otherRayOrigin) + { + var rayPos = rayOrigin.position; + var otherRayPos = otherRayOrigin.position; + var halfPos = (rayPos + otherRayPos) / 2f; + var targetPosition = halfPos + Vector3.up * 0.1f; + + var pickerTrans = m_ColorPicker.transform; + pickerTrans.position = targetPosition; + pickerTrans.LookAt(VRView.viewerCamera.transform); + } + private void OnColorPickerValueChanged(Color newColor) { m_ColorToUse = newColor; @@ -591,10 +603,10 @@ private void LineToPlane(List newVertices) prevDirection = direction; } } - + private void SmoothPlane(List newVertices) { - const float kSmoothRatio = .75f; + const float kSmoothRatio = 0.75f; for (int side = 0; side < 2; side++) { for (int i = 4; i < newVertices.Count - 4 - side; i++) @@ -625,7 +637,9 @@ private void CalculateUvs(List newUvs, List newVertices) for (int i = 0; i < newVertices.Count; i += 2) { for (int side = 0; side < 2; side++) + { newUvs.Add(new Vector2(side, i / 2)); + } } } diff --git a/Tools/AnnotationTool/AnnotationTool.cs.meta b/Tools/AnnotationTool/AnnotationTool.cs.meta index eef73c906..ac0281dce 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs.meta +++ b/Tools/AnnotationTool/AnnotationTool.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: ecba8b13e3259e14eab642c0d0657d5c -timeCreated: 1479382887 +timeCreated: 1479813204 licenseType: Free MonoImporter: serializedVersion: 2 @@ -13,6 +13,8 @@ MonoImporter: type: 2} - m_BrushSizePrefab: {fileID: 1000012251850158, guid: 76909d1f493d664469c9e0f4726790a3, type: 2} + - m_ColorPickerActivatorPrefab: {fileID: 1000010255295176, guid: a643645e8043ba84a8109a98e55603ff, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Tools/AnnotationTool/Materials/ColorPalette.mat b/Tools/AnnotationTool/Materials/ColorPalette.mat new file mode 100644 index 000000000..8ba259b5f --- /dev/null +++ b/Tools/AnnotationTool/Materials/ColorPalette.mat @@ -0,0 +1,128 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: ColorPalette + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHATEST_ON _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF + m_LightmapFlags: 1 + m_CustomRenderQueue: 2450 + stringTagMap: + RenderType: TransparentCutout + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 2800000, guid: 213a1424a537fb84d8128ab7db0cf05b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 2800000, guid: 213a1424a537fb84d8128ab7db0cf05b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: _BumpScale + second: 1 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 0 + - first: + name: _GlossMapScale + second: 1 + - first: + name: _Glossiness + second: 0 + - first: + name: _GlossyReflections + second: 0 + - first: + name: _Metallic + second: 0 + - first: + name: _Mode + second: 1 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _SmoothnessTextureChannel + second: 0 + - first: + name: _SpecularHighlights + second: 0 + - first: + name: _SrcBlend + second: 1 + - first: + name: _UVSec + second: 0 + - first: + name: _ZWrite + second: 1 + m_Colors: + - first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} + - first: + name: _EmissionColor + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tools/AnnotationTool/Materials/ColorPalette.mat.meta b/Tools/AnnotationTool/Materials/ColorPalette.mat.meta new file mode 100644 index 000000000..424ea9bc5 --- /dev/null +++ b/Tools/AnnotationTool/Materials/ColorPalette.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed6062fbd167bed46b70b3ae75c81624 +timeCreated: 1479812877 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab new file mode 100644 index 000000000..3adce5172 --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab @@ -0,0 +1,288 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000010255295176} + m_IsPrefabParent: 1 +--- !u!1 &1000010255295176 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012841704540} + - 114: {fileID: 114000012106753508} + - 135: {fileID: 135000013639289666} + - 114: {fileID: 114000013627361928} + - 114: {fileID: 114000014269249202} + m_Layer: 5 + m_Name: ColorPickerActivator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010848960288 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010665089078} + - 33: {fileID: 33000012657744172} + - 23: {fileID: 23000013942706604} + m_Layer: 5 + m_Name: Base + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011463743810 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010924652800} + - 33: {fileID: 33000010952925324} + - 23: {fileID: 23000011095290868} + m_Layer: 5 + m_Name: ColorWheel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012208465784 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013117727556} + m_Layer: 5 + m_Name: AlternatePRS + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014121892912 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010343588658} + m_Layer: 5 + m_Name: WheelHolder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010343588658 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014121892912} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0.0008, z: 0} + m_LocalScale: {x: 0.024999999, y: 0.025000013, z: 0.025000013} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} + m_Children: + - {fileID: 4000010924652800} + m_Father: {fileID: 4000012841704540} + m_RootOrder: 2 +--- !u!4 &4000010665089078 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010848960288} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012841704540} + m_RootOrder: 0 +--- !u!4 &4000010924652800 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011463743810} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000010343588658} + m_RootOrder: 0 +--- !u!4 &4000012841704540 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010255295176} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000010665089078} + - {fileID: 4000013117727556} + - {fileID: 4000010343588658} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!4 &4000013117727556 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012208465784} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012841704540} + m_RootOrder: 1 +--- !u!23 &23000011095290868 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011463743810} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: ed6062fbd167bed46b70b3ae75c81624, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!23 &23000013942706604 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010848960288} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 3ba9a60dbce8cf0468d3f47a4761a58c, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!33 &33000010952925324 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011463743810} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33000012657744172 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010848960288} + m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!114 &114000012106753508 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010255295176} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d6f3e100bf7b5f54d9ad1b115494abed, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Icon: {fileID: 4000010924652800} + m_HighlightedPRS: {fileID: 4000013117727556} +--- !u!114 &114000013627361928 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010255295176} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_SelectionFlags: 3 +--- !u!114 &114000014269249202 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010255295176} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39742408926c5694d89876057a60578a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 +--- !u!135 &135000013639289666 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010255295176} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.05 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab.meta b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab.meta new file mode 100644 index 000000000..f520c952c --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a643645e8043ba84a8109a98e55603ff +timeCreated: 1479813013 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab index fc5214209..778d745f8 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab @@ -499,7 +499,7 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014053269536} - m_LocalRotation: {x: 0.64278877, y: 0.00000082701445, z: 0.00000012293458, w: 0.76604354} + m_LocalRotation: {x: 0.6427876, y: 0, z: 0, w: 0.7660445} m_LocalPosition: {x: 0, y: 0, z: -0.03} m_LocalScale: {x: 0.00024999998, y: 0.00025, z: 0.00025} m_LocalEulerAnglesHint: {x: 80, y: 0, z: 0} diff --git a/Tools/AnnotationTool/Textures/ColorWheel.png b/Tools/AnnotationTool/Textures/ColorWheel.png new file mode 100644 index 000000000..51edf22f0 --- /dev/null +++ b/Tools/AnnotationTool/Textures/ColorWheel.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88168ebc4829acffc4dcd8288024cc2a3608e32955d3387f3d2846155a847f08 +size 102050 diff --git a/Tools/AnnotationTool/Textures/ColorWheel.png.meta b/Tools/AnnotationTool/Textures/ColorWheel.png.meta new file mode 100644 index 000000000..d3e98c7a0 --- /dev/null +++ b/Tools/AnnotationTool/Textures/ColorWheel.png.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 213a1424a537fb84d8128ab7db0cf05b +timeCreated: 1479805892 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 16 + mipBias: -1 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs new file mode 100644 index 000000000..8b204ef91 --- /dev/null +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.EventSystems; +using System; +using UnityEngine.VR.Tools; + +public class ColorPickerActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IMenuOrigins, IUsesRayOrigin +{ + public Transform alternateMenuOrigin { private get; set; } + public Transform menuOrigin { private get; set; } + + public Transform rayOrigin { private get; set; } + + public void OnPointerClick(PointerEventData eventData) + { + + } + + public void OnPointerEnter(PointerEventData eventData) + { + + } + + public void OnPointerExit(PointerEventData eventData) + { + + } + +} diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs.meta b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs.meta new file mode 100644 index 000000000..fbce8aa4f --- /dev/null +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 39742408926c5694d89876057a60578a +timeCreated: 1479826008 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index 18416dfac..63e2328e0 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -102,6 +102,8 @@ private IEnumerator FadeCanvas(bool fadeOut) } canvasGroup.alpha = target; + canvasGroup.interactable = !fadeOut; + canvasGroup.blocksRaycasts = !fadeOut; m_FadeCoroutine = null; } From 08268328f3422e68cac6b6f524a798a252da4c92 Mon Sep 17 00:00:00 2001 From: David Keri Date: Thu, 24 Nov 2016 17:03:10 +0100 Subject: [PATCH 017/870] modify color picker appearance requirements --- Scripts/EditorVR.cs | 45 ++++++++ Scripts/Interfaces/ICustomMenuOrigins.cs | 9 ++ Scripts/Interfaces/ICustomMenuOrigins.cs.meta | 12 ++ Tools/AnnotationTool/AnnotationTool.cs | 106 +++++++++++------- Tools/AnnotationTool/Materials/BrushCone.mat | 2 +- .../AnnotationTool/Materials/ColorPalette.mat | 4 +- .../AnnotationTool/Prefabs/BrushSizeUI.prefab | 22 ++-- .../Prefabs/ColorPickerActivator.prefab | 16 +-- .../Prefabs/ColorPickerUI.prefab | 47 ++++++++ .../UserInterface/BrushSizeUI.cs | 2 +- .../UserInterface/ColorPickerActivator.cs | 41 ++++++- .../UserInterface/ColorPickerUI.cs | 12 +- 12 files changed, 242 insertions(+), 76 deletions(-) create mode 100644 Scripts/Interfaces/ICustomMenuOrigins.cs create mode 100644 Scripts/Interfaces/ICustomMenuOrigins.cs.meta diff --git a/Scripts/EditorVR.cs b/Scripts/EditorVR.cs index c53c44f3e..02403e476 100644 --- a/Scripts/EditorVR.cs +++ b/Scripts/EditorVR.cs @@ -1330,6 +1330,13 @@ void ConnectInterfaces(object obj, Transform rayOrigin = null) menuOrigins.alternateMenuOrigin = alternateMenuOrigin; } } + + var customMenuOrigins = obj as ICustomMenuOrigins; + if (customMenuOrigins != null) + { + customMenuOrigins.customMenuOrigin = GetCustomMainMenuOrigin; + customMenuOrigins.customAlternateMenuOrigin = GetCustomAlternateMenuOrigin; + } } // Specific proxy ray setting @@ -1458,6 +1465,44 @@ private void DisconnectInterfaces(object obj) } } + private Transform GetCustomMainMenuOrigin(Transform rayOrigin) + { + Transform mainMenuOrigin = null; + + ForEachRayOrigin((proxy, rayOriginPair, rayOriginDevice, deviceData) => + { + if (mainMenuOrigin) + return; + + if (rayOriginPair.Value == rayOrigin) + { + if (proxy.menuOrigins.ContainsKey(rayOrigin)) + mainMenuOrigin = proxy.menuOrigins[rayOrigin]; + } + }, true); + + return mainMenuOrigin; + } + + private Transform GetCustomAlternateMenuOrigin(Transform rayOrigin) + { + Transform alternateMenuOrigin = null; + + ForEachRayOrigin((proxy, rayOriginPair, rayOriginDevice, deviceData) => + { + if (alternateMenuOrigin) + return; + + if (rayOriginPair.Value == rayOrigin) + { + if (proxy.alternateMenuOrigins.ContainsKey(rayOrigin)) + alternateMenuOrigin = proxy.alternateMenuOrigins[rayOrigin]; + } + }, true); + + return alternateMenuOrigin; + } + private void UpdateAlternateMenuActions() { foreach (var deviceData in m_DeviceData.Values) diff --git a/Scripts/Interfaces/ICustomMenuOrigins.cs b/Scripts/Interfaces/ICustomMenuOrigins.cs new file mode 100644 index 000000000..a160e599f --- /dev/null +++ b/Scripts/Interfaces/ICustomMenuOrigins.cs @@ -0,0 +1,9 @@ +using UnityEngine; +using System; + +public interface ICustomMenuOrigins +{ + Func customMenuOrigin { set; } + + Func customAlternateMenuOrigin { set; } +} diff --git a/Scripts/Interfaces/ICustomMenuOrigins.cs.meta b/Scripts/Interfaces/ICustomMenuOrigins.cs.meta new file mode 100644 index 000000000..02ce3d7cb --- /dev/null +++ b/Scripts/Interfaces/ICustomMenuOrigins.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: af25e59a0b4ab8047ba80affdf334eae +timeCreated: 1479979664 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index a27863f2e..ae48656b8 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -10,7 +10,7 @@ using UnityEngine.VR.Menus; [MainMenuItem("Annotation", "Tools", "Draw in the space")] -public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IMenuOrigins +public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IMenuOrigins, ICustomMenuOrigins { public Transform rayOrigin { private get; set; } @@ -63,6 +63,9 @@ public ActionMap actionMap public Transform menuOrigin { set; private get; } public Transform alternateMenuOrigin { set; private get; } + public Func customMenuOrigin { private get; set; } + public Func customAlternateMenuOrigin { private get; set; } + private Transform m_AnnotationHolder; private bool m_IsRayHidden; @@ -75,7 +78,7 @@ public ActionMap actionMap private GameObject m_ColorPickerActivatorPrefab; private GameObject m_ColorPickerActivator; - private const float kTopMinRadius = 0.001f; + private const float kTopMinRadius = 0.0025f; private const float kTopMaxRadius = 0.05f; private const float kBottomRadius = 0.01f; private const float kTipDistance = 0.05f; @@ -138,17 +141,19 @@ private void HandleRayOrigins() if (rayOrigin != null) { GenerateCustomPointer(); - - if (otherRayOrigins != null) - CheckColorPicker(); - CheckBrushSizeUi(); if (m_ColorPickerActivator == null) { m_ColorPickerActivator = instantiateUI(m_ColorPickerActivatorPrefab); - m_ColorPickerActivator.GetComponentInChildren().alternateMenuOrigin = alternateMenuOrigin; - m_ColorPickerActivator.transform.localPosition += Vector3.right * 0.05f; + var otherAltMenu = customAlternateMenuOrigin(otherRayOrigins[0]); + m_ColorPickerActivator.transform.SetParent(otherAltMenu); + m_ColorPickerActivator.transform.localRotation = Quaternion.identity; + m_ColorPickerActivator.transform.localPosition = Vector3.back * 0.075f + Vector3.right * 0.05f; + + var activator = m_ColorPickerActivator.GetComponent(); + activator.rayOrigin = otherRayOrigins[0]; + activator.showColorPicker = ShowColorPicker; } } } @@ -185,10 +190,10 @@ private void CheckBrushSizeUi() { if (m_BrushSizeUi == null) { - var bsuiObj = instantiateUI(m_BrushSizePrefab); - m_BrushSizeUi = bsuiObj.GetComponent(); + var brushSizeUi = instantiateUI(m_BrushSizePrefab); + m_BrushSizeUi = brushSizeUi.GetComponent(); - var trans = bsuiObj.transform; + var trans = brushSizeUi.transform; trans.SetParent(alternateMenuOrigin); trans.localPosition = Vector3.zero; trans.localRotation = Quaternion.Euler(-90, 0, 0); @@ -211,27 +216,37 @@ private void CheckColorPicker() var otherRayMatrix = otherRayOrigin.worldToLocalMatrix; var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); - if (m_ColorPickerRegion.Contains(rayLocalPos)) - { - if (m_ColorPicker == null) - CreateColorPicker(otherRayOrigin); + if (!m_ColorPickerRegion.Contains(rayLocalPos)) + HideColorPicker(); + } + } + } - if (!m_ColorPicker.enabled) - { - PositionColorPicker(otherRayOrigin); + private void ShowColorPicker(Transform otherRayOrigin) + { + if (m_IsValidStroke) + return; - m_ColorPicker.Show(); - showDefaultRay(rayOrigin); - m_CustomPointerObject.SetActive(false); - } - } - else if (m_ColorPicker && m_ColorPicker.enabled) - { - m_ColorPicker.Hide(); - hideDefaultRay(rayOrigin); - m_CustomPointerObject.SetActive(true); - } - } + if (!m_ColorPicker) + CreateColorPicker(otherRayOrigin); + + if (!m_ColorPicker.enabled) + { + PositionColorPicker(otherRayOrigin); + + m_ColorPicker.Show(); + showDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(false); + } + } + + private void HideColorPicker() + { + if (m_ColorPicker && m_ColorPicker.enabled) + { + m_ColorPicker.Hide(); + hideDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(true); } } @@ -239,6 +254,7 @@ private void CreateColorPicker(Transform otherRayOrigin) { var colorPickerObj = instantiateUI(m_ColorPickerPrefab); m_ColorPicker = colorPickerObj.GetComponent(); + m_ColorPicker.onHideCalled = HideColorPicker; m_ColorPicker.toolRayOrigin = rayOrigin; m_ColorPicker.onColorPicked = OnColorPickerValueChanged; @@ -253,11 +269,13 @@ private void PositionColorPicker(Transform otherRayOrigin) var rayPos = rayOrigin.position; var otherRayPos = otherRayOrigin.position; var halfPos = (rayPos + otherRayPos) / 2f; - var targetPosition = halfPos + Vector3.up * 0.1f; + var upVector = Vector3.up * 0.1f; + var forwardVector = VRView.viewerCamera.transform.forward * 0.025f; + var targetPosition = halfPos + upVector + forwardVector; var pickerTrans = m_ColorPicker.transform; pickerTrans.position = targetPosition; - pickerTrans.LookAt(VRView.viewerCamera.transform); + pickerTrans.rotation = Quaternion.LookRotation(pickerTrans.position - VRView.viewerCamera.transform.position); } private void OnColorPickerValueChanged(Color newColor) @@ -309,8 +327,8 @@ private void GenerateCustomPointer() return; m_CustomPointerMesh = new Mesh(); - m_CustomPointerMesh.vertices = GenerateVertices(); - m_CustomPointerMesh.triangles = GenerateTriangles(); + m_CustomPointerMesh.vertices = GeneratePointerVertices(); + m_CustomPointerMesh.triangles = GeneratePointerTriangles(); m_CustomPointerObject = new GameObject("CustomPointer"); @@ -327,7 +345,7 @@ private void GenerateCustomPointer() pointerTrans.localRotation = Quaternion.identity; } - private Vector3[] GenerateVertices() + private Vector3[] GeneratePointerVertices() { List points = new List(); @@ -351,17 +369,17 @@ private Vector3[] GenerateVertices() return points.ToArray(); } - private int[] GenerateTriangles() + private int[] GeneratePointerTriangles() { List triangles = new List(); - GenerateSideTriangles(triangles); - GenerateCapsTriangles(triangles); + GeneratePointerSideTriangles(triangles); + GeneratePointerCapsTriangles(triangles); return triangles.ToArray(); } - private void GenerateSideTriangles(List triangles) + private void GeneratePointerSideTriangles(List triangles) { for (int i = 1; i < kSides; i++) { @@ -379,7 +397,7 @@ private void GenerateSideTriangles(List triangles) triangles.AddRange(finishTriangles); } - private void GenerateCapsTriangles(List triangles) + private void GeneratePointerCapsTriangles(List triangles) { // Generate the bottom circle cap. for (int i = 1; i < kSides; i++) @@ -502,6 +520,14 @@ private void UpdateAnnotation() Vector3 worldPoint = rayOrigin.position + rayForward * kTipDistance; Vector3 localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); + if (m_Points.Count > 0) + { + var lastPoint = m_Points.Last(); + var velocity = (localPoint - lastPoint) / Time.unscaledDeltaTime; + if (velocity.magnitude < m_CurrentRadius) + return; + } + InterpolatePointsIfNeeded(localPoint, rayForward, rayRight); m_Points.Add(localPoint); diff --git a/Tools/AnnotationTool/Materials/BrushCone.mat b/Tools/AnnotationTool/Materials/BrushCone.mat index 56f522d55..748b4f324 100644 --- a/Tools/AnnotationTool/Materials/BrushCone.mat +++ b/Tools/AnnotationTool/Materials/BrushCone.mat @@ -130,4 +130,4 @@ Material: second: {r: 0.95686275, g: 0.95686275, b: 0.95686275, a: 0.7529412} - first: name: _EmissionColor - second: {r: 1, g: 1, b: 1, a: 1} + second: {r: 1, g: 1, b: 1, a: 0.75} diff --git a/Tools/AnnotationTool/Materials/ColorPalette.mat b/Tools/AnnotationTool/Materials/ColorPalette.mat index 8ba259b5f..6b88a080f 100644 --- a/Tools/AnnotationTool/Materials/ColorPalette.mat +++ b/Tools/AnnotationTool/Materials/ColorPalette.mat @@ -9,7 +9,7 @@ Material: m_Name: ColorPalette m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _ALPHATEST_ON _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF - m_LightmapFlags: 1 + m_LightmapFlags: 0 m_CustomRenderQueue: 2450 stringTagMap: RenderType: TransparentCutout @@ -122,7 +122,7 @@ Material: m_Colors: - first: name: _Color - second: {r: 1, g: 1, b: 1, a: 1} + second: {r: 0, g: 0, b: 0, a: 1} - first: name: _EmissionColor second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab index d3401a074..a7f13677d 100644 --- a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab +++ b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab @@ -592,8 +592,8 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013993980200} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -1.2434494e-14, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: @@ -602,8 +602,8 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -57.89, y: 1} - m_SizeDelta: {x: 382, y: 240} + m_AnchoredPosition: {x: -55.800014, y: 0.9999981} + m_SizeDelta: {x: 377.9, y: 240} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010302154246 RectTransform: @@ -622,8 +622,8 @@ RectTransform: m_RootOrder: 3 m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 250} + m_AnchoredPosition: {x: 2.25, y: 0} + m_SizeDelta: {x: -3.5, y: 250} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010313966380 RectTransform: @@ -675,7 +675,7 @@ RectTransform: m_GameObject: {fileID: 1000011542462532} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.05, y: 0.05, z: 0.05} + m_LocalScale: {x: 0.125, y: 0.125, z: 0.125} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011445143916} @@ -709,8 +709,8 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013490968792} - m_LocalRotation: {x: 0, y: 0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: -1.852897e-22, y: 0.000000014901266, z: -0.70710665, w: 0.7071069} + m_LocalPosition: {x: 0, y: 0, z: -0} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} m_Children: [] @@ -718,8 +718,8 @@ RectTransform: m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 14, y: -1} - m_SizeDelta: {x: 291, y: 420} + m_AnchoredPosition: {x: 43.80002, y: -1.0000011} + m_SizeDelta: {x: 335, y: 484} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012965305110 RectTransform: diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab index 3adce5172..4f8b3cb6f 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab @@ -19,7 +19,6 @@ GameObject: serializedVersion: 4 m_Component: - 4: {fileID: 4000012841704540} - - 114: {fileID: 114000012106753508} - 135: {fileID: 135000013639289666} - 114: {fileID: 114000013627361928} - 114: {fileID: 114000014269249202} @@ -235,20 +234,6 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010848960288} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} ---- !u!114 &114000012106753508 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010255295176} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d6f3e100bf7b5f54d9ad1b115494abed, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RunInEditMode: 0 - m_Icon: {fileID: 4000010924652800} - m_HighlightedPRS: {fileID: 4000013117727556} --- !u!114 &114000013627361928 MonoBehaviour: m_ObjectHideFlags: 1 @@ -274,6 +259,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 + m_Icon: {fileID: 4000010924652800} --- !u!135 &135000013639289666 SphereCollider: m_ObjectHideFlags: 1 diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab index 778d745f8..28f01c2f1 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab @@ -11,6 +11,22 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 1000014053269536} m_IsPrefabParent: 1 +--- !u!1 &1000010276380942 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013914949862} + - 65: {fileID: 65000013187502658} + m_Layer: 5 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000010858889288 GameObject: m_ObjectHideFlags: 1 @@ -148,6 +164,18 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!65 &65000013187502658 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010276380942} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1024, y: 1280, z: 10} + m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114000010107362308 MonoBehaviour: m_ObjectHideFlags: 1 @@ -506,6 +534,7 @@ RectTransform: m_Children: - {fileID: 224000011329703258} - {fileID: 224000011527980190} + - {fileID: 224000013914949862} m_Father: {fileID: 0} m_RootOrder: 0 m_AnchorMin: {x: 0, y: 0} @@ -644,6 +673,24 @@ RectTransform: m_AnchoredPosition: {x: 0, y: -256} m_SizeDelta: {x: 50, y: 50} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013914949862 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010276380942} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000010585279630} + m_RootOrder: 2 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000011919119404 CanvasGroup: m_ObjectHideFlags: 1 diff --git a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs index 9cb72f72e..5da298c40 100644 --- a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs +++ b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs @@ -16,7 +16,7 @@ public class BrushSizeUI : MonoBehaviour private Image m_SliderHandleImage; - private const float kMinSize = 0.25f; + private const float kMinSize = 0.625f; private const float kMaxSize = 12.5f; void Start() diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index 8b204ef91..34a62c684 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -3,27 +3,60 @@ using UnityEngine.EventSystems; using System; using UnityEngine.VR.Tools; +using System.Collections.Generic; -public class ColorPickerActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IMenuOrigins, IUsesRayOrigin +public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler, IUsesRayOrigin { - public Transform alternateMenuOrigin { private get; set; } - public Transform menuOrigin { private get; set; } public Transform rayOrigin { private get; set; } + [SerializeField] + Transform m_Icon; + + Coroutine m_Coroutine; + + public Action showColorPicker { private get; set; } + public void OnPointerClick(PointerEventData eventData) { - + if (showColorPicker != null) + showColorPicker(rayOrigin); } public void OnPointerEnter(PointerEventData eventData) { + if (m_Coroutine != null) + StopCoroutine(m_Coroutine); + + m_Coroutine = StartCoroutine(Highlight()); + if (showColorPicker != null) + showColorPicker(rayOrigin); } public void OnPointerExit(PointerEventData eventData) { + if (m_Coroutine != null) + StopCoroutine(m_Coroutine); + m_Coroutine = StartCoroutine(Highlight(false)); + } + + IEnumerator Highlight(bool transitionIn = true) + { + var amount = 0f; + var currentScale = m_Icon.localScale; + var targetScale = transitionIn == true ? Vector3.one * 1.5f : Vector3.one; + var speed = (currentScale.x + 0.5f / targetScale.x) * 4; + + while (amount < 1f) + { + amount += Time.unscaledDeltaTime * speed; + m_Icon.localScale = Vector3.Lerp(currentScale, targetScale, Mathf.SmoothStep(0f, 1f, amount)); + yield return null; + } + + m_Icon.localScale = targetScale; } } diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index 63e2328e0..cd5947427 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -4,13 +4,15 @@ using System; using UnityEngine.EventSystems; -public class ColorPickerUI : MonoBehaviour +public class ColorPickerUI : MonoBehaviour, IPointerExitHandler { public Transform toolRayOrigin { private get; set; } public Action onColorPicked { private get; set; } + public Action onHideCalled { private get; set; } + [SerializeField] private float m_FadeTime; @@ -101,6 +103,7 @@ private IEnumerator FadeCanvas(bool fadeOut) yield return null; } + GetComponentInChildren().enabled = !fadeOut; canvasGroup.alpha = target; canvasGroup.interactable = !fadeOut; canvasGroup.blocksRaycasts = !fadeOut; @@ -191,5 +194,10 @@ private void PositionToColor() onColorPicked(col); } } - + + public void OnPointerExit(PointerEventData eventData) + { + if (onHideCalled != null) + onHideCalled(); + } } From 7724cd404668c1869e5a89c0921fbafdc433022e Mon Sep 17 00:00:00 2001 From: David Keri Date: Fri, 25 Nov 2016 17:46:10 +0100 Subject: [PATCH 018/870] hide color picker when radial menu is active --- Tools/AnnotationTool/AnnotationTool.cs | 38 +++------- .../UserInterface/ColorPickerActivator.cs | 74 ++++++++++++++++--- 2 files changed, 75 insertions(+), 37 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index ae48656b8..190f1c6e8 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -9,7 +9,7 @@ using UnityEditor.VR; using UnityEngine.VR.Menus; -[MainMenuItem("Annotation", "Tools", "Draw in the space")] +[MainMenuItem("Annotation", "Tools", "Draw in 3D")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IMenuOrigins, ICustomMenuOrigins { @@ -19,6 +19,12 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr public DefaultRayVisibilityDelegate showDefaultRay { get; set; } public DefaultRayVisibilityDelegate hideDefaultRay { get; set; } + public Transform menuOrigin { set; private get; } + public Transform alternateMenuOrigin { set; private get; } + + public Func customMenuOrigin { private get; set; } + public Func customAlternateMenuOrigin { private get; set; } + public ActionMap actionMap { get { return m_ActionMap; } @@ -31,6 +37,8 @@ public ActionMap actionMap public Func instantiateUI { private get; set; } + private Action onBrushSizeChanged { set; get; } + private const int kInitialListSize = 32767; private List m_Points = new List(kInitialListSize); @@ -58,14 +66,6 @@ public ActionMap actionMap private GameObject m_BrushSizePrefab; private BrushSizeUI m_BrushSizeUi; - private Action onBrushSizeChanged { set; get; } - - public Transform menuOrigin { set; private get; } - public Transform alternateMenuOrigin { set; private get; } - - public Func customMenuOrigin { private get; set; } - public Func customAlternateMenuOrigin { private get; set; } - private Transform m_AnnotationHolder; private bool m_IsRayHidden; @@ -84,8 +84,6 @@ public ActionMap actionMap private const float kTipDistance = 0.05f; private const int kSides = 16; - private readonly Bounds m_ColorPickerRegion = new Bounds(Vector3.zero, Vector3.one * 0.35f); - private float m_CurrentRadius = kTopMinRadius; private List m_UndoList = new List(); @@ -99,6 +97,9 @@ void OnDestroy() U.Object.Destroy(m_ColorPicker.gameObject); if (m_BrushSizeUi) U.Object.Destroy(m_BrushSizeUi.gameObject); + if (m_ColorPickerActivator) + U.Object.Destroy(m_ColorPickerActivator); + if (m_CustomPointerObject) DestroyImmediate(m_CustomPointerObject); } @@ -207,21 +208,6 @@ private void CheckBrushSizeUi() } } - private void CheckColorPicker() - { - if (!m_IsValidStroke) - { - foreach (var otherRayOrigin in otherRayOrigins) - { - var otherRayMatrix = otherRayOrigin.worldToLocalMatrix; - var rayLocalPos = otherRayMatrix.MultiplyPoint3x4(rayOrigin.position); - - if (!m_ColorPickerRegion.Contains(rayLocalPos)) - HideColorPicker(); - } - } - } - private void ShowColorPicker(Transform otherRayOrigin) { if (m_IsValidStroke) diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index 34a62c684..1f5c99fdb 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -4,6 +4,7 @@ using System; using UnityEngine.VR.Tools; using System.Collections.Generic; +using UnityEngine.VR.Menus; public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler, IUsesRayOrigin { @@ -11,12 +12,45 @@ public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointe public Transform rayOrigin { private get; set; } [SerializeField] - Transform m_Icon; + private Transform m_Icon; + + private Coroutine m_HighlightCoroutine; + private Coroutine m_MoveCoroutine; - Coroutine m_Coroutine; - public Action showColorPicker { private get; set; } - + + private RadialMenuUI m_RadialMenu; + private Vector3 m_OriginalPosition; + + private bool m_ActivatorMoveAway; + private bool activatorMoveAway + { + set + { + if (m_ActivatorMoveAway != value) + { + m_ActivatorMoveAway = value; + + if (m_MoveCoroutine != null) + StopCoroutine(m_MoveCoroutine); + + m_MoveCoroutine = StartCoroutine(MoveAway(value)); + } + } + } + + void Start() + { + m_OriginalPosition = transform.localPosition; + m_RadialMenu = transform.parent.GetComponentInChildren(true); + } + + void Update() + { + if (m_RadialMenu) + activatorMoveAway = m_RadialMenu.visible; + } + public void OnPointerClick(PointerEventData eventData) { if (showColorPicker != null) @@ -25,10 +59,10 @@ public void OnPointerClick(PointerEventData eventData) public void OnPointerEnter(PointerEventData eventData) { - if (m_Coroutine != null) - StopCoroutine(m_Coroutine); + if (m_HighlightCoroutine != null) + StopCoroutine(m_HighlightCoroutine); - m_Coroutine = StartCoroutine(Highlight()); + m_HighlightCoroutine = StartCoroutine(Highlight()); if (showColorPicker != null) showColorPicker(rayOrigin); @@ -36,17 +70,17 @@ public void OnPointerEnter(PointerEventData eventData) public void OnPointerExit(PointerEventData eventData) { - if (m_Coroutine != null) - StopCoroutine(m_Coroutine); + if (m_HighlightCoroutine != null) + StopCoroutine(m_HighlightCoroutine); - m_Coroutine = StartCoroutine(Highlight(false)); + m_HighlightCoroutine = StartCoroutine(Highlight(false)); } IEnumerator Highlight(bool transitionIn = true) { var amount = 0f; var currentScale = m_Icon.localScale; - var targetScale = transitionIn == true ? Vector3.one * 1.5f : Vector3.one; + var targetScale = transitionIn ? Vector3.one * 1.5f : Vector3.one; var speed = (currentScale.x + 0.5f / targetScale.x) * 4; while (amount < 1f) @@ -59,4 +93,22 @@ IEnumerator Highlight(bool transitionIn = true) m_Icon.localScale = targetScale; } + IEnumerator MoveAway(bool moveDown) + { + var amount = 0f; + var currentPosition = transform.localPosition; + var targetPosition = moveDown ? m_OriginalPosition + Vector3.back * 0.055f : m_OriginalPosition; + var speed = (currentPosition.z / targetPosition.z) * (moveDown ? 10 : 3); + + while (amount < 1f) + { + amount += Time.unscaledDeltaTime * speed; + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, Mathf.SmoothStep(0f, 1f, amount)); + yield return null; + } + + transform.localPosition = targetPosition; + m_MoveCoroutine = null; + } + } From ee71e9b099e36ee8e6d367df0071bafaa1f742a2 Mon Sep 17 00:00:00 2001 From: David Keri Date: Mon, 28 Nov 2016 17:44:13 +0100 Subject: [PATCH 019/870] fix errors caused by merge --- Tools/AnnotationTool/AnnotationTool.cs | 71 +++++++++++-------- .../Prefabs/ColorPickerActivator.prefab | 2 +- .../UserInterface/ColorPickerActivator.cs | 71 +++---------------- 3 files changed, 52 insertions(+), 92 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 190f1c6e8..ded9a568e 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -1,16 +1,15 @@ -using UnityEngine; -using System.Collections; -using UnityEngine.VR.Tools; using System; -using UnityEngine.InputNew; -using System.Linq; using System.Collections.Generic; -using UnityEngine.VR.Utilities; +using System.Linq; using UnityEditor.VR; +using UnityEngine; +using UnityEngine.InputNew; using UnityEngine.VR.Menus; +using UnityEngine.VR.Tools; +using UnityEngine.VR.Utilities; [MainMenuItem("Annotation", "Tools", "Draw in 3D")] -public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IMenuOrigins, ICustomMenuOrigins +public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IMenuOrigins, ICustomMenuOrigins, IRayLocking { public Transform rayOrigin { private get; set; } @@ -32,13 +31,13 @@ public ActionMap actionMap [SerializeField] private ActionMap m_ActionMap; - public ActionMapInput actionMapInput { get { return m_AnnotationInput; } set { m_AnnotationInput = (AnnotationInput)value; } } - private AnnotationInput m_AnnotationInput; - public Func instantiateUI { private get; set; } - private Action onBrushSizeChanged { set; get; } + public Func lockRay { private get; set; } + public Func unlockRay { private get; set; } + private Action onBrushSizeChanged { set; get; } + private const int kInitialListSize = 32767; private List m_Points = new List(kInitialListSize); @@ -108,21 +107,6 @@ void Update() { HideRay(); HandleRayOrigins(); - - if (m_AnnotationInput.draw.wasJustPressed) - SetupAnnotation(); - else if (m_IsValidStroke) - { - if (m_AnnotationInput.draw.isHeld) - UpdateAnnotation(); - else if (m_AnnotationInput.draw.wasJustReleased) - FinalizeMesh(); - } - else if (m_AnnotationInput.undo.wasJustPressed) - UndoLast(); - - if (m_AnnotationInput.changeBrushSize.value != 0) - HandleBrushSize(); } private void HideRay() @@ -132,6 +116,7 @@ private void HideRay() if (hideDefaultRay != null) { hideDefaultRay(rayOrigin); + lockRay(rayOrigin, this); m_IsRayHidden = true; } } @@ -148,12 +133,13 @@ private void HandleRayOrigins() { m_ColorPickerActivator = instantiateUI(m_ColorPickerActivatorPrefab); var otherAltMenu = customAlternateMenuOrigin(otherRayOrigins[0]); - m_ColorPickerActivator.transform.SetParent(otherAltMenu); + + m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); m_ColorPickerActivator.transform.localRotation = Quaternion.identity; - m_ColorPickerActivator.transform.localPosition = Vector3.back * 0.075f + Vector3.right * 0.05f; + m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; var activator = m_ColorPickerActivator.GetComponent(); - activator.rayOrigin = otherRayOrigins[0]; + activator.rayOrigin = otherRayOrigins.First(); activator.showColorPicker = ShowColorPicker; } } @@ -221,6 +207,7 @@ private void ShowColorPicker(Transform otherRayOrigin) PositionColorPicker(otherRayOrigin); m_ColorPicker.Show(); + unlockRay(rayOrigin, this); showDefaultRay(rayOrigin); m_CustomPointerObject.SetActive(false); } @@ -232,6 +219,7 @@ private void HideColorPicker() { m_ColorPicker.Hide(); hideDefaultRay(rayOrigin); + lockRay(rayOrigin, this); m_CustomPointerObject.SetActive(true); } } @@ -246,6 +234,7 @@ private void CreateColorPicker(Transform otherRayOrigin) PositionColorPicker(otherRayOrigin); + unlockRay(rayOrigin, this); showDefaultRay(rayOrigin); m_CustomPointerObject.SetActive(false); } @@ -274,11 +263,11 @@ private void OnColorPickerValueChanged(Color newColor) m_BrushSizeUi.OnBrushColorChanged(newColor); } - private void HandleBrushSize() + private void HandleBrushSize(float value) { if (m_CustomPointerMesh != null) { - var sign = Mathf.Sign(m_AnnotationInput.changeBrushSize.value); + var sign = Mathf.Sign(value); m_CurrentRadius += sign * Time.unscaledDeltaTime * .1f; m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); @@ -693,5 +682,25 @@ private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, in return triangles; } + + public void ProcessInput(ActionMapInput input, Action consumeControl) + { + var annotationInput = input as AnnotationInput; + + if (annotationInput.draw.wasJustPressed) + SetupAnnotation(); + else if (m_IsValidStroke) + { + if (annotationInput.draw.isHeld) + UpdateAnnotation(); + else if (annotationInput.draw.wasJustReleased) + FinalizeMesh(); + } + else if (annotationInput.undo.wasJustPressed) + UndoLast(); + + if (annotationInput.changeBrushSize.value != 0) + HandleBrushSize(annotationInput.changeBrushSize.value); + } } diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab index 4f8b3cb6f..3a4d0bb33 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab @@ -270,5 +270,5 @@ SphereCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Radius: 0.05 + m_Radius: 0.015 m_Center: {x: 0, y: 0, z: 0} diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index 1f5c99fdb..9ebb19226 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -1,60 +1,26 @@ -using UnityEngine; +using System; using System.Collections; +using UnityEngine; using UnityEngine.EventSystems; -using System; -using UnityEngine.VR.Tools; -using System.Collections.Generic; -using UnityEngine.VR.Menus; -public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler, IUsesRayOrigin +public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler { public Transform rayOrigin { private get; set; } + public Action showColorPicker { private get; set; } [SerializeField] private Transform m_Icon; private Coroutine m_HighlightCoroutine; - private Coroutine m_MoveCoroutine; - - public Action showColorPicker { private get; set; } - - private RadialMenuUI m_RadialMenu; - private Vector3 m_OriginalPosition; - - private bool m_ActivatorMoveAway; - private bool activatorMoveAway - { - set - { - if (m_ActivatorMoveAway != value) - { - m_ActivatorMoveAway = value; - - if (m_MoveCoroutine != null) - StopCoroutine(m_MoveCoroutine); - - m_MoveCoroutine = StartCoroutine(MoveAway(value)); - } - } - } - - void Start() - { - m_OriginalPosition = transform.localPosition; - m_RadialMenu = transform.parent.GetComponentInChildren(true); - } - - void Update() - { - if (m_RadialMenu) - activatorMoveAway = m_RadialMenu.visible; - } - + public void OnPointerClick(PointerEventData eventData) { if (showColorPicker != null) + { showColorPicker(rayOrigin); + eventData.Use(); + } } public void OnPointerEnter(PointerEventData eventData) @@ -65,7 +31,10 @@ public void OnPointerEnter(PointerEventData eventData) m_HighlightCoroutine = StartCoroutine(Highlight()); if (showColorPicker != null) + { showColorPicker(rayOrigin); + eventData.Use(); + } } public void OnPointerExit(PointerEventData eventData) @@ -93,22 +62,4 @@ IEnumerator Highlight(bool transitionIn = true) m_Icon.localScale = targetScale; } - IEnumerator MoveAway(bool moveDown) - { - var amount = 0f; - var currentPosition = transform.localPosition; - var targetPosition = moveDown ? m_OriginalPosition + Vector3.back * 0.055f : m_OriginalPosition; - var speed = (currentPosition.z / targetPosition.z) * (moveDown ? 10 : 3); - - while (amount < 1f) - { - amount += Time.unscaledDeltaTime * speed; - transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, Mathf.SmoothStep(0f, 1f, amount)); - yield return null; - } - - transform.localPosition = targetPosition; - m_MoveCoroutine = null; - } - } From 8222443c8345d3d34df603289308cf07486220e7 Mon Sep 17 00:00:00 2001 From: David Keri Date: Wed, 30 Nov 2016 12:43:57 +0100 Subject: [PATCH 020/870] change annotation shader queue fix input bugs --- Tools/AnnotationTool/AnnotationTool.cs | 36 +++++++++++++++++-- .../Materials/AnnotationShader.shader | 2 +- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index ded9a568e..6b9382c99 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -4,6 +4,7 @@ using UnityEditor.VR; using UnityEngine; using UnityEngine.InputNew; +using UnityEngine.VR; using UnityEngine.VR.Menus; using UnityEngine.VR.Tools; using UnityEngine.VR.Utilities; @@ -90,7 +91,10 @@ public ActionMap actionMap void OnDestroy() { if (m_IsRayHidden && showDefaultRay != null) + { + unlockRay(rayOrigin, this); showDefaultRay(rayOrigin); + } if (m_ColorPicker) U.Object.Destroy(m_ColorPicker.gameObject); @@ -267,9 +271,15 @@ private void HandleBrushSize(float value) { if (m_CustomPointerMesh != null) { - var sign = Mathf.Sign(value); - m_CurrentRadius += sign * Time.unscaledDeltaTime * .1f; - m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); + // For vive controllers, use 1:1 touchpad setting. + if (VRSettings.loadedDeviceName == "OpenVR") + m_CurrentRadius = Mathf.Lerp(kTopMinRadius, kTopMaxRadius, (value + 1) / 2f); + // For touch and hydra, let the thumbstick gradually modifiy the width. + else + { + m_CurrentRadius += value * Time.unscaledDeltaTime * .1f; + m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); + } if (m_BrushSizeUi && onBrushSizeChanged != null) { @@ -648,6 +658,8 @@ private void FinalizeMesh() { m_IsValidStroke = false; + CenterMesh(); + m_CurrentMesh.RecalculateBounds(); m_CurrentMesh.RecalculateNormals(); m_CurrentMesh.Optimize(); @@ -655,6 +667,24 @@ private void FinalizeMesh() m_CurrentMesh.UploadMeshData(true); } + private void CenterMesh() + { + Vector3 center = Vector3.zero; + + var vertices = m_CurrentMesh.vertices; + + for (int i = 0; i < m_CurrentMesh.vertexCount; i++) + center += vertices[i]; + + center /= m_CurrentMesh.vertexCount; + + for (int i = 0; i < m_CurrentMesh.vertexCount; i++) + vertices[i] -= center; + + m_CurrentMesh.vertices = vertices; + m_CurrentMeshFilter.transform.localPosition += center; + } + private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) { int triangleCount = doubleSided ? 12 : 6; diff --git a/Tools/AnnotationTool/Materials/AnnotationShader.shader b/Tools/AnnotationTool/Materials/AnnotationShader.shader index b492cbf82..d66cbe36d 100644 --- a/Tools/AnnotationTool/Materials/AnnotationShader.shader +++ b/Tools/AnnotationTool/Materials/AnnotationShader.shader @@ -13,7 +13,7 @@ Shader "EditorVR/Annotation/Line" Tags { "IgnoreProjector"="True" - "Queue"="Transparent" + "Queue"="AlphaTest" "RenderType"="Transparent" } From 7d6f2b654b02dbab9c612680f28b94a7f464ae3b Mon Sep 17 00:00:00 2001 From: David Keri Date: Thu, 1 Dec 2016 16:37:50 +0100 Subject: [PATCH 021/870] change color picker appearance and functionality --- Tools/AnnotationTool/AnnotationTool.cs | 64 +- .../Input/AnnotationInput.asset | 2 - .../Prefabs/ColorPickerActivator.prefab | 770 +++++++++++++++++- .../Prefabs/ColorPickerUI.prefab | 4 +- .../Textures/ColorWheel.png.meta | 4 +- .../UserInterface/ColorPickerActivator.cs | 22 +- .../UserInterface/ColorPickerUI.cs | 59 +- 7 files changed, 827 insertions(+), 98 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 6b9382c99..05e2cb4eb 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -34,11 +34,12 @@ public ActionMap actionMap public Func instantiateUI { private get; set; } + private Action onBrushSizeChanged { set; get; } + public Func lockRay { private get; set; } public Func unlockRay { private get; set; } - private Action onBrushSizeChanged { set; get; } - + private const int kInitialListSize = 32767; private List m_Points = new List(kInitialListSize); @@ -115,14 +116,11 @@ void Update() private void HideRay() { - if (!m_IsRayHidden) + if (hideDefaultRay != null && !m_IsRayHidden) { - if (hideDefaultRay != null) - { - hideDefaultRay(rayOrigin); - lockRay(rayOrigin, this); - m_IsRayHidden = true; - } + hideDefaultRay(rayOrigin); + lockRay(rayOrigin, this); + m_IsRayHidden = true; } } @@ -143,8 +141,15 @@ private void HandleRayOrigins() m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; var activator = m_ColorPickerActivator.GetComponent(); + + m_ColorPicker = activator.GetComponentInChildren(true); + m_ColorPicker.onHideCalled = HideColorPicker; + m_ColorPicker.toolRayOrigin = rayOrigin; + m_ColorPicker.onColorPicked = OnColorPickerValueChanged; + activator.rayOrigin = otherRayOrigins.First(); activator.showColorPicker = ShowColorPicker; + activator.hideColorPicker = HideColorPicker; } } } @@ -203,18 +208,12 @@ private void ShowColorPicker(Transform otherRayOrigin) if (m_IsValidStroke) return; - if (!m_ColorPicker) - CreateColorPicker(otherRayOrigin); - if (!m_ColorPicker.enabled) - { - PositionColorPicker(otherRayOrigin); - m_ColorPicker.Show(); - unlockRay(rayOrigin, this); - showDefaultRay(rayOrigin); - m_CustomPointerObject.SetActive(false); - } + + unlockRay(rayOrigin, this); + showDefaultRay(rayOrigin); + m_CustomPointerObject.SetActive(false); } private void HideColorPicker() @@ -665,10 +664,15 @@ private void FinalizeMesh() m_CurrentMesh.Optimize(); m_CurrentMesh.UploadMeshData(true); + + CenterHolder(); } private void CenterMesh() { + if (m_CurrentMesh == null || m_CurrentMesh.vertexCount == 0) + return; + Vector3 center = Vector3.zero; var vertices = m_CurrentMesh.vertices; @@ -685,6 +689,28 @@ private void CenterMesh() m_CurrentMeshFilter.transform.localPosition += center; } + private void CenterHolder() + { + if (m_AnnotationHolder == null || m_AnnotationHolder.childCount == 0) + return; + + List childWorldPositions = new List(); + Vector3 center = Vector3.zero; + + for (int i = 0; i < m_AnnotationHolder.childCount; i++) + { + var worldPos = m_AnnotationHolder.GetChild(i).position; + childWorldPositions.Add(worldPos); + center += worldPos; + } + + center /= m_AnnotationHolder.childCount; + + m_AnnotationHolder.localPosition += center; + for (int i = 0; i < m_AnnotationHolder.childCount; i++) + m_AnnotationHolder.GetChild(i).position = childWorldPositions[i]; + } + private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) { int triangleCount = doubleSided ? 12 : 6; diff --git a/Tools/AnnotationTool/Input/AnnotationInput.asset b/Tools/AnnotationTool/Input/AnnotationInput.asset index c083c0664..e6025df19 100644 --- a/Tools/AnnotationTool/Input/AnnotationInput.asset +++ b/Tools/AnnotationTool/Input/AnnotationInput.asset @@ -36,8 +36,6 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 1 - deviceKey: 1 - controlIndex: 0 deviceKey: 1 deadZone: 0.3 diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab index 3a4d0bb33..2e4f320f6 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab @@ -11,6 +11,25 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 1000010255295176} m_IsPrefabParent: 1 +--- !u!1 &1000010117119988 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011933393472} + - 223: {fileID: 223000010278076522} + - 114: {fileID: 114000013959281966} + - 114: {fileID: 114000011474110792} + - 114: {fileID: 114000010240686482} + m_Layer: 5 + m_Name: ColorPickerUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000010255295176 GameObject: m_ObjectHideFlags: 0 @@ -19,7 +38,6 @@ GameObject: serializedVersion: 4 m_Component: - 4: {fileID: 4000012841704540} - - 135: {fileID: 135000013639289666} - 114: {fileID: 114000013627361928} - 114: {fileID: 114000014269249202} m_Layer: 5 @@ -29,9 +47,27 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000010613848074 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013792078156} + - 222: {fileID: 222000013607042274} + - 114: {fileID: 114000010862220058} + - 114: {fileID: 114000012642262872} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000010848960288 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 @@ -39,6 +75,7 @@ GameObject: - 4: {fileID: 4000010665089078} - 33: {fileID: 33000012657744172} - 23: {fileID: 23000013942706604} + - 64: {fileID: 64000011116907714} m_Layer: 5 m_Name: Base m_TagString: Untagged @@ -46,6 +83,39 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000010898514098 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013901019326} + - 65: {fileID: 65000012153002324} + m_Layer: 5 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010981163860 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011891419810} + - 114: {fileID: 114000012907839542} + - 225: {fileID: 225000012229749264} + m_Layer: 5 + m_Name: BrightnessSlider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000011463743810 GameObject: m_ObjectHideFlags: 1 @@ -62,6 +132,38 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000011582997490 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011129790424} + - 222: {fileID: 222000010186370168} + - 114: {fileID: 114000013248295880} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012033952848 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013465431762} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!1 &1000012208465784 GameObject: @@ -72,19 +174,85 @@ GameObject: m_Component: - 4: {fileID: 4000013117727556} m_Layer: 5 - m_Name: AlternatePRS + m_Name: TargetScale m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000014121892912 +--- !u!1 &1000012763078460 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012639415320} + - 222: {fileID: 222000013457728422} + - 114: {fileID: 114000010927911954} + m_Layer: 5 + m_Name: ColorPicker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013722987470 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 m_Component: + - 4: {fileID: 4000012336507532} + m_Layer: 5 + m_Name: GrowHolder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013793807480 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013288384236} + - 222: {fileID: 222000011629875738} + - 114: {fileID: 114000012792763378} + m_Layer: 5 + m_Name: Picker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000014088439944 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012070844378} + - 222: {fileID: 222000013866580918} + - 114: {fileID: 114000011559721380} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014121892912 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: - 4: {fileID: 4000010343588658} m_Layer: 5 m_Name: WheelHolder @@ -100,13 +268,14 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014121892912} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0.0008, z: 0} - m_LocalScale: {x: 0.024999999, y: 0.025000013, z: 0.025000013} + m_LocalPosition: {x: 0.015, y: 0.0008, z: 0} + m_LocalScale: {x: 0.029, y: 0.029, z: 0.029} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: - {fileID: 4000010924652800} - m_Father: {fileID: 4000012841704540} - m_RootOrder: 2 + - {fileID: 224000011933393472} + m_Father: {fileID: 4000012336507532} + m_RootOrder: 1 --- !u!4 &4000010665089078 Transform: m_ObjectHideFlags: 1 @@ -114,11 +283,11 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010848960288} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_LocalPosition: {x: 0.015, y: 0.0004, z: 0} + m_LocalScale: {x: 0.5, y: 0.25, z: 0.5} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 4000012841704540} + m_Father: {fileID: 4000012336507532} m_RootOrder: 0 --- !u!4 &4000010924652800 Transform: @@ -133,6 +302,21 @@ Transform: m_Children: [] m_Father: {fileID: 4000010343588658} m_RootOrder: 0 +--- !u!4 &4000012336507532 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013722987470} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.015, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000010665089078} + - {fileID: 4000010343588658} + m_Father: {fileID: 4000012841704540} + m_RootOrder: 1 --- !u!4 &4000012841704540 Transform: m_ObjectHideFlags: 1 @@ -144,9 +328,8 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 4000010665089078} - {fileID: 4000013117727556} - - {fileID: 4000010343588658} + - {fileID: 4000012336507532} m_Father: {fileID: 0} m_RootOrder: 0 --- !u!4 &4000013117727556 @@ -157,11 +340,11 @@ Transform: m_GameObject: {fileID: 1000012208465784} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0} - m_LocalScale: {x: 1.5, y: 1.5, z: 1.5} + m_LocalScale: {x: 4, y: 1, z: 4} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012841704540} - m_RootOrder: 1 + m_RootOrder: 0 --- !u!23 &23000011095290868 MeshRenderer: m_ObjectHideFlags: 1 @@ -204,7 +387,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 3ba9a60dbce8cf0468d3f47a4761a58c, type: 2} + - {fileID: 2100000, guid: f250eb9aab0312446bf01122291cf55e, type: 2} m_SubsetIndices: m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} @@ -234,6 +417,304 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010848960288} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!64 &64000011116907714 +MeshCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010848960288} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Convex: 0 + m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!65 &65000012153002324 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010898514098} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 675.84, y: 844.8, z: 10} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &114000010240686482 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ab372430e8c50ee47b774cdb4ac79e18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_FadeTime: 0.25 + m_ColorPicker: {fileID: 114000010862220058} + m_BrightnessSlider: {fileID: 114000012907839542} + m_SliderBackground: {fileID: 114000013248295880} + m_Picker: {fileID: 224000013288384236} + m_ColorPickerSquare: {fileID: 114000012642262872} +--- !u!114 &114000010862220058 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010613848074} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 2800000, guid: 213a1424a537fb84d8128ab7db0cf05b, type: 3} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &114000010927911954 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012763078460} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Content: {fileID: 224000013288384236} + m_Horizontal: 1 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 0 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 224000013792078156} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 0 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000011474110792 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_IgnoreReversedGraphics: 0 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114000011559721380 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014088439944} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 0 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012642262872 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010613848074} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d26287cff9f94b448a1b36ffa9eccd4e, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000010862220058} +--- !u!114 &114000012792763378 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013793807480} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 054f8016e5e85e745a11230d51f0ca2b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012907839542 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010981163860} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000011559721380} + m_FillRect: {fileID: 0} + m_HandleRect: {fileID: 224000012070844378} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 1 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010240686482} + m_MethodName: OnSliderChanged + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000013248295880 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011582997490} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 --- !u!114 &114000013627361928 MonoBehaviour: m_ObjectHideFlags: 1 @@ -247,6 +728,28 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_SelectionFlags: 3 +--- !u!114 &114000013959281966 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 --- !u!114 &114000014269249202 MonoBehaviour: m_ObjectHideFlags: 1 @@ -259,16 +762,235 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Icon: {fileID: 4000010924652800} ---- !u!135 &135000013639289666 -SphereCollider: + m_TargetScale: {fileID: 4000013117727556} + m_Icon: {fileID: 4000012336507532} +--- !u!222 &222000010186370168 +CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010255295176} - m_Material: {fileID: 0} - m_IsTrigger: 0 + m_GameObject: {fileID: 1000011582997490} +--- !u!222 &222000011629875738 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013793807480} +--- !u!222 &222000013457728422 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012763078460} +--- !u!222 &222000013607042274 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010613848074} +--- !u!222 &222000013866580918 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014088439944} +--- !u!223 &223000010278076522 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} m_Enabled: 1 serializedVersion: 2 - m_Radius: 0.015 - m_Center: {x: 0, y: 0, z: 0} + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &224000011129790424 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011582997490} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011891419810} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011891419810 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010981163860} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000011129790424} + - {fileID: 224000013465431762} + m_Father: {fileID: 224000011933393472} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 128} + m_Pivot: {x: 0.5, y: 0} +--- !u!224 &224000011933393472 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.001} + m_LocalScale: {x: 0.00195, y: 0.00195, z: 0.00195} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000012639415320} + - {fileID: 224000011891419810} + - {fileID: 224000013901019326} + m_Father: {fileID: 4000010343588658} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: -0.125} + m_SizeDelta: {x: 512, y: 640} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012070844378 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014088439944} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000013465431762} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 4.1, y: 0} + m_SizeDelta: {x: 28.3, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012639415320 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012763078460} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000013792078156} + m_Father: {fileID: 224000011933393472} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 512} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &224000013288384236 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013793807480} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000013792078156} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -256} + m_SizeDelta: {x: 50, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013465431762 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012033952848} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000012070844378} + m_Father: {fileID: 224000011891419810} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -48} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013792078156 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010613848074} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000013288384236} + m_Father: {fileID: 224000012639415320} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013901019326 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010898514098} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011933393472} + m_RootOrder: 2 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &225000012229749264 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010981163860} + m_Enabled: 1 + m_Alpha: 0 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab index 28f01c2f1..c42be5980 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab @@ -530,7 +530,7 @@ RectTransform: m_LocalRotation: {x: 0.6427876, y: 0, z: 0, w: 0.7660445} m_LocalPosition: {x: 0, y: 0, z: -0.03} m_LocalScale: {x: 0.00024999998, y: 0.00025, z: 0.00025} - m_LocalEulerAnglesHint: {x: 80, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000011329703258} - {fileID: 224000011527980190} @@ -697,7 +697,7 @@ CanvasGroup: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014053269536} - m_Enabled: 1 + m_Enabled: 0 m_Alpha: 1 m_Interactable: 1 m_BlocksRaycasts: 1 diff --git a/Tools/AnnotationTool/Textures/ColorWheel.png.meta b/Tools/AnnotationTool/Textures/ColorWheel.png.meta index d3e98c7a0..ca0caa611 100644 --- a/Tools/AnnotationTool/Textures/ColorWheel.png.meta +++ b/Tools/AnnotationTool/Textures/ColorWheel.png.meta @@ -19,7 +19,7 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - isReadable: 0 + isReadable: 1 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 @@ -47,7 +47,7 @@ TextureImporter: spritePixelsToUnits: 100 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 0 + textureType: 5 buildTargetSettings: [] spriteSheet: serializedVersion: 2 diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index 9ebb19226..719a3cc62 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -6,8 +6,12 @@ public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler { + [SerializeField] + private Transform m_TargetScale; + public Transform rayOrigin { private get; set; } public Action showColorPicker { private get; set; } + public Action hideColorPicker { private get; set; } [SerializeField] private Transform m_Icon; @@ -16,11 +20,7 @@ public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointe public void OnPointerClick(PointerEventData eventData) { - if (showColorPicker != null) - { - showColorPicker(rayOrigin); - eventData.Use(); - } + eventData.Use(); } public void OnPointerEnter(PointerEventData eventData) @@ -28,13 +28,10 @@ public void OnPointerEnter(PointerEventData eventData) if (m_HighlightCoroutine != null) StopCoroutine(m_HighlightCoroutine); + showColorPicker(rayOrigin); m_HighlightCoroutine = StartCoroutine(Highlight()); - - if (showColorPicker != null) - { - showColorPicker(rayOrigin); - eventData.Use(); - } + + eventData.Use(); } public void OnPointerExit(PointerEventData eventData) @@ -42,6 +39,7 @@ public void OnPointerExit(PointerEventData eventData) if (m_HighlightCoroutine != null) StopCoroutine(m_HighlightCoroutine); + hideColorPicker(); m_HighlightCoroutine = StartCoroutine(Highlight(false)); } @@ -49,7 +47,7 @@ IEnumerator Highlight(bool transitionIn = true) { var amount = 0f; var currentScale = m_Icon.localScale; - var targetScale = transitionIn ? Vector3.one * 1.5f : Vector3.one; + var targetScale = transitionIn ? m_TargetScale.localScale : Vector3.one; var speed = (currentScale.x + 0.5f / targetScale.x) * 4; while (amount < 1f) diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index cd5947427..b1cd1f9be 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -42,14 +42,13 @@ void Start() { m_ColorPickerSquare.onDrag = OnDrag; - GenerateColorPicker(); + m_ColorPickerTexture = m_ColorPickerSquare.GetComponent().texture as Texture2D; GenerateBrightnessBar(); } void OnDestroy() { DestroyImmediate(m_BrightnessBarTexture); - DestroyImmediate(m_ColorPickerTexture); } void Update() @@ -84,7 +83,7 @@ private IEnumerator FadeCanvas(bool fadeOut) enabled = !fadeOut; m_Picker.localPosition = m_PickerTargetPosition; - var canvasGroup = GetComponent(); + var canvasGroup = GetComponentInChildren(); float current = canvasGroup.alpha; float start = fadeOut ? 1 : 0; float target = 1 - start; @@ -104,6 +103,7 @@ private IEnumerator FadeCanvas(bool fadeOut) } GetComponentInChildren().enabled = !fadeOut; + m_Picker.gameObject.SetActive(!fadeOut); canvasGroup.alpha = target; canvasGroup.interactable = !fadeOut; canvasGroup.blocksRaycasts = !fadeOut; @@ -112,7 +112,7 @@ private IEnumerator FadeCanvas(bool fadeOut) void OnDrag() { - if (toolRayOrigin) + if (toolRayOrigin && enabled) { var worldToLocal = m_ColorPicker.rectTransform.worldToLocalMatrix; var rect = m_ColorPicker.rectTransform.rect; @@ -126,8 +126,7 @@ void OnDrag() float distance = Mathf.Abs(height / sine); Vector2 point = localRayPos + localRayForward * distance; - point.x = Mathf.Clamp(point.x, -rect.width / 2f, rect.width / 2f); - point.y = Mathf.Clamp(point.y, -rect.height / 2f, rect.height / 2f); + point = point.normalized * Mathf.Min(point.magnitude, rect.width / 2f); m_PickerTargetPosition = point; GenerateBrightnessBar(); @@ -140,19 +139,17 @@ private void GenerateBrightnessBar() var rect = m_SliderBackground.rectTransform.rect; if (!m_BrightnessBarTexture) m_BrightnessBarTexture = new Texture2D((int)rect.width, 1); - - var squareRect = m_ColorPicker.rectTransform.rect; - var pickerPos = m_Picker.localPosition; - float hue = (pickerPos.x + squareRect.width / 2f) / squareRect.width; - float saturation = (pickerPos.y + squareRect.height / 2f) / squareRect.height; + Color col = GetColorForCurrentPosition(); for (int y = 0; y < m_BrightnessBarTexture.height; y++) { for (int x = 0; x < m_BrightnessBarTexture.width; x++) { float brightness = x / rect.width; - m_BrightnessBarTexture.SetPixel(x, y, Color.HSVToRGB(hue, saturation, brightness)); + var tempCol = col * brightness; + tempCol.a = 1; + m_BrightnessBarTexture.SetPixel(x, y, tempCol); } } m_BrightnessBarTexture.Apply(); @@ -160,39 +157,27 @@ private void GenerateBrightnessBar() m_SliderBackground.texture = m_BrightnessBarTexture; } - private void GenerateColorPicker() + private void PositionToColor() { - var rect = m_ColorPicker.rectTransform.rect; - if (!m_ColorPickerTexture) - m_ColorPickerTexture = new Texture2D((int)rect.width, (int)rect.height); - - for (int y = 0; y < m_ColorPickerTexture.height; y++) + if (onColorPicked != null) { - for (int x = 0; x < m_ColorPickerTexture.width; x++) - { - float hue = x / rect.width; - float saturation = y / rect.height; - m_ColorPickerTexture.SetPixel(x, y, Color.HSVToRGB(hue, saturation, 1)); - } + var col = GetColorForCurrentPosition(); + onColorPicked(col); } - m_ColorPickerTexture.Apply(); - - m_ColorPicker.texture = m_ColorPickerTexture; } - private void PositionToColor() + private Color GetColorForCurrentPosition() { - if (onColorPicked != null) - { - var rect = m_ColorPicker.rectTransform.rect; + var rect = m_ColorPicker.rectTransform.rect; - float hue = (m_PickerTargetPosition.x + rect.width / 2f) / rect.width; - float saturation = (m_PickerTargetPosition.y + rect.height / 2f) / rect.height; - float brightness = m_BrightnessSlider.value; + Vector3 dir = m_PickerTargetPosition; + var x = (dir.x + rect.width / 2f) / rect.width; + var y = (dir.y + rect.height / 2f) / rect.height; + int textureX = (int)(x * m_ColorPickerTexture.width); + int textureY = (int)(y * m_ColorPickerTexture.height); + Color col = m_ColorPickerTexture.GetPixel(textureX, textureY); - Color col = Color.HSVToRGB(hue, saturation, brightness); - onColorPicked(col); - } + return col; } public void OnPointerExit(PointerEventData eventData) From a9945b14ade207e16525b6fa07bb3595ae1e29bb Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 6 Mar 2017 17:59:21 -0800 Subject: [PATCH 022/870] Add new ProxyGradientOutline shader; used to draw a unified gradient-outline behind a proxy's meshes (touch, vive, etc). --- Shaders/ProxyGradientOutline.shader | 123 +++++++++++++++++++++++ Shaders/ProxyGradientOutline.shader.meta | 9 ++ 2 files changed, 132 insertions(+) create mode 100644 Shaders/ProxyGradientOutline.shader create mode 100644 Shaders/ProxyGradientOutline.shader.meta diff --git a/Shaders/ProxyGradientOutline.shader b/Shaders/ProxyGradientOutline.shader new file mode 100644 index 000000000..a1643a8dc --- /dev/null +++ b/Shaders/ProxyGradientOutline.shader @@ -0,0 +1,123 @@ +Shader "EditorVR/ProxyGradientOutline" +{ + Properties + { + _ColorTop ("Top Color", Color) = (1,1,1,1) + _ColorBottom ("Bottom Color", Color) = (1,1,1,1) + _Alpha ("Alpha", Range(0, 1)) = 1 + _Thickness ("Thickness", Range (0, 0.025)) = 0.02 + _StencilRef ("StencilRef", Int) = 0 + _ObjectScale ("Object Scale", Range (-0.1, 0.1)) = -0.05 + [Toggle(ROTATE_GRADIENT)] _RotateGradient("Rotate Gradient", Float) = 0 + } + + SubShader + { + Tags{ "Queue" = "Geometry" "IgnoreProjector" = "True" "ForceNoShadowCasting" = "True" "LightMode" = "Always"} + + // Write stencil + Pass + { + ZTest LEqual + ZWrite Off + Cull Back + ColorMask 0 + + Stencil + { + Ref [_StencilRef] + Pass Replace + } + + CGPROGRAM + + #include "UnityCG.cginc" + #pragma vertex vertStencil + #pragma fragment fragStencil + + struct v2f + { + float4 position : SV_POSITION; + }; + + v2f vertStencil(appdata_full v) + { + v2f output; + output.position = UnityObjectToClipPos(v.vertex); + return output; + } + + float4 fragStencil(v2f input) : SV_Target + { + return 0; + } + + ENDCG + } + + // Draw outline + Pass + { + ZTest LEqual + ZWrite On + Cull Back + Blend SrcAlpha OneMinusSrcAlpha + + Stencil + { + Ref [_StencilRef] + Comp NotEqual + } + + CGPROGRAM + + #include "UnityCG.cginc" + #pragma vertex vertOutline + #pragma fragment fragOutline + #pragma multi_compile __ ROTATE_GRADIENT + + fixed4 _ColorTop; + fixed4 _ColorBottom; + half _Thickness; + half _ObjectScale; + half _Alpha; + + struct v2f + { + float4 position : SV_POSITION; + fixed4 color : COLOR; + half3 localPosition : FLOAT; + }; + + v2f vertOutline(appdata_full v) + { + v2f output; + + output.position = UnityObjectToClipPos(v.vertex); + output.color = lerp(_ColorBottom, _ColorTop, v.vertex); + output.localPosition = v.vertex.xyz; + + float3 norm = normalize( mul((float3x3)UNITY_MATRIX_IT_MV, v.normal) ); + float2 offset = TransformViewToProjection(norm.xy); + output.position.xy += offset * _Thickness * 0.1; + return output; + } + + float4 fragOutline(v2f input) : SV_Target + { + #ifdef ROTATE_GRADIENT + half localPos = input.localPosition.y; + #else + half localPos = input.localPosition.z; + #endif + + half4 color = lerp(_ColorTop, _ColorBottom, localPos / _ObjectScale); + color.a = _Alpha; + + return color; + } + + ENDCG + } + } +} diff --git a/Shaders/ProxyGradientOutline.shader.meta b/Shaders/ProxyGradientOutline.shader.meta new file mode 100644 index 000000000..ee5e3f7c9 --- /dev/null +++ b/Shaders/ProxyGradientOutline.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 461584442bc21b24f94fbca006b8d4c7 +timeCreated: 1488845989 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: From e1fdcc8c6a2c69a6f387e6c386ca39c37111620d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 6 Mar 2017 18:03:20 -0800 Subject: [PATCH 023/870] Add new ProxyGradientOutline material --- Prefabs/UI/Materials/ProxyGradientOutline.mat | 160 ++++++++++++++++++ .../Materials/ProxyGradientOutline.mat.meta | 8 + 2 files changed, 168 insertions(+) create mode 100644 Prefabs/UI/Materials/ProxyGradientOutline.mat create mode 100644 Prefabs/UI/Materials/ProxyGradientOutline.mat.meta diff --git a/Prefabs/UI/Materials/ProxyGradientOutline.mat b/Prefabs/UI/Materials/ProxyGradientOutline.mat new file mode 100644 index 000000000..155326182 --- /dev/null +++ b/Prefabs/UI/Materials/ProxyGradientOutline.mat @@ -0,0 +1,160 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: ProxyGradientOutline + m_Shader: {fileID: 4800000, guid: 461584442bc21b24f94fbca006b8d4c7, type: 3} + m_ShaderKeywords: USE_HEIGHT_INSTEAD_OF_DEPTH _EMISSION + m_LightmapFlags: 1 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: _Alpha + second: 1 + - first: + name: _BumpScale + second: 1 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 0 + - first: + name: _GlossMapScale + second: 1 + - first: + name: _Glossiness + second: 0.5 + - first: + name: _GlossyReflections + second: 1 + - first: + name: _Metallic + second: 0 + - first: + name: _Mode + second: 0 + - first: + name: _ObjectDepthScale + second: -0.05 + - first: + name: _ObjectScale + second: -0.05 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _RotateGradient + second: 0 + - first: + name: _SizeMultiplier + second: 1 + - first: + name: _SmoothnessTextureChannel + second: 0 + - first: + name: _SpecularHighlights + second: 1 + - first: + name: _SrcBlend + second: 1 + - first: + name: _StencilRef + second: 3 + - first: + name: _Thickness + second: 0.02 + - first: + name: _UVSec + second: 0 + - first: + name: _UseHeightInstead + second: 1 + - first: + name: _ZWrite + second: 1 + m_Colors: + - first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} + - first: + name: _ColorBottom + second: {r: 0.889, g: 0.653225, b: 0.14579597, a: 1} + - first: + name: _ColorTop + second: {r: 0.328, g: 0.69412404, b: 1, a: 1} + - first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + - first: + name: _ObjectExtents + second: {r: 0, g: -0.05, b: -0.05, a: 0} diff --git a/Prefabs/UI/Materials/ProxyGradientOutline.mat.meta b/Prefabs/UI/Materials/ProxyGradientOutline.mat.meta new file mode 100644 index 000000000..c02ead31b --- /dev/null +++ b/Prefabs/UI/Materials/ProxyGradientOutline.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40ce8f85e3653a84abffb13adb986781 +timeCreated: 1488846314 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From 0bd2fd5f3efd99dc0233361cbd3a1838ee5faf49 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 7 Mar 2017 23:24:42 -0800 Subject: [PATCH 024/870] Add missing SteamVR Setup fix --- Scripts/Proxies/ViveProxy.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/Proxies/ViveProxy.cs b/Scripts/Proxies/ViveProxy.cs index c5d55e480..a67f22539 100644 --- a/Scripts/Proxies/ViveProxy.cs +++ b/Scripts/Proxies/ViveProxy.cs @@ -10,13 +10,18 @@ sealed class ViveProxy : TwoHandedProxyBase #if ENABLE_STEAMVR_INPUT SteamVR_RenderModel m_RightModel; SteamVR_RenderModel m_LeftModel; +#endif public override void Awake() { base.Awake(); m_InputToEvents = ObjectUtils.AddComponent(gameObject); +#if !ENABLE_STEAMVR_INPUT + enabled = false; +#endif } +#if ENABLE_STEAMVR_INPUT public override IEnumerator Start() { SteamVR_Render.instance.transform.parent = gameObject.transform; From d3b2799fbb4fc292247fd362d68e6e61936fe235 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 7 Mar 2017 23:26:48 -0800 Subject: [PATCH 025/870] Add rough initial support for multi-button & permanent selection tool button to pinned tool button --- Scripts/UI/PinnedToolButton.cs | 65 ++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 6d2df5390..e51d7fbed 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -20,7 +20,7 @@ public Type toolType { if (m_ToolType == value) return; - + Debug.LogError("PinnedToolButton setting TYPE : " + value.ToString() + ""); m_GradientButton.gameObject.SetActive(true); m_ToolType = value; @@ -29,21 +29,82 @@ public Type toolType m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); SetButtonGradients(true); m_GradientButton.visible = true; + + if (m_ToolType == typeof(Tools.SelectionTool)) + { + m_Tooltip.tooltipText = "Selection TOOL!!!!"; + activeTool = true; + } + else + m_Tooltip.tooltipText = "NOT SELECTION TOOL!!!"; + } + else + { + m_GradientButton.visible = false; } } } Type m_ToolType; + public bool activeTool // use this externally to make visible & move a button to the active/inactive position + { + get { return m_ActiveTool; } + set + { + if (value == m_ActiveTool) + return; + + m_ActiveTool = value; + + if (value) + { + if (m_ToolType == null) + { + //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + gameObject.SetActive(true); + } + + // Perform re-position coroutine here + //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(activePosition)); + transform.localPosition = activePosition; + } + else + { + //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(inactivePosition)); + transform.localPosition = inactivePosition; + } + } + } + bool m_ActiveTool; + + public Vector3 activePosition + { + private get { return m_ActivePosition; } + set + { + m_ActivePosition = value; + inactivePosition = value * 2.25f; // additional offset for the button when it is visible and inactive + } + } + Vector3 m_ActivePosition; + [SerializeField] GradientButton m_GradientButton; + [SerializeField] + Tooltip m_Tooltip; + public Transform rayOrigin { get; set; } public Func selectTool { private get; set; } + Vector3 inactivePosition; // Inactive button offset from the main menu activator + void Start() { m_GradientButton.onClick += OnClick; - m_GradientButton.gameObject.SetActive(false); + + if (m_ToolType == null) + m_GradientButton.gameObject.SetActive(false); } void OnClick() From 735085212f681a8e466ed0031b308cef88d52531 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 7 Mar 2017 23:27:25 -0800 Subject: [PATCH 026/870] Add selectionToolButton to DeviceDate in EditorVR --- Scripts/Core/EditorVR.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index bb0e787f7..d4dfeb2bd 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -19,7 +19,7 @@ namespace UnityEditor.Experimental.EditorVR [RequiresTag(k_VRPlayerTag)] sealed partial class EditorVR { - public const HideFlags DefaultHideFlags = HideFlags.HideAndDontSave; + public const HideFlags DefaultHideFlags = HideFlags.None; const string k_VRPlayerTag = "VRPlayer"; [SerializeField] @@ -81,6 +81,7 @@ class DeviceData public ITool currentTool; public IMenu customMenu; public PinnedToolButton previousToolButton; + public PinnedToolButton selectionToolButton; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); } From 019b3f0155f39df84eedc058eb6eba1f6f1a0f2c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 7 Mar 2017 23:29:11 -0800 Subject: [PATCH 027/870] Add rough initial support for multiple PinnedToolButtons, and a permanent SelectionTool button to EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 38 ++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 6e77c21e4..8589aab8e 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -85,11 +85,20 @@ internal void SpawnDefaultTools(IProxy proxy) mainMenuActivator.hoverStarted += evrMenus.OnMainMenuActivatorHoverStarted; mainMenuActivator.hoverEnded += evrMenus.OnMainMenuActivatorHoverEnded; + var pinnedToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); // Active button offset from the main menu activator var pinnedToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); deviceData.previousToolButton = pinnedToolButton; var pinnedToolButtonTransform = pinnedToolButton.transform; pinnedToolButtonTransform.SetParent(mainMenuActivator.transform, false); - pinnedToolButtonTransform.localPosition = new Vector3(0f, 0f, -0.035f); // Offset from the main menu activator + pinnedToolButton.activePosition = pinnedToolButtonActivePosition; + + var selectionToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); + deviceData.selectionToolButton = selectionToolButton; + var selectionToolButtonTransform = selectionToolButton.transform; + selectionToolButtonTransform.SetParent(mainMenuActivator.transform, false); + selectionToolButton.activePosition = pinnedToolButtonActivePosition; + selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default + //selectionToolButton.activeTool = true; // Selection tool button is always visible, and defaults as the active tool button var alternateMenu = evrMenus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); deviceData.alternateMenu = alternateMenu; @@ -151,17 +160,27 @@ internal bool IsToolActive(Transform targetRayOrigin, Type toolType) internal bool SelectTool(Transform rayOrigin, Type toolType) { + Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); + if (toolType == typeof(SelectionTool)) + Debug.LogError("!!!!! SelectionTool detected"); + var result = false; evr.m_Rays.ForEachProxyDevice((deviceData) => { if (deviceData.rayOrigin == rayOrigin) { var spawnTool = true; + var isSelectionTool = deviceData.currentTool is SelectionTool; // If this tool was on the current device already, then simply remove it if (deviceData.currentTool != null && deviceData.currentTool.GetType() == toolType) { - DespawnTool(deviceData, deviceData.currentTool); + // SelectionTool is permanent, and cannot be despawned; it remains as the active tool (button) + if (!isSelectionTool) + { + DespawnTool(deviceData, deviceData.currentTool); + deviceData.selectionToolButton.activeTool = true; + } // Don't spawn a new tool, since we are only removing the old tool spawnTool = false; @@ -199,8 +218,19 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) AddToolToStack(dd, newTool); - deviceData.previousToolButton.toolType = toolType; // assign the new current tool type to the active tool button - deviceData.previousToolButton.rayOrigin = rayOrigin; + if (isSelectionTool) + { + deviceData.selectionToolButton.toolType = toolType; // assign the new current tool type to the active tool button + deviceData.selectionToolButton.rayOrigin = rayOrigin; + } + else + { + deviceData.previousToolButton.toolType = toolType; // assign the new current tool type to the active tool button + deviceData.previousToolButton.rayOrigin = rayOrigin; + } + + deviceData.previousToolButton.activeTool = !isSelectionTool; + deviceData.selectionToolButton.activeTool = isSelectionTool; } } From 573657184c745e69d93435e8604942cd0dcda9b3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 7 Mar 2017 23:30:19 -0800 Subject: [PATCH 028/870] Assign ToolTip reference on PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 1 + 1 file changed, 1 insertion(+) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index b42e3d7ce..4341a553c 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -364,6 +364,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_GradientButton: {fileID: 114000010373680160} + m_Tooltip: {fileID: 114000012566785296} --- !u!114 &114000012566785296 MonoBehaviour: m_ObjectHideFlags: 1 From f4692c15eccab4b1523f4b05090868a74b73ef0f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 8 Mar 2017 19:13:54 -0800 Subject: [PATCH 029/870] Add HighlightDevice function/contract to the IProxy interface; used to display per-proxy-device highlight --- Scripts/Interfaces/IProxy.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Scripts/Interfaces/IProxy.cs b/Scripts/Interfaces/IProxy.cs index 58775c295..aff84524e 100644 --- a/Scripts/Interfaces/IProxy.cs +++ b/Scripts/Interfaces/IProxy.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Helpers; using UnityEngine; using UnityEngine.InputNew; @@ -77,6 +78,13 @@ Dictionary previewOrigins { get; set; } + + /// + /// Display the highlight visuals for proxy device + /// Node = device node on which to display the highlight + /// GradientPair = gradientPair used in the highlight visuals + /// + void HighlightDevice (Node node, GradientPair gradientPair); } } #endif From 4c0fcebdb65dd4102c7ce9de7bdba59ba3e46829 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 8 Mar 2017 19:15:11 -0800 Subject: [PATCH 030/870] Add first pass per-button-type custom-gradient support to PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index e51d7fbed..ef1532d63 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Text; +using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -20,6 +21,7 @@ public Type toolType { if (m_ToolType == value) return; + Debug.LogError("PinnedToolButton setting TYPE : " + value.ToString() + ""); m_GradientButton.gameObject.SetActive(true); @@ -30,13 +32,19 @@ public Type toolType SetButtonGradients(true); m_GradientButton.visible = true; - if (m_ToolType == typeof(Tools.SelectionTool)) + if (isSelectTool) { m_Tooltip.tooltipText = "Selection TOOL!!!!"; activeTool = true; + gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair } else + { m_Tooltip.tooltipText = "NOT SELECTION TOOL!!!"; + + // Tools other than select fetch a random gradientPair; also used by the device when highlighted + gradientPair = UnityBrandColorScheme.GetRandomGradient(); + } } else { @@ -88,6 +96,17 @@ public Vector3 activePosition } Vector3 m_ActivePosition; + /// + /// gradientPair should be set with new random gradientPair each time a new Tool is associated with this Button + /// This gradientPair is also used to highlight the input device when appropriate + /// + public GradientPair gradientPair + { + get { return _mGradientPair; } + private set { _mGradientPair = value; } + } + GradientPair _mGradientPair; + [SerializeField] GradientButton m_GradientButton; @@ -97,6 +116,11 @@ public Vector3 activePosition public Transform rayOrigin { get; set; } public Func selectTool { private get; set; } + bool isSelectTool + { + get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } + } + Vector3 inactivePosition; // Inactive button offset from the main menu activator void Start() @@ -132,13 +156,13 @@ void SetButtonGradients(bool active) { if (active) { - m_GradientButton.normalGradientPair = UnityBrandColorScheme.sessionGradient; + m_GradientButton.normalGradientPair = gradientPair; m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; } else { m_GradientButton.normalGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.highlightGradientPair = UnityBrandColorScheme.sessionGradient; + m_GradientButton.highlightGradientPair = gradientPair; } } } From 91ec83c11506dc6e0ce8d619bd261bdf5d1da83d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 8 Mar 2017 19:16:20 -0800 Subject: [PATCH 031/870] Add first-pass support for displaying device highlight in TwoHandedProxyBase --- Scripts/Proxies/TwoHandedProxyBase.cs | 33 ++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs b/Scripts/Proxies/TwoHandedProxyBase.cs index 413c64a7d..e59aca75f 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs +++ b/Scripts/Proxies/TwoHandedProxyBase.cs @@ -2,6 +2,8 @@ using System; using System.Collections; using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Input; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -22,6 +24,9 @@ abstract class TwoHandedProxyBase : MonoBehaviour, IProxy [SerializeField] protected PlayerInput m_PlayerInput; + [SerializeField] + protected Material m_HighlightMaterial; + internal IInputToEvents m_InputToEvents; public Transform leftHand @@ -38,6 +43,8 @@ public Transform rightHand readonly List m_Materials = new List(); protected Dictionary m_RayOrigins; + protected Dictionary m_HighlightMaterials; + Coroutine m_HighlightCoroutine; List m_ProxyMeshRoots = new List(); @@ -53,7 +60,6 @@ public event Action activeChanged remove { m_InputToEvents.activeChanged -= value; } } - public virtual bool hidden { set @@ -106,6 +112,13 @@ public virtual void Awake() { leftProxyHelper.rayOrigin, leftProxyHelper.previewOrigin }, { rightProxyHelper.rayOrigin, rightProxyHelper.previewOrigin } }; + + Debug.Log("TODO: Setup EVR friendly shared materials!"); + m_HighlightMaterials = new Dictionary + { + { Node.LeftHand, new Material(m_HighlightMaterial) }, + { Node.RightHand, new Material(m_HighlightMaterial) } + }; } public virtual IEnumerator Start() @@ -154,6 +167,24 @@ public virtual void Update() m_RightHand.localRotation = trackedObjectInput.rightRotation.quaternion; } } + + public void HighlightDevice (Node node, GradientPair gradientPair) + { + // COULD ALSO use rayOrigin + Debug.LogWarning("HighlightDevice called!!!"); + // use node/transform to detect which material to set gradientPair and perform highlight coroutine on + this.RestartCoroutine(ref m_HighlightCoroutine, ShowHighlight(null, gradientPair)); + } + + IEnumerator ShowHighlight(Material material, GradientPair gradientPair) + { + // IF the highlight is already running, lerp the gradientPair color to the new target colors + // If the highlight is not already running, just set the gradientPair colors, then lerp in alpha + // perform a quick opacity fade in then out of the opacity on the material passed in + + Debug.LogWarning("ShowHighlight called!!!"); + yield break; + } } } #endif From 2548778bde90952dd56d40e0896aa6163ed302ba Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 8 Mar 2017 19:17:05 -0800 Subject: [PATCH 032/870] Assign ProxyGradientOutline material to TwoHandedProxyBase --- Scripts/Proxies/TwoHandedProxyBase.cs.meta | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs.meta b/Scripts/Proxies/TwoHandedProxyBase.cs.meta index c16aa1811..ccd0349cd 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs.meta +++ b/Scripts/Proxies/TwoHandedProxyBase.cs.meta @@ -1,10 +1,15 @@ fileFormatVersion: 2 guid: 1075642011deb9841a2eecf5dc0bd444 -timeCreated: 1466801922 +timeCreated: 1489018189 licenseType: Pro MonoImporter: serializedVersion: 2 - defaultReferences: [] + defaultReferences: + - m_LeftHandProxyPrefab: {instanceID: 0} + - m_RightHandProxyPrefab: {instanceID: 0} + - m_PlayerInput: {instanceID: 0} + - m_HighlightMaterial: {fileID: 2100000, guid: 40ce8f85e3653a84abffb13adb986781, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: From ab5a683e678b92f61f098ac8e8d60ecb9b300f25 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 8 Mar 2017 19:17:49 -0800 Subject: [PATCH 033/870] Add initial gradient support for pinned tool buttons in EditorVR's SelectTool function --- Scripts/Core/EditorVR.Tools.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 8589aab8e..671294cdb 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Tools; @@ -217,18 +218,22 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) DespawnTool(deviceData, deviceData.currentTool); AddToolToStack(dd, newTool); + GradientPair highlightGradientPair; if (isSelectionTool) { deviceData.selectionToolButton.toolType = toolType; // assign the new current tool type to the active tool button deviceData.selectionToolButton.rayOrigin = rayOrigin; + highlightGradientPair = deviceData.selectionToolButton.gradientPair; } else { deviceData.previousToolButton.toolType = toolType; // assign the new current tool type to the active tool button deviceData.previousToolButton.rayOrigin = rayOrigin; + highlightGradientPair = deviceData.previousToolButton.gradientPair; } + deviceData.proxy.HighlightDevice(deviceData.node, highlightGradientPair); // Perform the higlight on the node with the button's gradient pair deviceData.previousToolButton.activeTool = !isSelectionTool; deviceData.selectionToolButton.activeTool = isSelectionTool; } From a82a42f4fe3ccf3dfbaa0a1292e0b00c2b9b53f4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 9 Mar 2017 13:15:29 -0800 Subject: [PATCH 034/870] Update MaterialUtils function comments to take into account refator changes --- Scripts/Utilities/MaterialUtils.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Utilities/MaterialUtils.cs b/Scripts/Utilities/MaterialUtils.cs index c8d8903a3..4d9e729ec 100644 --- a/Scripts/Utilities/MaterialUtils.cs +++ b/Scripts/Utilities/MaterialUtils.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Utilities static class MaterialUtils { /// - /// Get a material clone; IMPORTANT: Make sure to call U.Destroy() on this material when done! + /// Get a material clone; IMPORTANT: Make sure to call ObjectUtils.Destroy() on this material when done! /// /// Renderer that will have its material clone and replaced /// Cloned material @@ -24,7 +24,7 @@ public static UnityMaterial GetMaterialClone(Renderer renderer) } /// - /// Get a material clone; IMPORTANT: Make sure to call U.Destroy() on this material when done! + /// Get a material clone; IMPORTANT: Make sure to call ObjectUtils.Destroy() on this material when done! /// /// Graphic that will have its material cloned and replaced /// Cloned material @@ -35,7 +35,7 @@ public static UnityMaterial GetMaterialClone(Graphic graphic) } /// - /// Clone all materials within a renderer; IMPORTANT: Make sure to call U.Destroy() on this material when done! + /// Clone all materials within a renderer; IMPORTANT: Make sure to call ObjectUtils.Destroy() on this material when done! /// /// Renderer that will have its materials cloned and replaced /// Cloned materials From dfad194682f4dcba8047862763c69f476452aa45 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 9 Mar 2017 23:56:44 -0800 Subject: [PATCH 035/870] Assign ProxyGradientOutline to proxy controllers --- Scripts/Proxies/SixenseProxy.cs.meta | 4 +++- Scripts/Proxies/TouchProxy.cs.meta | 4 ++-- Scripts/Proxies/ViveProxy.cs.meta | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Scripts/Proxies/SixenseProxy.cs.meta b/Scripts/Proxies/SixenseProxy.cs.meta index a086381d2..a4de8d204 100644 --- a/Scripts/Proxies/SixenseProxy.cs.meta +++ b/Scripts/Proxies/SixenseProxy.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 533cc1f4378be8540b46a00c8a103877 -timeCreated: 1467068979 +timeCreated: 1489103893 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -10,6 +10,8 @@ MonoImporter: - m_RightHandProxyPrefab: {fileID: 150470, guid: ea7d63f56711a60489bf0fe2405f5895, type: 2} - m_PlayerInput: {instanceID: 0} + - m_HighlightMaterial: {fileID: 2100000, guid: 40ce8f85e3653a84abffb13adb986781, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Scripts/Proxies/TouchProxy.cs.meta b/Scripts/Proxies/TouchProxy.cs.meta index 17985c599..f89753feb 100644 --- a/Scripts/Proxies/TouchProxy.cs.meta +++ b/Scripts/Proxies/TouchProxy.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: e65b17b06d176534a93a05157b341d41 -timeCreated: 1466800467 +timeCreated: 1489103874 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -10,7 +10,7 @@ MonoImporter: - m_RightHandProxyPrefab: {fileID: 141214, guid: d34262fb62f38944b97137c536cddf4b, type: 2} - m_PlayerInput: {instanceID: 0} - - m_RayOrigin: {fileID: 4000011673095590, guid: ea7d63f56711a60489bf0fe2405f5895, + - m_HighlightMaterial: {fileID: 2100000, guid: 40ce8f85e3653a84abffb13adb986781, type: 2} executionOrder: 0 icon: {instanceID: 0} diff --git a/Scripts/Proxies/ViveProxy.cs.meta b/Scripts/Proxies/ViveProxy.cs.meta index f9bc2766b..783e76d30 100644 --- a/Scripts/Proxies/ViveProxy.cs.meta +++ b/Scripts/Proxies/ViveProxy.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 1dd05fa08947fc34392a98bded9b0ae0 -timeCreated: 1467068989 +timeCreated: 1489103568 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -10,6 +10,8 @@ MonoImporter: - m_RightHandProxyPrefab: {fileID: 1000010426338840, guid: fbcfdb50f5e2d7a45bebae9a3a90b3fa, type: 2} - m_PlayerInput: {instanceID: 0} + - m_HighlightMaterial: {fileID: 2100000, guid: 40ce8f85e3653a84abffb13adb986781, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: From 8a19dc6fb1964a989a59a9d09a502a9c32045282 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 9 Mar 2017 23:57:43 -0800 Subject: [PATCH 036/870] Add MakeSpereTool to primitives menu for testing --- Tools/Temp/MakeSphereTool.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/Temp/MakeSphereTool.cs b/Tools/Temp/MakeSphereTool.cs index 2c5a68304..294acec08 100644 --- a/Tools/Temp/MakeSphereTool.cs +++ b/Tools/Temp/MakeSphereTool.cs @@ -5,8 +5,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - //[MainMenuItem("Sphere", "Create", "Create spheres in the scene")] - [MainMenuItem(false)] + [MainMenuItem("Sphere", "Create", "Create spheres in the scene")] + //[MainMenuItem(false)] sealed class MakeSphereTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash { public Transform rayOrigin { get; set; } From 0120f4f7ce5d5dff806e0409045a7b270f902d02 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 10 Mar 2017 01:42:20 -0800 Subject: [PATCH 037/870] Add additional animation, repositioning, gradient swapping, and tooltip support to PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 103 ++++++++++++++++++++++++++------- 1 file changed, 81 insertions(+), 22 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index ef1532d63..a3c052e69 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -1,6 +1,8 @@ #if UNITY_EDITOR using System; +using System.Collections; using System.Text; +using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; @@ -8,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolButton : MonoBehaviour, ISelectTool + sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement { public Type toolType { @@ -28,27 +30,27 @@ public Type toolType m_ToolType = value; if (m_ToolType != null) { - m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); - SetButtonGradients(true); - m_GradientButton.visible = true; - if (isSelectTool) { - m_Tooltip.tooltipText = "Selection TOOL!!!!"; - activeTool = true; + tooltipText = "Selection TOOL"; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair } else { - m_Tooltip.tooltipText = "NOT SELECTION TOOL!!!"; + tooltipText = toolType.Name; // Tools other than select fetch a random gradientPair; also used by the device when highlighted gradientPair = UnityBrandColorScheme.GetRandomGradient(); } + + m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); + SetButtonGradients(true); + m_GradientButton.visible = true; } else { m_GradientButton.visible = false; + gradientPair = UnityBrandColorScheme.grayscaleSessionGradient; } } } @@ -59,28 +61,34 @@ public bool activeTool // use this externally to make visible & move a button to get { return m_ActiveTool; } set { - if (value == m_ActiveTool) - return; + //if (value == m_ActiveTool) + //return; m_ActiveTool = value; - if (value) + if (m_ToolType != null) + Debug.LogError(m_ToolType.ToString() + " : PinnedToolButton ACTIVE : " + value); + + if (m_ActiveTool) { if (m_ToolType == null) { //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); - gameObject.SetActive(true); + gameObject.SetActive(m_ActiveTool); } // Perform re-position coroutine here - //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(activePosition)); + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); transform.localPosition = activePosition; } else { - //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(inactivePosition)); - transform.localPosition = inactivePosition; + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); + //gameObject.SetActive(false); + transform.localPosition = m_InactivePosition; } + + SetButtonGradients(m_ActiveTool); } } bool m_ActiveTool; @@ -91,7 +99,7 @@ public Vector3 activePosition set { m_ActivePosition = value; - inactivePosition = value * 2.25f; // additional offset for the button when it is visible and inactive + m_InactivePosition = value * 2f; // additional offset for the button when it is visible and inactive } } Vector3 m_ActivePosition; @@ -102,38 +110,67 @@ public Vector3 activePosition /// public GradientPair gradientPair { - get { return _mGradientPair; } - private set { _mGradientPair = value; } + get { return m_GradientPair; } + private set { m_GradientPair = value; } } - GradientPair _mGradientPair; + GradientPair m_GradientPair; + + public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } + string m_TooltipText; [SerializeField] GradientButton m_GradientButton; + //[SerializeField] + //Tooltip m_Tooltip; + + public Transform tooltipTarget { get { return m_TooltipTarget; } } [SerializeField] - Tooltip m_Tooltip; + Transform m_TooltipTarget; + public Transform tooltipSource { get { return m_TooltipSource; } } + [SerializeField] + Transform m_TooltipSource; + + public TextAlignment tooltipAlignment { get; private set; } public Transform rayOrigin { get; set; } public Func selectTool { private get; set; } + public Node node { get; set; } + public ITooltip tooltip { private get; set; } // Overrides text bool isSelectTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } - Vector3 inactivePosition; // Inactive button offset from the main menu activator + Vector3 m_InactivePosition; // Inactive button offset from the main menu activator + Coroutine m_PositionCoroutine; void Start() { m_GradientButton.onClick += OnClick; if (m_ToolType == null) + { + transform.localPosition = m_InactivePosition; m_GradientButton.gameObject.SetActive(false); + } + else + { + transform.localPosition = activePosition; + } + + var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, 0); + var tooltipXOffset = node == Node.LeftHand ? -0.05f : 0.05f; + tooltipSource.localPosition = tooltipSourcePosition; + tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; + m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); } void OnClick() { - SetButtonGradients(selectTool(rayOrigin, m_ToolType)); + selectTool(rayOrigin, m_ToolType); + SetButtonGradients(activeTool); } // Create periodic table-style names for types @@ -154,17 +191,39 @@ string GetTypeAbbreviation(Type type) void SetButtonGradients(bool active) { + Debug.LogWarning(m_ToolType.ToString() + "" + active + ""); if (active) { m_GradientButton.normalGradientPair = gradientPair; m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; + m_GradientButton.highlighted = true; + m_GradientButton.highlighted = false; } else { m_GradientButton.normalGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; m_GradientButton.highlightGradientPair = gradientPair; + m_GradientButton.highlighted = true; + m_GradientButton.highlighted = false; } } + + IEnumerator AnimatePosition() + { + var duration = 0f; + var currentPosition = transform.localPosition; + var targetPosition = m_ActiveTool ? activePosition : m_InactivePosition; + while (duration < 1) + { + duration += Time.unscaledDeltaTime * 3; + var durationShaped = Mathf.Pow(duration, 4); + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); + yield return null; + } + + transform.localPosition = targetPosition; + m_PositionCoroutine = null; + } } } #endif From 6dd7e89959586268ea49abe342871adc1bc3f9f3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 10 Mar 2017 01:44:36 -0800 Subject: [PATCH 038/870] Add device gradient-highlight setup and animation support to TwoHandedPoxyBase --- Scripts/Proxies/TwoHandedProxyBase.cs | 177 ++++++++++++++++++++++---- 1 file changed, 155 insertions(+), 22 deletions(-) diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs b/Scripts/Proxies/TwoHandedProxyBase.cs index e59aca75f..eb02a42da 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs +++ b/Scripts/Proxies/TwoHandedProxyBase.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Input; @@ -14,6 +15,12 @@ namespace UnityEditor.Experimental.EditorVR.Proxies abstract class TwoHandedProxyBase : MonoBehaviour, IProxy { const int k_RendererQueue = 9000; + const float k_TargetHighlightThicknessAmount = 0.02f; + const string k_MaterialAlphaProperty = "_Alpha"; + const string k_MaterialColorTopProperty = "_ColorTop"; + const string k_MaterialColorBottomProperty = "_ColorBottom"; + const string k_MaterialThicknessProperty = "_Thickness"; + const string k_MaterialObjectScaleProperty = "_ObjectScale"; [SerializeField] protected GameObject m_LeftHandProxyPrefab; @@ -44,10 +51,9 @@ public Transform rightHand protected Dictionary m_RayOrigins; protected Dictionary m_HighlightMaterials; + protected Dictionary m_ProxyMeshRoots; Coroutine m_HighlightCoroutine; - List m_ProxyMeshRoots = new List(); - public virtual Dictionary rayOrigins { get { return m_RayOrigins; } } public virtual TrackedObject trackedObjectInput { protected get; set; } @@ -86,8 +92,11 @@ public virtual void Awake() var leftProxyHelper = m_LeftHand.GetComponent(); var rightProxyHelper = m_RightHand.GetComponent(); - m_ProxyMeshRoots.Add(leftProxyHelper.meshRoot); - m_ProxyMeshRoots.Add(rightProxyHelper.meshRoot); + m_ProxyMeshRoots = new Dictionary + { + { Node.LeftHand, leftProxyHelper.meshRoot }, + { Node.RightHand, rightProxyHelper.meshRoot } + }; m_RayOrigins = new Dictionary { @@ -112,13 +121,6 @@ public virtual void Awake() { leftProxyHelper.rayOrigin, leftProxyHelper.previewOrigin }, { rightProxyHelper.rayOrigin, rightProxyHelper.previewOrigin } }; - - Debug.Log("TODO: Setup EVR friendly shared materials!"); - m_HighlightMaterials = new Dictionary - { - { Node.LeftHand, new Material(m_HighlightMaterial) }, - { Node.RightHand, new Material(m_HighlightMaterial) } - }; } public virtual IEnumerator Start() @@ -127,18 +129,27 @@ public virtual IEnumerator Start() if (trackedObjectInput == null && m_PlayerInput) trackedObjectInput = m_PlayerInput.GetActions(); - List renderers = new List(); - while (renderers.Count == 0) + List leftHandRenderers = new List(); + List rightHandRenderers = new List(); + while (leftHandRenderers.Count == 0) { yield return null; foreach (var meshRoot in m_ProxyMeshRoots) { - // Only add models of the device and not anything else that is spawned underneath the hand (e.g. menu button, cone/ray) - renderers.AddRange(meshRoot.GetComponentsInChildren()); + // Only add device renderers and not anything else that is spawned underneath the hand (e.g. menu button, cone/ray) + if (meshRoot.Key == Node.LeftHand) + leftHandRenderers.AddRange(meshRoot.Value.GetComponentsInChildren()); + else if (meshRoot.Key == Node.RightHand) + rightHandRenderers.AddRange(meshRoot.Value.GetComponentsInChildren()); } } - foreach (var r in renderers) + foreach (var r in leftHandRenderers) + { + m_Materials.AddRange(MaterialUtils.CloneMaterials(r)); + } + + foreach (var r in rightHandRenderers) { m_Materials.AddRange(MaterialUtils.CloneMaterials(r)); } @@ -148,6 +159,27 @@ public virtual IEnumerator Start() { m.renderQueue = k_RendererQueue; } + + // Perform highlight material setup after default device material setup + var leftHandHighlightMaterial = Instantiate(m_HighlightMaterial); + var rightHandHighlightMaterial = Instantiate(m_HighlightMaterial); + m_HighlightMaterials = new Dictionary + { + { Node.LeftHand, leftHandHighlightMaterial }, + { Node.RightHand, rightHandHighlightMaterial } + }; + + // Add materials to collection after controller material queues have been re-assigned; these material queues shouldn't be altered + m_Materials.Add(leftHandHighlightMaterial); + m_Materials.Add(rightHandHighlightMaterial); + //leftHandHighlightMaterial.SetFloat(k_MaterialAlphaProperty, 1f); + leftHandHighlightMaterial.SetFloat(k_MaterialThicknessProperty, 0f); + //rightHandHighlightMaterial.SetFloat(k_MaterialAlphaProperty, 1f); + rightHandHighlightMaterial.SetFloat(k_MaterialThicknessProperty, 0f); + + AssignDeviceHighlightMaterials(Node.LeftHand, leftHandRenderers, leftHandHighlightMaterial); + AssignDeviceHighlightMaterials(Node.RightHand, rightHandRenderers, rightHandHighlightMaterial); + Debug.Log("Populate object scale in outline material (shader)"); } public virtual void OnDestroy() @@ -156,6 +188,21 @@ public virtual void OnDestroy() ObjectUtils.Destroy(m); } + public virtual void OnDisable() + { + this.StopCoroutine(ref m_HighlightCoroutine); + + // Set highlight material to hidden state in case it is re-enabled + if (m_HighlightMaterials != null && m_HighlightMaterials.Any()) + { + foreach (var pair in m_HighlightMaterials) + { + pair.Value.SetFloat(k_MaterialThicknessProperty, 0f); + break; + } + } + } + public virtual void Update() { if (active) @@ -168,22 +215,108 @@ public virtual void Update() } } - public void HighlightDevice (Node node, GradientPair gradientPair) + void AssignDeviceHighlightMaterials(Node node, List deviceRenderers, Material deviceHighlightMaterial) + { + foreach (var meshRoot in m_ProxyMeshRoots) + { + // Only add device renderers and not anything else that is spawned underneath the hand (e.g. menu button, cone/ray) + if (meshRoot.Key == node) + { + foreach (var renderer in deviceRenderers) + { + var sharedMaterials = renderer.sharedMaterials; + var materialsWithHighlightAdded = new Material[sharedMaterials.Length + 1]; + for (var i = 0; i < sharedMaterials.Length; i++) + { + materialsWithHighlightAdded[i] = sharedMaterials[i]; + } + materialsWithHighlightAdded[materialsWithHighlightAdded.Length - 1] = deviceHighlightMaterial; + renderer.sharedMaterials = materialsWithHighlightAdded; + } + } + } + } + + public void HighlightDevice (Node deviceNode, GradientPair gradientPair) { - // COULD ALSO use rayOrigin Debug.LogWarning("HighlightDevice called!!!"); - // use node/transform to detect which material to set gradientPair and perform highlight coroutine on - this.RestartCoroutine(ref m_HighlightCoroutine, ShowHighlight(null, gradientPair)); + + Material deviceMaterial = null; + foreach (var pair in m_HighlightMaterials) + { + if (pair.Key == deviceNode) + { + deviceMaterial = pair.Value; + break; + } + } + + if (!deviceMaterial) + { + Debug.LogWarning("Material was not found for the node : " + deviceNode.ToString()); + return; + } + + this.RestartCoroutine(ref m_HighlightCoroutine, ShowHighlight(deviceMaterial, gradientPair)); } - IEnumerator ShowHighlight(Material material, GradientPair gradientPair) + IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair) { // IF the highlight is already running, lerp the gradientPair color to the new target colors // If the highlight is not already running, just set the gradientPair colors, then lerp in alpha // perform a quick opacity fade in then out of the opacity on the material passed in Debug.LogWarning("ShowHighlight called!!!"); - yield break; + + //deviceMaterial.SetFloat(k_MaterialAlphaProperty, 0); + //deviceMaterial.SetColor(k_MaterialColorTopProperty, m_OriginalInsetGradientPair.a); + //deviceMaterial.SetColor(k_MaterialColorBottomProperty, m_OriginalInsetGradientPair.b); + //m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); + //deviceMaterial.SetFloat(k_MaterialExpandProperty, 0); + var currentAlpha = deviceMaterial.GetFloat(k_MaterialAlphaProperty); + var currentThickness = deviceMaterial.GetFloat(k_MaterialThicknessProperty); + var currentTopColor = deviceMaterial.GetColor(k_MaterialColorTopProperty); + var currentBottomColor = deviceMaterial.GetColor(k_MaterialColorBottomProperty); + var targetTopColor = gradientPair.a; + var targetBottomColor = gradientPair.b; + var duration = 0f; + while (duration < 1) + { + duration += Time.unscaledDeltaTime * 3f; + var durationShaped = Mathf.Pow(duration, 3); + var topColor = Color.Lerp(currentTopColor, targetTopColor, durationShaped); + var bottomColor = Color.Lerp(currentBottomColor, targetBottomColor, durationShaped); + //deviceMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentAlpha, 1f, durationShaped)); + deviceMaterial.SetFloat(k_MaterialThicknessProperty, Mathf.Lerp(currentThickness, k_TargetHighlightThicknessAmount, durationShaped)); + deviceMaterial.SetColor(k_MaterialColorTopProperty, topColor); + deviceMaterial.SetColor(k_MaterialColorBottomProperty, bottomColor); + yield return null; + } + + //deviceMaterial.SetFloat(k_MaterialAlphaProperty, 1f); + deviceMaterial.SetFloat(k_MaterialThicknessProperty, k_TargetHighlightThicknessAmount); + deviceMaterial.SetColor(k_MaterialColorTopProperty, targetTopColor); + deviceMaterial.SetColor(k_MaterialColorBottomProperty, targetBottomColor); + + var pauseDuration = 0.5f; + while (pauseDuration > 0f) + { + pauseDuration -= Time.unscaledDeltaTime; + yield return null; + } + + while (duration > 0) + { + duration -= Time.unscaledDeltaTime * 0.5f; + var durationShaped = Mathf.Pow(duration, 2); + deviceMaterial.SetFloat(k_MaterialThicknessProperty, Mathf.Lerp(0f, k_TargetHighlightThicknessAmount, durationShaped)); + yield return null; + } + + //deviceMaterial.SetFloat(k_MaterialAlphaProperty, 0f); + deviceMaterial.SetFloat(k_MaterialThicknessProperty, 0f); + + m_HighlightCoroutine = null; } } } From 0bd9c6fd97cb7399dee87deac9ad3c7ecd7c47f2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 10 Mar 2017 01:53:48 -0800 Subject: [PATCH 039/870] Assign new tooltip inspector references to PinnedToolButton; ToolTip functionality has been moved into the PinnedToolButton controller; the separate tooltip controller was removed from the prefab --- Prefabs/UI/PinnedToolButton.prefab | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 4341a553c..007889285 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -20,7 +20,6 @@ GameObject: m_Component: - 4: {fileID: 4000012504767854} - 114: {fileID: 114000011260412956} - - 114: {fileID: 114000012566785296} m_Layer: 5 m_Name: PinnedToolButton m_TagString: Untagged @@ -364,23 +363,8 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_GradientButton: {fileID: 114000010373680160} - m_Tooltip: {fileID: 114000012566785296} ---- !u!114 &114000012566785296 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010204453368} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 121a9b94e41e9e444af3e8069a887154, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RunInEditMode: 0 - m_TooltipText: Toggle Current Tool m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} - m_TooltipAlignment: 1 --- !u!114 &114000012662170858 MonoBehaviour: m_ObjectHideFlags: 1 From 853b4648bda343420d0b81db584041cb4fd2f777 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 10 Mar 2017 01:55:32 -0800 Subject: [PATCH 040/870] Add pinnedToolButton swapping functionality to SelectTool() in EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 50 ++++++++++++++++------------------ 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 671294cdb..37dfb9b12 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -92,6 +92,7 @@ internal void SpawnDefaultTools(IProxy proxy) var pinnedToolButtonTransform = pinnedToolButton.transform; pinnedToolButtonTransform.SetParent(mainMenuActivator.transform, false); pinnedToolButton.activePosition = pinnedToolButtonActivePosition; + pinnedToolButton.node = deviceData.node; var selectionToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); deviceData.selectionToolButton = selectionToolButton; @@ -99,6 +100,7 @@ internal void SpawnDefaultTools(IProxy proxy) selectionToolButtonTransform.SetParent(mainMenuActivator.transform, false); selectionToolButton.activePosition = pinnedToolButtonActivePosition; selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default + selectionToolButton.node = deviceData.node; //selectionToolButton.activeTool = true; // Selection tool button is always visible, and defaults as the active tool button var alternateMenu = evrMenus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); @@ -161,27 +163,24 @@ internal bool IsToolActive(Transform targetRayOrigin, Type toolType) internal bool SelectTool(Transform rayOrigin, Type toolType) { - Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); + Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); if (toolType == typeof(SelectionTool)) - Debug.LogError("!!!!! SelectionTool detected"); + Debug.LogError("!!!!! SelectionTool detected"); var result = false; evr.m_Rays.ForEachProxyDevice((deviceData) => { if (deviceData.rayOrigin == rayOrigin) { + Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString()); var spawnTool = true; - var isSelectionTool = deviceData.currentTool is SelectionTool; + var setSelectAsCurrentTool = toolType == typeof(SelectionTool);//deviceData.currentTool is ILocomotor; // If this tool was on the current device already, then simply remove it - if (deviceData.currentTool != null && deviceData.currentTool.GetType() == toolType) + if (deviceData.currentTool != null && (deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool)) { - // SelectionTool is permanent, and cannot be despawned; it remains as the active tool (button) - if (!isSelectionTool) - { - DespawnTool(deviceData, deviceData.currentTool); - deviceData.selectionToolButton.activeTool = true; - } + Debug.LogError("Despawing tool !!!! : toolType == typeof(SelectionTool) : " + (toolType == typeof(SelectionTool)).ToString()); + DespawnTool(deviceData, deviceData.currentTool); // Don't spawn a new tool, since we are only removing the old tool spawnTool = false; @@ -218,27 +217,26 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) DespawnTool(deviceData, deviceData.currentTool); AddToolToStack(dd, newTool); - GradientPair highlightGradientPair; - if (isSelectionTool) - { - deviceData.selectionToolButton.toolType = toolType; // assign the new current tool type to the active tool button - deviceData.selectionToolButton.rayOrigin = rayOrigin; - highlightGradientPair = deviceData.selectionToolButton.gradientPair; - } + if (setSelectAsCurrentTool) + deviceData.selectionToolButton.toolType = toolType; // assign the selection tool to the selection tool button else - { - deviceData.previousToolButton.toolType = toolType; // assign the new current tool type to the active tool button - deviceData.previousToolButton.rayOrigin = rayOrigin; - highlightGradientPair = deviceData.previousToolButton.gradientPair; - } + deviceData.previousToolButton.toolType = toolType; // assign the new current tool type to the additional tool button - deviceData.proxy.HighlightDevice(deviceData.node, highlightGradientPair); // Perform the higlight on the node with the button's gradient pair - deviceData.previousToolButton.activeTool = !isSelectionTool; - deviceData.selectionToolButton.activeTool = isSelectionTool; + deviceData.previousToolButton.rayOrigin = rayOrigin; + deviceData.selectionToolButton.rayOrigin = rayOrigin; } } + var currentToolIsSelect = deviceData.currentTool is ILocomotor; + Debug.LogError("currentToolIsSelect : " + currentToolIsSelect); + Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " - selection is current tool : " + setSelectAsCurrentTool); + var highlightGradientPair = currentToolIsSelect ? deviceData.selectionToolButton.gradientPair : deviceData.previousToolButton.gradientPair; + deviceData.proxy.HighlightDevice(deviceData.node, highlightGradientPair); // Perform the higlight on the node with the button's gradient pair + deviceData.previousToolButton.activeTool = !currentToolIsSelect; + deviceData.selectionToolButton.activeTool = currentToolIsSelect; + + evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; } @@ -269,7 +267,7 @@ void DespawnTool(DeviceData deviceData, ITool tool) topTool = deviceData.toolData.Peek(); deviceData.currentTool = topTool.tool; - // Pop this tool of any other stack that references it (for single instance tools) + // Pop this tool off any other stack that references it (for single instance tools) foreach (var otherDeviceData in evr.m_DeviceData) { if (otherDeviceData != deviceData) From e9d4a449a69054e36450093e12c75337c5c59565 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 17 Mar 2017 18:08:14 -0700 Subject: [PATCH 041/870] Smooth tooltip reveal animation slightly --- Scripts/Modules/TooltipModule/TooltipModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index b6319c615..f987c5df6 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules sealed class TooltipModule : MonoBehaviour, IUsesViewerScale { const float k_Delay = 0; // In case we want to bring back a delay - const float k_TransitionDuration = 0.1f; + const float k_TransitionDuration = 0.175f; const float k_UVScale = 100f; const float k_UVScrollSpeed = 1.5f; const float k_Offset = 0.05f; @@ -107,6 +107,7 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa if (tooltipText) tooltipText.text = tooltip.tooltipText; + lerp = Mathf.Pow(lerp, 3); var viewerScale = getViewerScale(); tooltipTransform.localScale = m_TooltipScale * lerp * viewerScale; From 93244dbbadc98d633642d05b05a9c29db0a442f3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 17 Mar 2017 18:11:43 -0700 Subject: [PATCH 042/870] Fix fading out (back to original) of gradient colors when pointer exits GradientButton --- Scripts/UI/GradientButton.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index fcd18dbad..fa655f233 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -359,7 +359,7 @@ IEnumerator EndHighlight() const float kTargetTransitionAmount = 1f; var transitionAmount = Time.unscaledDeltaTime; var shapedTransitionAmount = 0f; - var currentGradientPair = GetMaterialColors(); + var originalGradientPair = GetMaterialColors(); var targetGradientPair = normalGradientPair; var currentLocalScale = m_ContentContainer.localScale; var targetScale = m_OriginalContentContainerLocalScale; @@ -367,9 +367,9 @@ IEnumerator EndHighlight() { transitionAmount += Time.unscaledDeltaTime * 3; shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); - currentGradientPair = GradientPair.Lerp(currentGradientPair, targetGradientPair, shapedTransitionAmount); + var transitioningGradientPair = GradientPair.Lerp(originalGradientPair, targetGradientPair, shapedTransitionAmount); - SetMaterialColors(normalGradientPair); + SetMaterialColors(transitioningGradientPair); m_ContentContainer.localScale = Vector3.Lerp(currentLocalScale, targetScale, shapedTransitionAmount); yield return null; From 52475201fe5f22e71254344bcbdeecdc1b023122 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 17 Mar 2017 18:16:12 -0700 Subject: [PATCH 043/870] Speed up gradient button begin+end highlight animations --- Scripts/UI/GradientButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index fa655f233..a843bd0ad 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -334,7 +334,7 @@ IEnumerator BeginHighlight() var highlightedLocalScale = new Vector3(m_OriginalContentContainerLocalScale.x, m_OriginalContentContainerLocalScale.y, m_OriginalContentContainerLocalScale.z * m_highlightZScaleMultiplier); while (transitionAmount < kTargetTransitionAmount) { - transitionAmount += Time.unscaledDeltaTime * 3; + transitionAmount += Time.unscaledDeltaTime * 4; shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); m_ContentContainer.localScale = Vector3.Lerp(currentLocalScale, highlightedLocalScale, shapedTransitionAmount); @@ -365,7 +365,7 @@ IEnumerator EndHighlight() var targetScale = m_OriginalContentContainerLocalScale; while (transitionAmount < kTargetTransitionAmount) { - transitionAmount += Time.unscaledDeltaTime * 3; + transitionAmount += Time.unscaledDeltaTime * 6; shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); var transitioningGradientPair = GradientPair.Lerp(originalGradientPair, targetGradientPair, shapedTransitionAmount); From 551501a37bdffafa078737d37bfd6e24777f198e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 17 Mar 2017 19:04:40 -0700 Subject: [PATCH 044/870] Set proper renderQueue & transparency on TooltipBackground material --- Prefabs/UI/Materials/TooltipBackground.mat | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Prefabs/UI/Materials/TooltipBackground.mat b/Prefabs/UI/Materials/TooltipBackground.mat index 7e5af35ad..47bb53490 100644 --- a/Prefabs/UI/Materials/TooltipBackground.mat +++ b/Prefabs/UI/Materials/TooltipBackground.mat @@ -8,10 +8,11 @@ Material: m_PrefabInternal: {fileID: 0} m_Name: TooltipBackground m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _EMISSION + m_ShaderKeywords: _ALPHABLEND_ON _EMISSION m_LightmapFlags: 1 - m_CustomRenderQueue: 9002 - stringTagMap: {} + m_CustomRenderQueue: 9001 + stringTagMap: + RenderType: Transparent m_SavedProperties: serializedVersion: 2 m_TexEnvs: @@ -96,7 +97,7 @@ Material: second: 1 - first: name: _DstBlend - second: 0 + second: 10 - first: name: _GlossMapScale second: 0.5 @@ -117,7 +118,7 @@ Material: second: 0.256 - first: name: _Mode - second: 0 + second: 2 - first: name: _OcclusionStrength second: 1 @@ -135,7 +136,7 @@ Material: second: 1 - first: name: _SrcBlend - second: 1 + second: 5 - first: name: _StencilRef second: 3 From 9bd680faca5a760d1636599f03b5e789d4bb1ab5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 17 Mar 2017 19:05:09 -0700 Subject: [PATCH 045/870] Assign background image inspector reference in Tooltip prefab --- Prefabs/UI/Tooltip.prefab | 1 + 1 file changed, 1 insertion(+) diff --git a/Prefabs/UI/Tooltip.prefab b/Prefabs/UI/Tooltip.prefab index 70e2553a9..d03741ae3 100644 --- a/Prefabs/UI/Tooltip.prefab +++ b/Prefabs/UI/Tooltip.prefab @@ -407,6 +407,7 @@ MonoBehaviour: - {fileID: 4000010243013896} - {fileID: 4000013086257722} m_Highlight: {fileID: 114000011868131886} + m_Background: {fileID: 114000012161072266} --- !u!114 &114000013855091962 MonoBehaviour: m_ObjectHideFlags: 1 From 7c9c7c91023123df68a46b6e583a8450e85a6920 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 17 Mar 2017 19:06:59 -0700 Subject: [PATCH 046/870] Add animated fading of background & text elements in tooltip --- Scripts/Modules/TooltipModule/TooltipModule.cs | 18 +++++++++++++++--- .../TooltipModule/TooltipModule.cs.meta | 4 +++- Scripts/Modules/TooltipModule/TooltipUI.cs | 4 ++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index f987c5df6..29f54a7a2 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -27,6 +27,9 @@ sealed class TooltipModule : MonoBehaviour, IUsesViewerScale [SerializeField] Material m_HighlightMaterial; + [SerializeField] + Material m_TooltipBackgroundMaterial; + class TooltipData { public float startTime; @@ -37,6 +40,7 @@ class TooltipData Transform m_TooltipCanvas; Vector3 m_TooltipScale; + Color m_OriginalBackgroundColor; public Func getViewerScale { private get; set; } @@ -46,6 +50,8 @@ void Start() m_TooltipCanvas.SetParent(transform); m_TooltipScale = m_TooltipPrefab.transform.localScale; m_HighlightMaterial = Instantiate(m_HighlightMaterial); + m_TooltipBackgroundMaterial = Instantiate(m_TooltipBackgroundMaterial); + m_OriginalBackgroundColor = m_TooltipBackgroundMaterial.color; var sessionGradient = UnityBrandColorScheme.sessionGradient; m_HighlightMaterial.SetColor(k_MaterialColorTopProperty, sessionGradient.a); m_HighlightMaterial.SetColor(k_MaterialColorBottomProperty, sessionGradient.b); @@ -70,6 +76,7 @@ void Update() tooltipUI = tooltipObject.GetComponent(); tooltipData.tooltipUI = tooltipUI; tooltipUI.highlight.material = m_HighlightMaterial; + tooltipUI.background.material = m_TooltipBackgroundMaterial; var tooltipTransform = tooltipObject.transform; MathUtilsExt.SetTransformOffset(target, tooltipTransform, Vector3.zero, Quaternion.identity); tooltipTransform.localScale = Vector3.zero; @@ -103,13 +110,18 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa { var tooltipTransform = tooltipUI.transform; + lerp = Mathf.Pow(lerp, 3); // shape the lerp for better presentation + var viewerScale = getViewerScale(); + tooltipTransform.localScale = m_TooltipScale * lerp * viewerScale; + var tooltipText = tooltipUI.text; if (tooltipText) + { tooltipText.text = tooltip.tooltipText; + tooltipText.color = Color.Lerp(Color.clear, Color.white, lerp); + } - lerp = Mathf.Pow(lerp, 3); - var viewerScale = getViewerScale(); - tooltipTransform.localScale = m_TooltipScale * lerp * viewerScale; + m_TooltipBackgroundMaterial.SetColor("_Color", Color.Lerp(Color.clear, m_OriginalBackgroundColor, lerp)); var placement = tooltip as ITooltipPlacement; diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs.meta b/Scripts/Modules/TooltipModule/TooltipModule.cs.meta index b35201964..e10c4a8d8 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs.meta +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 42531cab117a2db4bb168cd9158d0b46 -timeCreated: 1485301412 +timeCreated: 1489801768 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -11,6 +11,8 @@ MonoImporter: type: 2} - m_HighlightMaterial: {fileID: 2100000, guid: 1b4a84ce11844ed4db6319efe2895bf3, type: 2} + - m_TooltipBackgroundMaterial: {fileID: 2100000, guid: 69e61a53e7f11654da3aca080739eb8b, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Scripts/Modules/TooltipModule/TooltipUI.cs b/Scripts/Modules/TooltipModule/TooltipUI.cs index c5970d1ae..bc42813a6 100644 --- a/Scripts/Modules/TooltipModule/TooltipUI.cs +++ b/Scripts/Modules/TooltipModule/TooltipUI.cs @@ -21,6 +21,10 @@ sealed class TooltipUI : MonoBehaviour public Image highlight { get { return m_Highlight; } } [SerializeField] Image m_Highlight; + + public Image background { get { return m_Background; } } + [SerializeField] + Image m_Background; } } #endif \ No newline at end of file From 2e27e238f6a51668751cf1df9da8fb6f11be6413 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 14:49:07 -0700 Subject: [PATCH 047/870] Add new SmoothInOutLerpFloat function to MathUtilsExt; Used for adding a weighted smoothing of the beginning and end of a float based lerp --- Scripts/Utilities/MathUtilsExt.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Scripts/Utilities/MathUtilsExt.cs b/Scripts/Utilities/MathUtilsExt.cs index 0a5fbd420..ed63eb174 100644 --- a/Scripts/Utilities/MathUtilsExt.cs +++ b/Scripts/Utilities/MathUtilsExt.cs @@ -204,6 +204,16 @@ public static void LerpTransform(Transform source, Vector3 targetPosition, Quate source.position = Vector3.Lerp(source.position, targetPosition, t); source.rotation = Quaternion.Slerp(source.rotation, targetRotation, t); } + + /// + /// Perform a smooth in+out interpolation of a 0-1 lerp value + /// + /// The 0-1 lerp value that is to be shaped by this function + /// The 0-1 smoothed lerp value + public static float SmoothInOutLerpFloat(float lerpAmount) + { + return Mathf.Pow(lerpAmount, 3) * (lerpAmount * (6f * lerpAmount - 15f) + 10f); + } } } #endif From daac3a938e34088e52b758716376cba6809a1a85 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 16:11:52 -0700 Subject: [PATCH 048/870] Add new float lerp smoothing to GradientButton transitions --- Scripts/UI/GradientButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index a843bd0ad..4f8301bdb 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -335,7 +335,7 @@ IEnumerator BeginHighlight() while (transitionAmount < kTargetTransitionAmount) { transitionAmount += Time.unscaledDeltaTime * 4; - shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); + shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); m_ContentContainer.localScale = Vector3.Lerp(currentLocalScale, highlightedLocalScale, shapedTransitionAmount); currentGradientPair = GradientPair.Lerp(currentGradientPair, targetGradientPair, shapedTransitionAmount); @@ -366,7 +366,7 @@ IEnumerator EndHighlight() while (transitionAmount < kTargetTransitionAmount) { transitionAmount += Time.unscaledDeltaTime * 6; - shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); + shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); var transitioningGradientPair = GradientPair.Lerp(originalGradientPair, targetGradientPair, shapedTransitionAmount); SetMaterialColors(transitioningGradientPair); From 85f1f9de8e59feb72c29c3dcae2c7423c51c8ab4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 16:13:09 -0700 Subject: [PATCH 049/870] Add new float lerp smoothing to ToolTipModule animation --- Scripts/Modules/TooltipModule/TooltipModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index 29f54a7a2..dc4a6c791 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -110,7 +110,7 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa { var tooltipTransform = tooltipUI.transform; - lerp = Mathf.Pow(lerp, 3); // shape the lerp for better presentation + lerp = MathUtilsExt.SmoothInOutLerpFloat(lerp); // shape the lerp for better presentation var viewerScale = getViewerScale(); tooltipTransform.localScale = m_TooltipScale * lerp * viewerScale; From 13e13f63d9b7a6a8e3a2c3cf852ba203070c754e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 16:21:01 -0700 Subject: [PATCH 050/870] Remove unused function member in TwoHandedProxyBase --- Scripts/Proxies/TwoHandedProxyBase.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs b/Scripts/Proxies/TwoHandedProxyBase.cs index 870b6b177..a94cbc42d 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs +++ b/Scripts/Proxies/TwoHandedProxyBase.cs @@ -280,7 +280,6 @@ IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair) //deviceMaterial.SetColor(k_MaterialColorBottomProperty, m_OriginalInsetGradientPair.b); //m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); //deviceMaterial.SetFloat(k_MaterialExpandProperty, 0); - var currentAlpha = deviceMaterial.GetFloat(k_MaterialAlphaProperty); var currentThickness = deviceMaterial.GetFloat(k_MaterialThicknessProperty); var currentTopColor = deviceMaterial.GetColor(k_MaterialColorTopProperty); var currentBottomColor = deviceMaterial.GetColor(k_MaterialColorBottomProperty); From 091036e03c22b582d0b4a5784e8a218a43f1e333 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 16:32:50 -0700 Subject: [PATCH 051/870] Add initial support for pinned tool button highlight-previews(on opposite device) when hovering a main menu button --- Menus/MainMenu/MainMenu.cs | 5 +++ Menus/MainMenu/Scripts/MainMenuButton.cs | 16 +++++++++ Scripts/Core/EditorVR.Menus.cs | 1 + Scripts/Core/EditorVR.Tools.cs | 20 ++++++++++- Scripts/Interfaces/IMainMenu.cs | 10 ++++++ Scripts/UI/PinnedToolButton.cs | 46 +++++++++++++++++++----- 6 files changed, 89 insertions(+), 9 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 947b5d85c..c4578790d 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -75,6 +75,7 @@ public bool visible public Transform targetRayOrigin { private get; set; } public Func isToolActive { private get; set; } public Type proxyType { private get; set; } + public Func previewToolInPinnedToolButton { private get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } @@ -174,6 +175,10 @@ private void CreateFaceButtons(List types) createWorkspace(selectedType); }); } + + // Assign pinned tool button preview properties + b.toolType = selectedType; + b.previewToolInPinnedToolButton = previewToolInPinnedToolButton; }); } } diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 8199b1379..33b18bca2 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; using UnityEngine.UI; @@ -18,6 +19,14 @@ sealed class MainMenuButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler Transform m_HoveringRayOrigin; Color m_OriginalColor; + PinnedToolButton m_HighlightedPinnedToolbutton; + + /// + /// Highlights a pinned tool button when this menu button is highlighted + /// + public Func previewToolInPinnedToolButton { private get; set; } + + public Type toolType { get; set; } public bool selected { @@ -55,12 +64,19 @@ public void OnRayEnter(RayEventData eventData) { // Track which pointer is over us, so this information can supply context (e.g. selecting a tool for a different hand) m_HoveringRayOrigin = eventData.rayOrigin; + + // Enable preview-mode on a pinned tool button; Display on the opposite proxy device via the HoveringRayOrigin + m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(m_HoveringRayOrigin, toolType); } public void OnRayExit(RayEventData eventData) { if (m_HoveringRayOrigin == eventData.rayOrigin) m_HoveringRayOrigin = null; + + // Disable preview-mode on pinned tool button + if (m_HighlightedPinnedToolbutton) + m_HighlightedPinnedToolbutton.previewToolType = null; } } } diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index cab6f832e..ab79b89d6 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -309,6 +309,7 @@ internal IMainMenu SpawnMainMenu(Type type, InputDevice device, bool visible, ou input = evr.m_DeviceInputModule.CreateActionMapInputForObject(mainMenu, device); evr.m_Interfaces.ConnectInterfaces(mainMenu, device); mainMenu.visible = visible; + mainMenu.previewToolInPinnedToolButton = evr.m_Tools.PreviewToolInPinnedToolButton; return mainMenu; } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 37dfb9b12..02fd199f7 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Tools; @@ -367,6 +366,25 @@ internal void UpdatePlayerHandleMaps(List maps) } } } + + internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType) + { + // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions + if (!toolType.GetInterfaces().Contains(typeof(ITool))) + return null; + + PinnedToolButton pinnedToolButton = null; + evr.m_Rays.ForEachProxyDevice((deviceData) => + { + if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device + { + pinnedToolButton = deviceData.selectionToolButton.activeTool ? deviceData.selectionToolButton : deviceData.previousToolButton; + pinnedToolButton.previewToolType = toolType; + } + }); + + return pinnedToolButton; + } } } } diff --git a/Scripts/Interfaces/IMainMenu.cs b/Scripts/Interfaces/IMainMenu.cs index ebe6c1df7..cadb3e3d6 100644 --- a/Scripts/Interfaces/IMainMenu.cs +++ b/Scripts/Interfaces/IMainMenu.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Menus; using UnityEngine; namespace UnityEditor.Experimental.EditorVR @@ -32,6 +33,15 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Returns whether the active tool is of the same type /// Func isToolActive { set; } + + /// + /// Highlights a pinned tool button when a menu button is highlighted + /// Transform: Ray origin to check + /// Type: MenuButton's tool type to preview + /// Returns the unoccupied pinned tool button that will display the menu-button-tool preview while the button is highlighted + /// The returned PinnedToolButton has its preview mode disabled upon a ray exit of the menu button + /// + Func previewToolInPinnedToolButton { set; } } } #endif diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index a3c052e69..bc8ebb8c3 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement + public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility { public Type toolType { @@ -32,8 +32,9 @@ public Type toolType { if (isSelectTool) { - tooltipText = "Selection TOOL"; + tooltipText = "Selection Tool (cannot be closed)"; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair + activeTool = true; } else { @@ -105,7 +106,7 @@ public Vector3 activePosition Vector3 m_ActivePosition; /// - /// gradientPair should be set with new random gradientPair each time a new Tool is associated with this Button + /// GradientPair should be set with new random gradientPair each time a new Tool is associated with this Button /// This gradientPair is also used to highlight the input device when appropriate /// public GradientPair gradientPair @@ -115,15 +116,43 @@ public GradientPair gradientPair } GradientPair m_GradientPair; + /// + /// Type, that if not null, denotes that preview-mode is enabled + /// This is enabled when highlighting a tool on the main menu + /// + public Type previewToolType + { + set + { + m_previewToolType = value; + + if (m_previewToolType != null) // Show the highlight if the preview type is valid; hide otherwise + { + // Show the grayscale highlight when previewing a tool on this button + m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; + m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); + tooltipText = "Assign " + m_previewToolType.Name; + showTooltip(this); + } + else + { + SetButtonGradients(activeTool); + m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); + hideTooltip(this); + tooltipText = toolType.Name; + } + + m_GradientButton.highlighted = m_previewToolType != null; + } + } + Type m_previewToolType; + public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } string m_TooltipText; [SerializeField] GradientButton m_GradientButton; - //[SerializeField] - //Tooltip m_Tooltip; - public Transform tooltipTarget { get { return m_TooltipTarget; } } [SerializeField] Transform m_TooltipTarget; @@ -137,6 +166,8 @@ public GradientPair gradientPair public Func selectTool { private get; set; } public Node node { get; set; } public ITooltip tooltip { private get; set; } // Overrides text + public Action showTooltip { private get; set; } + public Action hideTooltip { private get; set; } bool isSelectTool { @@ -191,7 +222,6 @@ string GetTypeAbbreviation(Type type) void SetButtonGradients(bool active) { - Debug.LogWarning(m_ToolType.ToString() + "" + active + ""); if (active) { m_GradientButton.normalGradientPair = gradientPair; @@ -216,7 +246,7 @@ IEnumerator AnimatePosition() while (duration < 1) { duration += Time.unscaledDeltaTime * 3; - var durationShaped = Mathf.Pow(duration, 4); + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); yield return null; } From e22583f9aa749891533218592c71513851514337 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 18:29:36 -0700 Subject: [PATCH 052/870] Add new ISetCustomHighlightColor interface; decorates a class with the functionality to define a custom tooltip highlight color gradient --- Scripts/Interfaces/ISetCustomTooltipColor.cs | 17 +++++++++++++++++ .../Interfaces/ISetCustomTooltipColor.cs.meta | 12 ++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Scripts/Interfaces/ISetCustomTooltipColor.cs create mode 100644 Scripts/Interfaces/ISetCustomTooltipColor.cs.meta diff --git a/Scripts/Interfaces/ISetCustomTooltipColor.cs b/Scripts/Interfaces/ISetCustomTooltipColor.cs new file mode 100644 index 000000000..6fe88e889 --- /dev/null +++ b/Scripts/Interfaces/ISetCustomTooltipColor.cs @@ -0,0 +1,17 @@ +using UnityEditor.Experimental.EditorVR.Helpers; + +#if UNITY_EDITOR +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Decorates classes which can specify custom tool tip colors + /// + public interface ISetCustomTooltipColor + { + /// + /// Custom tooltip highlight color + /// + GradientPair customToolTipHighlightColor { get; } + } +} +#endif \ No newline at end of file diff --git a/Scripts/Interfaces/ISetCustomTooltipColor.cs.meta b/Scripts/Interfaces/ISetCustomTooltipColor.cs.meta new file mode 100644 index 000000000..429d57276 --- /dev/null +++ b/Scripts/Interfaces/ISetCustomTooltipColor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c5f14d351f5d233438db90fae66b5bd9 +timeCreated: 1490057704 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 17c1b9145e1d39c4c4926709609030c51f5235fd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 18:30:37 -0700 Subject: [PATCH 053/870] Add custom highlight gradient/color support to ToolTips (that implements ISetCustomTooltipColor) in the ToolTipModule --- Scripts/Modules/TooltipModule/TooltipModule.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index dc4a6c791..afc58c802 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -41,6 +41,7 @@ class TooltipData Transform m_TooltipCanvas; Vector3 m_TooltipScale; Color m_OriginalBackgroundColor; + Material m_CustomHighlightMaterial; public Func getViewerScale { private get; set; } @@ -50,6 +51,7 @@ void Start() m_TooltipCanvas.SetParent(transform); m_TooltipScale = m_TooltipPrefab.transform.localScale; m_HighlightMaterial = Instantiate(m_HighlightMaterial); + m_CustomHighlightMaterial = Instantiate(m_HighlightMaterial); m_TooltipBackgroundMaterial = Instantiate(m_TooltipBackgroundMaterial); m_OriginalBackgroundColor = m_TooltipBackgroundMaterial.color; var sessionGradient = UnityBrandColorScheme.sessionGradient; @@ -121,6 +123,14 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa tooltipText.color = Color.Lerp(Color.clear, Color.white, lerp); } + var customToolTipColor = tooltip as ISetCustomTooltipColor; + if (customToolTipColor != null) + { + tooltipUI.highlight.material= m_CustomHighlightMaterial; + m_CustomHighlightMaterial.SetColor(k_MaterialColorTopProperty, customToolTipColor.customToolTipHighlightColor.a); + m_CustomHighlightMaterial.SetColor(k_MaterialColorBottomProperty, customToolTipColor.customToolTipHighlightColor.b); + } + m_TooltipBackgroundMaterial.SetColor("_Color", Color.Lerp(Color.clear, m_OriginalBackgroundColor, lerp)); var placement = tooltip as ITooltipPlacement; From 28b9d0e2d31356f345bf59d7e05c0313e267f0af Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 18:31:33 -0700 Subject: [PATCH 054/870] Implement custom tooltip highlight color functionality in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index bc8ebb8c3..39a38d8ec 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility + public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor { public Type toolType { @@ -112,7 +112,11 @@ public Vector3 activePosition public GradientPair gradientPair { get { return m_GradientPair; } - private set { m_GradientPair = value; } + private set + { + m_GradientPair = value; + customToolTipHighlightColor = value; + } } GradientPair m_GradientPair; @@ -132,14 +136,16 @@ public Type previewToolType m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); tooltipText = "Assign " + m_previewToolType.Name; + customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; showTooltip(this); } else { SetButtonGradients(activeTool); m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); + customToolTipHighlightColor = gradientPair; hideTooltip(this); - tooltipText = toolType.Name; + tooltipText = isSelectTool ? tooltipText = "Selection Tool (cannot be closed)" : toolType.Name; } m_GradientButton.highlighted = m_previewToolType != null; @@ -168,6 +174,7 @@ public Type previewToolType public ITooltip tooltip { private get; set; } // Overrides text public Action showTooltip { private get; set; } public Action hideTooltip { private get; set; } + public GradientPair customToolTipHighlightColor { get; set; } bool isSelectTool { From 2820f89c8bfca328e48bf0e73e5aadc2b8e09264 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 20 Mar 2017 18:33:45 -0700 Subject: [PATCH 055/870] Slightly increase opacity of hidden/semi-transparent RadialMenuSlots --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 09d25a906..f47510068 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -227,7 +227,7 @@ void Awake() m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); var frameMaterialColor = m_FrameMaterial.color; s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); - m_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.125f); + m_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); } void OnDisable() @@ -467,7 +467,7 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); var targetInsetAlpha = makeSemiTransparent ? 0.25f : 1f; var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); - var targetIconColor = makeSemiTransparent ? m_SemiTransparentFrameColor * 2 : Color.white; + var targetIconColor = makeSemiTransparent ? m_SemiTransparentFrameColor : Color.white; var currentInsetScale = m_MenuInset.localScale; var targetInsetScale = makeSemiTransparent ? m_HighlightedInsetLocalScale * 4 : m_VisibleInsetLocalScale; var currentIconScale = m_IconContainer.localScale; From 88be3bab82157a5cefad617db8e31a114eaec5b7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 21 Mar 2017 13:15:17 -0700 Subject: [PATCH 056/870] Refactor PinnedToolButton logic in SelectTool; move into separate functions, in preparation for 3+ tool button support (beyond current 2 button support) --- Scripts/Core/EditorVR.Tools.cs | 58 ++++++++++++++++++++++++---------- Scripts/Core/EditorVR.cs | 2 +- 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 02fd199f7..0ae263f0d 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -87,7 +87,7 @@ internal void SpawnDefaultTools(IProxy proxy) var pinnedToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); // Active button offset from the main menu activator var pinnedToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); - deviceData.previousToolButton = pinnedToolButton; + deviceData.pinnedToolButton = pinnedToolButton; var pinnedToolButtonTransform = pinnedToolButton.transform; pinnedToolButtonTransform.SetParent(mainMenuActivator.transform, false); pinnedToolButton.activePosition = pinnedToolButtonActivePosition; @@ -162,9 +162,9 @@ internal bool IsToolActive(Transform targetRayOrigin, Type toolType) internal bool SelectTool(Transform rayOrigin, Type toolType) { - Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); - if (toolType == typeof(SelectionTool)) - Debug.LogError("!!!!! SelectionTool detected"); + //Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); + //if (toolType == typeof(SelectionTool)) + //Debug.LogError("!!!!! SelectionTool detected"); var result = false; evr.m_Rays.ForEachProxyDevice((deviceData) => @@ -220,22 +220,14 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) if (setSelectAsCurrentTool) deviceData.selectionToolButton.toolType = toolType; // assign the selection tool to the selection tool button else - deviceData.previousToolButton.toolType = toolType; // assign the new current tool type to the additional tool button + AddPinnedToolButton(deviceData, toolType); - deviceData.previousToolButton.rayOrigin = rayOrigin; + deviceData.pinnedToolButton.rayOrigin = rayOrigin; deviceData.selectionToolButton.rayOrigin = rayOrigin; } } - var currentToolIsSelect = deviceData.currentTool is ILocomotor; - Debug.LogError("currentToolIsSelect : " + currentToolIsSelect); - Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " - selection is current tool : " + setSelectAsCurrentTool); - var highlightGradientPair = currentToolIsSelect ? deviceData.selectionToolButton.gradientPair : deviceData.previousToolButton.gradientPair; - deviceData.proxy.HighlightDevice(deviceData.node, highlightGradientPair); // Perform the higlight on the node with the button's gradient pair - deviceData.previousToolButton.activeTool = !currentToolIsSelect; - deviceData.selectionToolButton.activeTool = currentToolIsSelect; - - + SetupPinnedToolButtonsForDevice(deviceData); evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; } @@ -248,6 +240,40 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) return result; } + void AddPinnedToolButton(DeviceData deviceData, Type toolType) + { + // CHECK FOR TOOL ALREADY ADDED AS AN EXISTING PIN, RETURN THE BUTTON GRADIENT + deviceData.pinnedToolButton.toolType = toolType; // assign the new current tool type to the additional tool button + + //return new GradientPair(); + } + + PinnedToolButton SetupPinnedToolButtonsForDevice(DeviceData deviceData) + { + PinnedToolButton activeButton = null; + + if (deviceData.currentTool is ILocomotor) // Verify that Selection is not already the currently active tool + { + Debug.LogError("currentToolIsSelect <--"); + activeButton = deviceData.selectionToolButton; + activeButton.activeTool = true; + deviceData.pinnedToolButton.activeTool = false; // ITERATE OVER ALL TOOL BUTTONS except for selection + } + else + { + // activeButton = ITERATE OVER ALL TOOL BUTTONS except for selection + activeButton = deviceData.pinnedToolButton; + deviceData.selectionToolButton.activeTool = false; + deviceData.pinnedToolButton.activeTool = true; // ITERATE OVER ALL TOOL BUTTONS except for selection + // Iternate over the pinnedToolButton array/list searching for the active tool + } + + Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " - selection is current tool : " + (activeButton == deviceData.selectionToolButton)); + deviceData.proxy.HighlightDevice(deviceData.node, activeButton.gradientPair); // Perform the higlight on the node with the button's gradient pair + + return activeButton; + } + void DespawnTool(DeviceData deviceData, ITool tool) { if (!IsPermanentTool(tool.GetType())) @@ -378,7 +404,7 @@ internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Ty { if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device { - pinnedToolButton = deviceData.selectionToolButton.activeTool ? deviceData.selectionToolButton : deviceData.previousToolButton; + pinnedToolButton = deviceData.selectionToolButton.activeTool ? deviceData.selectionToolButton : deviceData.pinnedToolButton; pinnedToolButton.previewToolType = toolType; } }); diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index cf48ccc71..eefd2bc2c 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -91,7 +91,7 @@ class DeviceData public ActionMapInput alternateMenuInput; public ITool currentTool; public IMenu customMenu; - public PinnedToolButton previousToolButton; + public PinnedToolButton pinnedToolButton; public PinnedToolButton selectionToolButton; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); From 5bde94dba1e4feb4b54a61b193fbfd0c608d847b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 21 Mar 2017 14:16:09 -0700 Subject: [PATCH 057/870] Make getter for ActivePosition public in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 39a38d8ec..d281a99bc 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -96,7 +96,7 @@ public bool activeTool // use this externally to make visible & move a button to public Vector3 activePosition { - private get { return m_ActivePosition; } + get { return m_ActivePosition; } set { m_ActivePosition = value; From 76c3e830868a0d44a16be5492a0673700b384005 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 21 Mar 2017 14:17:57 -0700 Subject: [PATCH 058/870] Refactor DeviceData's PinnedToolButton to a List in order to support 3+ buttons with specific ordering of visual elements --- Scripts/Core/EditorVR.Tools.cs | 59 ++++++++++++++++++++++------------ Scripts/Core/EditorVR.cs | 2 +- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 0ae263f0d..056b7089b 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -85,22 +85,15 @@ internal void SpawnDefaultTools(IProxy proxy) mainMenuActivator.hoverStarted += evrMenus.OnMainMenuActivatorHoverStarted; mainMenuActivator.hoverEnded += evrMenus.OnMainMenuActivatorHoverEnded; - var pinnedToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); // Active button offset from the main menu activator - var pinnedToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); - deviceData.pinnedToolButton = pinnedToolButton; - var pinnedToolButtonTransform = pinnedToolButton.transform; - pinnedToolButtonTransform.SetParent(mainMenuActivator.transform, false); - pinnedToolButton.activePosition = pinnedToolButtonActivePosition; - pinnedToolButton.node = deviceData.node; - + var toolButtonActivePosition = new Vector3(0f, 0f, -0.035f); // Frontmost active button offset from the main menu activator var selectionToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); - deviceData.selectionToolButton = selectionToolButton; var selectionToolButtonTransform = selectionToolButton.transform; + deviceData.pinnedToolButtons = new List(); + deviceData.selectionToolButton = selectionToolButton; selectionToolButtonTransform.SetParent(mainMenuActivator.transform, false); - selectionToolButton.activePosition = pinnedToolButtonActivePosition; + selectionToolButton.activePosition = toolButtonActivePosition; selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default selectionToolButton.node = deviceData.node; - //selectionToolButton.activeTool = true; // Selection tool button is always visible, and defaults as the active tool button var alternateMenu = evrMenus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); deviceData.alternateMenu = alternateMenu; @@ -222,12 +215,12 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) else AddPinnedToolButton(deviceData, toolType); - deviceData.pinnedToolButton.rayOrigin = rayOrigin; + //deviceData.pinnedToolButtons.rayOrigin = rayOrigin; deviceData.selectionToolButton.rayOrigin = rayOrigin; } } - SetupPinnedToolButtonsForDevice(deviceData); + SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, toolType); evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; } @@ -243,12 +236,25 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) void AddPinnedToolButton(DeviceData deviceData, Type toolType) { // CHECK FOR TOOL ALREADY ADDED AS AN EXISTING PIN, RETURN THE BUTTON GRADIENT - deviceData.pinnedToolButton.toolType = toolType; // assign the new current tool type to the additional tool button + foreach (var button in deviceData.pinnedToolButtons) + { + if (button.toolType == toolType) + return; + } - //return new GradientPair(); + var evrMenus = evr.m_Menus; + var pinnedToolButton = evrMenus.SpawnPinnedToolButton(deviceData.inputDevice); + var pinnedToolButtonTransform = pinnedToolButton.transform; + deviceData.pinnedToolButtons.Add(pinnedToolButton); + pinnedToolButtonTransform.SetParent(deviceData.mainMenuActivator.transform, false); + pinnedToolButton.activePosition = deviceData.selectionToolButton.activePosition; + pinnedToolButton.node = deviceData.node; + pinnedToolButton.activeTool = true; + pinnedToolButton.toolType = toolType; // assign/setup the new current tool type in the new tool button + deviceData.selectionToolButton.activeTool = false; } - PinnedToolButton SetupPinnedToolButtonsForDevice(DeviceData deviceData) + PinnedToolButton SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) { PinnedToolButton activeButton = null; @@ -257,15 +263,26 @@ PinnedToolButton SetupPinnedToolButtonsForDevice(DeviceData deviceData) Debug.LogError("currentToolIsSelect <--"); activeButton = deviceData.selectionToolButton; activeButton.activeTool = true; - deviceData.pinnedToolButton.activeTool = false; // ITERATE OVER ALL TOOL BUTTONS except for selection + foreach (var button in deviceData.pinnedToolButtons) + { + button.rayOrigin = rayOrigin; + button.activeTool = false; + } } else { // activeButton = ITERATE OVER ALL TOOL BUTTONS except for selection - activeButton = deviceData.pinnedToolButton; deviceData.selectionToolButton.activeTool = false; - deviceData.pinnedToolButton.activeTool = true; // ITERATE OVER ALL TOOL BUTTONS except for selection - // Iternate over the pinnedToolButton array/list searching for the active tool + foreach (var button in deviceData.pinnedToolButtons) + { + button.rayOrigin = rayOrigin; + button.activeTool = button.toolType == activeToolType; + + if (button.activeTool) + activeButton = button; + } + //deviceData.pinnedToolButtons.activeTool = true; // ITERATE OVER ALL TOOL BUTTONS except for selection + // Iternate over the pinnedToolButtons array/list searching for the active tool } Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " - selection is current tool : " + (activeButton == deviceData.selectionToolButton)); @@ -404,7 +421,7 @@ internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Ty { if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device { - pinnedToolButton = deviceData.selectionToolButton.activeTool ? deviceData.selectionToolButton : deviceData.pinnedToolButton; + pinnedToolButton = deviceData.selectionToolButton.activeTool ? deviceData.selectionToolButton : deviceData.pinnedToolButtons.FirstOrDefault( (x) => x.activeTool); pinnedToolButton.previewToolType = toolType; } }); diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index eefd2bc2c..7b969dccd 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -91,7 +91,7 @@ class DeviceData public ActionMapInput alternateMenuInput; public ITool currentTool; public IMenu customMenu; - public PinnedToolButton pinnedToolButton; + public List pinnedToolButtons; // using a list in order to rely on order for positioning of visual elements public PinnedToolButton selectionToolButton; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); From 7820653b2597c4e2d1cfeea3924d95c785b827dd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 21 Mar 2017 19:56:33 -0700 Subject: [PATCH 059/870] Add support for 3+ pinned tool buttons per proxy device, including the ability to swap between them --- Scripts/Core/EditorVR.Tools.cs | 82 ++++++++++++++++++++++------------ Scripts/Core/EditorVR.cs | 1 - Scripts/UI/PinnedToolButton.cs | 46 ++++++++++++------- 3 files changed, 85 insertions(+), 44 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 056b7089b..ada358e40 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -85,20 +85,21 @@ internal void SpawnDefaultTools(IProxy proxy) mainMenuActivator.hoverStarted += evrMenus.OnMainMenuActivatorHoverStarted; mainMenuActivator.hoverEnded += evrMenus.OnMainMenuActivatorHoverEnded; + var alternateMenu = evrMenus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); + deviceData.alternateMenu = alternateMenu; + deviceData.menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; + alternateMenu.itemWasSelected += evrMenus.UpdateAlternateMenuOnSelectionChanged; + var toolButtonActivePosition = new Vector3(0f, 0f, -0.035f); // Frontmost active button offset from the main menu activator + PinnedToolButton.activePosition = toolButtonActivePosition; // Shared active button position var selectionToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); var selectionToolButtonTransform = selectionToolButton.transform; deviceData.pinnedToolButtons = new List(); - deviceData.selectionToolButton = selectionToolButton; - selectionToolButtonTransform.SetParent(mainMenuActivator.transform, false); - selectionToolButton.activePosition = toolButtonActivePosition; selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default + deviceData.pinnedToolButtons.Add(selectionToolButton); + selectionToolButton.order = 0; // The "active" tool occupies the zeroth position + selectionToolButtonTransform.SetParent(mainMenuActivator.transform, false); selectionToolButton.node = deviceData.node; - - var alternateMenu = evrMenus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); - deviceData.alternateMenu = alternateMenu; - deviceData.menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; - alternateMenu.itemWasSelected += evrMenus.UpdateAlternateMenuOnSelectionChanged; } evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); @@ -211,12 +212,18 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) AddToolToStack(dd, newTool); if (setSelectAsCurrentTool) - deviceData.selectionToolButton.toolType = toolType; // assign the selection tool to the selection tool button + { + foreach (var button in deviceData.pinnedToolButtons) + { + //if (button.isSelectTool) + //button.toolType = toolType; // assign the selection tool to the selection tool button + } + } else AddPinnedToolButton(deviceData, toolType); //deviceData.pinnedToolButtons.rayOrigin = rayOrigin; - deviceData.selectionToolButton.rayOrigin = rayOrigin; + //deviceData.selectionToolButton.rayOrigin = rayOrigin; } } @@ -238,57 +245,68 @@ void AddPinnedToolButton(DeviceData deviceData, Type toolType) // CHECK FOR TOOL ALREADY ADDED AS AN EXISTING PIN, RETURN THE BUTTON GRADIENT foreach (var button in deviceData.pinnedToolButtons) { + // Return if tooltype already occupies a pinned tool button if (button.toolType == toolType) return; } + // Offset each button to a position greater than the first (the active tool position) + foreach (var button in deviceData.pinnedToolButtons) + { + button.order++; + } + var evrMenus = evr.m_Menus; var pinnedToolButton = evrMenus.SpawnPinnedToolButton(deviceData.inputDevice); var pinnedToolButtonTransform = pinnedToolButton.transform; deviceData.pinnedToolButtons.Add(pinnedToolButton); pinnedToolButtonTransform.SetParent(deviceData.mainMenuActivator.transform, false); - pinnedToolButton.activePosition = deviceData.selectionToolButton.activePosition; + //pinnedToolButton.activePosition = deviceData.pinnedToolButtons[0].activePosition; pinnedToolButton.node = deviceData.node; - pinnedToolButton.activeTool = true; pinnedToolButton.toolType = toolType; // assign/setup the new current tool type in the new tool button - deviceData.selectionToolButton.activeTool = false; + pinnedToolButton.order = 0; // Set this tool button's order as first in the list (the active tool slot) } - PinnedToolButton SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) + void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) { + Debug.LogError("Setting up pinned tool button : " + activeToolType); PinnedToolButton activeButton = null; - if (deviceData.currentTool is ILocomotor) // Verify that Selection is not already the currently active tool { - Debug.LogError("currentToolIsSelect <--"); - activeButton = deviceData.selectionToolButton; - activeButton.activeTool = true; + Debug.LogError("currentToolIsSelectTool <--"); + //activeButton.activeTool = true; + var order = 0; foreach (var button in deviceData.pinnedToolButtons) { button.rayOrigin = rayOrigin; - button.activeTool = false; + button.order = button.toolType == activeToolType ? 0 : ++order; // Set selection tool as the active/first tool button + + if (button.order == 0) + activeButton = button; } + + //activeButton = deviceData.pinnedToolButtons[0]; // deviceData.selectionToolButton; } else { - // activeButton = ITERATE OVER ALL TOOL BUTTONS except for selection - deviceData.selectionToolButton.activeTool = false; + Debug.LogError("Setting up tool button for NON-SELECTION TOOL<--"); + //if (deviceData.selectionToolButton.order == 0) + // deviceData.selectionToolButton.order++; + var order = 0; foreach (var button in deviceData.pinnedToolButtons) { button.rayOrigin = rayOrigin; - button.activeTool = button.toolType == activeToolType; + button.order = button.toolType == activeToolType ? 0 : ++order; - if (button.activeTool) + if (button.order == 0) activeButton = button; } //deviceData.pinnedToolButtons.activeTool = true; // ITERATE OVER ALL TOOL BUTTONS except for selection // Iternate over the pinnedToolButtons array/list searching for the active tool } - Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " - selection is current tool : " + (activeButton == deviceData.selectionToolButton)); + Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " - selection is current tool : " + (activeButton == deviceData.pinnedToolButtons[0].isSelectTool)); deviceData.proxy.HighlightDevice(deviceData.node, activeButton.gradientPair); // Perform the higlight on the node with the button's gradient pair - - return activeButton; } void DespawnTool(DeviceData deviceData, ITool tool) @@ -421,8 +439,16 @@ internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Ty { if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device { - pinnedToolButton = deviceData.selectionToolButton.activeTool ? deviceData.selectionToolButton : deviceData.pinnedToolButtons.FirstOrDefault( (x) => x.activeTool); - pinnedToolButton.previewToolType = toolType; + var pinnedToolButtons = deviceData.pinnedToolButtons; + for (int i = 0; i < pinnedToolButtons.Count; ++i) + { + if (pinnedToolButtons[i].order == 0) + { + pinnedToolButton = pinnedToolButtons[i]; + pinnedToolButton.previewToolType = toolType; + break; + } + } } }); diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 7b969dccd..624075def 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -92,7 +92,6 @@ class DeviceData public ITool currentTool; public IMenu customMenu; public List pinnedToolButtons; // using a list in order to rely on order for positioning of visual elements - public PinnedToolButton selectionToolButton; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index d281a99bc..c29d2b5a4 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -12,6 +12,17 @@ namespace UnityEditor.Experimental.EditorVR.Menus { public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor { + public static Vector3 activePosition + { + get { return s_ActivePosition; } + set + { + s_ActivePosition = value; + //m_InactivePosition = value * 2f; // additional offset for the button when it is visible and inactive + } + } + static Vector3 s_ActivePosition; + public Type toolType { get @@ -24,7 +35,7 @@ public Type toolType if (m_ToolType == value) return; - Debug.LogError("PinnedToolButton setting TYPE : " + value.ToString() + ""); + //Debug.LogError("PinnedToolButton setting TYPE : " + value.ToString() + ""); m_GradientButton.gameObject.SetActive(true); m_ToolType = value; @@ -57,7 +68,7 @@ public Type toolType } Type m_ToolType; - public bool activeTool // use this externally to make visible & move a button to the active/inactive position + bool activeTool // use this externally to make visible & move a button to the active/inactive position { get { return m_ActiveTool; } set @@ -67,8 +78,8 @@ public bool activeTool // use this externally to make visible & move a button to m_ActiveTool = value; - if (m_ToolType != null) - Debug.LogError(m_ToolType.ToString() + " : PinnedToolButton ACTIVE : " + value); + //if (m_ToolType != null) + //Debug.LogError(m_ToolType.ToString() + " : PinnedToolButton ACTIVE : " + value); if (m_ActiveTool) { @@ -79,14 +90,14 @@ public bool activeTool // use this externally to make visible & move a button to } // Perform re-position coroutine here - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); - transform.localPosition = activePosition; + //order = 0; + //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); } else { - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); + //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); //gameObject.SetActive(false); - transform.localPosition = m_InactivePosition; + //transform.localPosition = m_InactivePosition; } SetButtonGradients(m_ActiveTool); @@ -94,16 +105,21 @@ public bool activeTool // use this externally to make visible & move a button to } bool m_ActiveTool; - public Vector3 activePosition + public int order { - get { return m_ActivePosition; } + get { return m_Order; } set { - m_ActivePosition = value; - m_InactivePosition = value * 2f; // additional offset for the button when it is visible and inactive + m_Order = value; // Position of this button in relation to other pinned tool buttons + //if (m_Order == 0) + var zerothPosition = m_Order == 0; + activeTool = zerothPosition; + m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive + transform.localPosition = zerothPosition ? activePosition : m_InactivePosition; + Debug.LogError(m_ToolType.ToString() + " : Order : " + m_Order + " / " + value); } } - Vector3 m_ActivePosition; + int m_Order; /// /// GradientPair should be set with new random gradientPair each time a new Tool is associated with this Button @@ -176,13 +192,13 @@ public Type previewToolType public Action hideTooltip { private get; set; } public GradientPair customToolTipHighlightColor { get; set; } - bool isSelectTool + public bool isSelectTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } - Vector3 m_InactivePosition; // Inactive button offset from the main menu activator Coroutine m_PositionCoroutine; + Vector3 m_InactivePosition; // Inactive button offset from the main menu activator void Start() { From c6661f7ea7ba9898da0af5c42326d3254ab4f268 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 21 Mar 2017 20:14:47 -0700 Subject: [PATCH 060/870] Add animated position swapping support to pinned tool button; remove ActiveTool backer and property logic --- Scripts/UI/PinnedToolButton.cs | 48 +++++----------------------------- 1 file changed, 6 insertions(+), 42 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index c29d2b5a4..d1a830740 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -45,7 +45,6 @@ public Type toolType { tooltipText = "Selection Tool (cannot be closed)"; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair - activeTool = true; } else { @@ -68,43 +67,6 @@ public Type toolType } Type m_ToolType; - bool activeTool // use this externally to make visible & move a button to the active/inactive position - { - get { return m_ActiveTool; } - set - { - //if (value == m_ActiveTool) - //return; - - m_ActiveTool = value; - - //if (m_ToolType != null) - //Debug.LogError(m_ToolType.ToString() + " : PinnedToolButton ACTIVE : " + value); - - if (m_ActiveTool) - { - if (m_ToolType == null) - { - //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); - gameObject.SetActive(m_ActiveTool); - } - - // Perform re-position coroutine here - //order = 0; - //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); - } - else - { - //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); - //gameObject.SetActive(false); - //transform.localPosition = m_InactivePosition; - } - - SetButtonGradients(m_ActiveTool); - } - } - bool m_ActiveTool; - public int order { get { return m_Order; } @@ -112,10 +74,11 @@ public int order { m_Order = value; // Position of this button in relation to other pinned tool buttons //if (m_Order == 0) - var zerothPosition = m_Order == 0; - activeTool = zerothPosition; m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive - transform.localPosition = zerothPosition ? activePosition : m_InactivePosition; + //transform.localPosition = activeTool ? activePosition : m_InactivePosition; + SetButtonGradients(activeTool); + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); + Debug.LogError(m_ToolType.ToString() + " : Order : " + m_Order + " / " + value); } } @@ -197,6 +160,7 @@ public bool isSelectTool get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } + bool activeTool { get { return m_Order == 0; } } Coroutine m_PositionCoroutine; Vector3 m_InactivePosition; // Inactive button offset from the main menu activator @@ -265,7 +229,7 @@ IEnumerator AnimatePosition() { var duration = 0f; var currentPosition = transform.localPosition; - var targetPosition = m_ActiveTool ? activePosition : m_InactivePosition; + var targetPosition = activeTool ? activePosition : m_InactivePosition; while (duration < 1) { duration += Time.unscaledDeltaTime * 3; From 428b4f43b68852b34a745011c630a2d38df70ce8 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 21 Mar 2017 20:37:16 -0700 Subject: [PATCH 061/870] Enable the MakeCubeTool's inclusion in the MainMenu for testing --- Tools/Temp/MakeCubeTool.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/Temp/MakeCubeTool.cs b/Tools/Temp/MakeCubeTool.cs index d8eef5b2b..bfaf80786 100644 --- a/Tools/Temp/MakeCubeTool.cs +++ b/Tools/Temp/MakeCubeTool.cs @@ -6,8 +6,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - //[MainMenuItem("Cube", "Create", "Create cubes in the scene")] - [MainMenuItem(false)] + [MainMenuItem("Cube", "Create", "Create cubes in the scene")] + //[MainMenuItem(false)] sealed class MakeCubeTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IActions, IUsesSpatialHash { class CubeToolAction : IAction From 88804a7f6d279171386a868c90701f36ba2ae6ec Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 21 Mar 2017 20:48:51 -0700 Subject: [PATCH 062/870] Disable IActions in MakeCubeTool; used for testing --- Tools/Temp/MakeCubeTool.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/Temp/MakeCubeTool.cs b/Tools/Temp/MakeCubeTool.cs index bfaf80786..3df64b616 100644 --- a/Tools/Temp/MakeCubeTool.cs +++ b/Tools/Temp/MakeCubeTool.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Cube", "Create", "Create cubes in the scene")] //[MainMenuItem(false)] - sealed class MakeCubeTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IActions, IUsesSpatialHash + sealed class MakeCubeTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesSpatialHash { class CubeToolAction : IAction { From 3bc2063188396715a6911df561422db34b80370f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 21 Mar 2017 21:38:00 -0700 Subject: [PATCH 063/870] Convert DeviceData's pinnedToolButton's collection into Dictionary (previously a list); reduce logic in SelectTool(), AddPinnedToolButton(), & SetupPinnedToolButtonsForDevice() --- Scripts/Core/EditorVR.Tools.cs | 96 +++++++++------------------------- Scripts/Core/EditorVR.cs | 2 +- 2 files changed, 27 insertions(+), 71 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index ada358e40..f150c940a 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -94,9 +94,9 @@ internal void SpawnDefaultTools(IProxy proxy) PinnedToolButton.activePosition = toolButtonActivePosition; // Shared active button position var selectionToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); var selectionToolButtonTransform = selectionToolButton.transform; - deviceData.pinnedToolButtons = new List(); + deviceData.pinnedToolButtons = new Dictionary(); selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default - deviceData.pinnedToolButtons.Add(selectionToolButton); + deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); selectionToolButton.order = 0; // The "active" tool occupies the zeroth position selectionToolButtonTransform.SetParent(mainMenuActivator.transform, false); selectionToolButton.node = deviceData.node; @@ -211,19 +211,8 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) AddToolToStack(dd, newTool); - if (setSelectAsCurrentTool) - { - foreach (var button in deviceData.pinnedToolButtons) - { - //if (button.isSelectTool) - //button.toolType = toolType; // assign the selection tool to the selection tool button - } - } - else + if (!setSelectAsCurrentTool) AddPinnedToolButton(deviceData, toolType); - - //deviceData.pinnedToolButtons.rayOrigin = rayOrigin; - //deviceData.selectionToolButton.rayOrigin = rayOrigin; } } @@ -242,71 +231,37 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) void AddPinnedToolButton(DeviceData deviceData, Type toolType) { - // CHECK FOR TOOL ALREADY ADDED AS AN EXISTING PIN, RETURN THE BUTTON GRADIENT - foreach (var button in deviceData.pinnedToolButtons) - { - // Return if tooltype already occupies a pinned tool button - if (button.toolType == toolType) - return; - } + var pinnedToolButtons = deviceData.pinnedToolButtons; + if (pinnedToolButtons.ContainsKey(toolType)) // Return if tooltype already occupies a pinned tool button + return; - // Offset each button to a position greater than the first (the active tool position) - foreach (var button in deviceData.pinnedToolButtons) + // Before adding new button, offset each button to a position greater than the zeroth/active tool position + foreach (var pair in pinnedToolButtons) { - button.order++; + pair.Value.order++; } - var evrMenus = evr.m_Menus; - var pinnedToolButton = evrMenus.SpawnPinnedToolButton(deviceData.inputDevice); - var pinnedToolButtonTransform = pinnedToolButton.transform; - deviceData.pinnedToolButtons.Add(pinnedToolButton); - pinnedToolButtonTransform.SetParent(deviceData.mainMenuActivator.transform, false); - //pinnedToolButton.activePosition = deviceData.pinnedToolButtons[0].activePosition; + var pinnedToolButton = evr.m_Menus.SpawnPinnedToolButton(deviceData.inputDevice); + pinnedToolButtons.Add(toolType, pinnedToolButton); + pinnedToolButton.transform.SetParent(deviceData.mainMenuActivator.transform, false); pinnedToolButton.node = deviceData.node; - pinnedToolButton.toolType = toolType; // assign/setup the new current tool type in the new tool button - pinnedToolButton.order = 0; // Set this tool button's order as first in the list (the active tool slot) + pinnedToolButton.toolType = toolType; // Assign Tool Type before assigning order + pinnedToolButton.order = 0; // Zeroth position is the active tool position } void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) { - Debug.LogError("Setting up pinned tool button : " + activeToolType); - PinnedToolButton activeButton = null; - if (deviceData.currentTool is ILocomotor) // Verify that Selection is not already the currently active tool - { - Debug.LogError("currentToolIsSelectTool <--"); - //activeButton.activeTool = true; - var order = 0; - foreach (var button in deviceData.pinnedToolButtons) - { - button.rayOrigin = rayOrigin; - button.order = button.toolType == activeToolType ? 0 : ++order; // Set selection tool as the active/first tool button - - if (button.order == 0) - activeButton = button; - } - - //activeButton = deviceData.pinnedToolButtons[0]; // deviceData.selectionToolButton; - } - else + Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); + var order = 0; + foreach (var pair in deviceData.pinnedToolButtons) { - Debug.LogError("Setting up tool button for NON-SELECTION TOOL<--"); - //if (deviceData.selectionToolButton.order == 0) - // deviceData.selectionToolButton.order++; - var order = 0; - foreach (var button in deviceData.pinnedToolButtons) - { - button.rayOrigin = rayOrigin; - button.order = button.toolType == activeToolType ? 0 : ++order; + var button = pair.Value; + button.rayOrigin = rayOrigin; + button.order = button.toolType == activeToolType ? 0 : ++order; - if (button.order == 0) - activeButton = button; - } - //deviceData.pinnedToolButtons.activeTool = true; // ITERATE OVER ALL TOOL BUTTONS except for selection - // Iternate over the pinnedToolButtons array/list searching for the active tool + if (button.order == 0) + deviceData.proxy.HighlightDevice(deviceData.node, button.gradientPair); // Perform the higlight on the node with the button's gradient pair } - - Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " - selection is current tool : " + (activeButton == deviceData.pinnedToolButtons[0].isSelectTool)); - deviceData.proxy.HighlightDevice(deviceData.node, activeButton.gradientPair); // Perform the higlight on the node with the button's gradient pair } void DespawnTool(DeviceData deviceData, ITool tool) @@ -440,11 +395,12 @@ internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Ty if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device { var pinnedToolButtons = deviceData.pinnedToolButtons; - for (int i = 0; i < pinnedToolButtons.Count; ++i) + foreach (var pair in pinnedToolButtons) { - if (pinnedToolButtons[i].order == 0) + var button = pair.Value; + if (button.order == 0) { - pinnedToolButton = pinnedToolButtons[i]; + pinnedToolButton = button; pinnedToolButton.previewToolType = toolType; break; } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 1617ed8c4..c0bca6125 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -91,7 +91,7 @@ class DeviceData public ActionMapInput alternateMenuInput; public ITool currentTool; public IMenu customMenu; - public List pinnedToolButtons; // using a list in order to rely on order for positioning of visual elements + public Dictionary pinnedToolButtons; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); } From fc1eb61420907ffe3fd5ee5a6fd1b40c5b119f94 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 22 Mar 2017 19:15:24 -0700 Subject: [PATCH 064/870] Add highlight scale inversion support to GradientButton --- Scripts/UI/GradientButton.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 4f8301bdb..f73459df9 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -102,6 +102,16 @@ public bool visible } bool m_Visible; + Vector3 originalScale + { + get { return invertHighlightScale ? m_HighlightContentContainerLocalScale : m_OriginalContentContainerLocalScale; } + } + + private Vector3 highlightScale + { + get { return invertHighlightScale ? m_OriginalContentContainerLocalScale : m_HighlightContentContainerLocalScale; } + } + public GradientPair normalGradientPair { get { return m_NormalGradientPair; } set { m_NormalGradientPair = value; } } [SerializeField] GradientPair m_NormalGradientPair; @@ -160,6 +170,7 @@ public bool visible Material m_ButtonMaterial; Vector3 m_OriginalIconLocalPosition; Vector3 m_OriginalContentContainerLocalScale; + Vector3 m_HighlightContentContainerLocalScale; Vector3 m_IconHighlightedLocalPosition; Vector3 m_IconPressedLocalPosition; Sprite m_OriginalIconSprite; @@ -173,6 +184,8 @@ public bool visible Coroutine m_HighlightCoroutine; Coroutine m_IconHighlightCoroutine; + public bool invertHighlightScale { private get; set; } + void Awake() { m_OriginalIconSprite = m_Icon.sprite; @@ -180,6 +193,7 @@ void Awake() m_OriginalLocalScale = transform.localScale; m_OriginalIconLocalPosition = m_IconContainer.localPosition; m_OriginalContentContainerLocalScale = m_ContentContainer.localScale; + m_HighlightContentContainerLocalScale = new Vector3(m_OriginalContentContainerLocalScale.x, m_OriginalContentContainerLocalScale.y, m_OriginalContentContainerLocalScale.z * m_highlightZScaleMultiplier); m_IconHighlightedLocalPosition = m_OriginalIconLocalPosition + Vector3.forward * k_IconHighlightedLocalZOffset; m_IconPressedLocalPosition = m_OriginalIconLocalPosition + Vector3.back * k_IconHighlightedLocalZOffset; @@ -216,7 +230,7 @@ IEnumerator AnimateShow() { m_CanvasGroup.interactable = false; m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - m_ContentContainer.localScale = m_OriginalContentContainerLocalScale; + m_ContentContainer.localScale = originalScale; SetMaterialColors(normalGradientPair); this.StopCoroutine(ref m_ContentVisibilityCoroutine); @@ -331,7 +345,7 @@ IEnumerator BeginHighlight() var currentGradientPair = GetMaterialColors(); var targetGradientPair = highlightGradientPair; var currentLocalScale = m_ContentContainer.localScale; - var highlightedLocalScale = new Vector3(m_OriginalContentContainerLocalScale.x, m_OriginalContentContainerLocalScale.y, m_OriginalContentContainerLocalScale.z * m_highlightZScaleMultiplier); + var highlightedLocalScale = highlightScale; while (transitionAmount < kTargetTransitionAmount) { transitionAmount += Time.unscaledDeltaTime * 4; @@ -362,7 +376,7 @@ IEnumerator EndHighlight() var originalGradientPair = GetMaterialColors(); var targetGradientPair = normalGradientPair; var currentLocalScale = m_ContentContainer.localScale; - var targetScale = m_OriginalContentContainerLocalScale; + var targetScale = originalScale; while (transitionAmount < kTargetTransitionAmount) { transitionAmount += Time.unscaledDeltaTime * 6; From 0a778fd71d4b0d76d86a00124eef4db30c454e70 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 22 Mar 2017 22:06:14 -0700 Subject: [PATCH 065/870] Add highlight scale inversion support to PinnedToolButton; merge the activeTool property and the SetButtonGradients function --- Scripts/UI/PinnedToolButton.cs | 62 ++++++++++++++-------------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index d1a830740..e837a14cb 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -18,11 +18,12 @@ public static Vector3 activePosition set { s_ActivePosition = value; - //m_InactivePosition = value * 2f; // additional offset for the button when it is visible and inactive } } static Vector3 s_ActivePosition; + const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; + public Type toolType { get @@ -35,7 +36,6 @@ public Type toolType if (m_ToolType == value) return; - //Debug.LogError("PinnedToolButton setting TYPE : " + value.ToString() + ""); m_GradientButton.gameObject.SetActive(true); m_ToolType = value; @@ -43,7 +43,7 @@ public Type toolType { if (isSelectTool) { - tooltipText = "Selection Tool (cannot be closed)"; + tooltipText = k_SelectionToolTipText; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair } else @@ -55,7 +55,7 @@ public Type toolType } m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); - SetButtonGradients(true); + activeTool = true; m_GradientButton.visible = true; } else @@ -73,10 +73,8 @@ public int order set { m_Order = value; // Position of this button in relation to other pinned tool buttons - //if (m_Order == 0) m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive - //transform.localPosition = activeTool ? activePosition : m_InactivePosition; - SetButtonGradients(activeTool); + activeTool = activeTool; this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); Debug.LogError(m_ToolType.ToString() + " : Order : " + m_Order + " / " + value); @@ -120,11 +118,11 @@ public Type previewToolType } else { - SetButtonGradients(activeTool); + activeTool = activeTool; m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); customToolTipHighlightColor = gradientPair; hideTooltip(this); - tooltipText = isSelectTool ? tooltipText = "Selection Tool (cannot be closed)" : toolType.Name; + tooltipText = isSelectTool ? tooltipText = k_SelectionToolTipText : toolType.Name; } m_GradientButton.highlighted = m_previewToolType != null; @@ -132,9 +130,6 @@ public Type previewToolType } Type m_previewToolType; - public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } - string m_TooltipText; - [SerializeField] GradientButton m_GradientButton; @@ -146,6 +141,9 @@ public Type previewToolType [SerializeField] Transform m_TooltipSource; + public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } + string m_TooltipText; + public TextAlignment tooltipAlignment { get; private set; } public Transform rayOrigin { get; set; } public Func selectTool { private get; set; } @@ -154,16 +152,24 @@ public Type previewToolType public Action showTooltip { private get; set; } public Action hideTooltip { private get; set; } public GradientPair customToolTipHighlightColor { get; set; } + public bool isSelectTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } - public bool isSelectTool - { - get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } - } - - bool activeTool { get { return m_Order == 0; } } Coroutine m_PositionCoroutine; Vector3 m_InactivePosition; // Inactive button offset from the main menu activator + bool activeTool + { + get { return m_Order == 0; } + set + { + m_GradientButton.normalGradientPair = value ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; + m_GradientButton.highlightGradientPair = value ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; + m_GradientButton.invertHighlightScale = value; + m_GradientButton.highlighted = true; + m_GradientButton.highlighted = false; + } + } + void Start() { m_GradientButton.onClick += OnClick; @@ -188,7 +194,7 @@ void Start() void OnClick() { selectTool(rayOrigin, m_ToolType); - SetButtonGradients(activeTool); + activeTool = activeTool; } // Create periodic table-style names for types @@ -207,24 +213,6 @@ string GetTypeAbbreviation(Type type) return abbreviation.ToString(); } - void SetButtonGradients(bool active) - { - if (active) - { - m_GradientButton.normalGradientPair = gradientPair; - m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.highlighted = true; - m_GradientButton.highlighted = false; - } - else - { - m_GradientButton.normalGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.highlightGradientPair = gradientPair; - m_GradientButton.highlighted = true; - m_GradientButton.highlighted = false; - } - } - IEnumerator AnimatePosition() { var duration = 0f; From cf8ad30729088e6e2952ad03e4e8599abf787f03 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 22 Mar 2017 23:02:37 -0700 Subject: [PATCH 066/870] Add SmoothMotion support to pinned tool button --- Prefabs/UI/PinnedToolButton.prefab | 35 +++++++++++++++++++++++------- Scripts/UI/PinnedToolButton.cs | 10 +++++++-- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 007889285..22700004a 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -101,6 +101,7 @@ GameObject: serializedVersion: 4 m_Component: - 4: {fileID: 4000013747407424} + - 114: {fileID: 114000010887893374} m_Layer: 5 m_Name: RotationPivot m_TagString: Untagged @@ -236,10 +237,10 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011810879300} - m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000011060550722} - {fileID: 224000013167097666} @@ -350,6 +351,23 @@ MonoBehaviour: - {fileID: 114000012662170858} m_DelayBeforeReveal: 0 m_highlightZScaleMultiplier: 10 +--- !u!114 &114000010887893374 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011810879300} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_SmoothRotation: 1 + m_TightenRotation: 1 + m_SmoothPosition: 1 + m_TightenPosition: 1 + m_Target: {fileID: 4000012504767854} --- !u!114 &114000011260412956 MonoBehaviour: m_ObjectHideFlags: 1 @@ -363,6 +381,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_GradientButton: {fileID: 114000010373680160} + m_SmoothMotion: {fileID: 114000010887893374} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} --- !u!114 &114000012662170858 @@ -494,9 +513,9 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011266792292} - m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.425, y: 0.5000001, z: 0.42500013} + m_LocalScale: {x: 0.425, y: 0.50000024, z: 0.42500025} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000013747407424} @@ -532,9 +551,9 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012194113842} - m_LocalRotation: {x: 1, y: -0, z: -0, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 0.00093460095} - m_LocalScale: {x: 0.85, y: 0.85000026, z: 0.13000003} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.85, y: 0.8500012, z: 0.13000014} m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} m_Children: - {fileID: 4000012190781878} @@ -542,7 +561,7 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: -0.0000012314413} + m_AnchoredPosition: {x: 0, y: 0.0009338602} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013910327088 diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index e837a14cb..cff356b2d 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -75,9 +75,12 @@ public int order m_Order = value; // Position of this button in relation to other pinned tool buttons m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive activeTool = activeTool; + const float kSmoothingMax = 50f; + const int kSmoothingIncreaseFactor = 10; + var smoothingFactor = Mathf.Clamp(kSmoothingMax- m_Order * kSmoothingIncreaseFactor, 0f, kSmoothingMax); + m_SmoothMotion.SetPositionSmoothing(smoothingFactor); + m_SmoothMotion.SetRotationSmoothing(smoothingFactor); this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); - - Debug.LogError(m_ToolType.ToString() + " : Order : " + m_Order + " / " + value); } } int m_Order; @@ -133,6 +136,9 @@ public Type previewToolType [SerializeField] GradientButton m_GradientButton; + [SerializeField] + SmoothMotion m_SmoothMotion; + public Transform tooltipTarget { get { return m_TooltipTarget; } } [SerializeField] Transform m_TooltipTarget; From 11f521b2328faad67f96407ce1162d04d76f84d9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 23 Mar 2017 01:31:49 -0700 Subject: [PATCH 067/870] Add ConnectInterfaces support to PinnedToolButton; used to connect SmoothMotion's IUsesViewerScale interface --- Scripts/UI/PinnedToolButton.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index cff356b2d..37a9d2bcd 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor + public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces { public static Vector3 activePosition { @@ -159,6 +159,7 @@ public Type previewToolType public Action hideTooltip { private get; set; } public GradientPair customToolTipHighlightColor { get; set; } public bool isSelectTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } + public ConnectInterfacesDelegate connectInterfaces { get; set; } Coroutine m_PositionCoroutine; Vector3 m_InactivePosition; // Inactive button offset from the main menu activator @@ -195,6 +196,7 @@ void Start() tooltipSource.localPosition = tooltipSourcePosition; tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); + connectInterfaces(m_SmoothMotion); } void OnClick() From 7c41968dae925e65095692ac81ec2b32a512a209 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 23 Mar 2017 20:06:11 -0700 Subject: [PATCH 068/870] Cleanup property accessors in RadialMenuSlot & PinnedToolButton --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 5 +---- Scripts/UI/PinnedToolButton.cs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index d802670e1..4b64d8da5 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -57,7 +57,6 @@ sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, IT public bool pressed { - get { return m_Pressed; } set { // Proceed only if value is true after previously being false @@ -107,6 +106,7 @@ public bool highlighted public bool semiTransparent { + get { return m_SemiTransparent; } set { if (value == m_SemiTransparent || !gameObject.activeSelf) @@ -117,14 +117,11 @@ public bool semiTransparent this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateSemiTransparent(value)); PostReveal(); } - - get { return m_SemiTransparent; } } bool m_SemiTransparent; public bool visible { - get { return m_Visible; } set { if (value && m_Visible == value) // Allow false to fall through and perform hiding regardless of visibility diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 37a9d2bcd..41249afa8 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -14,7 +14,7 @@ public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITo { public static Vector3 activePosition { - get { return s_ActivePosition; } + private get { return s_ActivePosition; } set { s_ActivePosition = value; From 3979fe027e12be56845c94aa5a8dbb988b0c842f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 23 Mar 2017 20:26:39 -0700 Subject: [PATCH 069/870] Remove private declaration on highlightScale propery in GradientButton --- Scripts/UI/GradientButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index f73459df9..e5e7296cb 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -107,7 +107,7 @@ Vector3 originalScale get { return invertHighlightScale ? m_HighlightContentContainerLocalScale : m_OriginalContentContainerLocalScale; } } - private Vector3 highlightScale + Vector3 highlightScale { get { return invertHighlightScale ? m_OriginalContentContainerLocalScale : m_HighlightContentContainerLocalScale; } } From 72070ee894ac025c92342ed0532b56b96b983836 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 23 Mar 2017 21:25:04 -0700 Subject: [PATCH 070/870] Remove unused using from RadialMenuUI --- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index a8ab1632d..14bcd2123 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -5,7 +5,6 @@ using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Menus { From 89d690dfd4bd079cf2f643eb9af7b6e3be770fce Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 23 Mar 2017 21:26:54 -0700 Subject: [PATCH 071/870] Remove unnecessary log error print from GradientButton --- Scripts/UI/GradientButton.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index e5e7296cb..a60a5b41d 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -271,7 +271,6 @@ IEnumerator AnimateShow() /// IEnumerator AnimateHide() { - Debug.LogError("Animate hide"); m_CanvasGroup.interactable = false; m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); From fa3fe4f8f1fab639f387e8a50058873de8925c22 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 23 Mar 2017 22:04:49 -0700 Subject: [PATCH 072/870] Add new PinnedToolActionButton controller; used for the select + close buttons that appear in front of the pinned tool button's background gradient button on hover --- Scripts/UI/PinnedToolActionButton.cs | 431 ++++++++++++++++++++++ Scripts/UI/PinnedToolActionButton.cs.meta | 12 + 2 files changed, 443 insertions(+) create mode 100644 Scripts/UI/PinnedToolActionButton.cs create mode 100644 Scripts/UI/PinnedToolActionButton.cs.meta diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs new file mode 100644 index 000000000..d3224b93e --- /dev/null +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -0,0 +1,431 @@ +#if UNITY_EDITOR +using System; +using System.Collections; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.UI; + +namespace UnityEditor.Experimental.EditorVR.UI +{ + sealed class PinnedToolActionButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler + { + const string k_MaterialAlphaProperty = "_Alpha"; + + public event Action onClick; + + public bool pressed + { + get { return m_Pressed; } + set + { + if (!m_Highlighted) + { + value = false; + } + else if (value != m_Pressed && value) // proceed only if value is true after previously being false + { + m_Pressed = value; + + this.StopCoroutine(ref m_IconHighlightCoroutine); + + m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight(true)); + } + } + } + bool m_Pressed; + + bool highlighted + { + set + { + if (m_Highlighted == value) + { + return; + } + else + { + // Stop any existing icon highlight coroutines + this.StopCoroutine(ref m_IconHighlightCoroutine); + + m_Highlighted = value; + + // Stop any existing begin/end highlight coroutine + this.StopCoroutine(ref m_HighlightCoroutine); + + if (!gameObject.activeInHierarchy) + return; + + m_HighlightCoroutine = m_Highlighted ? StartCoroutine(BeginHighlight()) : StartCoroutine(EndHighlight()); + } + } + } + bool m_Highlighted; + + public bool visible + { + set + { + if (m_Visible == value) + return; + + m_Visible = value; + + this.StopCoroutine(ref m_VisibilityCoroutine); + m_VisibilityCoroutine = value ? StartCoroutine(AnimateShow()) : StartCoroutine(AnimateHide()); + } + } + bool m_Visible; + + [SerializeField] + Sprite m_IconSprite; + + // The inner-button's background gradient MeshRenderer + [SerializeField] + MeshRenderer m_ButtonMeshRenderer; + + // Transform-root of the contents in the icon container (icons, text, etc) + [SerializeField] + Transform m_IconContainer; + + // Transform-root of the contents that will be scaled when button is highlighted + [SerializeField] + Transform m_ContentContainer; + + // The canvas group managing the drawing of elements in the icon container + [SerializeField] + CanvasGroup m_CanvasGroup; + + [SerializeField] + Image m_Icon; + + // Alternate icon sprite, shown when the main icon sprite isn't; If set, this button will swap icon sprites OnClick + [SerializeField] + Sprite m_AlternateIconSprite; + + [SerializeField] + Color m_NormalContentColor; + + // The color that elements in the HighlighItems collection should inherit during the highlighted state + [SerializeField] + Color m_HighlightItemColor = UnityBrandColorScheme.light; + + // Collection of items that will change appearance during the highlighted state (color/position/etc) + [SerializeField] + Graphic[] m_HighlightItems; + + [Header("Animated Reveal Settings")] + [Tooltip("Default value is 0.25")] + // If AnimatedReveal is enabled, wait this duration before performing the reveal + [SerializeField] + [Range(0f, 2f)] + float m_DelayBeforeReveal = 0.25f; + + Material m_ButtonMaterial; + Vector3 m_OriginalIconLocalPosition; + Vector3 m_IconHighlightedLocalPosition; + Vector3 m_IconPressedLocalPosition; + Sprite m_OriginalIconSprite; + Vector3 m_OriginalLocalScale; + + // The initial button reveal coroutines, before highlighting occurs + Coroutine m_VisibilityCoroutine; + Coroutine m_ContentVisibilityCoroutine; + + // The visibility & highlight coroutines + Coroutine m_HighlightCoroutine; + Coroutine m_IconHighlightCoroutine; + + bool alternateIconVisible + { + set + { + if (m_AlternateIconSprite) // Only allow sprite swapping if an alternate sprite exists + m_Icon.sprite = value ? m_AlternateIconSprite : m_OriginalIconSprite; // If true, set the icon sprite back to the original sprite + } + get + { + return m_Icon.sprite == m_AlternateIconSprite; + } + } + + void Awake() + { + m_OriginalIconSprite = m_Icon.sprite; + m_ButtonMaterial = MaterialUtils.GetMaterialClone(m_ButtonMeshRenderer); + m_OriginalLocalScale = transform.localScale; + m_OriginalIconLocalPosition = m_IconContainer.localPosition; + + m_Icon.color = m_NormalContentColor; + } + + void OnEnable() + { + m_ContentContainer.gameObject.SetActive(true); + } + + void OnDisable() + { + if (!gameObject.activeInHierarchy) + { + this.StopCoroutine(ref m_IconHighlightCoroutine); + this.StopCoroutine(ref m_HighlightCoroutine); + this.StopCoroutine(ref m_ContentVisibilityCoroutine); + m_ContentContainer.gameObject.SetActive(false); + } + } + + /// + /// Animate the reveal of this button's visual elements + /// + IEnumerator AnimateShow() + { + m_CanvasGroup.interactable = false; + m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); + + this.StopCoroutine(ref m_ContentVisibilityCoroutine); + m_ContentVisibilityCoroutine = StartCoroutine(ShowContent()); + + const float kScaleRevealDuration = 0.25f; + var delay = 0f; + var scale = Vector3.zero; + var smoothVelocity = Vector3.zero; + var currentDuration = 0f; + var totalDuration = m_DelayBeforeReveal + kScaleRevealDuration; + var visibleLocalScale = m_OriginalLocalScale; + while (currentDuration < totalDuration) + { + currentDuration += Time.unscaledDeltaTime; + transform.localScale = scale; + m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, scale.y); + + // Perform initial delay + while (delay < m_DelayBeforeReveal) + { + delay += Time.unscaledDeltaTime; + yield return null; + } + + // Perform the button depth reveal + scale = MathUtilsExt.SmoothDamp(scale, visibleLocalScale, ref smoothVelocity, kScaleRevealDuration, Mathf.Infinity, Time.unscaledDeltaTime); + yield return null; + } + + m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 1f); + transform.localScale = m_OriginalLocalScale; + m_VisibilityCoroutine = null; + } + + /// + /// Animate the hiding of this button's visual elements + /// + IEnumerator AnimateHide() + { + m_CanvasGroup.interactable = false; + m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); + + const float kTotalDuration = 0.25f; + var scale = transform.localScale; + var smoothVelocity = Vector3.zero; + var hiddenLocalScale = Vector3.zero; + var currentDuration = 0f; + while (currentDuration < kTotalDuration) + { + currentDuration += Time.unscaledDeltaTime; + scale = MathUtilsExt.SmoothDamp(scale, hiddenLocalScale, ref smoothVelocity, kTotalDuration, Mathf.Infinity, Time.unscaledDeltaTime); + transform.localScale = scale; + m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, scale.z); + + yield return null; + } + + m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); + transform.localScale = hiddenLocalScale; + m_VisibilityCoroutine = null; + gameObject.SetActive(false); + } + + /// + /// Animate the canvas group's alpha to full opacity + /// + IEnumerator ShowContent() + { + m_CanvasGroup.interactable = true; + + const float kTargetAlpha = 1f; + const float kRevealDuration = 0.4f; + const float kInitialDelayLengthenMultipler = 5f; // used to scale up the initial delay based on the m_InitialDelay value + var delay = 0f; + var targetDelay = Mathf.Clamp(m_DelayBeforeReveal * kInitialDelayLengthenMultipler, 0f, 2.5f); // scale the target delay, with a maximum clamp + var alpha = 0f; + var opacitySmoothVelocity = 1f; + var currentDuration = 0f; + var targetDuration = targetDelay + kRevealDuration; + while (currentDuration < targetDuration) + { + currentDuration += Time.unscaledDeltaTime; + m_CanvasGroup.alpha = alpha; + + while (delay < targetDelay) + { + delay += Time.unscaledDeltaTime; + yield return null; + } + + alpha = MathUtilsExt.SmoothDamp(alpha, kTargetAlpha, ref opacitySmoothVelocity, targetDuration, Mathf.Infinity, Time.unscaledDeltaTime); + yield return null; + } + + m_CanvasGroup.alpha = 1; + m_ContentVisibilityCoroutine = null; + } + + /// + /// Performs the animated beginning of a button's highlighted state + /// + IEnumerator BeginHighlight() + { + this.StopCoroutine(ref m_IconHighlightCoroutine); + m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); + + const float kTargetTransitionAmount = 1f; + var transitionAmount = Time.unscaledDeltaTime; + var shapedTransitionAmount = 0f; + while (transitionAmount < kTargetTransitionAmount) + { + transitionAmount += Time.unscaledDeltaTime * 4; + shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + yield return null; + } + + m_HighlightCoroutine = null; + } + + /// + /// Performs the animated ending of a button's highlighted state + /// + IEnumerator EndHighlight() + { + this.StopCoroutine(ref m_IconHighlightCoroutine); + m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsEndHighlight()); + + const float kTargetTransitionAmount = 1f; + var transitionAmount = Time.unscaledDeltaTime; + var shapedTransitionAmount = 0f; + while (transitionAmount < kTargetTransitionAmount) + { + transitionAmount += Time.unscaledDeltaTime * 6; + shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + + yield return null; + } + + m_HighlightCoroutine = null; + } + + /// + /// Performs the animated transition of the icon container's visual elements to their highlighted state + /// + /// If true, perform pressed-state specific visual changes, as opposed to hover-state specific visuals + IEnumerator IconContainerContentsBeginHighlight(bool pressed = false) + { + var currentPosition = m_IconContainer.localPosition; + var targetPosition = pressed == false ? m_IconHighlightedLocalPosition : m_IconPressedLocalPosition; // forward for highlight, backward for press + var transitionAmount = Time.unscaledDeltaTime; + var transitionAddMultiplier = !pressed ? 2 : 5; // Faster transition in for highlight; slower for pressed highlight + while (transitionAmount < 1) + { + transitionAmount += Time.unscaledDeltaTime * transitionAddMultiplier; + + foreach (var graphic in m_HighlightItems) + { + if (graphic) + graphic.color = Color.Lerp(m_NormalContentColor, m_HighlightItemColor, transitionAmount); + } + + m_IconContainer.localPosition = Vector3.Lerp(currentPosition, targetPosition, transitionAmount); + yield return null; + } + + foreach (var graphic in m_HighlightItems) + { + if (graphic) + graphic.color = m_HighlightItemColor; + } + + m_IconContainer.localPosition = targetPosition; + m_IconHighlightCoroutine = null; + } + + /// + /// Performs the animated transition of the icon container's visual elements to their non-highlighted state + /// + IEnumerator IconContainerContentsEndHighlight() + { + var currentPosition = m_IconContainer.localPosition; + var transitionAmount = 1f; + const float kTransitionSubtractMultiplier = 5f; + while (transitionAmount > 0) + { + transitionAmount -= Time.unscaledDeltaTime * kTransitionSubtractMultiplier; + + foreach (var graphic in m_HighlightItems) + { + if (graphic != null) + graphic.color = Color.Lerp(m_NormalContentColor, m_HighlightItemColor, transitionAmount); + } + + m_IconContainer.localPosition = Vector3.Lerp(m_OriginalIconLocalPosition, currentPosition, transitionAmount); + yield return null; + } + + foreach (var graphic in m_HighlightItems) + { + if (graphic != null) + graphic.color = m_NormalContentColor; + } + + m_IconContainer.localPosition = m_OriginalIconLocalPosition; + m_IconHighlightCoroutine = null; + } + + /// + /// Enable button highlighting on ray enter if autoHighlight is true + /// + public void OnPointerEnter(PointerEventData eventData) + { + highlighted = true; + eventData.Use(); + } + + /// + /// Disable button highlighting on ray exit if autoHighlight is true + /// + public void OnPointerExit(PointerEventData eventData) + { + highlighted = false; + eventData.Use(); + } + + /// + /// Raise the OnClick event when this button is clicked + /// + public void OnPointerClick(PointerEventData eventData) + { + SwapIconSprite(); + onClick(); + } + + /// + /// Swap between the main and alternate icon-sprites + /// + void SwapIconSprite() + { + // Alternate between the main icon and the alternate icon when the button is clicked + if (m_AlternateIconSprite) + alternateIconVisible = !alternateIconVisible; + } + } +} +#endif diff --git a/Scripts/UI/PinnedToolActionButton.cs.meta b/Scripts/UI/PinnedToolActionButton.cs.meta new file mode 100644 index 000000000..f693dc5dd --- /dev/null +++ b/Scripts/UI/PinnedToolActionButton.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 57d51bc05acd35a4fbe890fe1217cbd7 +timeCreated: 1490326191 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 6d1bbb7fef922e55a0030e478569559871b13f10 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 23 Mar 2017 22:14:54 -0700 Subject: [PATCH 073/870] Add initial left & right PinnedToolActionButton support to PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 41249afa8..a5b70dea1 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -139,6 +139,12 @@ public Type previewToolType [SerializeField] SmoothMotion m_SmoothMotion; + [SerializeField] + PinnedToolActionButton m_LeftPinnedToolActionButton; + + [SerializeField] + PinnedToolActionButton m_RightPinnedToolActionButton; + public Transform tooltipTarget { get { return m_TooltipTarget; } } [SerializeField] Transform m_TooltipTarget; @@ -174,6 +180,9 @@ bool activeTool m_GradientButton.invertHighlightScale = value; m_GradientButton.highlighted = true; m_GradientButton.highlighted = false; + + m_LeftPinnedToolActionButton.onClick += OnLeftActionButtonClick; + m_RightPinnedToolActionButton.onClick += OnRightActionButtonClick; } } @@ -237,6 +246,22 @@ IEnumerator AnimatePosition() transform.localPosition = targetPosition; m_PositionCoroutine = null; } + + /// + /// Called when the left action button (either select or close) is clicked + /// + public void OnLeftActionButtonClick() + { + Debug.LogError("Left Action Button clicked!"); + } + + /// + /// Called when the right action button (either select or close) is clicked + /// + public void OnRightActionButtonClick() + { + Debug.LogError("Right Action Button clicked!"); + } } } #endif From 8c7c9cbbcb0158fda02a95380903ddd853ff2739 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 23 Mar 2017 22:25:20 -0700 Subject: [PATCH 074/870] Add initial left + right PinnedToolActionButton structure to PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 162 ++++++++++++++++++++++++++--- 1 file changed, 148 insertions(+), 14 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 22700004a..5b9e08a96 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -42,6 +42,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000010952468146 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010173711686} + - 114: {fileID: 114000011092814558} + - 65: {fileID: 65000011977207724} + m_Layer: 5 + m_Name: LeftActionButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 --- !u!1 &1000011241481320 GameObject: m_ObjectHideFlags: 1 @@ -66,18 +83,16 @@ GameObject: m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 m_Component: - - 224: {fileID: 224000011060550722} - - 33: {fileID: 33000013208543088} - - 23: {fileID: 23000013566874788} - - 114: {fileID: 114000010373680160} - - 135: {fileID: 135000012241492716} + - 4: {fileID: 4000011440036932} + - 114: {fileID: 114000012257132026} + - 65: {fileID: 65000011837907890} m_Layer: 5 - m_Name: Base + m_Name: RightActionButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000011695512812 GameObject: m_ObjectHideFlags: 0 @@ -175,6 +190,38 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000014093660532 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011060550722} + - 33: {fileID: 33000013208543088} + - 23: {fileID: 23000013566874788} + - 114: {fileID: 114000010373680160} + - 135: {fileID: 135000012241492716} + m_Layer: 5 + m_Name: Base + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010173711686 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010952468146} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000013747407424} + m_RootOrder: 0 --- !u!4 &4000010683372396 Transform: m_ObjectHideFlags: 1 @@ -188,6 +235,19 @@ Transform: m_Children: [] m_Father: {fileID: 4000012504767854} m_RootOrder: 0 +--- !u!4 &4000011440036932 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011266792292} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000013747407424} + m_RootOrder: 1 --- !u!4 &4000012190781878 Transform: m_ObjectHideFlags: 1 @@ -242,6 +302,8 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: + - {fileID: 4000010173711686} + - {fileID: 4000011440036932} - {fileID: 224000011060550722} - {fileID: 224000013167097666} m_Father: {fileID: 4000012504767854} @@ -251,7 +313,7 @@ MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} + m_GameObject: {fileID: 1000014093660532} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -317,14 +379,38 @@ MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} + m_GameObject: {fileID: 1000014093660532} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!65 &65000011837907890 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011266792292} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.0135, y: 0.0035, z: 0.0275} + m_Center: {x: -0.00675, y: -0.000000059604645, z: 0.000000008381903} +--- !u!65 &65000011977207724 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010952468146} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.0135, y: 0.0035, z: 0.0275} + m_Center: {x: 0.00675, y: -0.000000059604645, z: 0.000000008381903} --- !u!114 &114000010373680160 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} + m_GameObject: {fileID: 1000014093660532} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} @@ -368,6 +454,29 @@ MonoBehaviour: m_SmoothPosition: 1 m_TightenPosition: 1 m_Target: {fileID: 4000012504767854} +--- !u!114 &114000011092814558 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010952468146} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_IconSprite: {fileID: 0} + m_ButtonMeshRenderer: {fileID: 0} + m_IconContainer: {fileID: 0} + m_ContentContainer: {fileID: 0} + m_CanvasGroup: {fileID: 0} + m_Icon: {fileID: 0} + m_AlternateIconSprite: {fileID: 0} + m_NormalContentColor: {r: 0, g: 0, b: 0, a: 0} + m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_HighlightItems: [] + m_DelayBeforeReveal: 0 --- !u!114 &114000011260412956 MonoBehaviour: m_ObjectHideFlags: 1 @@ -382,8 +491,33 @@ MonoBehaviour: m_RunInEditMode: 0 m_GradientButton: {fileID: 114000010373680160} m_SmoothMotion: {fileID: 114000010887893374} + m_LeftPinnedToolActionButton: {fileID: 114000011092814558} + m_RightPinnedToolActionButton: {fileID: 114000012257132026} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} +--- !u!114 &114000012257132026 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011266792292} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_IconSprite: {fileID: 0} + m_ButtonMeshRenderer: {fileID: 0} + m_IconContainer: {fileID: 0} + m_ContentContainer: {fileID: 0} + m_CanvasGroup: {fileID: 0} + m_Icon: {fileID: 0} + m_AlternateIconSprite: {fileID: 0} + m_NormalContentColor: {r: 0, g: 0, b: 0, a: 0} + m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_HighlightItems: [] + m_DelayBeforeReveal: 0 --- !u!114 &114000012662170858 MonoBehaviour: m_ObjectHideFlags: 1 @@ -451,7 +585,7 @@ SphereCollider: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} + m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 @@ -512,14 +646,14 @@ RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} + m_GameObject: {fileID: 1000014093660532} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.425, y: 0.50000024, z: 0.42500025} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000013747407424} - m_RootOrder: 0 + m_RootOrder: 2 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} @@ -558,7 +692,7 @@ RectTransform: m_Children: - {fileID: 4000012190781878} m_Father: {fileID: 4000013747407424} - m_RootOrder: 1 + m_RootOrder: 3 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0.0009338602} From e4183e04be3c9f924fc8eec0187104339ecc968b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 24 Mar 2017 11:48:00 -0700 Subject: [PATCH 075/870] Correct left/right pinned tool action button naming in PinnedToolbutton prefab --- Prefabs/UI/PinnedToolButton.prefab | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 5b9e08a96..49b6cd09b 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -53,12 +53,12 @@ GameObject: - 114: {fileID: 114000011092814558} - 65: {fileID: 65000011977207724} m_Layer: 5 - m_Name: LeftActionButton + m_Name: RightActionButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!1 &1000011241481320 GameObject: m_ObjectHideFlags: 1 @@ -87,12 +87,12 @@ GameObject: - 114: {fileID: 114000012257132026} - 65: {fileID: 65000011837907890} m_Layer: 5 - m_Name: RightActionButton + m_Name: LeftActionButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!1 &1000011695512812 GameObject: m_ObjectHideFlags: 0 From c1b4847b7c275c154349a713e4278bee11838e93 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 24 Mar 2017 11:48:56 -0700 Subject: [PATCH 076/870] Add initial hover support for PinnedTool action buttons --- Scripts/UI/PinnedToolActionButton.cs | 9 ++++++-- Scripts/UI/PinnedToolButton.cs | 32 +++++++++++++++++++++------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs index d3224b93e..bc2aef140 100644 --- a/Scripts/UI/PinnedToolActionButton.cs +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -14,6 +14,8 @@ sealed class PinnedToolActionButton : MonoBehaviour, IPointerEnterHandler, IPoin const string k_MaterialAlphaProperty = "_Alpha"; public event Action onClick; + public event Action onHoverEnter; + public event Action onHoverExit; public bool pressed { @@ -72,8 +74,9 @@ public bool visible m_Visible = value; - this.StopCoroutine(ref m_VisibilityCoroutine); - m_VisibilityCoroutine = value ? StartCoroutine(AnimateShow()) : StartCoroutine(AnimateHide()); + gameObject.SetActive(value); + //this.StopCoroutine(ref m_VisibilityCoroutine); + //m_VisibilityCoroutine = value ? StartCoroutine(AnimateShow()) : StartCoroutine(AnimateHide()); } } bool m_Visible; @@ -396,6 +399,7 @@ IEnumerator IconContainerContentsEndHighlight() public void OnPointerEnter(PointerEventData eventData) { highlighted = true; + onHoverEnter(); eventData.Use(); } @@ -405,6 +409,7 @@ public void OnPointerEnter(PointerEventData eventData) public void OnPointerExit(PointerEventData eventData) { highlighted = false; + onHoverExit(); eventData.Use(); } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index a5b70dea1..6ebe4b701 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -182,7 +182,11 @@ bool activeTool m_GradientButton.highlighted = false; m_LeftPinnedToolActionButton.onClick += OnLeftActionButtonClick; + m_LeftPinnedToolActionButton.onHoverEnter += OnActionButtonHoverEnter; + m_LeftPinnedToolActionButton.onHoverExit += OnActionButtonHoverExit; m_RightPinnedToolActionButton.onClick += OnRightActionButtonClick; + m_RightPinnedToolActionButton.onHoverEnter += OnActionButtonHoverEnter; + m_RightPinnedToolActionButton.onHoverExit += OnActionButtonHoverExit; } } @@ -247,21 +251,33 @@ IEnumerator AnimatePosition() m_PositionCoroutine = null; } - /// - /// Called when the left action button (either select or close) is clicked - /// - public void OnLeftActionButtonClick() + void OnLeftActionButtonClick() { Debug.LogError("Left Action Button clicked!"); } - /// - /// Called when the right action button (either select or close) is clicked - /// - public void OnRightActionButtonClick() + void OnRightActionButtonClick() { Debug.LogError("Right Action Button clicked!"); } + + void OnActionButtonHoverEnter() + { + Debug.LogError("Action Button hover ENTER event raised!"); + // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons + m_LeftPinnedToolActionButton.visible = true; + m_RightPinnedToolActionButton.visible = true; + } + + void OnActionButtonHoverExit() + { + Debug.LogError("Action Button hover EXIT event raised!"); + // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons + + // allow the coroutine in the action button to allow for a hover from one button to the other without changing the opacity when going between buttons left/right + m_LeftPinnedToolActionButton.visible = false; + m_RightPinnedToolActionButton.visible = false; + } } } #endif From 410352f2942687ee7c6c7ca7e7063f108cc3ef35 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 24 Mar 2017 19:11:40 -0700 Subject: [PATCH 077/870] Add additional pinned tool (sub-button: select/close) action support to PinnedToolButton --- Prefabs/UI/PinnedToolButton.prefab | 629 +++++++++++++++++++++++++-- Scripts/UI/GradientButton.cs | 6 +- Scripts/UI/PinnedToolActionButton.cs | 48 +- Scripts/UI/PinnedToolButton.cs | 72 ++- 4 files changed, 696 insertions(+), 59 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 49b6cd09b..58f6009ed 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -27,6 +27,38 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000010351058842 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013783073276} + m_Layer: 5 + m_Name: IconContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010561241686 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000010555036514} + - 222: {fileID: 222000012771696822} + - 114: {fileID: 114000013054965370} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 --- !u!1 &1000010797218832 GameObject: m_ObjectHideFlags: 0 @@ -58,7 +90,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000011241481320 GameObject: m_ObjectHideFlags: 1 @@ -92,7 +124,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000011695512812 GameObject: m_ObjectHideFlags: 0 @@ -124,6 +156,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000011923834384 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011657560110} + - 222: {fileID: 222000011737525400} + - 114: {fileID: 114000011928962840} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000012194113842 GameObject: m_ObjectHideFlags: 1 @@ -149,8 +198,27 @@ GameObject: serializedVersion: 4 m_Component: - 224: {fileID: 224000012388631740} + - 114: {fileID: 114000011926581952} + - 225: {fileID: 225000011672881634} m_Layer: 5 - m_Name: IconContainer + m_Name: LeftActionButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013207144374 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013975901740} + - 222: {fileID: 222000012834606604} + - 114: {fileID: 114000013055861932} + m_Layer: 5 + m_Name: Background m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -172,6 +240,74 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000013816124996 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013933582366} + - 222: {fileID: 222000011708094976} + - 114: {fileID: 114000010635728284} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013929112766 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012760332454} + - 222: {fileID: 222000011673250278} + - 114: {fileID: 114000011796366970} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013979951132 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000014065128128} + - 114: {fileID: 114000013773965116} + - 225: {fileID: 225000013730456080} + m_Layer: 5 + m_Name: RightActionButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014013795426 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013218953584} + - 222: {fileID: 222000014289754014} + - 114: {fileID: 114000013828986210} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!1 &1000014082726766 GameObject: @@ -189,7 +325,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000014093660532 GameObject: m_ObjectHideFlags: 1 @@ -259,9 +395,9 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 224000012388631740} + - {fileID: 224000013783073276} m_Father: {fileID: 224000013167097666} - m_RootOrder: 0 + m_RootOrder: 2 --- !u!4 &4000012504767854 Transform: m_ObjectHideFlags: 1 @@ -424,19 +560,53 @@ MonoBehaviour: a: {r: 0, g: 0, b: 0, a: 0} b: {r: 0, g: 0, b: 0, a: 0} m_ButtonMeshRenderer: {fileID: 23000013664958186} - m_IconContainer: {fileID: 224000012388631740} + m_IconContainer: {fileID: 224000013783073276} m_ContentContainer: {fileID: 224000013167097666} m_CanvasGroup: {fileID: 225000013680203428} - m_Text: {fileID: 114000012662170858} - m_Icon: {fileID: 114000013366903114} + m_Text: {fileID: 114000010635728284} + m_Icon: {fileID: 114000011796366970} m_AlternateIconSprite: {fileID: 0} m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItems: - - {fileID: 114000013366903114} - - {fileID: 114000012662170858} + - {fileID: 114000011796366970} + - {fileID: 114000010635728284} m_DelayBeforeReveal: 0 m_highlightZScaleMultiplier: 10 +--- !u!114 &114000010635728284 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013816124996} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 007346dc664d64847a830c562c9659f9, type: 3} + m_FontSize: 250 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 0 + m_MaxSize: 250 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: A --- !u!114 &114000010887893374 MonoBehaviour: m_ObjectHideFlags: 1 @@ -491,10 +661,89 @@ MonoBehaviour: m_RunInEditMode: 0 m_GradientButton: {fileID: 114000010373680160} m_SmoothMotion: {fileID: 114000010887893374} - m_LeftPinnedToolActionButton: {fileID: 114000011092814558} - m_RightPinnedToolActionButton: {fileID: 114000012257132026} + m_LeftPinnedToolActionButton: {fileID: 114000012257132026} + m_RightPinnedToolActionButton: {fileID: 114000011092814558} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} +--- !u!114 &114000011796366970 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013929112766} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 15545907e08dab74692cb3d226382ced, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114000011926581952 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013126942410} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_IconSprite: {fileID: 0} + m_ButtonMeshRenderer: {fileID: 0} + m_IconContainer: {fileID: 224000012388631740} + m_ContentContainer: {fileID: 224000012388631740} + m_CanvasGroup: {fileID: 0} + m_Icon: {fileID: 114000013828986210} + m_AlternateIconSprite: {fileID: 0} + m_NormalContentColor: {r: 0, g: 0, b: 0, a: 0} + m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_HighlightItems: [] + m_DelayBeforeReveal: 0 +--- !u!114 &114000011928962840 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011923834384} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 --- !u!114 &114000012257132026 MonoBehaviour: m_ObjectHideFlags: 1 @@ -551,7 +800,69 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: A + m_Text: L +--- !u!114 &114000013054965370 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010561241686} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 007346dc664d64847a830c562c9659f9, type: 3} + m_FontSize: 250 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 0 + m_MaxSize: 250 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: R +--- !u!114 &114000013055861932 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013207144374} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0.5411765, g: 0.7607843, b: 0.28627452, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 --- !u!114 &114000013366903114 MonoBehaviour: m_ObjectHideFlags: 1 @@ -572,7 +883,59 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 15545907e08dab74692cb3d226382ced, type: 3} + m_Sprite: {fileID: 21300000, guid: fc47de3bcfede8d49b869829e6ff0c0a, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114000013773965116 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013979951132} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_IconSprite: {fileID: 0} + m_ButtonMeshRenderer: {fileID: 0} + m_IconContainer: {fileID: 224000014065128128} + m_ContentContainer: {fileID: 224000014065128128} + m_CanvasGroup: {fileID: 0} + m_Icon: {fileID: 114000013366903114} + m_AlternateIconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, + type: 3} + m_NormalContentColor: {r: 0, g: 0, b: 0, a: 0} + m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_HighlightItems: [] + m_DelayBeforeReveal: 0 +--- !u!114 &114000013828986210 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014013795426} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: fc47de3bcfede8d49b869829e6ff0c0a, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -598,12 +961,48 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013544577132} +--- !u!222 &222000011673250278 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013929112766} +--- !u!222 &222000011708094976 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013816124996} +--- !u!222 &222000011737525400 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011923834384} +--- !u!222 &222000012771696822 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010561241686} +--- !u!222 &222000012834606604 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013207144374} --- !u!222 &222000013364307902 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011241481320} +--- !u!222 &222000014289754014 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014013795426} --- !u!223 &223000013382208598 Canvas: m_ObjectHideFlags: 1 @@ -623,6 +1022,24 @@ Canvas: m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 +--- !u!224 &224000010555036514 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010561241686} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000010134187} + m_LocalScale: {x: 0.00008000002, y: 0.00008000015, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000014065128128} + m_RootOrder: 2 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} + m_SizeDelta: {x: 268.38452, y: 268.38452} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010919883134 RectTransform: m_ObjectHideFlags: 1 @@ -630,16 +1047,16 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011241481320} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.00000013453973} + m_LocalPosition: {x: 0, y: 0, z: -0.000010134172} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 224000012388631740} - m_RootOrder: 0 + m_Father: {fileID: 224000014065128128} + m_RootOrder: 1 m_AnchorMin: {x: -24.5, y: -24.5} m_AnchorMax: {x: 25.5, y: 25.5} - m_AnchoredPosition: {x: -0.00000032782555, y: 0.00000014901161} - m_SizeDelta: {x: -1.13105, y: -1.13086} + m_AnchoredPosition: {x: 0.0000032478506, y: 0.0000002459069} + m_SizeDelta: {x: -0.77736, y: -1.57623} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011060550722 RectTransform: @@ -659,25 +1076,62 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011657560110 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011923834384} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000010134} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000014065128128} + m_RootOrder: 0 + m_AnchorMin: {x: -24.5, y: -24.5} + m_AnchorMax: {x: 25.5, y: 25.5} + m_AnchoredPosition: {x: 0.0000032147218, y: -0.000000029735968} + m_SizeDelta: {x: -0.77715, y: -1.5602} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012388631740 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013126942410} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.0001} + m_LocalScale: {x: 1, y: 0.9999989, z: 0.99999917} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 224000010919883134} + - {fileID: 224000013975901740} + - {fileID: 224000013218953584} - {fileID: 224000013910327088} - m_Father: {fileID: 4000012190781878} + m_Father: {fileID: 224000013167097666} m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -8.731149e-10, y: -2.3283064e-10} - m_SizeDelta: {x: 0.02307, y: 0.02307} + m_AnchoredPosition: {x: -0.00793, y: -7.7125195e-10} + m_SizeDelta: {x: 0.01586, y: 0.03184} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012760332454 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013929112766} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00000013453973} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000013783073276} + m_RootOrder: 0 + m_AnchorMin: {x: -24.5, y: -24.5} + m_AnchorMax: {x: 25.5, y: 25.5} + m_AnchoredPosition: {x: -0.00000032782555, y: 0.00000014901161} + m_SizeDelta: {x: -1.13105, y: -1.13086} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013167097666 RectTransform: @@ -690,6 +1144,8 @@ RectTransform: m_LocalScale: {x: 0.85, y: 0.8500012, z: 0.13000014} m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} m_Children: + - {fileID: 224000012388631740} + - {fileID: 224000014065128128} - {fileID: 4000012190781878} m_Father: {fileID: 4000013747407424} m_RootOrder: 3 @@ -698,6 +1154,44 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0.0009338602} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013218953584 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014013795426} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000010135} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000012388631740} + m_RootOrder: 1 + m_AnchorMin: {x: -24.5, y: -24.5} + m_AnchorMax: {x: 25.5, y: 25.5} + m_AnchoredPosition: {x: 0.0000032142561, y: -0.00000023339817} + m_SizeDelta: {x: -0.77736, y: -1.57623} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013783073276 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010351058842} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000012760332454} + - {fileID: 224000013933582366} + m_Father: {fileID: 4000012190781878} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -8.731149e-10, y: -2.3283064e-10} + m_SizeDelta: {x: 0.02307, y: 0.02307} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013910327088 RectTransform: m_ObjectHideFlags: 1 @@ -705,17 +1199,85 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013544577132} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000010134187} + m_LocalScale: {x: 0.00008000002, y: 0.00008000015, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000012388631740} + m_RootOrder: 2 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} + m_SizeDelta: {x: 268.38452, y: 268.38452} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013933582366 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013816124996} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.00000013408862} m_LocalScale: {x: 0.00008, y: 0.00008, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 224000012388631740} + m_Father: {fileID: 224000013783073276} m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0.00008, y: 0.0005} m_SizeDelta: {x: 268.38452, y: 268.38452} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013975901740 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013207144374} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000010134} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000012388631740} + m_RootOrder: 0 + m_AnchorMin: {x: -24.5, y: -24.5} + m_AnchorMax: {x: 25.5, y: 25.5} + m_AnchoredPosition: {x: 0.0000032147218, y: -0.000000029735968} + m_SizeDelta: {x: -0.77715, y: -1.5602} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000014065128128 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013979951132} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.0001} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000011657560110} + - {fileID: 224000010919883134} + - {fileID: 224000010555036514} + m_Father: {fileID: 224000013167097666} + m_RootOrder: 1 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.007930756, y: -2.2493912e-10} + m_SizeDelta: {x: 0.01586, y: 0.03184} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &225000011672881634 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013126942410} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 --- !u!225 &225000013680203428 CanvasGroup: m_ObjectHideFlags: 1 @@ -727,3 +1289,14 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 +--- !u!225 &225000013730456080 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013979951132} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index a60a5b41d..e5b07fd71 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -18,6 +18,8 @@ sealed class GradientButton : MonoBehaviour, IPointerEnterHandler, IPointerExitH const string k_MaterialColorBottomProperty = "_ColorBottom"; public event Action onClick; + public event Action onHoverEnter; + public event Action onHoverExit; public Sprite iconSprite { @@ -465,7 +467,7 @@ IEnumerator IconContainerContentsEndHighlight() public void OnPointerEnter(PointerEventData eventData) { highlighted = true; - + onHoverEnter(); eventData.Use(); } @@ -475,7 +477,7 @@ public void OnPointerEnter(PointerEventData eventData) public void OnPointerExit(PointerEventData eventData) { highlighted = false; - + onHoverExit(); eventData.Use(); } diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs index bc2aef140..3c566679f 100644 --- a/Scripts/UI/PinnedToolActionButton.cs +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections; +using System.Xml.Schema; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -11,11 +12,20 @@ namespace UnityEditor.Experimental.EditorVR.UI { sealed class PinnedToolActionButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler { + public enum ButtonType + { + SelectTool, + Close + } + + static Color s_CloseColor = UnityBrandColorScheme.red; + static Color s_SelectColor = UnityBrandColorScheme.green; + const string k_MaterialAlphaProperty = "_Alpha"; - public event Action onClick; - public event Action onHoverEnter; - public event Action onHoverExit; + //public event Action onClick; + //public event Action onHoverEnter; + //public event Action onHoverExit; public bool pressed { @@ -38,8 +48,9 @@ public bool pressed } bool m_Pressed; - bool highlighted + public bool highlighted { + get { return m_Highlighted; } set { if (m_Highlighted == value) @@ -81,6 +92,21 @@ public bool visible } bool m_Visible; + public ButtonType buttonType + { + get + { + return m_ButtonType; + } + + set + { + m_ButtonType = value; + m_ButtonColor = buttonType == ButtonType.SelectTool ? s_SelectColor : s_CloseColor; + } + } + ButtonType m_ButtonType; + [SerializeField] Sprite m_IconSprite; @@ -131,6 +157,7 @@ public bool visible Vector3 m_IconPressedLocalPosition; Sprite m_OriginalIconSprite; Vector3 m_OriginalLocalScale; + Color m_ButtonColor; // The initial button reveal coroutines, before highlighting occurs Coroutine m_VisibilityCoroutine; @@ -153,6 +180,11 @@ bool alternateIconVisible } } + public Action clicked { get; set; } + public Action closeButton { get; set; } + public Action hoverEnter { get; set; } + public Action hoverExit { get; set; } + void Awake() { m_OriginalIconSprite = m_Icon.sprite; @@ -161,6 +193,8 @@ void Awake() m_OriginalIconLocalPosition = m_IconContainer.localPosition; m_Icon.color = m_NormalContentColor; + + visible = false; // Initially perform a hide setup on the visuals } void OnEnable() @@ -399,8 +433,8 @@ IEnumerator IconContainerContentsEndHighlight() public void OnPointerEnter(PointerEventData eventData) { highlighted = true; - onHoverEnter(); eventData.Use(); + hoverEnter(); } /// @@ -409,8 +443,8 @@ public void OnPointerEnter(PointerEventData eventData) public void OnPointerExit(PointerEventData eventData) { highlighted = false; - onHoverExit(); eventData.Use(); + hoverExit(); } /// @@ -419,7 +453,7 @@ public void OnPointerExit(PointerEventData eventData) public void OnPointerClick(PointerEventData eventData) { SwapIconSprite(); - onClick(); + clicked(this); } /// diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 6ebe4b701..9b819b270 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -180,19 +180,12 @@ bool activeTool m_GradientButton.invertHighlightScale = value; m_GradientButton.highlighted = true; m_GradientButton.highlighted = false; - - m_LeftPinnedToolActionButton.onClick += OnLeftActionButtonClick; - m_LeftPinnedToolActionButton.onHoverEnter += OnActionButtonHoverEnter; - m_LeftPinnedToolActionButton.onHoverExit += OnActionButtonHoverExit; - m_RightPinnedToolActionButton.onClick += OnRightActionButtonClick; - m_RightPinnedToolActionButton.onHoverEnter += OnActionButtonHoverEnter; - m_RightPinnedToolActionButton.onHoverExit += OnActionButtonHoverExit; } } void Start() { - m_GradientButton.onClick += OnClick; + //m_GradientButton.onClick += SelectTool; // TODO remove after action button refactor if (m_ToolType == null) { @@ -210,9 +203,25 @@ void Start() tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); connectInterfaces(m_SmoothMotion); + + m_GradientButton.onHoverEnter += BackgroundHovered; // Display the foreground button actions + + m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; + m_LeftPinnedToolActionButton.closeButton = CloseButton; + //m_LeftPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; + m_LeftPinnedToolActionButton.hoverExit = ActionButtonHoverExit; + m_RightPinnedToolActionButton.clicked = ActionButtonClicked; + m_RightPinnedToolActionButton.closeButton = CloseButton; + //m_RightPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; + m_RightPinnedToolActionButton.hoverExit = ActionButtonHoverExit; + + // Assign the select action button to the side closest to the opposite hand, that allows the arrow to also point in the direction the + var leftHand = node == Node.LeftHand; + m_RightPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.SelectTool : PinnedToolActionButton.ButtonType.Close; + m_LeftPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.Close : PinnedToolActionButton.ButtonType.SelectTool; } - void OnClick() + void SelectTool() { selectTool(rayOrigin, m_ToolType); activeTool = activeTool; @@ -251,32 +260,51 @@ IEnumerator AnimatePosition() m_PositionCoroutine = null; } - void OnLeftActionButtonClick() + void BackgroundHovered () { - Debug.LogError("Left Action Button clicked!"); + Debug.LogError("Background button was hovered, now triggereing the foreground action button visuals"); + m_GradientButton.highlighted = true; + m_GradientButton.visible = false; + + m_LeftPinnedToolActionButton.visible = true; + m_RightPinnedToolActionButton.visible = true; } - void OnRightActionButtonClick() + void ActionButtonClicked(PinnedToolActionButton button) { - Debug.LogError("Right Action Button clicked!"); + Debug.LogError("Action Button clicked!"); + if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool) + SelectTool(); + else + button.closeButton(); } - - void OnActionButtonHoverEnter() +/* + void ActionButtonHoverEnter() { Debug.LogError("Action Button hover ENTER event raised!"); - // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons m_LeftPinnedToolActionButton.visible = true; m_RightPinnedToolActionButton.visible = true; } - - void OnActionButtonHoverExit() +*/ + void ActionButtonHoverExit() { - Debug.LogError("Action Button hover EXIT event raised!"); + // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons - // allow the coroutine in the action button to allow for a hover from one button to the other without changing the opacity when going between buttons left/right - m_LeftPinnedToolActionButton.visible = false; - m_RightPinnedToolActionButton.visible = false; + // Hide both action buttons if the user is no longer hovering over the button + if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + { + m_LeftPinnedToolActionButton.visible = false; + m_RightPinnedToolActionButton.visible = false; + m_GradientButton.visible = true; + m_GradientButton.highlighted = false; + } + } + + void CloseButton() + { + // TODO add full close functionality + gameObject.SetActive(false); } } } From 47772a2c3780870bfe40acf08d639a28afce645b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 3 Apr 2017 17:04:36 -0700 Subject: [PATCH 078/870] Update submodules --- libs/UnityOctree | 2 +- libs/VRLineRenderer | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/UnityOctree b/libs/UnityOctree index d8a1c150d..ba8bfe85a 160000 --- a/libs/UnityOctree +++ b/libs/UnityOctree @@ -1 +1 @@ -Subproject commit d8a1c150db407a1d400466391c3622238ef6246a +Subproject commit ba8bfe85a5fb5c47a13e9e3121df9d1b958221b6 diff --git a/libs/VRLineRenderer b/libs/VRLineRenderer index 14c770cc2..6ed5f3638 160000 --- a/libs/VRLineRenderer +++ b/libs/VRLineRenderer @@ -1 +1 @@ -Subproject commit 14c770cc2aeb5ee8f97f0cbec428af89ca7d5a18 +Subproject commit 6ed5f3638aca8d0ab1a7270b9772f0f7b2a83bb6 From 5810d58eaf00d099da389997d4145018739e1b7c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 3 Apr 2017 17:42:28 -0700 Subject: [PATCH 079/870] Perform post-development merge fixes --- Scripts/Core/EditorVR.Menus.cs | 2 +- Scripts/Core/EditorVR.Tools.cs | 4 ++++ Scripts/Interfaces/IMainMenu.cs | 8 -------- Scripts/Interfaces/ISelectTool.cs | 10 ++++++++++ Scripts/UI/PinnedToolButton.cs | 6 +++--- Scripts/Utilities/MaterialUtils.cs | 1 + 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 83287b81b..76a0faeab 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -347,7 +347,7 @@ internal IMainMenu SpawnMainMenu(Type type, InputDevice device, bool visible, ou input = evr.m_DeviceInputModule.CreateActionMapInputForObject(mainMenu, device); evr.m_Interfaces.ConnectInterfaces(mainMenu, device); mainMenu.visible = visible; - mainMenu.previewToolInPinnedToolButton = evr.m_Tools.PreviewToolInPinnedToolButton; + //mainMenu.previewToolInPinnedToolButton = evr.m_Tools.PreviewToolInPinnedToolButton; // Handled in EditorVR.Tools ConnectInterfaces now return mainMenu; } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 70a7184ff..c1f4be6a7 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -50,6 +50,10 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) linkedObjectList.Add(linkedObject); linkedObject.linkedObjects = linkedObjectList; } + + var mainMenu = obj as IMainMenu; + if (mainMenu != null) + mainMenu.previewToolInPinnedToolButton = PreviewToolInPinnedToolButton; } public void DisconnectInterface(object obj) diff --git a/Scripts/Interfaces/IMainMenu.cs b/Scripts/Interfaces/IMainMenu.cs index 02ab6e0cb..82b9d6770 100644 --- a/Scripts/Interfaces/IMainMenu.cs +++ b/Scripts/Interfaces/IMainMenu.cs @@ -31,14 +31,6 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Transform targetRayOrigin { set; } - /// - /// Returns true if the active tool on the given ray origin is of the given type - /// Transform: Ray origin to check - /// Type: Type with which to compare - /// Returns whether the active tool is of the same type - /// - Func isToolActive { set; } - /// /// Highlights a pinned tool button when a menu button is highlighted /// Transform: Ray origin to check diff --git a/Scripts/Interfaces/ISelectTool.cs b/Scripts/Interfaces/ISelectTool.cs index 984ae2169..f8ddccbfb 100644 --- a/Scripts/Interfaces/ISelectTool.cs +++ b/Scripts/Interfaces/ISelectTool.cs @@ -36,6 +36,16 @@ public static bool IsToolActive(this ISelectTool obj, Transform rayOrigin, Type { return isToolActive(rayOrigin, type); } + + /* + /// + /// Returns true if the active tool on the given ray origin is of the given type + /// Transform: Ray origin to check + /// Type: Type with which to compare + /// Returns whether the active tool is of the same type + /// + Func isToolActive { set; } + */ } } #endif diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 47a6f5cc6..ded678c41 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -160,7 +160,7 @@ public Type previewToolType public Action hideTooltip { private get; set; } public GradientPair customToolTipHighlightColor { get; set; } public bool isSelectTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } - public ConnectInterfacesDelegate connectInterfaces { get; set; } + //public ConnectInterfacesDelegate connectInterfaces { get; set; } Coroutine m_PositionCoroutine; Vector3 m_InactivePosition; // Inactive button offset from the main menu activator @@ -197,7 +197,7 @@ void Start() tooltipSource.localPosition = tooltipSourcePosition; tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); - connectInterfaces(m_SmoothMotion); + this.ConnectInterfaces(m_SmoothMotion); m_GradientButton.onHoverEnter += BackgroundHovered; // Display the foreground button actions @@ -221,7 +221,7 @@ void Start() void SelectTool() { - selectTool(rayOrigin, m_ToolType); + this.SelectTool(rayOrigin, m_ToolType); activeTool = activeTool; //SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); } diff --git a/Scripts/Utilities/MaterialUtils.cs b/Scripts/Utilities/MaterialUtils.cs index 4d9e729ec..0de1f1298 100644 --- a/Scripts/Utilities/MaterialUtils.cs +++ b/Scripts/Utilities/MaterialUtils.cs @@ -46,6 +46,7 @@ public static UnityMaterial[] CloneMaterials(Renderer renderer) { sharedMaterials[i] = UnityObject.Instantiate(sharedMaterials[i]); } + renderer.sharedMaterials = sharedMaterials; return sharedMaterials; } From 4acabc99a74884a932f4604410ba0d1dd0c19aa1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 3 Apr 2017 17:43:06 -0700 Subject: [PATCH 080/870] Setup left + right pinned tool action buttons in PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 142 +---------------------------- 1 file changed, 5 insertions(+), 137 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 58f6009ed..cc3651ad1 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -74,23 +74,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000010952468146 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 4000010173711686} - - 114: {fileID: 114000011092814558} - - 65: {fileID: 65000011977207724} - m_Layer: 5 - m_Name: RightActionButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000011241481320 GameObject: m_ObjectHideFlags: 1 @@ -108,23 +91,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000011266792292 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 4000011440036932} - - 114: {fileID: 114000012257132026} - - 65: {fileID: 65000011837907890} - m_Layer: 5 - m_Name: LeftActionButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000011695512812 GameObject: m_ObjectHideFlags: 0 @@ -325,7 +291,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!1 &1000014093660532 GameObject: m_ObjectHideFlags: 1 @@ -345,19 +311,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4000010173711686 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010952468146} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 4000013747407424} - m_RootOrder: 0 --- !u!4 &4000010683372396 Transform: m_ObjectHideFlags: 1 @@ -371,19 +324,6 @@ Transform: m_Children: [] m_Father: {fileID: 4000012504767854} m_RootOrder: 0 ---- !u!4 &4000011440036932 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 4000013747407424} - m_RootOrder: 1 --- !u!4 &4000012190781878 Transform: m_ObjectHideFlags: 1 @@ -438,8 +378,6 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 4000010173711686} - - {fileID: 4000011440036932} - {fileID: 224000011060550722} - {fileID: 224000013167097666} m_Father: {fileID: 4000012504767854} @@ -517,30 +455,6 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014093660532} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} ---- !u!65 &65000011837907890 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 0.0135, y: 0.0035, z: 0.0275} - m_Center: {x: -0.00675, y: -0.000000059604645, z: 0.000000008381903} ---- !u!65 &65000011977207724 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010952468146} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 0.0135, y: 0.0035, z: 0.0275} - m_Center: {x: 0.00675, y: -0.000000059604645, z: 0.000000008381903} --- !u!114 &114000010373680160 MonoBehaviour: m_ObjectHideFlags: 1 @@ -624,29 +538,6 @@ MonoBehaviour: m_SmoothPosition: 1 m_TightenPosition: 1 m_Target: {fileID: 4000012504767854} ---- !u!114 &114000011092814558 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010952468146} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RunInEditMode: 0 - m_IconSprite: {fileID: 0} - m_ButtonMeshRenderer: {fileID: 0} - m_IconContainer: {fileID: 0} - m_ContentContainer: {fileID: 0} - m_CanvasGroup: {fileID: 0} - m_Icon: {fileID: 0} - m_AlternateIconSprite: {fileID: 0} - m_NormalContentColor: {r: 0, g: 0, b: 0, a: 0} - m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_HighlightItems: [] - m_DelayBeforeReveal: 0 --- !u!114 &114000011260412956 MonoBehaviour: m_ObjectHideFlags: 1 @@ -661,8 +552,8 @@ MonoBehaviour: m_RunInEditMode: 0 m_GradientButton: {fileID: 114000010373680160} m_SmoothMotion: {fileID: 114000010887893374} - m_LeftPinnedToolActionButton: {fileID: 114000012257132026} - m_RightPinnedToolActionButton: {fileID: 114000011092814558} + m_LeftPinnedToolActionButton: {fileID: 114000011926581952} + m_RightPinnedToolActionButton: {fileID: 114000013773965116} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} --- !u!114 &114000011796366970 @@ -744,29 +635,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114000012257132026 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RunInEditMode: 0 - m_IconSprite: {fileID: 0} - m_ButtonMeshRenderer: {fileID: 0} - m_IconContainer: {fileID: 0} - m_ContentContainer: {fileID: 0} - m_CanvasGroup: {fileID: 0} - m_Icon: {fileID: 0} - m_AlternateIconSprite: {fileID: 0} - m_NormalContentColor: {r: 0, g: 0, b: 0, a: 0} - m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_HighlightItems: [] - m_DelayBeforeReveal: 0 --- !u!114 &114000012662170858 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1070,7 +938,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000013747407424} - m_RootOrder: 2 + m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} @@ -1148,7 +1016,7 @@ RectTransform: - {fileID: 224000014065128128} - {fileID: 4000012190781878} m_Father: {fileID: 4000013747407424} - m_RootOrder: 3 + m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0.0009338602} From 35dc696aa13f95d6ff3e47220db737fb595e4f9c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 4 Apr 2017 11:15:39 -0700 Subject: [PATCH 081/870] Update ForEachProxyDevice call in PreviewToolInPinnedToolButton --- Scripts/Core/EditorVR.Tools.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 211f05b73..350e65f8d 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -433,7 +433,7 @@ internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Ty return null; PinnedToolButton pinnedToolButton = null; - evr.m_Rays.ForEachProxyDevice((deviceData) => + Rays.ForEachProxyDevice((deviceData) => { if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device { From 2f81d975dbe202cbe46a660dde30f9ca04385321 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 4 Apr 2017 17:44:07 -0700 Subject: [PATCH 082/870] Add new PinnerToolButton action-button UI material --- .../PinnedToolActionButtonUIContent.mat | 157 ++++++++++++++++++ .../PinnedToolActionButtonUIContent.mat.meta | 8 + 2 files changed, 165 insertions(+) create mode 100644 Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat create mode 100644 Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat.meta diff --git a/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat b/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat new file mode 100644 index 000000000..b0a7f4598 --- /dev/null +++ b/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat @@ -0,0 +1,157 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: PinnedToolActionButtonUIContent + m_Shader: {fileID: 10760, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHABLEND_ON _EMISSION + m_LightmapFlags: 1 + m_CustomRenderQueue: 9504 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: PixelSnap + second: 0 + - first: + name: _BumpScale + second: 1 + - first: + name: _ColorMask + second: 15 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 10 + - first: + name: _GlossMapScale + second: 1 + - first: + name: _Glossiness + second: 0.5 + - first: + name: _GlossyReflections + second: 1 + - first: + name: _InvFade + second: 1 + - first: + name: _Metallic + second: 0 + - first: + name: _Mode + second: 2 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _SmoothnessTextureChannel + second: 0 + - first: + name: _SpecularHighlights + second: 1 + - first: + name: _SrcBlend + second: 5 + - first: + name: _Stencil + second: 0 + - first: + name: _StencilComp + second: 8 + - first: + name: _StencilOp + second: 0 + - first: + name: _StencilReadMask + second: 255 + - first: + name: _StencilWriteMask + second: 255 + - first: + name: _UVSec + second: 0 + - first: + name: _UseUIAlphaClip + second: 0 + - first: + name: _ZWrite + second: 0 + m_Colors: + - first: + name: _Color + second: {r: 1, g: 1, b: 1, a: 1} + - first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + - first: + name: _TintColor + second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat.meta b/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat.meta new file mode 100644 index 000000000..249143125 --- /dev/null +++ b/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4acc1ec5dda65fc4895d9a4d22a63a14 +timeCreated: 1475037493 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From 256960507d4532a38c239b96053ac0ec4f3a1f08 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 4 Apr 2017 18:46:00 -0700 Subject: [PATCH 083/870] Add event null checks & rename events to match conventions in GradientButton --- Scripts/UI/GradientButton.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index a8fc8629a..a312f1ad6 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -18,8 +18,8 @@ sealed class GradientButton : MonoBehaviour, IPointerEnterHandler, IPointerExitH const string k_MaterialColorBottomProperty = "_ColorBottom"; public event Action click; - public event Action onHoverEnter; - public event Action onHoverExit; + public event Action hoverEnter; + public event Action hoverExit; public Sprite iconSprite { @@ -463,7 +463,10 @@ IEnumerator IconContainerContentsEndHighlight() public void OnPointerEnter(PointerEventData eventData) { highlighted = true; - onHoverEnter(); + + if (hoverEnter != null) + hoverEnter(); + eventData.Use(); } @@ -473,7 +476,10 @@ public void OnPointerEnter(PointerEventData eventData) public void OnPointerExit(PointerEventData eventData) { highlighted = false; - onHoverExit(); + + if (hoverExit != null) + hoverExit(); + eventData.Use(); } @@ -483,7 +489,9 @@ public void OnPointerExit(PointerEventData eventData) public void OnPointerClick(PointerEventData eventData) { SwapIconSprite(); - click(); + + if (click != null) + click(); } /// From 30a6752b8adc2d341d97def76c80207c2d2c361d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 4 Apr 2017 19:24:09 -0700 Subject: [PATCH 084/870] Add initial multi-action(select/close) button support to PinnedToolButtons --- Prefabs/UI/PinnedToolButton.prefab | 239 ++++++++++++++++++++------- Scripts/UI/PinnedToolActionButton.cs | 60 ++++--- Scripts/UI/PinnedToolButton.cs | 51 ++++-- 3 files changed, 248 insertions(+), 102 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index cc3651ad1..5bfa3c040 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -166,6 +166,7 @@ GameObject: - 224: {fileID: 224000012388631740} - 114: {fileID: 114000011926581952} - 225: {fileID: 225000011672881634} + - 65: {fileID: 65000010916098064} m_Layer: 5 m_Name: LeftActionButton m_TagString: Untagged @@ -207,6 +208,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 +--- !u!1 &1000013805247488 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000010630333128} + - 222: {fileID: 222000013997269160} + - 114: {fileID: 114000011073612486} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000013816124996 GameObject: m_ObjectHideFlags: 1 @@ -234,8 +252,9 @@ GameObject: - 224: {fileID: 224000012760332454} - 222: {fileID: 222000011673250278} - 114: {fileID: 114000011796366970} + - 114: {fileID: 114000013866165818} m_Layer: 5 - m_Name: Icon + m_Name: ActionButtonsMask m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -251,6 +270,7 @@ GameObject: - 224: {fileID: 224000014065128128} - 114: {fileID: 114000013773965116} - 225: {fileID: 225000013730456080} + - 65: {fileID: 65000012740030200} m_Layer: 5 m_Name: RightActionButton m_TagString: Untagged @@ -303,7 +323,7 @@ GameObject: - 33: {fileID: 33000013208543088} - 23: {fileID: 23000013566874788} - 114: {fileID: 114000010373680160} - - 135: {fileID: 135000012241492716} + - 65: {fileID: 65000011941282114} m_Layer: 5 m_Name: Base m_TagString: Untagged @@ -337,7 +357,7 @@ Transform: m_Children: - {fileID: 224000013783073276} m_Father: {fileID: 224000013167097666} - m_RootOrder: 2 + m_RootOrder: 1 --- !u!4 &4000012504767854 Transform: m_ObjectHideFlags: 1 @@ -455,6 +475,42 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014093660532} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!65 &65000010916098064 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013126942410} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.0165, y: 0.033, z: 0.035} + m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65000011941282114 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014093660532} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.06, y: 0.005, z: 0.06} + m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65000012740030200 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013979951132} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.0165, y: 0.033, z: 0.035} + m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114000010373680160 MonoBehaviour: m_ObjectHideFlags: 1 @@ -478,12 +534,12 @@ MonoBehaviour: m_ContentContainer: {fileID: 224000013167097666} m_CanvasGroup: {fileID: 225000013680203428} m_Text: {fileID: 114000010635728284} - m_Icon: {fileID: 114000011796366970} + m_Icon: {fileID: 114000011073612486} m_AlternateIconSprite: {fileID: 0} m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItems: - - {fileID: 114000011796366970} + - {fileID: 114000011073612486} - {fileID: 114000010635728284} m_DelayBeforeReveal: 0 m_highlightZScaleMultiplier: 10 @@ -538,6 +594,34 @@ MonoBehaviour: m_SmoothPosition: 1 m_TightenPosition: 1 m_Target: {fileID: 4000012504767854} +--- !u!114 &114000011073612486 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013805247488} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 15545907e08dab74692cb3d226382ced, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 --- !u!114 &114000011260412956 MonoBehaviour: m_ObjectHideFlags: 1 @@ -568,7 +652,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 0} m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -596,16 +680,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_IconSprite: {fileID: 0} - m_ButtonMeshRenderer: {fileID: 0} + m_IconSprite: {fileID: 21300000, guid: fc47de3bcfede8d49b869829e6ff0c0a, type: 3} m_IconContainer: {fileID: 224000012388631740} m_ContentContainer: {fileID: 224000012388631740} - m_CanvasGroup: {fileID: 0} + m_CanvasGroup: {fileID: 225000011672881634} m_Icon: {fileID: 114000013828986210} - m_AlternateIconSprite: {fileID: 0} - m_NormalContentColor: {r: 0, g: 0, b: 0, a: 0} + m_Background: {fileID: 114000013055861932} + m_CloseIconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, type: 3} + m_NormalContentColor: {r: 0.19607843, g: 0.2, b: 0.2, a: 1} m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_HighlightItems: [] + m_HighlightItems: + - {fileID: 114000013828986210} m_DelayBeforeReveal: 0 --- !u!114 &114000011928962840 MonoBehaviour: @@ -619,7 +704,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -627,7 +712,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Sprite: {fileID: 0} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 @@ -715,7 +800,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0.5411765, g: 0.7607843, b: 0.28627452, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -723,8 +808,8 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} - m_Type: 0 + m_Sprite: {fileID: 0} + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 4 @@ -743,7 +828,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -771,17 +856,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_IconSprite: {fileID: 0} - m_ButtonMeshRenderer: {fileID: 0} + m_IconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, type: 3} m_IconContainer: {fileID: 224000014065128128} m_ContentContainer: {fileID: 224000014065128128} - m_CanvasGroup: {fileID: 0} + m_CanvasGroup: {fileID: 225000013730456080} m_Icon: {fileID: 114000013366903114} - m_AlternateIconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, - type: 3} - m_NormalContentColor: {r: 0, g: 0, b: 0, a: 0} + m_Background: {fileID: 114000011928962840} + m_CloseIconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, type: 3} + m_NormalContentColor: {r: 0.19607843, g: 0.2, b: 0.2, a: 1} m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_HighlightItems: [] + m_HighlightItems: + - {fileID: 114000013366903114} m_DelayBeforeReveal: 0 --- !u!114 &114000013828986210 MonoBehaviour: @@ -795,7 +880,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -811,18 +896,19 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!135 &135000012241492716 -SphereCollider: +--- !u!114 &114000013866165818 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014093660532} - m_Material: {fileID: 0} - m_IsTrigger: 0 + m_GameObject: {fileID: 1000013929112766} m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.03 - m_Center: {x: 0, y: 0, z: 0} + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ShowMaskGraphic: 0 --- !u!222 &222000011018194712 CanvasRenderer: m_ObjectHideFlags: 1 @@ -865,6 +951,12 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011241481320} +--- !u!222 &222000013997269160 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013805247488} --- !u!222 &222000014289754014 CanvasRenderer: m_ObjectHideFlags: 1 @@ -908,6 +1000,24 @@ RectTransform: m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} m_SizeDelta: {x: 268.38452, y: 268.38452} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010630333128 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013805247488} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000010135} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000013783073276} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.00000032782555, y: 0.00000014901161} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010919883134 RectTransform: m_ObjectHideFlags: 1 @@ -915,16 +1025,16 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011241481320} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000010134172} + m_LocalPosition: {x: 0, y: 0, z: -0.0017} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000014065128128} m_RootOrder: 1 - m_AnchorMin: {x: -24.5, y: -24.5} - m_AnchorMax: {x: 25.5, y: 25.5} - m_AnchoredPosition: {x: 0.0000032478506, y: 0.0000002459069} - m_SizeDelta: {x: -0.77736, y: -1.57623} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.001155945, y: 0.00000023841858} + m_SizeDelta: {x: 0.01564002, y: 0.015769958} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011060550722 RectTransform: @@ -951,7 +1061,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011923834384} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000010134} + m_LocalPosition: {x: 0, y: 0, z: -0.0008} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] @@ -960,7 +1070,7 @@ RectTransform: m_AnchorMin: {x: -24.5, y: -24.5} m_AnchorMax: {x: 25.5, y: 25.5} m_AnchoredPosition: {x: 0.0000032147218, y: -0.000000029735968} - m_SizeDelta: {x: -0.77715, y: -1.5602} + m_SizeDelta: {x: -0.77715, y: -1.56415} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012388631740 RectTransform: @@ -969,14 +1079,14 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013126942410} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.0001} - m_LocalScale: {x: 1, y: 0.9999989, z: 0.99999917} + m_LocalPosition: {x: 0, y: 0, z: 0.0018000513} + m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013975901740} - {fileID: 224000013218953584} - {fileID: 224000013910327088} - m_Father: {fileID: 224000013167097666} + m_Father: {fileID: 224000012760332454} m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -990,16 +1100,18 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013929112766} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.00000013453973} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 224000013783073276} + m_Children: + - {fileID: 224000012388631740} + - {fileID: 224000014065128128} + m_Father: {fileID: 224000013167097666} m_RootOrder: 0 - m_AnchorMin: {x: -24.5, y: -24.5} - m_AnchorMax: {x: 25.5, y: 25.5} - m_AnchoredPosition: {x: -0.00000032782555, y: 0.00000014901161} - m_SizeDelta: {x: -1.13105, y: -1.13086} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0.027832031, y: 0.027832031} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013167097666 RectTransform: @@ -1012,8 +1124,7 @@ RectTransform: m_LocalScale: {x: 0.85, y: 0.8500012, z: 0.13000014} m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} m_Children: - - {fileID: 224000012388631740} - - {fileID: 224000014065128128} + - {fileID: 224000012760332454} - {fileID: 4000012190781878} m_Father: {fileID: 4000013747407424} m_RootOrder: 1 @@ -1029,16 +1140,16 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014013795426} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000010135} + m_LocalPosition: {x: 0, y: 0, z: -0.0017} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000012388631740} m_RootOrder: 1 - m_AnchorMin: {x: -24.5, y: -24.5} - m_AnchorMax: {x: 25.5, y: 25.5} - m_AnchoredPosition: {x: 0.0000032142561, y: -0.00000023339817} - m_SizeDelta: {x: -0.77736, y: -1.57623} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.0011559452, y: 0.00000023841858} + m_SizeDelta: {x: 0.01564002, y: 0.015769958} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013783073276 RectTransform: @@ -1051,7 +1162,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 224000012760332454} + - {fileID: 224000010630333128} - {fileID: 224000013933582366} m_Father: {fileID: 4000012190781878} m_RootOrder: 0 @@ -1103,7 +1214,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013207144374} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000010134} + m_LocalPosition: {x: 0, y: 0, z: -0.0008} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] @@ -1112,7 +1223,7 @@ RectTransform: m_AnchorMin: {x: -24.5, y: -24.5} m_AnchorMax: {x: 25.5, y: 25.5} m_AnchoredPosition: {x: 0.0000032147218, y: -0.000000029735968} - m_SizeDelta: {x: -0.77715, y: -1.5602} + m_SizeDelta: {x: -0.77715, y: -1.56415} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000014065128128 RectTransform: @@ -1121,18 +1232,18 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013979951132} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.0001} + m_LocalPosition: {x: 0, y: 0, z: 0.0018000002} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000011657560110} - {fileID: 224000010919883134} - {fileID: 224000010555036514} - m_Father: {fileID: 224000013167097666} + m_Father: {fileID: 224000012760332454} m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.007930756, y: -2.2493912e-10} + m_AnchoredPosition: {x: 0.007930756, y: -2.2493914e-10} m_SizeDelta: {x: 0.01586, y: 0.03184} m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000011672881634 diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs index 3c566679f..b3eb49461 100644 --- a/Scripts/UI/PinnedToolActionButton.cs +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections; +using System.Security.Cryptography.X509Certificates; using System.Xml.Schema; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; @@ -80,6 +81,8 @@ public bool visible { set { + Debug.LogWarning("Perform graceful showing/hiding of pinned tool action button visual here : start value : " + m_Visible + " - Setting to : " + value); + if (m_Visible == value) return; @@ -90,7 +93,7 @@ public bool visible //m_VisibilityCoroutine = value ? StartCoroutine(AnimateShow()) : StartCoroutine(AnimateHide()); } } - bool m_Visible; + bool m_Visible = true; // Initialize as true in order to allow for the first set to hide the visuals. public ButtonType buttonType { @@ -103,6 +106,8 @@ public ButtonType buttonType { m_ButtonType = value; m_ButtonColor = buttonType == ButtonType.SelectTool ? s_SelectColor : s_CloseColor; + m_Background.color = m_ButtonColor; + m_Icon.sprite = buttonType == ButtonType.Close ? m_CloseIconSprite : m_Icon.sprite; } } ButtonType m_ButtonType; @@ -110,10 +115,6 @@ public ButtonType buttonType [SerializeField] Sprite m_IconSprite; - // The inner-button's background gradient MeshRenderer - [SerializeField] - MeshRenderer m_ButtonMeshRenderer; - // Transform-root of the contents in the icon container (icons, text, etc) [SerializeField] Transform m_IconContainer; @@ -129,9 +130,12 @@ public ButtonType buttonType [SerializeField] Image m_Icon; + [SerializeField] + Image m_Background; + // Alternate icon sprite, shown when the main icon sprite isn't; If set, this button will swap icon sprites OnClick [SerializeField] - Sprite m_AlternateIconSprite; + Sprite m_CloseIconSprite; [SerializeField] Color m_NormalContentColor; @@ -171,30 +175,35 @@ bool alternateIconVisible { set { - if (m_AlternateIconSprite) // Only allow sprite swapping if an alternate sprite exists - m_Icon.sprite = value ? m_AlternateIconSprite : m_OriginalIconSprite; // If true, set the icon sprite back to the original sprite + if (m_CloseIconSprite) // Only allow sprite swapping if an alternate sprite exists + m_Icon.sprite = value ? m_CloseIconSprite : m_OriginalIconSprite; // If true, set the icon sprite back to the original sprite } get { - return m_Icon.sprite == m_AlternateIconSprite; + return m_Icon.sprite == m_CloseIconSprite; + } + } + + public bool rotateIcon + { + set + { + m_Icon.transform.localRotation = value ? Quaternion.Euler(0f, 0f, 180f) : Quaternion.identity; } } public Action clicked { get; set; } - public Action closeButton { get; set; } - public Action hoverEnter { get; set; } + //public Action hoverEnter { get; set; } public Action hoverExit { get; set; } void Awake() { m_OriginalIconSprite = m_Icon.sprite; - m_ButtonMaterial = MaterialUtils.GetMaterialClone(m_ButtonMeshRenderer); + //m_ButtonMaterial = MaterialUtils.GetMaterialClone(m_ButtonMeshRenderer); m_OriginalLocalScale = transform.localScale; m_OriginalIconLocalPosition = m_IconContainer.localPosition; m_Icon.color = m_NormalContentColor; - - visible = false; // Initially perform a hide setup on the visuals } void OnEnable() @@ -204,8 +213,9 @@ void OnEnable() void OnDisable() { - if (!gameObject.activeInHierarchy) + if (gameObject.activeSelf) { + Debug.LogWarning("Disabling PinnedToolACtionButton"); this.StopCoroutine(ref m_IconHighlightCoroutine); this.StopCoroutine(ref m_HighlightCoroutine); this.StopCoroutine(ref m_ContentVisibilityCoroutine); @@ -234,7 +244,7 @@ IEnumerator AnimateShow() while (currentDuration < totalDuration) { currentDuration += Time.unscaledDeltaTime; - transform.localScale = scale; + //transform.localScale = scale; m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, scale.y); // Perform initial delay @@ -250,7 +260,7 @@ IEnumerator AnimateShow() } m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 1f); - transform.localScale = m_OriginalLocalScale; + //transform.localScale = m_OriginalLocalScale; m_VisibilityCoroutine = null; } @@ -271,14 +281,14 @@ IEnumerator AnimateHide() { currentDuration += Time.unscaledDeltaTime; scale = MathUtilsExt.SmoothDamp(scale, hiddenLocalScale, ref smoothVelocity, kTotalDuration, Mathf.Infinity, Time.unscaledDeltaTime); - transform.localScale = scale; + //transform.localScale = scale; m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, scale.z); yield return null; } m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - transform.localScale = hiddenLocalScale; + //transform.localScale = hiddenLocalScale; m_VisibilityCoroutine = null; gameObject.SetActive(false); } @@ -381,7 +391,7 @@ IEnumerator IconContainerContentsBeginHighlight(bool pressed = false) graphic.color = Color.Lerp(m_NormalContentColor, m_HighlightItemColor, transitionAmount); } - m_IconContainer.localPosition = Vector3.Lerp(currentPosition, targetPosition, transitionAmount); + //m_IconContainer.localPosition = Vector3.Lerp(currentPosition, targetPosition, transitionAmount); yield return null; } @@ -391,7 +401,7 @@ IEnumerator IconContainerContentsBeginHighlight(bool pressed = false) graphic.color = m_HighlightItemColor; } - m_IconContainer.localPosition = targetPosition; + //m_IconContainer.localPosition = targetPosition; m_IconHighlightCoroutine = null; } @@ -413,7 +423,7 @@ IEnumerator IconContainerContentsEndHighlight() graphic.color = Color.Lerp(m_NormalContentColor, m_HighlightItemColor, transitionAmount); } - m_IconContainer.localPosition = Vector3.Lerp(m_OriginalIconLocalPosition, currentPosition, transitionAmount); + //m_IconContainer.localPosition = Vector3.Lerp(m_OriginalIconLocalPosition, currentPosition, transitionAmount); yield return null; } @@ -423,7 +433,7 @@ IEnumerator IconContainerContentsEndHighlight() graphic.color = m_NormalContentColor; } - m_IconContainer.localPosition = m_OriginalIconLocalPosition; + //m_IconContainer.localPosition = m_OriginalIconLocalPosition; m_IconHighlightCoroutine = null; } @@ -434,7 +444,7 @@ public void OnPointerEnter(PointerEventData eventData) { highlighted = true; eventData.Use(); - hoverEnter(); + //hoverEnter(); } /// @@ -462,7 +472,7 @@ public void OnPointerClick(PointerEventData eventData) void SwapIconSprite() { // Alternate between the main icon and the alternate icon when the button is clicked - if (m_AlternateIconSprite) + if (m_CloseIconSprite) alternateIconVisible = !alternateIconVisible; } } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index ded678c41..562c239d3 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -165,7 +165,7 @@ public Type previewToolType Coroutine m_PositionCoroutine; Vector3 m_InactivePosition; // Inactive button offset from the main menu activator - bool activeTool + private bool activeTool { get { return m_Order == 0; } set @@ -182,6 +182,8 @@ void Start() { //m_GradientButton.onClick += SelectTool; // TODO remove after action button refactor + Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); + if (m_ToolType == null) { transform.localPosition = m_InactivePosition; @@ -199,14 +201,12 @@ void Start() m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); this.ConnectInterfaces(m_SmoothMotion); - m_GradientButton.onHoverEnter += BackgroundHovered; // Display the foreground button actions + m_GradientButton.hoverEnter += BackgroundHovered; // Display the foreground button actions m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; - m_LeftPinnedToolActionButton.closeButton = CloseButton; //m_LeftPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; m_LeftPinnedToolActionButton.hoverExit = ActionButtonHoverExit; m_RightPinnedToolActionButton.clicked = ActionButtonClicked; - m_RightPinnedToolActionButton.closeButton = CloseButton; //m_RightPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; m_RightPinnedToolActionButton.hoverExit = ActionButtonHoverExit; @@ -215,13 +215,20 @@ void Start() m_RightPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.SelectTool : PinnedToolActionButton.ButtonType.Close; m_LeftPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.Close : PinnedToolActionButton.ButtonType.SelectTool; + m_RightPinnedToolActionButton.rotateIcon = leftHand ? false : true; + m_LeftPinnedToolActionButton.rotateIcon = leftHand ? false : true; + + m_LeftPinnedToolActionButton.visible = false; + m_RightPinnedToolActionButton.visible = false; + + //m_ButtonCollider.enabled = true; //m_GradientButton.click += OnClick; //m_GradientButton.gameObject.SetActive(false); } void SelectTool() { - this.SelectTool(rayOrigin, m_ToolType); + this.SelectTool(rayOrigin, m_ToolType); // SelectTool will set button order to 0 activeTool = activeTool; //SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); } @@ -261,21 +268,36 @@ IEnumerator AnimatePosition() void BackgroundHovered () { - Debug.LogError("Background button was hovered, now triggereing the foreground action button visuals"); - m_GradientButton.highlighted = true; - m_GradientButton.visible = false; + if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + { + Debug.LogError("Background button was hovered, now triggereing the foreground action button visuals"); + m_GradientButton.highlighted = true; + //m_GradientButton.visible = false; - m_LeftPinnedToolActionButton.visible = true; - m_RightPinnedToolActionButton.visible = true; + Debug.LogWarning( + "Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); + + + m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; + m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; + //m_ButtonCollider.enabled = false; + } } void ActionButtonClicked(PinnedToolActionButton button) { Debug.LogError("Action Button clicked!"); if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool) + { + m_LeftPinnedToolActionButton.highlighted = false; + m_RightPinnedToolActionButton.highlighted = false; + ActionButtonHoverExit(); SelectTool(); + } else - button.closeButton(); + { + CloseButton(); + } } /* void ActionButtonHoverEnter() @@ -287,15 +309,17 @@ void ActionButtonHoverEnter() */ void ActionButtonHoverExit() { - + Debug.LogWarning("ActionButtonHoverExit : " + name); // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons // Hide both action buttons if the user is no longer hovering over the button if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) { + Debug.LogWarning("!!!"); + //m_ButtonCollider.enabled = true; m_LeftPinnedToolActionButton.visible = false; m_RightPinnedToolActionButton.visible = false; - m_GradientButton.visible = true; + //m_GradientButton.visible = true; m_GradientButton.highlighted = false; } @@ -305,6 +329,7 @@ void ActionButtonHoverExit() void CloseButton() { // TODO add full close functionality + Debug.LogWarning("Implement pinnedTool button hiding visuals. Implement the action button hide visuals as well"); gameObject.SetActive(false); } } From 14f08267998a2e87737d947ebb67f5125d5b4712 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 4 Apr 2017 19:49:33 -0700 Subject: [PATCH 085/870] Add support for automatic PinnedTool action button UI resizing when the button represents the currently active tool (hiding the select button, and only showing the close button. --- Prefabs/UI/PinnedToolButton.prefab | 60 ++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 5bfa3c040..b5f7b91e0 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -253,6 +253,7 @@ GameObject: - 222: {fileID: 222000011673250278} - 114: {fileID: 114000011796366970} - 114: {fileID: 114000013866165818} + - 114: {fileID: 114000013570860828} m_Layer: 5 m_Name: ActionButtonsMask m_TagString: Untagged @@ -844,6 +845,27 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114000013570860828 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013929112766} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 --- !u!114 &114000013773965116 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1033,7 +1055,7 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.001155945, y: 0.00000023841858} + m_AnchoredPosition: {x: 0, y: 0.00000023841858} m_SizeDelta: {x: 0.01564002, y: 0.015769958} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011060550722 @@ -1067,10 +1089,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 224000014065128128} m_RootOrder: 0 - m_AnchorMin: {x: -24.5, y: -24.5} - m_AnchorMax: {x: 25.5, y: 25.5} - m_AnchoredPosition: {x: 0.0000032147218, y: -0.000000029735968} - m_SizeDelta: {x: -0.77715, y: -1.56415} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.0000032186508, y: -0.000000029802322} + m_SizeDelta: {x: -0.00001, y: -0.00007} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012388631740 RectTransform: @@ -1088,10 +1110,10 @@ RectTransform: - {fileID: 224000013910327088} m_Father: {fileID: 224000012760332454} m_RootOrder: 0 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.00793, y: -7.7125195e-10} - m_SizeDelta: {x: 0.01586, y: 0.03184} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012760332454 RectTransform: @@ -1111,7 +1133,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0.027832031, y: 0.027832031} + m_SizeDelta: {x: 0.02634, y: 0.02648} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013167097666 RectTransform: @@ -1148,7 +1170,7 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.0011559452, y: 0.00000023841858} + m_AnchoredPosition: {x: 0, y: 0.00000023841858} m_SizeDelta: {x: 0.01564002, y: 0.015769958} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013783073276 @@ -1220,10 +1242,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 224000012388631740} m_RootOrder: 0 - m_AnchorMin: {x: -24.5, y: -24.5} - m_AnchorMax: {x: 25.5, y: 25.5} - m_AnchoredPosition: {x: 0.0000032147218, y: -0.000000029735968} - m_SizeDelta: {x: -0.77715, y: -1.56415} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.0000032186508, y: -0.000000029802322} + m_SizeDelta: {x: -0.00001, y: -0.00007} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000014065128128 RectTransform: @@ -1241,10 +1263,10 @@ RectTransform: - {fileID: 224000010555036514} m_Father: {fileID: 224000012760332454} m_RootOrder: 1 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.007930756, y: -2.2493914e-10} - m_SizeDelta: {x: 0.01586, y: 0.03184} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000011672881634 CanvasGroup: From fe56a5563335c16d9d465afdae6f63c119cae6db Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 4 Apr 2017 21:40:37 -0700 Subject: [PATCH 086/870] Add support for animated PinnedToolActionButton content visibility --- Prefabs/UI/PinnedToolButton.prefab | 18 +-- Scripts/UI/PinnedToolActionButton.cs | 169 ++++++++++++--------------- Scripts/UI/PinnedToolButton.cs | 1 - 3 files changed, 83 insertions(+), 105 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index b5f7b91e0..794a345b4 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -35,6 +35,7 @@ GameObject: serializedVersion: 4 m_Component: - 224: {fileID: 224000013783073276} + - 225: {fileID: 225000010875730614} m_Layer: 5 m_Name: IconContainer m_TagString: Untagged @@ -147,7 +148,6 @@ GameObject: serializedVersion: 4 m_Component: - 224: {fileID: 224000013167097666} - - 225: {fileID: 225000013680203428} - 223: {fileID: 223000013382208598} m_Layer: 5 m_Name: ButtonContentContainer @@ -533,7 +533,7 @@ MonoBehaviour: m_ButtonMeshRenderer: {fileID: 23000013664958186} m_IconContainer: {fileID: 224000013783073276} m_ContentContainer: {fileID: 224000013167097666} - m_CanvasGroup: {fileID: 225000013680203428} + m_CanvasGroup: {fileID: 225000010875730614} m_Text: {fileID: 114000010635728284} m_Icon: {fileID: 114000011073612486} m_AlternateIconSprite: {fileID: 0} @@ -1101,7 +1101,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013126942410} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.0018000513} + m_LocalPosition: {x: 0, y: 0, z: 0.0018000894} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: @@ -1268,27 +1268,27 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!225 &225000011672881634 +--- !u!225 &225000010875730614 CanvasGroup: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013126942410} + m_GameObject: {fileID: 1000010351058842} m_Enabled: 1 m_Alpha: 1 m_Interactable: 1 - m_BlocksRaycasts: 1 + m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 ---- !u!225 &225000013680203428 +--- !u!225 &225000011672881634 CanvasGroup: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012194113842} + m_GameObject: {fileID: 1000013126942410} m_Enabled: 1 m_Alpha: 1 m_Interactable: 1 - m_BlocksRaycasts: 0 + m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 --- !u!225 &225000013730456080 CanvasGroup: diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs index b3eb49461..4fb542159 100644 --- a/Scripts/UI/PinnedToolActionButton.cs +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -43,7 +43,7 @@ public bool pressed this.StopCoroutine(ref m_IconHighlightCoroutine); - m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight(true)); + //m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight(true)); } } } @@ -71,7 +71,7 @@ public bool highlighted if (!gameObject.activeInHierarchy) return; - m_HighlightCoroutine = m_Highlighted ? StartCoroutine(BeginHighlight()) : StartCoroutine(EndHighlight()); + //m_HighlightCoroutine = m_Highlighted ? StartCoroutine(BeginHighlight()) : StartCoroutine(EndHighlight()); } } } @@ -88,9 +88,10 @@ public bool visible m_Visible = value; - gameObject.SetActive(value); - //this.StopCoroutine(ref m_VisibilityCoroutine); - //m_VisibilityCoroutine = value ? StartCoroutine(AnimateShow()) : StartCoroutine(AnimateHide()); + if (value && !gameObject.activeSelf) + gameObject.SetActive(value); + + this.RestartCoroutine(ref m_VisibilityCoroutine, value ? AnimateShow() : AnimateHide()); } } bool m_Visible = true; // Initialize as true in order to allow for the first set to hide the visuals. @@ -165,7 +166,6 @@ public ButtonType buttonType // The initial button reveal coroutines, before highlighting occurs Coroutine m_VisibilityCoroutine; - Coroutine m_ContentVisibilityCoroutine; // The visibility & highlight coroutines Coroutine m_HighlightCoroutine; @@ -213,14 +213,15 @@ void OnEnable() void OnDisable() { - if (gameObject.activeSelf) - { + //if (gameObject.activeSelf) // TODO remove object shouldnt alredy be disabled + //{ Debug.LogWarning("Disabling PinnedToolACtionButton"); this.StopCoroutine(ref m_IconHighlightCoroutine); this.StopCoroutine(ref m_HighlightCoroutine); - this.StopCoroutine(ref m_ContentVisibilityCoroutine); + this.StopCoroutine(ref m_VisibilityCoroutine); m_ContentContainer.gameObject.SetActive(false); - } + highlighted = false; + //} } /// @@ -228,39 +229,17 @@ void OnDisable() /// IEnumerator AnimateShow() { - m_CanvasGroup.interactable = false; - m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - - this.StopCoroutine(ref m_ContentVisibilityCoroutine); - m_ContentVisibilityCoroutine = StartCoroutine(ShowContent()); - - const float kScaleRevealDuration = 0.25f; - var delay = 0f; - var scale = Vector3.zero; - var smoothVelocity = Vector3.zero; - var currentDuration = 0f; - var totalDuration = m_DelayBeforeReveal + kScaleRevealDuration; - var visibleLocalScale = m_OriginalLocalScale; - while (currentDuration < totalDuration) + const float kTargetTransitionAmount = 1f; + var transitionAmount = Time.unscaledDeltaTime; + var currentCanvasAlpha = m_CanvasGroup.alpha; + while (transitionAmount < kTargetTransitionAmount) { - currentDuration += Time.unscaledDeltaTime; - //transform.localScale = scale; - m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, scale.y); - - // Perform initial delay - while (delay < m_DelayBeforeReveal) - { - delay += Time.unscaledDeltaTime; - yield return null; - } - - // Perform the button depth reveal - scale = MathUtilsExt.SmoothDamp(scale, visibleLocalScale, ref smoothVelocity, kScaleRevealDuration, Mathf.Infinity, Time.unscaledDeltaTime); + transitionAmount += Time.unscaledDeltaTime * 2f; + m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 1f, MathUtilsExt.SmoothInOutLerpFloat(transitionAmount)); yield return null; } - m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 1f); - //transform.localScale = m_OriginalLocalScale; + m_CanvasGroup.alpha = 1f; m_VisibilityCoroutine = null; } @@ -269,80 +248,39 @@ IEnumerator AnimateShow() /// IEnumerator AnimateHide() { - m_CanvasGroup.interactable = false; - m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - - const float kTotalDuration = 0.25f; - var scale = transform.localScale; - var smoothVelocity = Vector3.zero; - var hiddenLocalScale = Vector3.zero; - var currentDuration = 0f; - while (currentDuration < kTotalDuration) + const float kTargetTransitionAmount = 1f; + var transitionAmount = Time.unscaledDeltaTime; + var currentCanvasAlpha = m_CanvasGroup.alpha; + while (transitionAmount < kTargetTransitionAmount) { - currentDuration += Time.unscaledDeltaTime; - scale = MathUtilsExt.SmoothDamp(scale, hiddenLocalScale, ref smoothVelocity, kTotalDuration, Mathf.Infinity, Time.unscaledDeltaTime); - //transform.localScale = scale; - m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, scale.z); - + transitionAmount += Time.unscaledDeltaTime * 1.5f; + m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 0f, MathUtilsExt.SmoothInOutLerpFloat(transitionAmount)); yield return null; } - m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - //transform.localScale = hiddenLocalScale; + m_CanvasGroup.alpha = 0f; m_VisibilityCoroutine = null; gameObject.SetActive(false); } - /// - /// Animate the canvas group's alpha to full opacity - /// - IEnumerator ShowContent() - { - m_CanvasGroup.interactable = true; - - const float kTargetAlpha = 1f; - const float kRevealDuration = 0.4f; - const float kInitialDelayLengthenMultipler = 5f; // used to scale up the initial delay based on the m_InitialDelay value - var delay = 0f; - var targetDelay = Mathf.Clamp(m_DelayBeforeReveal * kInitialDelayLengthenMultipler, 0f, 2.5f); // scale the target delay, with a maximum clamp - var alpha = 0f; - var opacitySmoothVelocity = 1f; - var currentDuration = 0f; - var targetDuration = targetDelay + kRevealDuration; - while (currentDuration < targetDuration) - { - currentDuration += Time.unscaledDeltaTime; - m_CanvasGroup.alpha = alpha; - - while (delay < targetDelay) - { - delay += Time.unscaledDeltaTime; - yield return null; - } - - alpha = MathUtilsExt.SmoothDamp(alpha, kTargetAlpha, ref opacitySmoothVelocity, targetDuration, Mathf.Infinity, Time.unscaledDeltaTime); - yield return null; - } - - m_CanvasGroup.alpha = 1; - m_ContentVisibilityCoroutine = null; - } - /// /// Performs the animated beginning of a button's highlighted state /// IEnumerator BeginHighlight() { - this.StopCoroutine(ref m_IconHighlightCoroutine); - m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); + //this.StopCoroutine(ref m_IconHighlightCoroutine); + //m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); + Debug.LogWarning("BeginHighlight : " + buttonType.ToString()); const float kTargetTransitionAmount = 1f; var transitionAmount = Time.unscaledDeltaTime; var shapedTransitionAmount = 0f; + var currentCanvasAlpha = m_CanvasGroup.alpha; while (transitionAmount < kTargetTransitionAmount) { transitionAmount += Time.unscaledDeltaTime * 4; shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 1f, shapedTransitionAmount); yield return null; } @@ -354,20 +292,58 @@ IEnumerator BeginHighlight() /// IEnumerator EndHighlight() { - this.StopCoroutine(ref m_IconHighlightCoroutine); - m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsEndHighlight()); + //this.StopCoroutine(ref m_IconHighlightCoroutine); + //m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsEndHighlight()); + Debug.LogWarning("EndHighlight : " + buttonType.ToString()); const float kTargetTransitionAmount = 1f; var transitionAmount = Time.unscaledDeltaTime; var shapedTransitionAmount = 0f; + var currentCanvasAlpha = m_CanvasGroup.alpha; while (transitionAmount < kTargetTransitionAmount) { transitionAmount += Time.unscaledDeltaTime * 6; shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 0f, shapedTransitionAmount); + yield return null; + } + } +/* + /// + /// Animate the canvas group's alpha to full opacity + /// + IEnumerator ShowContent() + { + m_CanvasGroup.interactable = true; + const float kTargetAlpha = 1f; + const float kRevealDuration = 0.4f; + const float kInitialDelayLengthenMultipler = 5f; // used to scale up the initial delay based on the m_InitialDelay value + var delay = 0f; + var targetDelay = Mathf.Clamp(m_DelayBeforeReveal * kInitialDelayLengthenMultipler, 0f, 2.5f); // scale the target delay, with a maximum clamp + var alpha = 0f; + var opacitySmoothVelocity = 1f; + var currentDuration = 0f; + var targetDuration = targetDelay + kRevealDuration; + while (currentDuration < targetDuration) + { + currentDuration += Time.unscaledDeltaTime; + m_CanvasGroup.alpha = alpha; + + while (delay < targetDelay) + { + delay += Time.unscaledDeltaTime; + yield return null; + } + + alpha = MathUtilsExt.SmoothDamp(alpha, kTargetAlpha, ref opacitySmoothVelocity, targetDuration, Mathf.Infinity, Time.unscaledDeltaTime); yield return null; } + m_CanvasGroup.alpha = 1; + m_VisibilityCoroutine = null; + } + m_HighlightCoroutine = null; } @@ -436,7 +412,7 @@ IEnumerator IconContainerContentsEndHighlight() //m_IconContainer.localPosition = m_OriginalIconLocalPosition; m_IconHighlightCoroutine = null; } - +*/ /// /// Enable button highlighting on ray enter if autoHighlight is true /// @@ -462,6 +438,9 @@ public void OnPointerExit(PointerEventData eventData) /// public void OnPointerClick(PointerEventData eventData) { + if (m_VisibilityCoroutine != null) + return; + SwapIconSprite(); clicked(this); } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 562c239d3..a53b13a52 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -277,7 +277,6 @@ void BackgroundHovered () Debug.LogWarning( "Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); - m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; //m_ButtonCollider.enabled = false; From 66658c25c69e232748d4ab4d53a65c653ddcd630 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 4 Apr 2017 23:11:06 -0700 Subject: [PATCH 087/870] Add support for quick enter/exit input state handling in PinnedToolButton --- Prefabs/UI/PinnedToolButton.prefab | 1 + Scripts/UI/PinnedToolActionButton.cs | 26 ++++++++++++++---------- Scripts/UI/PinnedToolButton.cs | 30 +++++++++++++++++----------- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 794a345b4..30ebf660c 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -639,6 +639,7 @@ MonoBehaviour: m_SmoothMotion: {fileID: 114000010887893374} m_LeftPinnedToolActionButton: {fileID: 114000011926581952} m_RightPinnedToolActionButton: {fileID: 114000013773965116} + m_RootCollider: {fileID: 65000011941282114} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} --- !u!114 &114000011796366970 diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs index 4fb542159..b562bfebc 100644 --- a/Scripts/UI/PinnedToolActionButton.cs +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -33,7 +33,7 @@ public bool pressed get { return m_Pressed; } set { - if (!m_Highlighted) + if (!highlighted) { value = false; } @@ -81,13 +81,15 @@ public bool visible { set { - Debug.LogWarning("Perform graceful showing/hiding of pinned tool action button visual here : start value : " + m_Visible + " - Setting to : " + value); - if (m_Visible == value) return; + Debug.LogWarning("Perform graceful showing/hiding of pinned tool action button visual here : start value : " + m_Visible + " - Setting to : " + value); + m_Visible = value; + highlighted = value ? highlighted : false; + if (value && !gameObject.activeSelf) gameObject.SetActive(value); @@ -193,8 +195,9 @@ public bool rotateIcon } public Action clicked { get; set; } - //public Action hoverEnter { get; set; } + public Action hoverEnter { get; set; } public Action hoverExit { get; set; } + public Collider mainButtonCollider { get; set; } void Awake() { @@ -208,7 +211,8 @@ void Awake() void OnEnable() { - m_ContentContainer.gameObject.SetActive(true); + //m_ContentContainer.gameObject.SetActive(true); + mainButtonCollider.enabled = false; } void OnDisable() @@ -219,9 +223,10 @@ void OnDisable() this.StopCoroutine(ref m_IconHighlightCoroutine); this.StopCoroutine(ref m_HighlightCoroutine); this.StopCoroutine(ref m_VisibilityCoroutine); - m_ContentContainer.gameObject.SetActive(false); - highlighted = false; + //m_ContentContainer.gameObject.SetActive(false); //} + + mainButtonCollider.enabled = true; } /// @@ -234,7 +239,7 @@ IEnumerator AnimateShow() var currentCanvasAlpha = m_CanvasGroup.alpha; while (transitionAmount < kTargetTransitionAmount) { - transitionAmount += Time.unscaledDeltaTime * 2f; + transitionAmount += Time.unscaledDeltaTime * 3f; m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 1f, MathUtilsExt.SmoothInOutLerpFloat(transitionAmount)); yield return null; } @@ -253,7 +258,7 @@ IEnumerator AnimateHide() var currentCanvasAlpha = m_CanvasGroup.alpha; while (transitionAmount < kTargetTransitionAmount) { - transitionAmount += Time.unscaledDeltaTime * 1.5f; + transitionAmount += Time.unscaledDeltaTime * 2.5f; m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 0f, MathUtilsExt.SmoothInOutLerpFloat(transitionAmount)); yield return null; } @@ -420,7 +425,7 @@ public void OnPointerEnter(PointerEventData eventData) { highlighted = true; eventData.Use(); - //hoverEnter(); + hoverEnter(); } /// @@ -441,6 +446,7 @@ public void OnPointerClick(PointerEventData eventData) if (m_VisibilityCoroutine != null) return; + highlighted = false; SwapIconSprite(); clicked(this); } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index a53b13a52..dd7128bfa 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -141,6 +141,9 @@ public Type previewToolType [SerializeField] PinnedToolActionButton m_RightPinnedToolActionButton; + [SerializeField] + Collider m_RootCollider; + public Transform tooltipTarget { get { return m_TooltipTarget; } } [SerializeField] Transform m_TooltipTarget; @@ -204,10 +207,10 @@ void Start() m_GradientButton.hoverEnter += BackgroundHovered; // Display the foreground button actions m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; - //m_LeftPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; + m_LeftPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; m_LeftPinnedToolActionButton.hoverExit = ActionButtonHoverExit; m_RightPinnedToolActionButton.clicked = ActionButtonClicked; - //m_RightPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; + m_RightPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; m_RightPinnedToolActionButton.hoverExit = ActionButtonHoverExit; // Assign the select action button to the side closest to the opposite hand, that allows the arrow to also point in the direction the @@ -221,6 +224,9 @@ void Start() m_LeftPinnedToolActionButton.visible = false; m_RightPinnedToolActionButton.visible = false; + m_LeftPinnedToolActionButton.mainButtonCollider = m_RootCollider; + m_RightPinnedToolActionButton.mainButtonCollider = m_RootCollider; + //m_ButtonCollider.enabled = true; //m_GradientButton.click += OnClick; //m_GradientButton.gameObject.SetActive(false); @@ -268,19 +274,19 @@ IEnumerator AnimatePosition() void BackgroundHovered () { - if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) - { + //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + //{ Debug.LogError("Background button was hovered, now triggereing the foreground action button visuals"); + m_RootCollider.enabled = false; m_GradientButton.highlighted = true; //m_GradientButton.visible = false; - Debug.LogWarning( - "Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); + //Debug.LogWarning("Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; //m_ButtonCollider.enabled = false; - } + //} } void ActionButtonClicked(PinnedToolActionButton button) @@ -298,17 +304,17 @@ void ActionButtonClicked(PinnedToolActionButton button) CloseButton(); } } -/* + void ActionButtonHoverEnter() { Debug.LogError("Action Button hover ENTER event raised!"); - m_LeftPinnedToolActionButton.visible = true; - m_RightPinnedToolActionButton.visible = true; + m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; + m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; } -*/ + void ActionButtonHoverExit() { - Debug.LogWarning("ActionButtonHoverExit : " + name); + Debug.LogWarning("ActionButtonHoverExit : " + name + " : " + toolType); // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons // Hide both action buttons if the user is no longer hovering over the button From a49eca6e87052c8e204204723234cd7dd71bc3d0 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Apr 2017 13:41:29 -0700 Subject: [PATCH 088/870] First pass on locomotion changes --- .../BlinkLocomotionTool.cs | 148 +++++++++++------- 1 file changed, 89 insertions(+), 59 deletions(-) diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs index 04dfd0721..2418f933c 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs @@ -84,6 +84,8 @@ public ActionMap actionMap public List linkedObjects { private get; set; } + public bool joystickLocomotion { private get; set; } + private void Start() { m_BlinkVisualsGO = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin); @@ -98,6 +100,8 @@ private void Start() m_OriginalNearClipPlane = m_MainCamera.nearClipPlane; m_OriginalFarClipPlane = m_MainCamera.farClipPlane; + joystickLocomotion = true; + Shader.SetGlobalFloat(k_WorldScaleProperty, 1); } @@ -111,6 +115,14 @@ private void OnDestroy() this.ShowDefaultRay(rayOrigin); } + void Update() + { + if (UnityEngine.Input.GetKeyUp(KeyCode.Space)) + joystickLocomotion = !joystickLocomotion; + } + + Quaternion lastRotation; + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var blinkInput = (BlinkLocomotion)input; @@ -246,82 +258,100 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon bool isVive = proxyType == typeof(ViveProxy); - if (m_EnableJoystick && (!isVive || m_Thumb != null)) + if (joystickLocomotion) { - var viewerCamera = CameraUtils.GetMainCamera(); - - if (Mathf.Abs(yawValue) > Mathf.Abs(forwardValue)) + if (blinkInput.blink.isHeld) { - if (!Mathf.Approximately(yawValue, 0)) + if (blinkInput.grip.isHeld) { - if (node == Node.LeftHand) - { - var direction = viewerCamera.transform.right; - direction.y = 0; - direction.Normalize(); + var viewerCamera = CameraUtils.GetMainCamera(); + var diff = Quaternion.Lerp(Quaternion.identity, MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(lastRotation) * rayOrigin.rotation), 0.7f); - Translate(yawValue, isVive, direction); - } - else - { - var speed = yawValue * k_SlowRotationSpeed; - var threshold = isVive ? k_RotationThresholdVive : k_RotationThreshold; - if (Mathf.Abs(yawValue) > threshold) - speed = k_FastRotationSpeed * Mathf.Sign(yawValue); - - cameraRig.RotateAround(viewerCamera.transform.position, Vector3.up, speed * Time.unscaledDeltaTime); - } - - consumeControl(blinkInput.yaw); + cameraRig.RotateAround(viewerCamera.transform.position, Vector3.up, diff.eulerAngles.y); } - } - else - { - if (!Mathf.Approximately(forwardValue, 0)) + else { - var direction = Vector3.up; - - if (node == Node.LeftHand) - { - direction = viewerCamera.transform.forward; - direction.y = 0; - direction.Normalize(); - } - - Translate(forwardValue, isVive, direction); - consumeControl(blinkInput.forward); + cameraRig.Translate(rayOrigin.forward * k_FastMoveSpeed * Time.unscaledDeltaTime); } + consumeControl(blinkInput.blink); + + //var viewerCamera = CameraUtils.GetMainCamera(); + + //if (Mathf.Abs(yawValue) > Mathf.Abs(forwardValue)) + //{ + // if (!Mathf.Approximately(yawValue, 0)) + // { + // if (node == Node.LeftHand) + // { + // var direction = viewerCamera.transform.right; + // direction.y = 0; + // direction.Normalize(); + + // Translate(yawValue, isVive, direction); + // } + // else + // { + // var speed = yawValue * k_SlowRotationSpeed; + // var threshold = isVive ? k_RotationThresholdVive : k_RotationThreshold; + // if (Mathf.Abs(yawValue) > threshold) + // speed = k_FastRotationSpeed * Mathf.Sign(yawValue); + + // cameraRig.RotateAround(viewerCamera.transform.position, Vector3.up, speed * Time.unscaledDeltaTime); + // } + + // consumeControl(blinkInput.yaw); + // } + //} + //else + //{ + // if (!Mathf.Approximately(forwardValue, 0)) + // { + // var direction = Vector3.up; + + // if (node == Node.LeftHand) + // { + // direction = viewerCamera.transform.forward; + // direction.y = 0; + // direction.Normalize(); + // } + + // Translate(forwardValue, isVive, direction); + // consumeControl(blinkInput.forward); + // } + //} } } - - if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) + else { - m_State = State.Aiming; - this.HideDefaultRay(rayOrigin); - this.LockRay(rayOrigin, this); - - m_BlinkVisuals.ShowVisuals(); + if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) + { + m_State = State.Aiming; + this.HideDefaultRay(rayOrigin); + this.LockRay(rayOrigin, this); - consumeControl(blinkInput.blink); - } - else if (m_State == State.Aiming && blinkInput.blink.wasJustReleased) - { - this.UnlockRay(rayOrigin, this); - this.ShowDefaultRay(rayOrigin); + m_BlinkVisuals.ShowVisuals(); - if (!m_BlinkVisuals.outOfMaxRange) - { - m_BlinkVisuals.HideVisuals(); - StartCoroutine(MoveTowardTarget(m_BlinkVisuals.locatorPosition)); + consumeControl(blinkInput.blink); } - else + else if (m_State == State.Aiming && blinkInput.blink.wasJustReleased) { - m_BlinkVisuals.enabled = false; - m_State = State.Inactive; + this.UnlockRay(rayOrigin, this); + this.ShowDefaultRay(rayOrigin); + + if (!m_BlinkVisuals.outOfMaxRange) + { + m_BlinkVisuals.HideVisuals(); + StartCoroutine(MoveTowardTarget(m_BlinkVisuals.locatorPosition)); + } + else + { + m_BlinkVisuals.enabled = false; + m_State = State.Inactive; + } } } - consumeControl(blinkInput.blink); + lastRotation = rayOrigin.rotation; } void Translate(float inputValue, bool isVive, Vector3 direction) From 16e32d86a633f931f498bdb435d4054383808fc8 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Apr 2017 16:32:15 -0700 Subject: [PATCH 089/870] Add "crawl" locomotion --- Tools/BlinkLocomotionTool/BlinkLocomotion.cs | 7 +- .../BlinkLocomotionTool.cs | 244 ++++++++---------- 2 files changed, 115 insertions(+), 136 deletions(-) diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs b/Tools/BlinkLocomotionTool/BlinkLocomotion.cs index b1761f882..78ccc4ecb 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotion.cs @@ -8,9 +8,8 @@ public class BlinkLocomotion : ActionMapInput { public BlinkLocomotion (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @blink { get { return (ButtonInputControl)this[0]; } } - public AxisInputControl @yaw { get { return (AxisInputControl)this[1]; } } - public AxisInputControl @forward { get { return (AxisInputControl)this[2]; } } - public ButtonInputControl @grip { get { return (ButtonInputControl)this[3]; } } - public ButtonInputControl @thumb { get { return (ButtonInputControl)this[4]; } } + public ButtonInputControl @grip { get { return (ButtonInputControl)this[1]; } } + public ButtonInputControl @thumb { get { return (ButtonInputControl)this[2]; } } + public ButtonInputControl @trigger { get { return (ButtonInputControl)this[3]; } } } } diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs index 2418f933c..9963f74dd 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs @@ -1,27 +1,16 @@ #if UNITY_EDITOR -using System; using System.Collections; using System.Collections.Generic; -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, ICustomRay, IUsesHandedRayOrigin, - ICustomActionMap, ILinkedObject, IUsesProxyType, IUsesViewerScale - + sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ICustomRay, ICustomActionMap, ILinkedObject, IUsesViewerScale { - const float k_FastRotationSpeed = 300f; - const float k_RotationThreshold = 0.9f; - const float k_SlowRotationSpeed = 15f; - const float k_FastMoveSpeed = 10f; - const float k_MoveThreshold = 0.9f; - const float k_SlowMoveSpeed = 3f; - - const float k_MoveThresholdVive = 0.8f; - const float k_RotationThresholdVive = 0.8f; + const float k_FastMoveSpeed = 25f; + const float k_SlowMoveSpeed = 5f; //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; @@ -42,14 +31,16 @@ enum State [SerializeField] GameObject m_ViewerScaleVisualsPrefab; + [SerializeField] + ActionMap m_BlinkActionMap; + ViewerScaleVisuals m_ViewerScaleVisuals; - private GameObject m_BlinkVisualsGO; - private BlinkVisuals m_BlinkVisuals; + GameObject m_BlinkVisualsGO; + BlinkVisuals m_BlinkVisuals; - private State m_State = State.Inactive; + State m_State = State.Inactive; - bool m_EnableJoystick; bool m_AllowScaling = true; bool m_Scaling; float m_StartScale; @@ -59,26 +50,26 @@ enum State Vector3 m_StartDirection; float m_StartYaw; + bool m_Rotating; + bool m_GrabMoving; + Vector3 m_RayOriginStartPosition; + Quaternion m_RayOriginStartRotation; + Quaternion m_RigStartRotation; + Vector3 m_RigStartPosition; + Vector3 m_CameraStartPosition; + Quaternion m_LastRotationDiff; + // Allow shared updater to consume these controls for another linked instance InputControl m_Grip; InputControl m_Thumb; - public ActionMap actionMap - { - get { return m_BlinkActionMap; } - } - - [SerializeField] - private ActionMap m_BlinkActionMap; - Camera m_MainCamera; float m_OriginalNearClipPlane; float m_OriginalFarClipPlane; - public Transform rayOrigin { private get; set; } - public Node? node { private get; set; } + public ActionMap actionMap { get { return m_BlinkActionMap; } } - public Type proxyType { private get; set; } + public Transform rayOrigin { private get; set; } public Transform cameraRig { private get; set; } @@ -86,7 +77,7 @@ public ActionMap actionMap public bool joystickLocomotion { private get; set; } - private void Start() + void Start() { m_BlinkVisualsGO = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin); m_BlinkVisuals = m_BlinkVisualsGO.GetComponentInChildren(); @@ -105,12 +96,12 @@ private void Start() Shader.SetGlobalFloat(k_WorldScaleProperty, 1); } - private void OnDisable() + void OnDisable() { m_State = State.Inactive; } - private void OnDestroy() + void OnDestroy() { this.ShowDefaultRay(rayOrigin); } @@ -121,8 +112,6 @@ void Update() joystickLocomotion = !joystickLocomotion; } - Quaternion lastRotation; - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var blinkInput = (BlinkLocomotion)input; @@ -140,9 +129,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; } - var yawValue = blinkInput.yaw.value; - var forwardValue = blinkInput.forward.value; - m_Grip = blinkInput.grip.isHeld ? blinkInput.grip : null; m_Thumb = blinkInput.thumb.isHeld ? blinkInput.thumb : null; @@ -186,8 +172,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_StartDirection = rayToRay; m_StartYaw = cameraRig.rotation.eulerAngles.y; - m_EnableJoystick = false; - blinkTool.m_EnableJoystick = false; + blinkTool.m_Scaling = true; CreateViewerScaleVisuals(rayOrigin, otherRayOrigin); } @@ -256,114 +241,109 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - bool isVive = proxyType == typeof(ViveProxy); - - if (joystickLocomotion) + if (!m_Scaling) { - if (blinkInput.blink.isHeld) + if (!blinkInput.blink.isHeld && blinkInput.grip.isHeld) { - if (blinkInput.grip.isHeld) + if (!m_GrabMoving) { - var viewerCamera = CameraUtils.GetMainCamera(); - var diff = Quaternion.Lerp(Quaternion.identity, MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(lastRotation) * rayOrigin.rotation), 0.7f); - - cameraRig.RotateAround(viewerCamera.transform.position, Vector3.up, diff.eulerAngles.y); - } - else - { - cameraRig.Translate(rayOrigin.forward * k_FastMoveSpeed * Time.unscaledDeltaTime); + m_GrabMoving = true; + m_RigStartPosition = cameraRig.position; + m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; } - consumeControl(blinkInput.blink); - - //var viewerCamera = CameraUtils.GetMainCamera(); - - //if (Mathf.Abs(yawValue) > Mathf.Abs(forwardValue)) - //{ - // if (!Mathf.Approximately(yawValue, 0)) - // { - // if (node == Node.LeftHand) - // { - // var direction = viewerCamera.transform.right; - // direction.y = 0; - // direction.Normalize(); - - // Translate(yawValue, isVive, direction); - // } - // else - // { - // var speed = yawValue * k_SlowRotationSpeed; - // var threshold = isVive ? k_RotationThresholdVive : k_RotationThreshold; - // if (Mathf.Abs(yawValue) > threshold) - // speed = k_FastRotationSpeed * Mathf.Sign(yawValue); - - // cameraRig.RotateAround(viewerCamera.transform.position, Vector3.up, speed * Time.unscaledDeltaTime); - // } - - // consumeControl(blinkInput.yaw); - // } - //} - //else - //{ - // if (!Mathf.Approximately(forwardValue, 0)) - // { - // var direction = Vector3.up; - - // if (node == Node.LeftHand) - // { - // direction = viewerCamera.transform.forward; - // direction.y = 0; - // direction.Normalize(); - // } - - // Translate(forwardValue, isVive, direction); - // consumeControl(blinkInput.forward); - // } - //} - } - } - else - { - if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) - { - m_State = State.Aiming; - this.HideDefaultRay(rayOrigin); - this.LockRay(rayOrigin, this); - - m_BlinkVisuals.ShowVisuals(); - consumeControl(blinkInput.blink); + var localRayPosition = cameraRig.position - rayOrigin.position; + cameraRig.position = m_RigStartPosition + (localRayPosition - m_RayOriginStartPosition); + // Do not consume grip control to allow passing through for multi-select } - else if (m_State == State.Aiming && blinkInput.blink.wasJustReleased) + else { - this.UnlockRay(rayOrigin, this); - this.ShowDefaultRay(rayOrigin); + m_GrabMoving = false; + } - if (!m_BlinkVisuals.outOfMaxRange) + if (joystickLocomotion) + { + if (blinkInput.blink.isHeld) { - m_BlinkVisuals.HideVisuals(); - StartCoroutine(MoveTowardTarget(m_BlinkVisuals.locatorPosition)); + if (blinkInput.grip.isHeld) + { + if (!m_Rotating) + { + m_Rotating = true; + m_RigStartPosition = cameraRig.position; + m_RigStartRotation = cameraRig.rotation; + m_RayOriginStartRotation = MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); + m_CameraStartPosition = CameraUtils.GetMainCamera().transform.position; + m_LastRotationDiff = Quaternion.identity; + } + + consumeControl(blinkInput.grip); + var startOffset = m_RigStartPosition - m_CameraStartPosition; + var localRayRotation = MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); + var rotation = Quaternion.Inverse(m_RayOriginStartRotation) * localRayRotation; + var filteredRotation = Quaternion.Lerp(m_LastRotationDiff, rotation, 0.2f); + + cameraRig.rotation = m_RigStartRotation * filteredRotation; + cameraRig.position = m_CameraStartPosition + filteredRotation * startOffset; + + m_LastRotationDiff = filteredRotation; + } + else + { + var speed = k_SlowMoveSpeed; + if (blinkInput.trigger.isHeld || blinkInput.trigger.wasJustReleased) + { + speed = k_FastMoveSpeed; + consumeControl(blinkInput.trigger); + } + + speed *= this.GetViewerScale(); + + m_Rotating = false; + cameraRig.Translate(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.forward * speed * Time.unscaledDeltaTime); + } + consumeControl(blinkInput.blink); } else { - m_BlinkVisuals.enabled = false; - m_State = State.Inactive; + m_Rotating = false; } } - } - - lastRotation = rayOrigin.rotation; - } + else + { + m_Rotating = false; + if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) + { + m_State = State.Aiming; + this.HideDefaultRay(rayOrigin); + this.LockRay(rayOrigin, this); - void Translate(float inputValue, bool isVive, Vector3 direction) - { - var speed = inputValue * k_SlowMoveSpeed; - var threshold = isVive ? k_MoveThresholdVive : k_MoveThreshold; - if (Mathf.Abs(inputValue) > threshold) - speed = k_FastMoveSpeed * Mathf.Sign(inputValue); + m_BlinkVisuals.ShowVisuals(); - speed *= this.GetViewerScale(); + consumeControl(blinkInput.blink); + } + else if (m_State == State.Aiming && blinkInput.blink.wasJustReleased) + { + this.UnlockRay(rayOrigin, this); + this.ShowDefaultRay(rayOrigin); - cameraRig.Translate(direction * speed * Time.unscaledDeltaTime, Space.World); + if (!m_BlinkVisuals.outOfMaxRange) + { + m_BlinkVisuals.HideVisuals(); + StartCoroutine(MoveTowardTarget(m_BlinkVisuals.locatorPosition)); + } + else + { + m_BlinkVisuals.enabled = false; + m_State = State.Inactive; + } + } + } + } + else + { + m_GrabMoving = false; + } } void CreateViewerScaleVisuals(Transform leftHand, Transform rightHand) @@ -380,14 +360,14 @@ void CancelScale() foreach (var linkedObject in linkedObjects) { - ((BlinkLocomotionTool)linkedObject).m_EnableJoystick = true; + ((BlinkLocomotionTool)linkedObject).m_Scaling = false; } if (m_ViewerScaleVisuals) ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); } - private IEnumerator MoveTowardTarget(Vector3 targetPosition) + IEnumerator MoveTowardTarget(Vector3 targetPosition) { m_State = State.Moving; targetPosition = new Vector3(targetPosition.x + (cameraRig.position.x - CameraUtils.GetMainCamera().transform.position.x), cameraRig.position.y, targetPosition.z + (cameraRig.position.z - CameraUtils.GetMainCamera().transform.position.z)); From ce14c1e3d00b15b1c0b309220fa465e77f32edd5 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Apr 2017 17:26:50 -0700 Subject: [PATCH 090/870] Add reverse button for Touch; Refactor different locomotion types into sub-methods --- Tools/BlinkLocomotionTool/BlinkLocomotion.cs | 2 + .../BlinkLocomotionTool.cs | 239 ++++++++++-------- 2 files changed, 130 insertions(+), 111 deletions(-) diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs b/Tools/BlinkLocomotionTool/BlinkLocomotion.cs index 78ccc4ecb..a4b4d7c5c 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotion.cs @@ -11,5 +11,7 @@ public BlinkLocomotion (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @grip { get { return (ButtonInputControl)this[1]; } } public ButtonInputControl @thumb { get { return (ButtonInputControl)this[2]; } } public ButtonInputControl @trigger { get { return (ButtonInputControl)this[3]; } } + public ButtonInputControl @reverse { get { return (ButtonInputControl)this[4]; } } + public ButtonInputControl @forward { get { return (ButtonInputControl)this[5]; } } } } diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs index 9963f74dd..c7cc7e5e3 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs @@ -11,6 +11,7 @@ sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOri { const float k_FastMoveSpeed = 25f; const float k_SlowMoveSpeed = 5f; + const float k_RotationDamping = 0.2f; //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; @@ -132,6 +133,132 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_Grip = blinkInput.grip.isHeld ? blinkInput.grip : null; m_Thumb = blinkInput.thumb.isHeld ? blinkInput.thumb : null; + DoTwoHandedScaling(consumeControl); + + if (!m_Scaling) + { + DoCrawl(blinkInput); + + if (joystickLocomotion) + DoFlying(consumeControl, blinkInput); + else + DoBlink(consumeControl, blinkInput); + } + else + { + m_GrabMoving = false; + } + } + + void DoFlying(ConsumeControlDelegate consumeControl, BlinkLocomotion blinkInput) + { + var reverse = blinkInput.reverse.isHeld; + var moving = blinkInput.forward.isHeld || reverse; + if (moving) + { + if (blinkInput.grip.isHeld) + { + if (!m_Rotating) + { + m_Rotating = true; + m_RigStartPosition = cameraRig.position; + m_RigStartRotation = cameraRig.rotation; + m_RayOriginStartRotation = MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); + m_CameraStartPosition = CameraUtils.GetMainCamera().transform.position; + m_LastRotationDiff = Quaternion.identity; + } + + consumeControl(blinkInput.grip); + var startOffset = m_RigStartPosition - m_CameraStartPosition; + var localRayRotation = MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); + var rotation = Quaternion.Inverse(m_RayOriginStartRotation) * localRayRotation; + var filteredRotation = Quaternion.Lerp(m_LastRotationDiff, rotation, k_RotationDamping); + + cameraRig.rotation = m_RigStartRotation * filteredRotation; + cameraRig.position = m_CameraStartPosition + filteredRotation * startOffset; + + m_LastRotationDiff = filteredRotation; + } + else + { + var speed = k_SlowMoveSpeed; + if (blinkInput.trigger.isHeld || blinkInput.trigger.wasJustReleased) // Consume control on release to block selection + { + speed = k_FastMoveSpeed; + consumeControl(blinkInput.trigger); + } + + speed *= this.GetViewerScale(); + if (reverse) + speed *= -1; + + m_Rotating = false; + cameraRig.Translate(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.forward * speed * Time.unscaledDeltaTime); + } + + consumeControl(blinkInput.forward); + } + else + { + m_Rotating = false; + } + } + + void DoCrawl(BlinkLocomotion blinkInput) + { + if (!blinkInput.forward.isHeld && !blinkInput.blink.isHeld && blinkInput.grip.isHeld) + { + if (!m_GrabMoving) + { + m_GrabMoving = true; + m_RigStartPosition = cameraRig.position; + m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; + } + + var localRayPosition = cameraRig.position - rayOrigin.position; + cameraRig.position = m_RigStartPosition + (localRayPosition - m_RayOriginStartPosition); + + // Do not consume grip control to allow passing through for multi-select + } + else + { + m_GrabMoving = false; + } + } + + void DoBlink(ConsumeControlDelegate consumeControl, BlinkLocomotion blinkInput) + { + m_Rotating = false; + if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) + { + m_State = State.Aiming; + this.HideDefaultRay(rayOrigin); + this.LockRay(rayOrigin, this); + + m_BlinkVisuals.ShowVisuals(); + + consumeControl(blinkInput.blink); + } + else if (m_State == State.Aiming && blinkInput.blink.wasJustReleased) + { + this.UnlockRay(rayOrigin, this); + this.ShowDefaultRay(rayOrigin); + + if (!m_BlinkVisuals.outOfMaxRange) + { + m_BlinkVisuals.HideVisuals(); + StartCoroutine(MoveTowardTarget(m_BlinkVisuals.locatorPosition)); + } + else + { + m_BlinkVisuals.enabled = false; + m_State = State.Inactive; + } + } + } + + void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) + { if (this.IsSharedUpdater(this)) { if (m_Grip != null) @@ -179,7 +306,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_Scaling = true; - var currentScale = m_StartScale * (m_StartDistance / distance); + var currentScale = Mathf.Clamp(m_StartScale * (m_StartDistance / distance), k_MinScale, k_MaxScale); // Press both thumb buttons to reset if (m_Thumb != null && blinkTool.m_Thumb != null) @@ -203,12 +330,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); } - if (currentScale < k_MinScale) - currentScale = k_MinScale; - - if (currentScale > k_MaxScale) - currentScale = k_MaxScale; - if (m_AllowScaling) { var yawSign = Mathf.Sign(Vector3.Dot(Quaternion.AngleAxis(90, Vector3.down) * m_StartDirection, rayToRay)); @@ -240,110 +361,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon CancelScale(); } } - - if (!m_Scaling) - { - if (!blinkInput.blink.isHeld && blinkInput.grip.isHeld) - { - if (!m_GrabMoving) - { - m_GrabMoving = true; - m_RigStartPosition = cameraRig.position; - m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - } - - var localRayPosition = cameraRig.position - rayOrigin.position; - cameraRig.position = m_RigStartPosition + (localRayPosition - m_RayOriginStartPosition); - // Do not consume grip control to allow passing through for multi-select - } - else - { - m_GrabMoving = false; - } - - if (joystickLocomotion) - { - if (blinkInput.blink.isHeld) - { - if (blinkInput.grip.isHeld) - { - if (!m_Rotating) - { - m_Rotating = true; - m_RigStartPosition = cameraRig.position; - m_RigStartRotation = cameraRig.rotation; - m_RayOriginStartRotation = MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); - m_CameraStartPosition = CameraUtils.GetMainCamera().transform.position; - m_LastRotationDiff = Quaternion.identity; - } - - consumeControl(blinkInput.grip); - var startOffset = m_RigStartPosition - m_CameraStartPosition; - var localRayRotation = MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); - var rotation = Quaternion.Inverse(m_RayOriginStartRotation) * localRayRotation; - var filteredRotation = Quaternion.Lerp(m_LastRotationDiff, rotation, 0.2f); - - cameraRig.rotation = m_RigStartRotation * filteredRotation; - cameraRig.position = m_CameraStartPosition + filteredRotation * startOffset; - - m_LastRotationDiff = filteredRotation; - } - else - { - var speed = k_SlowMoveSpeed; - if (blinkInput.trigger.isHeld || blinkInput.trigger.wasJustReleased) - { - speed = k_FastMoveSpeed; - consumeControl(blinkInput.trigger); - } - - speed *= this.GetViewerScale(); - - m_Rotating = false; - cameraRig.Translate(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.forward * speed * Time.unscaledDeltaTime); - } - consumeControl(blinkInput.blink); - } - else - { - m_Rotating = false; - } - } - else - { - m_Rotating = false; - if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) - { - m_State = State.Aiming; - this.HideDefaultRay(rayOrigin); - this.LockRay(rayOrigin, this); - - m_BlinkVisuals.ShowVisuals(); - - consumeControl(blinkInput.blink); - } - else if (m_State == State.Aiming && blinkInput.blink.wasJustReleased) - { - this.UnlockRay(rayOrigin, this); - this.ShowDefaultRay(rayOrigin); - - if (!m_BlinkVisuals.outOfMaxRange) - { - m_BlinkVisuals.HideVisuals(); - StartCoroutine(MoveTowardTarget(m_BlinkVisuals.locatorPosition)); - } - else - { - m_BlinkVisuals.enabled = false; - m_State = State.Inactive; - } - } - } - } - else - { - m_GrabMoving = false; - } } void CreateViewerScaleVisuals(Transform leftHand, Transform rightHand) From 6fd55333357e7c0bb6081529cccc19686b6408e1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 5 Apr 2017 17:47:08 -0700 Subject: [PATCH 091/870] Add support for deleting PinnedToolButtons in EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 350e65f8d..20d760c4b 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -290,6 +290,7 @@ void AddPinnedToolButton(DeviceData deviceData, Type toolType) pinnedToolButton.node = deviceData.node; pinnedToolButton.toolType = toolType; // Assign Tool Type before assigning order pinnedToolButton.order = 0; // Zeroth position is the active tool position + pinnedToolButton.DeletePinnedToolButton = DeletePinnedToolButton; } void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) @@ -307,6 +308,43 @@ void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, } } + void DeletePinnedToolButton(Transform rayOrigin, PinnedToolButton buttonToDelete) + { + // Remove the pinned tool from the device data collection + // re-order the current buttons + // Highlight the device if the top/selected tool was the one that was closed + + Debug.LogError("DeletePinnedToolButton called"); + + //var result = false; + //var deviceInputModule = evr.m_DeviceInputModule; + Type selectedButtontype = null; + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + { + var buttons = deviceData.pinnedToolButtons; + var selectedButtonOrder = buttons.Count; + foreach (var pair in deviceData.pinnedToolButtons) + { + var button = pair.Value; + if (button != buttonToDelete) + { + // Identify the new selected button + selectedButtonOrder = button.order < selectedButtonOrder ? button.order : selectedButtonOrder; + selectedButtontype = selectedButtonOrder == button.order ? button.toolType : selectedButtontype; + } + } + + + Debug.LogError("Removing button : " + buttonToDelete.toolType); + buttons.Remove(buttonToDelete.toolType); + SelectTool(rayOrigin, buttonToDelete.toolType); + SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, selectedButtontype); + } + }); + } + void DespawnTool(DeviceData deviceData, ITool tool) { if (!IsPermanentTool(tool.GetType())) From aca894396a6fffb02abaa753cf0d80d3bfe961be Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 5 Apr 2017 17:48:28 -0700 Subject: [PATCH 092/870] Add close/delete functionality to PinnedToolButtons and PinnedToolActionButtons --- Scripts/UI/PinnedToolActionButton.cs | 34 +++++------ Scripts/UI/PinnedToolButton.cs | 89 +++++++++++++++++++++------- 2 files changed, 82 insertions(+), 41 deletions(-) diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs index b562bfebc..51c1e5e89 100644 --- a/Scripts/UI/PinnedToolActionButton.cs +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -1,8 +1,6 @@ #if UNITY_EDITOR using System; using System.Collections; -using System.Security.Cryptography.X509Certificates; -using System.Xml.Schema; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -108,8 +106,7 @@ public ButtonType buttonType set { m_ButtonType = value; - m_ButtonColor = buttonType == ButtonType.SelectTool ? s_SelectColor : s_CloseColor; - m_Background.color = m_ButtonColor; + buttonColor = buttonType == ButtonType.SelectTool ? s_SelectColor : s_CloseColor; m_Icon.sprite = buttonType == ButtonType.Close ? m_CloseIconSprite : m_Icon.sprite; } } @@ -164,7 +161,14 @@ public ButtonType buttonType Vector3 m_IconPressedLocalPosition; Sprite m_OriginalIconSprite; Vector3 m_OriginalLocalScale; - Color m_ButtonColor; + + /// + /// Set a custom button color for the selectTool + /// + public Color buttonColor + { + set { m_Background.color = value; } + } // The initial button reveal coroutines, before highlighting occurs Coroutine m_VisibilityCoroutine; @@ -212,7 +216,6 @@ void Awake() void OnEnable() { //m_ContentContainer.gameObject.SetActive(true); - mainButtonCollider.enabled = false; } void OnDisable() @@ -234,12 +237,14 @@ void OnDisable() /// IEnumerator AnimateShow() { + mainButtonCollider.enabled = false; + const float kTargetTransitionAmount = 1f; var transitionAmount = Time.unscaledDeltaTime; var currentCanvasAlpha = m_CanvasGroup.alpha; while (transitionAmount < kTargetTransitionAmount) { - transitionAmount += Time.unscaledDeltaTime * 3f; + transitionAmount += Time.unscaledDeltaTime * 5f; m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 1f, MathUtilsExt.SmoothInOutLerpFloat(transitionAmount)); yield return null; } @@ -258,7 +263,7 @@ IEnumerator AnimateHide() var currentCanvasAlpha = m_CanvasGroup.alpha; while (transitionAmount < kTargetTransitionAmount) { - transitionAmount += Time.unscaledDeltaTime * 2.5f; + transitionAmount += Time.unscaledDeltaTime * 3f; m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 0f, MathUtilsExt.SmoothInOutLerpFloat(transitionAmount)); yield return null; } @@ -423,6 +428,7 @@ IEnumerator IconContainerContentsEndHighlight() /// public void OnPointerEnter(PointerEventData eventData) { + Debug.LogError("OnPointerEnter"); highlighted = true; eventData.Use(); hoverEnter(); @@ -433,6 +439,7 @@ public void OnPointerEnter(PointerEventData eventData) /// public void OnPointerExit(PointerEventData eventData) { + Debug.LogError("OnPointerExit"); highlighted = false; eventData.Use(); hoverExit(); @@ -447,19 +454,8 @@ public void OnPointerClick(PointerEventData eventData) return; highlighted = false; - SwapIconSprite(); clicked(this); } - - /// - /// Swap between the main and alternate icon-sprites - /// - void SwapIconSprite() - { - // Alternate between the main icon and the alternate icon when the button is clicked - if (m_CloseIconSprite) - alternateIconVisible = !alternateIconVisible; - } } } #endif diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index dd7128bfa..0896f4a28 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -37,7 +37,7 @@ public Type toolType m_ToolType = value; if (m_ToolType != null) { - if (isSelectTool) + if (isSelectionTool) { tooltipText = k_SelectionToolTipText; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair @@ -77,6 +77,8 @@ public int order m_SmoothMotion.SetPositionSmoothing(smoothingFactor); m_SmoothMotion.SetRotationSmoothing(smoothingFactor); this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); + m_LeftPinnedToolActionButton.visible = false; + m_RightPinnedToolActionButton.visible = false; } } int m_Order; @@ -113,15 +115,15 @@ public Type previewToolType m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); tooltipText = "Assign " + m_previewToolType.Name; customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; - showTooltip(this); + this.ShowTooltip(this); } else { activeTool = activeTool; m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); customToolTipHighlightColor = gradientPair; - hideTooltip(this); - tooltipText = isSelectTool ? tooltipText = k_SelectionToolTipText : toolType.Name; + this.HideTooltip(this); + tooltipText = isSelectionTool ? tooltipText = k_SelectionToolTipText : toolType.Name; } m_GradientButton.highlighted = m_previewToolType != null; @@ -162,10 +164,12 @@ public Type previewToolType public Action showTooltip { private get; set; } public Action hideTooltip { private get; set; } public GradientPair customToolTipHighlightColor { get; set; } - public bool isSelectTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } + public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } + public Action DeletePinnedToolButton { get; set; } //public ConnectInterfacesDelegate connectInterfaces { get; set; } Coroutine m_PositionCoroutine; + Coroutine m_VisibilityCoroutine; Vector3 m_InactivePosition; // Inactive button offset from the main menu activator private bool activeTool @@ -204,13 +208,14 @@ void Start() m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); this.ConnectInterfaces(m_SmoothMotion); - m_GradientButton.hoverEnter += BackgroundHovered; // Display the foreground button actions + m_GradientButton.hoverEnter += BackgroundHoverEnter; // Display the foreground button actions + m_GradientButton.hoverExit += ActionButtonHoverExit; m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; - m_LeftPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; + m_LeftPinnedToolActionButton.hoverEnter = HoverButton; m_LeftPinnedToolActionButton.hoverExit = ActionButtonHoverExit; m_RightPinnedToolActionButton.clicked = ActionButtonClicked; - m_RightPinnedToolActionButton.hoverEnter = ActionButtonHoverEnter; + m_RightPinnedToolActionButton.hoverEnter = HoverButton; m_RightPinnedToolActionButton.hoverExit = ActionButtonHoverExit; // Assign the select action button to the side closest to the opposite hand, that allows the arrow to also point in the direction the @@ -263,7 +268,7 @@ IEnumerator AnimatePosition() while (duration < 1) { duration += Time.unscaledDeltaTime * 3; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 6); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); yield return null; } @@ -272,21 +277,43 @@ IEnumerator AnimatePosition() m_PositionCoroutine = null; } - void BackgroundHovered () + void BackgroundHoverEnter () { //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) //{ Debug.LogError("Background button was hovered, now triggereing the foreground action button visuals"); - m_RootCollider.enabled = false; + //m_RootCollider.enabled = false; m_GradientButton.highlighted = true; //m_GradientButton.visible = false; //Debug.LogWarning("Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); + HoverButton(); + //m_ButtonCollider.enabled = false; + //} + } + + void HoverButton() + { + if (isSelectionTool) + { + if (activeTool) + { + m_RightPinnedToolActionButton.visible = false; + m_LeftPinnedToolActionButton.visible = false; + m_RootCollider.enabled = true; + } + else + { + m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? true : false; + m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? true : false; + } + } else + { + // Hide the select action button if this tool button is already the selected tool, else show the close button m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; - //m_ButtonCollider.enabled = false; - //} + } } void ActionButtonClicked(PinnedToolActionButton button) @@ -301,17 +328,13 @@ void ActionButtonClicked(PinnedToolActionButton button) } else { - CloseButton(); + if (!isSelectionTool) + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateClose()); + else + Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); } } - void ActionButtonHoverEnter() - { - Debug.LogError("Action Button hover ENTER event raised!"); - m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; - m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; - } - void ActionButtonHoverExit() { Debug.LogWarning("ActionButtonHoverExit : " + name + " : " + toolType); @@ -334,8 +357,30 @@ void ActionButtonHoverExit() void CloseButton() { // TODO add full close functionality - Debug.LogWarning("Implement pinnedTool button hiding visuals. Implement the action button hide visuals as well"); gameObject.SetActive(false); + + // perform a graceful hiding of visuals, then destroy this button gameobject + } + + IEnumerator AnimateClose() + { + this.HideTooltip(this); + m_RootCollider.enabled = false; + var duration = 0f; + var currentScale = transform.localScale; + var targetScale = Vector3.zero; + while (duration < 1) + { + duration += Time.unscaledDeltaTime * 3f; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); + transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + yield return null; + } + + transform.localScale = targetScale; + m_VisibilityCoroutine = null; + DeletePinnedToolButton(rayOrigin, this); + ObjectUtils.Destroy(gameObject, 0.1f); } } } From 2ef2f48ebc47846db32f0cf915568c28c44e0c19 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Apr 2017 18:01:48 -0700 Subject: [PATCH 093/870] Add locomotion settings to the menu --- Menus/MainMenu/MainMenu.cs | 74 +- Menus/MainMenu/Scripts/MainMenuUI.cs | 21 + Scripts/Core/EditorVR.Menus.cs | 6 + Scripts/Interfaces/IMainMenu.cs | 5 + .../Interfaces/ISettingsMenuItemProvider.cs | 22 + .../ISettingsMenuItemProvider.cs.meta | 12 + .../BlinkLocomotionTool/BlinkLocomotion.asset | 71 +- .../BlinkLocomotionTool.cs | 38 +- .../BlinkLocomotionTool.cs.meta | 4 +- .../Prefabs/SettingsUI.prefab | 724 ++++++++++++++++++ .../Prefabs/SettingsUI.prefab.meta | 8 + 11 files changed, 926 insertions(+), 59 deletions(-) create mode 100644 Scripts/Interfaces/ISettingsMenuItemProvider.cs create mode 100644 Scripts/Interfaces/ISettingsMenuItemProvider.cs.meta create mode 100644 Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab create mode 100644 Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab.meta diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 8d16cf1ca..acf1d0f16 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -68,6 +68,7 @@ public bool visible public List menuTools { private get; set; } public List menuWorkspaces { private get; set; } public Dictionary settingsMenuProviders { private get; set; } + public Dictionary settingsMenuItemProviders { private get; set; } public List menuActions { get; set; } public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } @@ -86,6 +87,7 @@ void Start() CreateFaceButtons(menuTools); CreateFaceButtons(menuWorkspaces); CreateFaceButtons(settingsMenuProviders.Keys.ToList()); + CreateFaceButtons(settingsMenuItemProviders.Keys.ToList()); m_MainMenuUI.SetupMenuFaces(); UpdateToolButtons(); } @@ -126,6 +128,7 @@ void CreateFaceButtons(List types) var isTool = typeof(ITool).IsAssignableFrom(type); var isWorkspace = typeof(Workspace).IsAssignableFrom(type); var isSettingsProvider = typeof(ISettingsMenuProvider).IsAssignableFrom(type); + var isSettingsItemProvider = typeof(ISettingsMenuItemProvider).IsAssignableFrom(type); var buttonData = new MainMenuUI.ButtonData(); buttonData.name = type.Name; @@ -146,47 +149,58 @@ void CreateFaceButtons(List types) buttonData.name = type.Name.Replace("Workspace", string.Empty); buttonData.sectionName = "Workspaces"; } - else if (isSettingsProvider) + else if (isSettingsProvider || isSettingsItemProvider) { - // For workspaces that haven't specified a custom attribute, do some menu categorization automatically + buttonData.name = type.Name.Replace("Tool", string.Empty); buttonData.name = type.Name.Replace("Module", string.Empty); buttonData.sectionName = "Settings"; } - var selectedType = type; // Local variable for proper closure - m_MainMenuUI.CreateFaceButton(buttonData, b => + if (isSettingsItemProvider) { - b.button.onClick.RemoveAllListeners(); - if (isTool) + var itemProvider = settingsMenuItemProviders[type]; + m_MainMenuUI.CreateCustomButton(itemProvider.settingsMenuItemPrefab, buttonData, b => { - m_ToolButtons[selectedType] = b; - - b.button.onClick.AddListener(() => + itemProvider.settingsMenuItemInstance = b; + }); + } + else + { + var selectedType = type; // Local variable for proper closure + m_MainMenuUI.CreateFaceButton(buttonData, b => + { + b.button.onClick.RemoveAllListeners(); + if (isTool) { - if (visible && targetRayOrigin) + m_ToolButtons[selectedType] = b; + + b.button.onClick.AddListener(() => { - this.SelectTool(targetRayOrigin, selectedType); - UpdateToolButtons(); - } - }); - } - else if (isWorkspace) - { - b.button.onClick.AddListener(() => + if (visible && targetRayOrigin) + { + this.SelectTool(targetRayOrigin, selectedType); + UpdateToolButtons(); + } + }); + } + else if (isWorkspace) { - if (visible) - this.CreateWorkspace(selectedType); - }); - } - else if (isSettingsProvider) - { - b.button.onClick.AddListener(() => + b.button.onClick.AddListener(() => + { + if (visible) + this.CreateWorkspace(selectedType); + }); + } + else if (isSettingsProvider) { - var provider = settingsMenuProviders[selectedType]; - provider.settingsMenuInstance = m_MainMenuUI.AddSubmenu(buttonData.sectionName, provider.settingsMenuPrefab); - }); - } - }); + b.button.onClick.AddListener(() => + { + var provider = settingsMenuProviders[selectedType]; + provider.settingsMenuInstance = m_MainMenuUI.AddSubmenu(buttonData.sectionName, provider.settingsMenuPrefab); + }); + } + }); + } } } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 1f1b765a8..5f94c8fe4 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -257,6 +257,27 @@ public void CreateFaceButton(ButtonData buttonData, Action butto } } + public void CreateCustomButton(GameObject prefab, ButtonData buttonData, Action buttonCreationCallback) + { + var button = ObjectUtils.Instantiate(prefab); + button.name = buttonData.name; + buttonCreationCallback(button); + + if (string.IsNullOrEmpty(buttonData.sectionName)) + buttonData.sectionName = k_UncategorizedFaceName; + + var found = m_FaceButtons.Any(x => x.Key == buttonData.sectionName); + if (found) + { + var kvp = m_FaceButtons.First(x => x.Key == buttonData.sectionName); + kvp.Value.Add(button.transform); + } + else + { + m_FaceButtons.Add(buttonData.sectionName, new List { button.transform }); + } + } + public void SetupMenuFaces() { var position = 0; diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index b8e672f07..b45b954f7 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -31,6 +31,7 @@ internal enum MenuHideFlags } readonly Dictionary m_SettingsMenuProviders = new Dictionary(); + readonly Dictionary m_SettingsMenuItemProviders = new Dictionary(); List m_MainMenuTools; WorkspaceModule m_WorkspaceModule; @@ -49,12 +50,17 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) if (settingsMenuProvider != null) m_SettingsMenuProviders[obj.GetType()] = settingsMenuProvider; + var settingsMenuItemProvider = obj as ISettingsMenuItemProvider; + if (settingsMenuItemProvider != null) + m_SettingsMenuItemProviders[obj.GetType()] = settingsMenuItemProvider; + var mainMenu = obj as IMainMenu; if (mainMenu != null) { mainMenu.menuTools = m_MainMenuTools; mainMenu.menuWorkspaces = WorkspaceModule.workspaceTypes; mainMenu.settingsMenuProviders = m_SettingsMenuProviders; + mainMenu.settingsMenuItemProviders = m_SettingsMenuItemProviders; } } diff --git a/Scripts/Interfaces/IMainMenu.cs b/Scripts/Interfaces/IMainMenu.cs index 5291fa7e9..a699183c2 100644 --- a/Scripts/Interfaces/IMainMenu.cs +++ b/Scripts/Interfaces/IMainMenu.cs @@ -25,6 +25,11 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Dictionary settingsMenuProviders { set; } + /// + /// The types which provide a settings menu item + /// + Dictionary settingsMenuItemProviders { set; } + /// /// The ray origin that spawned the menu and will be used for node-specific operations (e.g. selecting a tool) /// diff --git a/Scripts/Interfaces/ISettingsMenuItemProvider.cs b/Scripts/Interfaces/ISettingsMenuItemProvider.cs new file mode 100644 index 000000000..18de0e862 --- /dev/null +++ b/Scripts/Interfaces/ISettingsMenuItemProvider.cs @@ -0,0 +1,22 @@ +#if UNITY_EDITOR +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Decorates types that can provide a sub-menu on the Settings menu. The class should also use a MainMenuItemAttribute + /// + public interface ISettingsMenuItemProvider + { + /// + /// The menu face prefab which will be added to the menu + /// + GameObject settingsMenuItemPrefab { get; } + + /// + /// An instance of the menu face prefab that was added to the menu + /// + GameObject settingsMenuItemInstance { set; } + } +} +#endif \ No newline at end of file diff --git a/Scripts/Interfaces/ISettingsMenuItemProvider.cs.meta b/Scripts/Interfaces/ISettingsMenuItemProvider.cs.meta new file mode 100644 index 000000000..739de68a5 --- /dev/null +++ b/Scripts/Interfaces/ISettingsMenuItemProvider.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 74155b227683cf748a0598fa6b253d9c +timeCreated: 1490644447 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.asset b/Tools/BlinkLocomotionTool/BlinkLocomotion.asset index 7f46963ce..3a4503d01 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotion.asset +++ b/Tools/BlinkLocomotionTool/BlinkLocomotion.asset @@ -14,10 +14,11 @@ MonoBehaviour: m_RunInEditMode: 0 m_Actions: - {fileID: 114000011114386886} - - {fileID: 114000014052142292} - - {fileID: 114000011232169852} - {fileID: 114000013530790504} - {fileID: 114000011708774044} + - {fileID: 114000011230901436} + - {fileID: 114000010166273910} + - {fileID: 114000013424161920} m_ControlSchemes: - m_Name: BlinkLocomotion m_DeviceSlots: @@ -38,7 +39,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 0 + - controlIndex: 3 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -47,7 +48,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 1 + - controlIndex: 22 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -56,7 +57,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 3 + - controlIndex: 2 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -65,7 +66,16 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 22 + - controlIndex: 17 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 18 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -76,6 +86,27 @@ MonoBehaviour: m_MapTypeName: BlinkLocomotion, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: +--- !u!114 &114000010166273910 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Reverse + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 4 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Reverse + defaultValue: 0 --- !u!114 &114000011114386886 MonoBehaviour: m_ObjectHideFlags: 0 @@ -97,7 +128,7 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Blink defaultValue: 0 ---- !u!114 &114000011232169852 +--- !u!114 &114000011230901436 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} @@ -106,17 +137,17 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Forward + m_Name: Trigger m_EditorClassIdentifier: m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} - m_ActionIndex: 2 + m_ActionIndex: 3 m_ControlData: componentControlIndices: controlType: - m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - name: Forward + name: Trigger defaultValue: 0 --- !u!114 &114000011708774044 MonoBehaviour: @@ -131,7 +162,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} - m_ActionIndex: 4 + m_ActionIndex: 2 m_ControlData: componentControlIndices: controlType: @@ -139,7 +170,7 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Thumb defaultValue: 0 ---- !u!114 &114000013530790504 +--- !u!114 &114000013424161920 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} @@ -148,19 +179,19 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Grip + m_Name: Forward m_EditorClassIdentifier: m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} - m_ActionIndex: 3 + m_ActionIndex: 5 m_ControlData: componentControlIndices: controlType: m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - name: Grip + name: Forward defaultValue: 0 ---- !u!114 &114000014052142292 +--- !u!114 &114000013530790504 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} @@ -169,7 +200,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Yaw + m_Name: Grip m_EditorClassIdentifier: m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} @@ -177,7 +208,7 @@ MonoBehaviour: m_ControlData: componentControlIndices: controlType: - m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - name: Yaw + name: Grip defaultValue: 0 diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs index c7cc7e5e3..919e07025 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs @@ -4,10 +4,12 @@ using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; +using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ICustomRay, ICustomActionMap, ILinkedObject, IUsesViewerScale + sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ICustomRay, ICustomActionMap, + ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider { const float k_FastMoveSpeed = 25f; const float k_SlowMoveSpeed = 5f; @@ -35,6 +37,9 @@ enum State [SerializeField] ActionMap m_BlinkActionMap; + [SerializeField] + GameObject m_SettingsMenuItemPrefab; + ViewerScaleVisuals m_ViewerScaleVisuals; GameObject m_BlinkVisualsGO; @@ -76,7 +81,26 @@ enum State public List linkedObjects { private get; set; } - public bool joystickLocomotion { private get; set; } + public bool blinkMode { private get; set; } + + public GameObject settingsMenuItemPrefab { get { return m_SettingsMenuItemPrefab; } } + + public GameObject settingsMenuItemInstance + { + set + { + foreach (var toggle in value.GetComponentsInChildren()) + { + if (toggle.isOn) + { + toggle.onValueChanged.AddListener(isOn => + { + blinkMode = !isOn; + }); + } + } + } + } void Start() { @@ -92,8 +116,6 @@ void Start() m_OriginalNearClipPlane = m_MainCamera.nearClipPlane; m_OriginalFarClipPlane = m_MainCamera.farClipPlane; - joystickLocomotion = true; - Shader.SetGlobalFloat(k_WorldScaleProperty, 1); } @@ -110,7 +132,7 @@ void OnDestroy() void Update() { if (UnityEngine.Input.GetKeyUp(KeyCode.Space)) - joystickLocomotion = !joystickLocomotion; + blinkMode = !blinkMode; } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -139,10 +161,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { DoCrawl(blinkInput); - if (joystickLocomotion) - DoFlying(consumeControl, blinkInput); - else + if (blinkMode) DoBlink(consumeControl, blinkInput); + else + DoFlying(consumeControl, blinkInput); } else { diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs.meta b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs.meta index a700dc6d5..69c540d99 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs.meta +++ b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 403957a6dcd8bfe4a905881513f309b0 -timeCreated: 1488823315 +timeCreated: 1491439928 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -10,6 +10,8 @@ MonoImporter: - m_ViewerScaleVisualsPrefab: {fileID: 1000012817627458, guid: 60a4bda9bfa0dcc4e9ccab99d39c295f, type: 2} - m_BlinkActionMap: {fileID: 11400000, guid: 233e21336472f454bb9de757639a9ec0, type: 2} + - m_SettingsMenuItemPrefab: {fileID: 1000013404610172, guid: f1141ca24ceb64f49a6e988175713e3d, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab b/Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab new file mode 100644 index 000000000..8fc64baaf --- /dev/null +++ b/Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab @@ -0,0 +1,724 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000013404610172} + m_IsPrefabParent: 1 +--- !u!1 &1000010398065086 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012653929454} + - 222: {fileID: 222000012891014098} + - 114: {fileID: 114000012025195674} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011430478146 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012493860698} + - 222: {fileID: 222000012612170110} + - 114: {fileID: 114000010706236210} + m_Layer: 5 + m_Name: Foreground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011512978662 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011405639814} + - 222: {fileID: 222000011416400564} + - 114: {fileID: 114000011583981380} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011772923556 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000010858218954} + - 114: {fileID: 114000011920048442} + m_Layer: 5 + m_Name: Blink + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012753606596 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000010616025136} + - 222: {fileID: 222000010570603678} + - 114: {fileID: 114000011835530144} + m_Layer: 5 + m_Name: Foreground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013404610172 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011487074538} + - 222: {fileID: 222000012862005820} + m_Layer: 5 + m_Name: SettingsUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013494423478 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011444372664} + - 114: {fileID: 114000013714903302} + m_Layer: 5 + m_Name: Fly + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013599855740 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013724969698} + - 222: {fileID: 222000011524760356} + - 114: {fileID: 114000011422230102} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013796857246 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011778163486} + - 222: {fileID: 222000011646980040} + - 114: {fileID: 114000013593928534} + - 114: {fileID: 114000012940195592} + m_Layer: 5 + m_Name: LocomotionMode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014118413922 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013716393632} + - 222: {fileID: 222000012522696328} + - 114: {fileID: 114000013077659776} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &114000010706236210 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011430478146} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011422230102 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013599855740} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: db3c88ad8f7fe11479d2d3e48c08e6f0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011583981380 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011512978662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Blink +--- !u!114 &114000011835530144 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012753606596} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 0.10196079, g: 0.10196079, b: 0.10196079, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011920048442 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011772923556} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0, g: 0, b: 0, a: 0.76} + m_HighlightedColor: {r: 0, g: 0, b: 0, a: 0.866} + m_PressedColor: {r: 0, g: 0, b: 0, a: 0.76} + m_DisabledColor: {r: 0, g: 0, b: 0, a: 0.76} + m_ColorMultiplier: 1 + m_FadeDuration: 0.2 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000011835530144} + toggleTransition: 1 + graphic: {fileID: 114000013077659776} + m_Group: {fileID: 114000012940195592} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_IsOn: 0 +--- !u!114 &114000012025195674 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010398065086} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Fly +--- !u!114 &114000012940195592 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1184210157, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_AllowSwitchOff: 0 +--- !u!114 &114000013077659776 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014118413922} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: db3c88ad8f7fe11479d2d3e48c08e6f0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013593928534 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 +--- !u!114 &114000013714903302 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013494423478} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0, g: 0, b: 0, a: 0.76} + m_HighlightedColor: {r: 0, g: 0, b: 0, a: 0.866} + m_PressedColor: {r: 0, g: 0, b: 0, a: 0.76} + m_DisabledColor: {r: 0, g: 0, b: 0, a: 0.76} + m_ColorMultiplier: 1 + m_FadeDuration: 0.2 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000010706236210} + toggleTransition: 1 + graphic: {fileID: 114000011422230102} + m_Group: {fileID: 114000012940195592} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_IsOn: 1 +--- !u!222 &222000010570603678 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012753606596} +--- !u!222 &222000011416400564 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011512978662} +--- !u!222 &222000011524760356 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013599855740} +--- !u!222 &222000011646980040 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} +--- !u!222 &222000012522696328 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014118413922} +--- !u!222 &222000012612170110 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011430478146} +--- !u!222 &222000012862005820 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013404610172} +--- !u!222 &222000012891014098 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010398065086} +--- !u!224 &224000010616025136 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012753606596} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000010858218954} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.25, y: 0} + m_SizeDelta: {x: -0.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010858218954 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011772923556} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000013716393632} + - {fileID: 224000010616025136} + - {fileID: 224000011405639814} + m_Father: {fileID: 224000011778163486} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011405639814 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011512978662} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000010858218954} + m_RootOrder: 2 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.25, y: 0} + m_SizeDelta: {x: -0.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011444372664 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013494423478} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000013724969698} + - {fileID: 224000012493860698} + - {fileID: 224000012653929454} + m_Father: {fileID: 224000011778163486} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011487074538 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013404610172} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000011778163486} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 263.2, y: 45} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &224000011778163486 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000010858218954} + - {fileID: 224000011444372664} + m_Father: {fileID: 224000011487074538} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012493860698 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011430478146} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011444372664} + m_RootOrder: 1 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.25, y: 0} + m_SizeDelta: {x: -0.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012653929454 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010398065086} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011444372664} + m_RootOrder: 2 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.25, y: 0} + m_SizeDelta: {x: -0.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013716393632 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014118413922} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000010858218954} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2, y: 2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013724969698 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013599855740} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 224000011444372664} + m_RootOrder: 0 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2, y: 2} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab.meta b/Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab.meta new file mode 100644 index 000000000..8ad6c00ba --- /dev/null +++ b/Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f1141ca24ceb64f49a6e988175713e3d +timeCreated: 1491439922 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From 43feb833c4a8b1bab1589cab6ebbfd25da080e96 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Apr 2017 18:04:57 -0700 Subject: [PATCH 094/870] Rename BlinkLocomotion to Locomotion --- Scripts/Core/EditorVR.Tools.cs | 2 +- Tools/BlinkLocomotionTool.meta | 4 ++-- Tools/BlinkLocomotionTool/Scripts.meta | 12 +++--------- Tools/BlinkLocomotionTool/Shaders.meta | 12 +++--------- Tools/LocomotionTool.meta | 9 +++++++++ .../Demo.meta | 0 .../Demo/BlinkTestScene.unity | 0 .../Demo/BlinkTestScene.unity.meta | 0 .../Locomotion.asset} | 0 .../Locomotion.asset.meta} | 0 .../Locomotion.cs} | 4 ++-- .../Locomotion.cs.meta} | 4 ++-- .../LocomotionTool.cs} | 16 ++++++++-------- .../LocomotionTool.cs.meta} | 0 .../Materials.meta | 0 .../Materials/BlinkLine.mat | 0 .../Materials/BlinkLine.mat.meta | 0 .../Materials/BlinkVisuals.mat | 0 .../Materials/BlinkVisuals.mat.meta | 0 .../Materials/WorldScaleVisuals.mat | 0 .../Materials/WorldScaleVisuals.mat.meta | 0 .../Meshes.meta | 0 .../Meshes/BlinkArcFollower.fbx | 0 .../Meshes/BlinkArcFollower.fbx.meta | 0 .../Meshes/BlinkLocatorRing.fbx | 0 .../Meshes/BlinkLocatorRing.fbx.meta | 0 .../Meshes/BlinkLocatorTube.fbx | 0 .../Meshes/BlinkLocatorTube.fbx.meta | 0 .../Meshes/BlinkRoomScale.fbx | 0 .../Meshes/BlinkRoomScale.fbx.meta | 0 .../Prefabs.meta | 0 .../Prefabs/BlinkVisuals.prefab | 0 .../Prefabs/BlinkVisuals.prefab.meta | 0 .../Prefabs/ScaleIcon.prefab | 0 .../Prefabs/ScaleIcon.prefab.meta | 0 .../Prefabs/SettingsUI.prefab | 0 .../Prefabs/SettingsUI.prefab.meta | 0 .../Prefabs/ViewerScaleVisuals.prefab | 0 .../Prefabs/ViewerScaleVisuals.prefab.meta | 0 Tools/LocomotionTool/Scripts.meta | 9 +++++++++ .../Scripts/BlinkVisuals.cs | 0 .../Scripts/BlinkVisuals.cs.meta | 0 .../Scripts/ViewerScaleVisuals.cs | 0 .../Scripts/ViewerScaleVisuals.cs.meta | 0 Tools/LocomotionTool/Shaders.meta | 9 +++++++++ .../Shaders/UI-Default-NoDepth.shader | 0 .../Shaders/UI-Default-NoDepth.shader.meta | 0 .../Textures.meta | 0 .../Textures/RoomScale.png | 0 .../Textures/RoomScale.png.meta | 0 .../Textures/WorldScaleIcons.meta | 0 .../Textures/WorldScaleIcons/atom.png | 0 .../Textures/WorldScaleIcons/atom.png.meta | 0 .../Textures/WorldScaleIcons/building.png | 0 .../Textures/WorldScaleIcons/building.png.meta | 0 .../Textures/WorldScaleIcons/burrito.png | 0 .../Textures/WorldScaleIcons/burrito.png.meta | 0 .../Textures/WorldScaleIcons/moon.png | 0 .../Textures/WorldScaleIcons/moon.png.meta | 0 .../Textures/WorldScaleIcons/person.png | 0 .../Textures/WorldScaleIcons/person.png.meta | 0 .../Textures/WorldScaleIcons/sea monster.png | 0 .../WorldScaleIcons/sea monster.png.meta | 0 .../Textures/border.png | 0 .../Textures/border.png.meta | 0 65 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 Tools/LocomotionTool.meta rename Tools/{BlinkLocomotionTool => LocomotionTool}/Demo.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Demo/BlinkTestScene.unity (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Demo/BlinkTestScene.unity.meta (100%) rename Tools/{BlinkLocomotionTool/BlinkLocomotion.asset => LocomotionTool/Locomotion.asset} (100%) rename Tools/{BlinkLocomotionTool/BlinkLocomotion.asset.meta => LocomotionTool/Locomotion.asset.meta} (100%) rename Tools/{BlinkLocomotionTool/BlinkLocomotion.cs => LocomotionTool/Locomotion.cs} (84%) rename Tools/{BlinkLocomotionTool/BlinkLocomotion.cs.meta => LocomotionTool/Locomotion.cs.meta} (75%) rename Tools/{BlinkLocomotionTool/BlinkLocomotionTool.cs => LocomotionTool/LocomotionTool.cs} (95%) rename Tools/{BlinkLocomotionTool/BlinkLocomotionTool.cs.meta => LocomotionTool/LocomotionTool.cs.meta} (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Materials.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Materials/BlinkLine.mat (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Materials/BlinkLine.mat.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Materials/BlinkVisuals.mat (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Materials/BlinkVisuals.mat.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Materials/WorldScaleVisuals.mat (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Materials/WorldScaleVisuals.mat.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes/BlinkArcFollower.fbx (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes/BlinkArcFollower.fbx.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes/BlinkLocatorRing.fbx (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes/BlinkLocatorRing.fbx.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes/BlinkLocatorTube.fbx (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes/BlinkLocatorTube.fbx.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes/BlinkRoomScale.fbx (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Meshes/BlinkRoomScale.fbx.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs/BlinkVisuals.prefab (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs/BlinkVisuals.prefab.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs/ScaleIcon.prefab (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs/ScaleIcon.prefab.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs/SettingsUI.prefab (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs/SettingsUI.prefab.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs/ViewerScaleVisuals.prefab (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Prefabs/ViewerScaleVisuals.prefab.meta (100%) create mode 100644 Tools/LocomotionTool/Scripts.meta rename Tools/{BlinkLocomotionTool => LocomotionTool}/Scripts/BlinkVisuals.cs (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Scripts/BlinkVisuals.cs.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Scripts/ViewerScaleVisuals.cs (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Scripts/ViewerScaleVisuals.cs.meta (100%) create mode 100644 Tools/LocomotionTool/Shaders.meta rename Tools/{BlinkLocomotionTool => LocomotionTool}/Shaders/UI-Default-NoDepth.shader (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Shaders/UI-Default-NoDepth.shader.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/RoomScale.png (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/RoomScale.png.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/atom.png (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/atom.png.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/building.png (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/building.png.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/burrito.png (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/burrito.png.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/moon.png (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/moon.png.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/person.png (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/person.png.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/sea monster.png (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/WorldScaleIcons/sea monster.png.meta (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/border.png (100%) rename Tools/{BlinkLocomotionTool => LocomotionTool}/Textures/border.png.meta (100%) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index e4157a153..6abef2f57 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -105,7 +105,7 @@ internal void SpawnDefaultTools(IProxy proxy) // Using a shared instance of the transform tool across all device tool stacks AddToolToStack(deviceData, transformTool); - toolData = SpawnTool(typeof(BlinkLocomotionTool), out devices, inputDevice); + toolData = SpawnTool(typeof(LocomotionTool), out devices, inputDevice); AddToolToDeviceData(toolData, devices); var evrMenus = evr.m_Menus; diff --git a/Tools/BlinkLocomotionTool.meta b/Tools/BlinkLocomotionTool.meta index 191195ba0..3f31318a3 100644 --- a/Tools/BlinkLocomotionTool.meta +++ b/Tools/BlinkLocomotionTool.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: f1da287b01b790442b98732c830bcc75 +guid: 63952765f2756d34f8ce731515185f2a folderAsset: yes -timeCreated: 1468024799 +timeCreated: 1491440560 licenseType: Pro DefaultImporter: userData: diff --git a/Tools/BlinkLocomotionTool/Scripts.meta b/Tools/BlinkLocomotionTool/Scripts.meta index 420c04763..a4fd37bb6 100644 --- a/Tools/BlinkLocomotionTool/Scripts.meta +++ b/Tools/BlinkLocomotionTool/Scripts.meta @@ -1,9 +1,3 @@ -fileFormatVersion: 2 -guid: fa27d81e046c2c741b4237c765e18352 -folderAsset: yes -timeCreated: 1468535285 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: cb35d62e8ce94b60ae39dbac5d00fd7c +timeCreated: 1491440548 \ No newline at end of file diff --git a/Tools/BlinkLocomotionTool/Shaders.meta b/Tools/BlinkLocomotionTool/Shaders.meta index b66268749..01f4a7336 100644 --- a/Tools/BlinkLocomotionTool/Shaders.meta +++ b/Tools/BlinkLocomotionTool/Shaders.meta @@ -1,9 +1,3 @@ -fileFormatVersion: 2 -guid: 4d2c6e1f80e162146ab113fab5a84fef -folderAsset: yes -timeCreated: 1487119591 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 39499ff87f744e20b6869a8f9a89700b +timeCreated: 1491440548 \ No newline at end of file diff --git a/Tools/LocomotionTool.meta b/Tools/LocomotionTool.meta new file mode 100644 index 000000000..191195ba0 --- /dev/null +++ b/Tools/LocomotionTool.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f1da287b01b790442b98732c830bcc75 +folderAsset: yes +timeCreated: 1468024799 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/BlinkLocomotionTool/Demo.meta b/Tools/LocomotionTool/Demo.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Demo.meta rename to Tools/LocomotionTool/Demo.meta diff --git a/Tools/BlinkLocomotionTool/Demo/BlinkTestScene.unity b/Tools/LocomotionTool/Demo/BlinkTestScene.unity similarity index 100% rename from Tools/BlinkLocomotionTool/Demo/BlinkTestScene.unity rename to Tools/LocomotionTool/Demo/BlinkTestScene.unity diff --git a/Tools/BlinkLocomotionTool/Demo/BlinkTestScene.unity.meta b/Tools/LocomotionTool/Demo/BlinkTestScene.unity.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Demo/BlinkTestScene.unity.meta rename to Tools/LocomotionTool/Demo/BlinkTestScene.unity.meta diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.asset b/Tools/LocomotionTool/Locomotion.asset similarity index 100% rename from Tools/BlinkLocomotionTool/BlinkLocomotion.asset rename to Tools/LocomotionTool/Locomotion.asset diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.asset.meta b/Tools/LocomotionTool/Locomotion.asset.meta similarity index 100% rename from Tools/BlinkLocomotionTool/BlinkLocomotion.asset.meta rename to Tools/LocomotionTool/Locomotion.asset.meta diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs b/Tools/LocomotionTool/Locomotion.cs similarity index 84% rename from Tools/BlinkLocomotionTool/BlinkLocomotion.cs rename to Tools/LocomotionTool/Locomotion.cs index a4b4d7c5c..6ab91dbeb 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs +++ b/Tools/LocomotionTool/Locomotion.cs @@ -4,8 +4,8 @@ // GENERATED FILE - DO NOT EDIT MANUALLY namespace UnityEngine.InputNew { - public class BlinkLocomotion : ActionMapInput { - public BlinkLocomotion (ActionMap actionMap) : base (actionMap) { } + public class Locomotion : ActionMapInput { + public Locomotion (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @blink { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @grip { get { return (ButtonInputControl)this[1]; } } diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs.meta b/Tools/LocomotionTool/Locomotion.cs.meta similarity index 75% rename from Tools/BlinkLocomotionTool/BlinkLocomotion.cs.meta rename to Tools/LocomotionTool/Locomotion.cs.meta index f426d9966..80cae3f74 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs.meta +++ b/Tools/LocomotionTool/Locomotion.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 65f49ed3d39ab4744856db95c874ed0c -timeCreated: 1469002693 +guid: 7701565cecf69864ca148b577c901910 +timeCreated: 1491440597 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs similarity index 95% rename from Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs rename to Tools/LocomotionTool/LocomotionTool.cs index 919e07025..111686ba1 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ICustomRay, ICustomActionMap, + sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ICustomRay, ICustomActionMap, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider { const float k_FastMoveSpeed = 25f; @@ -137,7 +137,7 @@ void Update() public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var blinkInput = (BlinkLocomotion)input; + var blinkInput = (Locomotion)input; if (m_State == State.Moving) return; @@ -147,7 +147,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (linkedObject == this) continue; - var blinkTool = (BlinkLocomotionTool)linkedObject; + var blinkTool = (LocomotionTool)linkedObject; if (blinkTool.m_State != State.Inactive) return; } @@ -172,7 +172,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - void DoFlying(ConsumeControlDelegate consumeControl, BlinkLocomotion blinkInput) + void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) { var reverse = blinkInput.reverse.isHeld; var moving = blinkInput.forward.isHeld || reverse; @@ -226,7 +226,7 @@ void DoFlying(ConsumeControlDelegate consumeControl, BlinkLocomotion blinkInput) } } - void DoCrawl(BlinkLocomotion blinkInput) + void DoCrawl(Locomotion blinkInput) { if (!blinkInput.forward.isHeld && !blinkInput.blink.isHeld && blinkInput.grip.isHeld) { @@ -248,7 +248,7 @@ void DoCrawl(BlinkLocomotion blinkInput) } } - void DoBlink(ConsumeControlDelegate consumeControl, BlinkLocomotion blinkInput) + void DoBlink(ConsumeControlDelegate consumeControl, Locomotion blinkInput) { m_Rotating = false; if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) @@ -293,7 +293,7 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) if (linkedObject == this) continue; - var blinkTool = (BlinkLocomotionTool)linkedObject; + var blinkTool = (LocomotionTool)linkedObject; if (blinkTool.m_Grip != null) { otherGrip = true; @@ -399,7 +399,7 @@ void CancelScale() foreach (var linkedObject in linkedObjects) { - ((BlinkLocomotionTool)linkedObject).m_Scaling = false; + ((LocomotionTool)linkedObject).m_Scaling = false; } if (m_ViewerScaleVisuals) diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs.meta b/Tools/LocomotionTool/LocomotionTool.cs.meta similarity index 100% rename from Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs.meta rename to Tools/LocomotionTool/LocomotionTool.cs.meta diff --git a/Tools/BlinkLocomotionTool/Materials.meta b/Tools/LocomotionTool/Materials.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Materials.meta rename to Tools/LocomotionTool/Materials.meta diff --git a/Tools/BlinkLocomotionTool/Materials/BlinkLine.mat b/Tools/LocomotionTool/Materials/BlinkLine.mat similarity index 100% rename from Tools/BlinkLocomotionTool/Materials/BlinkLine.mat rename to Tools/LocomotionTool/Materials/BlinkLine.mat diff --git a/Tools/BlinkLocomotionTool/Materials/BlinkLine.mat.meta b/Tools/LocomotionTool/Materials/BlinkLine.mat.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Materials/BlinkLine.mat.meta rename to Tools/LocomotionTool/Materials/BlinkLine.mat.meta diff --git a/Tools/BlinkLocomotionTool/Materials/BlinkVisuals.mat b/Tools/LocomotionTool/Materials/BlinkVisuals.mat similarity index 100% rename from Tools/BlinkLocomotionTool/Materials/BlinkVisuals.mat rename to Tools/LocomotionTool/Materials/BlinkVisuals.mat diff --git a/Tools/BlinkLocomotionTool/Materials/BlinkVisuals.mat.meta b/Tools/LocomotionTool/Materials/BlinkVisuals.mat.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Materials/BlinkVisuals.mat.meta rename to Tools/LocomotionTool/Materials/BlinkVisuals.mat.meta diff --git a/Tools/BlinkLocomotionTool/Materials/WorldScaleVisuals.mat b/Tools/LocomotionTool/Materials/WorldScaleVisuals.mat similarity index 100% rename from Tools/BlinkLocomotionTool/Materials/WorldScaleVisuals.mat rename to Tools/LocomotionTool/Materials/WorldScaleVisuals.mat diff --git a/Tools/BlinkLocomotionTool/Materials/WorldScaleVisuals.mat.meta b/Tools/LocomotionTool/Materials/WorldScaleVisuals.mat.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Materials/WorldScaleVisuals.mat.meta rename to Tools/LocomotionTool/Materials/WorldScaleVisuals.mat.meta diff --git a/Tools/BlinkLocomotionTool/Meshes.meta b/Tools/LocomotionTool/Meshes.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes.meta rename to Tools/LocomotionTool/Meshes.meta diff --git a/Tools/BlinkLocomotionTool/Meshes/BlinkArcFollower.fbx b/Tools/LocomotionTool/Meshes/BlinkArcFollower.fbx similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes/BlinkArcFollower.fbx rename to Tools/LocomotionTool/Meshes/BlinkArcFollower.fbx diff --git a/Tools/BlinkLocomotionTool/Meshes/BlinkArcFollower.fbx.meta b/Tools/LocomotionTool/Meshes/BlinkArcFollower.fbx.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes/BlinkArcFollower.fbx.meta rename to Tools/LocomotionTool/Meshes/BlinkArcFollower.fbx.meta diff --git a/Tools/BlinkLocomotionTool/Meshes/BlinkLocatorRing.fbx b/Tools/LocomotionTool/Meshes/BlinkLocatorRing.fbx similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes/BlinkLocatorRing.fbx rename to Tools/LocomotionTool/Meshes/BlinkLocatorRing.fbx diff --git a/Tools/BlinkLocomotionTool/Meshes/BlinkLocatorRing.fbx.meta b/Tools/LocomotionTool/Meshes/BlinkLocatorRing.fbx.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes/BlinkLocatorRing.fbx.meta rename to Tools/LocomotionTool/Meshes/BlinkLocatorRing.fbx.meta diff --git a/Tools/BlinkLocomotionTool/Meshes/BlinkLocatorTube.fbx b/Tools/LocomotionTool/Meshes/BlinkLocatorTube.fbx similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes/BlinkLocatorTube.fbx rename to Tools/LocomotionTool/Meshes/BlinkLocatorTube.fbx diff --git a/Tools/BlinkLocomotionTool/Meshes/BlinkLocatorTube.fbx.meta b/Tools/LocomotionTool/Meshes/BlinkLocatorTube.fbx.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes/BlinkLocatorTube.fbx.meta rename to Tools/LocomotionTool/Meshes/BlinkLocatorTube.fbx.meta diff --git a/Tools/BlinkLocomotionTool/Meshes/BlinkRoomScale.fbx b/Tools/LocomotionTool/Meshes/BlinkRoomScale.fbx similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes/BlinkRoomScale.fbx rename to Tools/LocomotionTool/Meshes/BlinkRoomScale.fbx diff --git a/Tools/BlinkLocomotionTool/Meshes/BlinkRoomScale.fbx.meta b/Tools/LocomotionTool/Meshes/BlinkRoomScale.fbx.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Meshes/BlinkRoomScale.fbx.meta rename to Tools/LocomotionTool/Meshes/BlinkRoomScale.fbx.meta diff --git a/Tools/BlinkLocomotionTool/Prefabs.meta b/Tools/LocomotionTool/Prefabs.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs.meta rename to Tools/LocomotionTool/Prefabs.meta diff --git a/Tools/BlinkLocomotionTool/Prefabs/BlinkVisuals.prefab b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs/BlinkVisuals.prefab rename to Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab diff --git a/Tools/BlinkLocomotionTool/Prefabs/BlinkVisuals.prefab.meta b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs/BlinkVisuals.prefab.meta rename to Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab.meta diff --git a/Tools/BlinkLocomotionTool/Prefabs/ScaleIcon.prefab b/Tools/LocomotionTool/Prefabs/ScaleIcon.prefab similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs/ScaleIcon.prefab rename to Tools/LocomotionTool/Prefabs/ScaleIcon.prefab diff --git a/Tools/BlinkLocomotionTool/Prefabs/ScaleIcon.prefab.meta b/Tools/LocomotionTool/Prefabs/ScaleIcon.prefab.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs/ScaleIcon.prefab.meta rename to Tools/LocomotionTool/Prefabs/ScaleIcon.prefab.meta diff --git a/Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab b/Tools/LocomotionTool/Prefabs/SettingsUI.prefab similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab rename to Tools/LocomotionTool/Prefabs/SettingsUI.prefab diff --git a/Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab.meta b/Tools/LocomotionTool/Prefabs/SettingsUI.prefab.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs/SettingsUI.prefab.meta rename to Tools/LocomotionTool/Prefabs/SettingsUI.prefab.meta diff --git a/Tools/BlinkLocomotionTool/Prefabs/ViewerScaleVisuals.prefab b/Tools/LocomotionTool/Prefabs/ViewerScaleVisuals.prefab similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs/ViewerScaleVisuals.prefab rename to Tools/LocomotionTool/Prefabs/ViewerScaleVisuals.prefab diff --git a/Tools/BlinkLocomotionTool/Prefabs/ViewerScaleVisuals.prefab.meta b/Tools/LocomotionTool/Prefabs/ViewerScaleVisuals.prefab.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Prefabs/ViewerScaleVisuals.prefab.meta rename to Tools/LocomotionTool/Prefabs/ViewerScaleVisuals.prefab.meta diff --git a/Tools/LocomotionTool/Scripts.meta b/Tools/LocomotionTool/Scripts.meta new file mode 100644 index 000000000..420c04763 --- /dev/null +++ b/Tools/LocomotionTool/Scripts.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fa27d81e046c2c741b4237c765e18352 +folderAsset: yes +timeCreated: 1468535285 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/BlinkLocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs similarity index 100% rename from Tools/BlinkLocomotionTool/Scripts/BlinkVisuals.cs rename to Tools/LocomotionTool/Scripts/BlinkVisuals.cs diff --git a/Tools/BlinkLocomotionTool/Scripts/BlinkVisuals.cs.meta b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Scripts/BlinkVisuals.cs.meta rename to Tools/LocomotionTool/Scripts/BlinkVisuals.cs.meta diff --git a/Tools/BlinkLocomotionTool/Scripts/ViewerScaleVisuals.cs b/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs similarity index 100% rename from Tools/BlinkLocomotionTool/Scripts/ViewerScaleVisuals.cs rename to Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs diff --git a/Tools/BlinkLocomotionTool/Scripts/ViewerScaleVisuals.cs.meta b/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Scripts/ViewerScaleVisuals.cs.meta rename to Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs.meta diff --git a/Tools/LocomotionTool/Shaders.meta b/Tools/LocomotionTool/Shaders.meta new file mode 100644 index 000000000..b66268749 --- /dev/null +++ b/Tools/LocomotionTool/Shaders.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4d2c6e1f80e162146ab113fab5a84fef +folderAsset: yes +timeCreated: 1487119591 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/BlinkLocomotionTool/Shaders/UI-Default-NoDepth.shader b/Tools/LocomotionTool/Shaders/UI-Default-NoDepth.shader similarity index 100% rename from Tools/BlinkLocomotionTool/Shaders/UI-Default-NoDepth.shader rename to Tools/LocomotionTool/Shaders/UI-Default-NoDepth.shader diff --git a/Tools/BlinkLocomotionTool/Shaders/UI-Default-NoDepth.shader.meta b/Tools/LocomotionTool/Shaders/UI-Default-NoDepth.shader.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Shaders/UI-Default-NoDepth.shader.meta rename to Tools/LocomotionTool/Shaders/UI-Default-NoDepth.shader.meta diff --git a/Tools/BlinkLocomotionTool/Textures.meta b/Tools/LocomotionTool/Textures.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures.meta rename to Tools/LocomotionTool/Textures.meta diff --git a/Tools/BlinkLocomotionTool/Textures/RoomScale.png b/Tools/LocomotionTool/Textures/RoomScale.png similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/RoomScale.png rename to Tools/LocomotionTool/Textures/RoomScale.png diff --git a/Tools/BlinkLocomotionTool/Textures/RoomScale.png.meta b/Tools/LocomotionTool/Textures/RoomScale.png.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/RoomScale.png.meta rename to Tools/LocomotionTool/Textures/RoomScale.png.meta diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons.meta b/Tools/LocomotionTool/Textures/WorldScaleIcons.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons.meta rename to Tools/LocomotionTool/Textures/WorldScaleIcons.meta diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/atom.png b/Tools/LocomotionTool/Textures/WorldScaleIcons/atom.png similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/atom.png rename to Tools/LocomotionTool/Textures/WorldScaleIcons/atom.png diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/atom.png.meta b/Tools/LocomotionTool/Textures/WorldScaleIcons/atom.png.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/atom.png.meta rename to Tools/LocomotionTool/Textures/WorldScaleIcons/atom.png.meta diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/building.png b/Tools/LocomotionTool/Textures/WorldScaleIcons/building.png similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/building.png rename to Tools/LocomotionTool/Textures/WorldScaleIcons/building.png diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/building.png.meta b/Tools/LocomotionTool/Textures/WorldScaleIcons/building.png.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/building.png.meta rename to Tools/LocomotionTool/Textures/WorldScaleIcons/building.png.meta diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/burrito.png b/Tools/LocomotionTool/Textures/WorldScaleIcons/burrito.png similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/burrito.png rename to Tools/LocomotionTool/Textures/WorldScaleIcons/burrito.png diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/burrito.png.meta b/Tools/LocomotionTool/Textures/WorldScaleIcons/burrito.png.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/burrito.png.meta rename to Tools/LocomotionTool/Textures/WorldScaleIcons/burrito.png.meta diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/moon.png b/Tools/LocomotionTool/Textures/WorldScaleIcons/moon.png similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/moon.png rename to Tools/LocomotionTool/Textures/WorldScaleIcons/moon.png diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/moon.png.meta b/Tools/LocomotionTool/Textures/WorldScaleIcons/moon.png.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/moon.png.meta rename to Tools/LocomotionTool/Textures/WorldScaleIcons/moon.png.meta diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/person.png b/Tools/LocomotionTool/Textures/WorldScaleIcons/person.png similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/person.png rename to Tools/LocomotionTool/Textures/WorldScaleIcons/person.png diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/person.png.meta b/Tools/LocomotionTool/Textures/WorldScaleIcons/person.png.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/person.png.meta rename to Tools/LocomotionTool/Textures/WorldScaleIcons/person.png.meta diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/sea monster.png b/Tools/LocomotionTool/Textures/WorldScaleIcons/sea monster.png similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/sea monster.png rename to Tools/LocomotionTool/Textures/WorldScaleIcons/sea monster.png diff --git a/Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/sea monster.png.meta b/Tools/LocomotionTool/Textures/WorldScaleIcons/sea monster.png.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/WorldScaleIcons/sea monster.png.meta rename to Tools/LocomotionTool/Textures/WorldScaleIcons/sea monster.png.meta diff --git a/Tools/BlinkLocomotionTool/Textures/border.png b/Tools/LocomotionTool/Textures/border.png similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/border.png rename to Tools/LocomotionTool/Textures/border.png diff --git a/Tools/BlinkLocomotionTool/Textures/border.png.meta b/Tools/LocomotionTool/Textures/border.png.meta similarity index 100% rename from Tools/BlinkLocomotionTool/Textures/border.png.meta rename to Tools/LocomotionTool/Textures/border.png.meta From 17365b14c9024c27d73bae51de2862ba7c78da2e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Apr 2017 18:10:13 -0700 Subject: [PATCH 095/870] Fix bug where blink settings showed up on the wrong face --- Menus/MainMenu/MainMenu.cs | 3 ++- Tools/BlinkLocomotionTool.meta | 9 --------- Tools/BlinkLocomotionTool/Scripts.meta | 3 --- Tools/BlinkLocomotionTool/Shaders.meta | 3 --- 4 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 Tools/BlinkLocomotionTool.meta delete mode 100644 Tools/BlinkLocomotionTool/Scripts.meta delete mode 100644 Tools/BlinkLocomotionTool/Shaders.meta diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index acf1d0f16..6e2b99735 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -149,7 +149,8 @@ void CreateFaceButtons(List types) buttonData.name = type.Name.Replace("Workspace", string.Empty); buttonData.sectionName = "Workspaces"; } - else if (isSettingsProvider || isSettingsItemProvider) + + if (isSettingsProvider || isSettingsItemProvider) { buttonData.name = type.Name.Replace("Tool", string.Empty); buttonData.name = type.Name.Replace("Module", string.Empty); diff --git a/Tools/BlinkLocomotionTool.meta b/Tools/BlinkLocomotionTool.meta deleted file mode 100644 index 3f31318a3..000000000 --- a/Tools/BlinkLocomotionTool.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 63952765f2756d34f8ce731515185f2a -folderAsset: yes -timeCreated: 1491440560 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/BlinkLocomotionTool/Scripts.meta b/Tools/BlinkLocomotionTool/Scripts.meta deleted file mode 100644 index a4fd37bb6..000000000 --- a/Tools/BlinkLocomotionTool/Scripts.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: cb35d62e8ce94b60ae39dbac5d00fd7c -timeCreated: 1491440548 \ No newline at end of file diff --git a/Tools/BlinkLocomotionTool/Shaders.meta b/Tools/BlinkLocomotionTool/Shaders.meta deleted file mode 100644 index 01f4a7336..000000000 --- a/Tools/BlinkLocomotionTool/Shaders.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 39499ff87f744e20b6869a8f9a89700b -timeCreated: 1491440548 \ No newline at end of file From ae0792f306ca4c261b7742e347c9779250245053 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 6 Apr 2017 20:50:27 -0700 Subject: [PATCH 096/870] Add temporary demoTools in order to populate the MainMenu --- Tools/Temp/ToolFourDemo.cs | 39 ++++++++++++++++++++++++++++++++ Tools/Temp/ToolFourDemo.cs.meta | 13 +++++++++++ Tools/Temp/ToolOneDemo.cs | 39 ++++++++++++++++++++++++++++++++ Tools/Temp/ToolOneDemo.cs.meta | 13 +++++++++++ Tools/Temp/ToolThreeDemo.cs | 39 ++++++++++++++++++++++++++++++++ Tools/Temp/ToolThreeDemo.cs.meta | 13 +++++++++++ Tools/Temp/ToolTwoDemo.cs | 39 ++++++++++++++++++++++++++++++++ Tools/Temp/ToolTwoDemo.cs.meta | 13 +++++++++++ 8 files changed, 208 insertions(+) create mode 100644 Tools/Temp/ToolFourDemo.cs create mode 100644 Tools/Temp/ToolFourDemo.cs.meta create mode 100644 Tools/Temp/ToolOneDemo.cs create mode 100644 Tools/Temp/ToolOneDemo.cs.meta create mode 100644 Tools/Temp/ToolThreeDemo.cs create mode 100644 Tools/Temp/ToolThreeDemo.cs.meta create mode 100644 Tools/Temp/ToolTwoDemo.cs create mode 100644 Tools/Temp/ToolTwoDemo.cs.meta diff --git a/Tools/Temp/ToolFourDemo.cs b/Tools/Temp/ToolFourDemo.cs new file mode 100644 index 000000000..36bb6ac9b --- /dev/null +++ b/Tools/Temp/ToolFourDemo.cs @@ -0,0 +1,39 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; +using UnityEngine.InputNew; + +namespace UnityEditor.Experimental.EditorVR.Tools +{ + [MainMenuItem("XTool4", "Create", "4 Extra Demo Tool")] + //[MainMenuItem(false)] + sealed class ToolFourDemo : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash + { + public Transform rayOrigin { get; set; } + + public ActionMap actionMap + { + get { return m_ActionMap; } + set { m_ActionMap = value; } + } + + [SerializeField] + private ActionMap m_ActionMap; + + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) + { + var standardAlt = (StandardAlt)input; + if (standardAlt.action.wasJustPressed) + { + Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; + if (rayOrigin) + sphere.position = rayOrigin.position + rayOrigin.forward * 5f; + + this.AddToSpatialHash(sphere.gameObject); + + consumeControl(standardAlt.action); + } + } + } +} +#endif diff --git a/Tools/Temp/ToolFourDemo.cs.meta b/Tools/Temp/ToolFourDemo.cs.meta new file mode 100644 index 000000000..f36a7e913 --- /dev/null +++ b/Tools/Temp/ToolFourDemo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 69ab7950a8430ba459c6b9cb0c12b965 +timeCreated: 1466723731 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/ToolOneDemo.cs b/Tools/Temp/ToolOneDemo.cs new file mode 100644 index 000000000..bb38a480a --- /dev/null +++ b/Tools/Temp/ToolOneDemo.cs @@ -0,0 +1,39 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; +using UnityEngine.InputNew; + +namespace UnityEditor.Experimental.EditorVR.Tools +{ + [MainMenuItem("XTool1", "Create", "1 Extra Demo Tool")] + //[MainMenuItem(false)] + sealed class ToolOneDemo : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash + { + public Transform rayOrigin { get; set; } + + public ActionMap actionMap + { + get { return m_ActionMap; } + set { m_ActionMap = value; } + } + + [SerializeField] + private ActionMap m_ActionMap; + + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) + { + var standardAlt = (StandardAlt)input; + if (standardAlt.action.wasJustPressed) + { + Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; + if (rayOrigin) + sphere.position = rayOrigin.position + rayOrigin.forward * 5f; + + this.AddToSpatialHash(sphere.gameObject); + + consumeControl(standardAlt.action); + } + } + } +} +#endif diff --git a/Tools/Temp/ToolOneDemo.cs.meta b/Tools/Temp/ToolOneDemo.cs.meta new file mode 100644 index 000000000..1a9f887ab --- /dev/null +++ b/Tools/Temp/ToolOneDemo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b4fe0bd8373b6064a9c156d29db1ee26 +timeCreated: 1466723731 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/ToolThreeDemo.cs b/Tools/Temp/ToolThreeDemo.cs new file mode 100644 index 000000000..cf07f4162 --- /dev/null +++ b/Tools/Temp/ToolThreeDemo.cs @@ -0,0 +1,39 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; +using UnityEngine.InputNew; + +namespace UnityEditor.Experimental.EditorVR.Tools +{ + [MainMenuItem("XTool3", "Create", "3 Extra Demo Tool")] + //[MainMenuItem(false)] + sealed class ToolThreeDemo : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash + { + public Transform rayOrigin { get; set; } + + public ActionMap actionMap + { + get { return m_ActionMap; } + set { m_ActionMap = value; } + } + + [SerializeField] + private ActionMap m_ActionMap; + + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) + { + var standardAlt = (StandardAlt)input; + if (standardAlt.action.wasJustPressed) + { + Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; + if (rayOrigin) + sphere.position = rayOrigin.position + rayOrigin.forward * 5f; + + this.AddToSpatialHash(sphere.gameObject); + + consumeControl(standardAlt.action); + } + } + } +} +#endif diff --git a/Tools/Temp/ToolThreeDemo.cs.meta b/Tools/Temp/ToolThreeDemo.cs.meta new file mode 100644 index 000000000..1e7626231 --- /dev/null +++ b/Tools/Temp/ToolThreeDemo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: dde6653c14b4ff04fa5e5f7da36a6662 +timeCreated: 1466723731 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/ToolTwoDemo.cs b/Tools/Temp/ToolTwoDemo.cs new file mode 100644 index 000000000..a82ed2556 --- /dev/null +++ b/Tools/Temp/ToolTwoDemo.cs @@ -0,0 +1,39 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; +using UnityEngine.InputNew; + +namespace UnityEditor.Experimental.EditorVR.Tools +{ + [MainMenuItem("XTool2", "Create", "2 Extra Demo Tool")] + //[MainMenuItem(false)] + sealed class ToolTwoDemo : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash + { + public Transform rayOrigin { get; set; } + + public ActionMap actionMap + { + get { return m_ActionMap; } + set { m_ActionMap = value; } + } + + [SerializeField] + private ActionMap m_ActionMap; + + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) + { + var standardAlt = (StandardAlt)input; + if (standardAlt.action.wasJustPressed) + { + Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; + if (rayOrigin) + sphere.position = rayOrigin.position + rayOrigin.forward * 5f; + + this.AddToSpatialHash(sphere.gameObject); + + consumeControl(standardAlt.action); + } + } + } +} +#endif diff --git a/Tools/Temp/ToolTwoDemo.cs.meta b/Tools/Temp/ToolTwoDemo.cs.meta new file mode 100644 index 000000000..21c6f5ae5 --- /dev/null +++ b/Tools/Temp/ToolTwoDemo.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 09fb1e013aeb79e4ea15dd294ba654a9 +timeCreated: 1466723731 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From b9d9d15d97e8ae68a9d053b57e116358c1646724 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 6 Apr 2017 20:51:21 -0700 Subject: [PATCH 097/870] Add initial radial/circular button layout support to PinnedToolButtons --- Prefabs/UI/PinnedToolButton.prefab | 62 +++++++++++++++++++++-------- Scripts/Core/EditorVR.Tools.cs | 13 +++++- Scripts/UI/PinnedToolButton.cs | 63 ++++++++++++++++++++++-------- 3 files changed, 104 insertions(+), 34 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 30ebf660c..d685df54b 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -11,6 +11,21 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 1000010204453368} m_IsPrefabParent: 1 +--- !u!1 &1000010187295322 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012648346800} + m_Layer: 5 + m_Name: RotationOffsetContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000010204453368 GameObject: m_ObjectHideFlags: 0 @@ -62,7 +77,7 @@ GameObject: m_IsActive: 0 --- !u!1 &1000010797218832 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 @@ -94,7 +109,7 @@ GameObject: m_IsActive: 1 --- !u!1 &1000011695512812 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 @@ -109,7 +124,7 @@ GameObject: m_IsActive: 1 --- !u!1 &1000011810879300 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 @@ -117,7 +132,7 @@ GameObject: - 4: {fileID: 4000013747407424} - 114: {fileID: 114000010887893374} m_Layer: 5 - m_Name: RotationPivot + m_Name: RotatedUIContainer m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -150,7 +165,7 @@ GameObject: - 224: {fileID: 224000013167097666} - 223: {fileID: 223000013382208598} m_Layer: 5 - m_Name: ButtonContentContainer + m_Name: UIContainer m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -343,7 +358,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 4000012504767854} + m_Father: {fileID: 4000012648346800} m_RootOrder: 0 --- !u!4 &4000012190781878 Transform: @@ -370,10 +385,25 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: + - {fileID: 4000012648346800} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!4 &4000012648346800 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010187295322} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: - {fileID: 4000010683372396} - {fileID: 4000013378434912} + - {fileID: 224000011060550722} - {fileID: 4000013747407424} - m_Father: {fileID: 0} + m_Father: {fileID: 4000012504767854} m_RootOrder: 0 --- !u!4 &4000013378434912 Transform: @@ -386,7 +416,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 4000012504767854} + m_Father: {fileID: 4000012648346800} m_RootOrder: 1 --- !u!4 &4000013747407424 Transform: @@ -394,15 +424,14 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011810879300} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 224000011060550722} - {fileID: 224000013167097666} - m_Father: {fileID: 4000012504767854} - m_RootOrder: 2 + m_Father: {fileID: 4000012648346800} + m_RootOrder: 3 --- !u!23 &23000013566874788 MeshRenderer: m_ObjectHideFlags: 1 @@ -584,7 +613,7 @@ MonoBehaviour: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011810879300} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} m_Name: @@ -639,6 +668,7 @@ MonoBehaviour: m_SmoothMotion: {fileID: 114000010887893374} m_LeftPinnedToolActionButton: {fileID: 114000011926581952} m_RightPinnedToolActionButton: {fileID: 114000013773965116} + m_ContentContainer: {fileID: 4000013747407424} m_RootCollider: {fileID: 65000011941282114} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} @@ -1070,8 +1100,8 @@ RectTransform: m_LocalScale: {x: 0.425, y: 0.50000024, z: 0.42500025} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 4000013747407424} - m_RootOrder: 0 + m_Father: {fileID: 4000012648346800} + m_RootOrder: 2 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} @@ -1150,7 +1180,7 @@ RectTransform: - {fileID: 224000012760332454} - {fileID: 4000012190781878} m_Father: {fileID: 4000013747407424} - m_RootOrder: 1 + m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0.0009338602} diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 20d760c4b..c96fff1c5 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -296,11 +296,22 @@ void AddPinnedToolButton(DeviceData deviceData, Type toolType) void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) { Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); + const int kMaxButtonCount = 6; var order = 0; - foreach (var pair in deviceData.pinnedToolButtons) + var buttons = deviceData.pinnedToolButtons; + var buttonCount = buttons.Count; + + if (buttonCount >= kMaxButtonCount) + { + Debug.LogError("Attempting to add buttons beyond max count! Handle for removing highest ordered button and adding this new button!"); + return; + } + + foreach (var pair in buttons) { var button = pair.Value; button.rayOrigin = rayOrigin; + button.activeButtonCount = buttonCount; // Used to position buttons relative to count button.order = button.toolType == activeToolType ? 0 : ++order; if (button.order == 0) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 0896f4a28..35754b67f 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -73,12 +73,21 @@ public int order activeTool = activeTool; const float kSmoothingMax = 50f; const int kSmoothingIncreaseFactor = 10; - var smoothingFactor = Mathf.Clamp(kSmoothingMax- m_Order * kSmoothingIncreaseFactor, 0f, kSmoothingMax); - m_SmoothMotion.SetPositionSmoothing(smoothingFactor); - m_SmoothMotion.SetRotationSmoothing(smoothingFactor); - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); + //var smoothingFactor = Mathf.Clamp(kSmoothingMax- m_Order * kSmoothingIncreaseFactor, 0f, kSmoothingMax); + //m_SmoothMotion.SetPositionSmoothing(smoothingFactor); + //m_SmoothMotion.SetRotationSmoothing(smoothingFactor); + //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); m_LeftPinnedToolActionButton.visible = false; m_RightPinnedToolActionButton.visible = false; + + // We move in counter-clockwise direction + // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered + const float kMaxPinnedToolButtonCount = 12; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice + const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time + var phaseOffset = 0 - (activeButtonCount * 0.5f) * kRotationSpacing; + var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newTargetRotation)); + //transform.localRotation = newLocalRotation; } } int m_Order; @@ -143,20 +152,26 @@ public Type previewToolType [SerializeField] PinnedToolActionButton m_RightPinnedToolActionButton; + [SerializeField] + Transform m_ContentContainer; + [SerializeField] Collider m_RootCollider; - public Transform tooltipTarget { get { return m_TooltipTarget; } } [SerializeField] Transform m_TooltipTarget; - public Transform tooltipSource { get { return m_TooltipSource; } } [SerializeField] Transform m_TooltipSource; - public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } string m_TooltipText; + Coroutine m_PositionCoroutine; + Coroutine m_VisibilityCoroutine; + Vector3 m_InactivePosition; // Inactive button offset from the main menu activator + public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } + public Transform tooltipTarget { get { return m_TooltipTarget; } } + public Transform tooltipSource { get { return m_TooltipSource; } } public TextAlignment tooltipAlignment { get; private set; } public Transform rayOrigin { get; set; } public Node node { get; set; } @@ -166,11 +181,7 @@ public Type previewToolType public GradientPair customToolTipHighlightColor { get; set; } public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } public Action DeletePinnedToolButton { get; set; } - //public ConnectInterfacesDelegate connectInterfaces { get; set; } - - Coroutine m_PositionCoroutine; - Coroutine m_VisibilityCoroutine; - Vector3 m_InactivePosition; // Inactive button offset from the main menu activator + public int activeButtonCount { get; set; } private bool activeTool { @@ -260,20 +271,25 @@ string GetTypeAbbreviation(Type type) return abbreviation.ToString(); } - IEnumerator AnimatePosition() + IEnumerator AnimatePosition(Quaternion targetRotation) { var duration = 0f; - var currentPosition = transform.localPosition; - var targetPosition = activeTool ? activePosition : m_InactivePosition; + //var currentPosition = transform.localPosition; + //var targetPosition = activeTool ? activePosition : m_InactivePosition; + var currentRotation = transform.localRotation; while (duration < 1) { duration += Time.unscaledDeltaTime * 3; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 6); - transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); + transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); + CorrectIconRotation(); + //transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); yield return null; } - transform.localPosition = targetPosition; + //transform.localPosition = targetPosition; + transform.localRotation = targetRotation; + CorrectIconRotation(); m_PositionCoroutine = null; } @@ -382,6 +398,19 @@ IEnumerator AnimateClose() DeletePinnedToolButton(rayOrigin, this); ObjectUtils.Destroy(gameObject, 0.1f); } + + public void CorrectIconRotation() + { + const float kIconLookForwardOffset = 0.5f; + var iconLookDirection = m_ContentContainer.transform.position + transform.parent.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation + m_ContentContainer.LookAt(iconLookDirection); + m_ContentContainer.localEulerAngles = new Vector3(0f, m_ContentContainer.localEulerAngles.y, 0f); + var angle = m_ContentContainer.localEulerAngles.y; + m_TooltipTarget.localEulerAngles = new Vector3(90f, angle, 0f); + + var yaw = transform.localRotation.eulerAngles.y; + tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; + } } } #endif From dcfbeb0b720fed07790a2593cd585c3f2aef588b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 7 Apr 2017 00:13:57 -0700 Subject: [PATCH 098/870] Add new PinnedToolButton FBX mesh --- Models/PinnedToolButtonMesh.fbx | 3 + Models/PinnedToolButtonMesh.fbx.meta | 120 +++++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 Models/PinnedToolButtonMesh.fbx create mode 100644 Models/PinnedToolButtonMesh.fbx.meta diff --git a/Models/PinnedToolButtonMesh.fbx b/Models/PinnedToolButtonMesh.fbx new file mode 100644 index 000000000..d255ab5c3 --- /dev/null +++ b/Models/PinnedToolButtonMesh.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5954fc98d62cf08a7a29930db5b35bb5aef90ad20f220198eab7976624494b09 +size 24348 diff --git a/Models/PinnedToolButtonMesh.fbx.meta b/Models/PinnedToolButtonMesh.fbx.meta new file mode 100644 index 000000000..82432e39e --- /dev/null +++ b/Models/PinnedToolButtonMesh.fbx.meta @@ -0,0 +1,120 @@ +fileFormatVersion: 2 +guid: 303f9d32292c8d444aa4375f4f57be3a +timeCreated: 1491542067 +licenseType: Pro +ModelImporter: + serializedVersion: 19 + fileIDToRecycleName: + 100000: //RootNode + 100002: RadialMenuFrameSegment.001 + 100004: RadialMenuSlotInset.001 + 100006: RadialMenuSlotMask.002 + 100008: ButtonFaceMask + 100010: ButtonFrame + 100012: ButtonInset + 100014: PinnedToolButtonFaceMask + 100016: PinnedToolButtonFrame + 100018: PinnedToolButtonInset + 400000: //RootNode + 400002: RadialMenuFrameSegment.001 + 400004: RadialMenuSlotInset.001 + 400006: RadialMenuSlotMask.002 + 400008: ButtonFaceMask + 400010: ButtonFrame + 400012: ButtonInset + 400014: PinnedToolButtonFaceMask + 400016: PinnedToolButtonFrame + 400018: PinnedToolButtonInset + 2300000: RadialMenuFrameSegment.001 + 2300002: RadialMenuSlotInset.001 + 2300004: RadialMenuSlotMask.002 + 2300006: ButtonFaceMask + 2300008: ButtonFrame + 2300010: ButtonInset + 2300012: PinnedToolButtonFaceMask + 2300014: PinnedToolButtonFrame + 2300016: PinnedToolButtonInset + 3300000: RadialMenuFrameSegment.001 + 3300002: RadialMenuSlotInset.001 + 3300004: RadialMenuSlotMask.002 + 3300006: ButtonFaceMask + 3300008: ButtonFrame + 3300010: ButtonInset + 3300012: PinnedToolButtonFaceMask + 3300014: PinnedToolButtonFrame + 3300016: PinnedToolButtonInset + 4300000: RadialMenuFrameSegment.001 + 4300002: RadialMenuSlotInset.001 + 4300004: RadialMenuSlotMask.002 + 4300006: ButtonFrame + 4300008: ButtonInset + 4300010: ButtonFaceMask + 4300012: PinnedToolButtonFrame + 4300014: PinnedToolButtonInset + 4300016: PinnedToolButtonFaceMask + 9500000: //RootNode + 13700000: RadialMenuSlotMask.002 + materials: + importMaterials: 0 + materialName: 0 + materialSearch: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 0 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + hasTranslationDoF: 0 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: From 4282b4d215905b8651995b207ef7a8e492b81061 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 7 Apr 2017 00:15:11 -0700 Subject: [PATCH 099/870] Add UI rotation updating support to PinnedToolButton content --- Scripts/UI/PinnedToolButton.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 35754b67f..bd0b330ee 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -82,7 +82,7 @@ public int order // We move in counter-clockwise direction // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered - const float kMaxPinnedToolButtonCount = 12; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice + const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time var phaseOffset = 0 - (activeButtonCount * 0.5f) * kRotationSpacing; var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); @@ -404,9 +404,9 @@ public void CorrectIconRotation() const float kIconLookForwardOffset = 0.5f; var iconLookDirection = m_ContentContainer.transform.position + transform.parent.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation m_ContentContainer.LookAt(iconLookDirection); - m_ContentContainer.localEulerAngles = new Vector3(0f, m_ContentContainer.localEulerAngles.y, 0f); - var angle = m_ContentContainer.localEulerAngles.y; - m_TooltipTarget.localEulerAngles = new Vector3(90f, angle, 0f); + m_ContentContainer.localEulerAngles = new Vector3(0f, 0f, m_ContentContainer.localEulerAngles.z); + var angle = m_ContentContainer.localEulerAngles.z; + m_TooltipTarget.localEulerAngles = new Vector3(90f, 0f, angle); var yaw = transform.localRotation.eulerAngles.y; tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; From f722ba33b012ffd6908cb3ef5abc959ec18c9180 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 7 Apr 2017 00:16:09 -0700 Subject: [PATCH 100/870] Refactor PinnedToolButton prefab contents to include new PinnedToolButton FBX mesh contents --- Prefabs/UI/PinnedToolButton.prefab | 312 ++++++++++++++++++++++++----- 1 file changed, 262 insertions(+), 50 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index d685df54b..c49d39aeb 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -75,6 +75,40 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 +--- !u!1 &1000010714816488 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013614942004} + - 33: {fileID: 33000012298580722} + - 23: {fileID: 23000013623333764} + m_Layer: 0 + m_Name: PinnedToolButtonInset + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010746370754 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011771676402} + - 33: {fileID: 33000012558278368} + - 23: {fileID: 23000012760767544} + m_Layer: 0 + m_Name: PinnedToolButtonFaceMask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000010797218832 GameObject: m_ObjectHideFlags: 1 @@ -130,7 +164,6 @@ GameObject: serializedVersion: 4 m_Component: - 4: {fileID: 4000013747407424} - - 114: {fileID: 114000010887893374} m_Layer: 5 m_Name: RotatedUIContainer m_TagString: Untagged @@ -138,6 +171,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000011915299818 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013373873342} + m_Layer: 0 + m_Name: PinnedToolButtonMesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000011923834384 GameObject: m_ObjectHideFlags: 1 @@ -239,7 +287,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000013816124996 GameObject: m_ObjectHideFlags: 1 @@ -347,6 +395,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000014169611568 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012896115128} + - 33: {fileID: 33000012464504980} + - 23: {fileID: 23000013529982034} + m_Layer: 0 + m_Name: PinnedToolButtonFrame + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4000010683372396 Transform: m_ObjectHideFlags: 1 @@ -360,6 +425,19 @@ Transform: m_Children: [] m_Father: {fileID: 4000012648346800} m_RootOrder: 0 +--- !u!4 &4000011771676402 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010746370754} + m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000013373873342} + m_RootOrder: 0 --- !u!4 &4000012190781878 Transform: m_ObjectHideFlags: 1 @@ -367,8 +445,8 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014082726766} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0, z: 0.00009} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalPosition: {x: 0, y: -0.0012, z: 0} + m_LocalScale: {x: 2.7019417, y: 2.7019417, z: 2.7019417} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013783073276} @@ -382,7 +460,7 @@ Transform: m_GameObject: {fileID: 1000010204453368} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 0.465, y: 0.615, z: 0.465} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000012648346800} @@ -402,9 +480,39 @@ Transform: - {fileID: 4000010683372396} - {fileID: 4000013378434912} - {fileID: 224000011060550722} + - {fileID: 4000013373873342} - {fileID: 4000013747407424} m_Father: {fileID: 4000012504767854} m_RootOrder: 0 +--- !u!4 &4000012896115128 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014169611568} + m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000013373873342} + m_RootOrder: 1 +--- !u!4 &4000013373873342 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011915299818} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000011771676402} + - {fileID: 4000012896115128} + - {fileID: 4000013614942004} + m_Father: {fileID: 4000012648346800} + m_RootOrder: 3 --- !u!4 &4000013378434912 Transform: m_ObjectHideFlags: 1 @@ -418,6 +526,19 @@ Transform: m_Children: [] m_Father: {fileID: 4000012648346800} m_RootOrder: 1 +--- !u!4 &4000013614942004 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010714816488} + m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000013373873342} + m_RootOrder: 2 --- !u!4 &4000013747407424 Transform: m_ObjectHideFlags: 1 @@ -431,14 +552,72 @@ Transform: m_Children: - {fileID: 224000013167097666} m_Father: {fileID: 4000012648346800} - m_RootOrder: 3 + m_RootOrder: 4 +--- !u!23 &23000012760767544 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010746370754} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 +--- !u!23 &23000013529982034 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014169611568} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 5c092e872a72dd144a84ae7da8095049, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 --- !u!23 &23000013566874788 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014093660532} - m_Enabled: 1 + m_Enabled: 0 m_CastShadows: 0 m_ReceiveShadows: 0 m_MotionVectors: 0 @@ -461,13 +640,42 @@ MeshRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 +--- !u!23 &23000013623333764 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010714816488} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 --- !u!23 &23000013664958186 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014082726766} - m_Enabled: 1 + m_Enabled: 0 m_CastShadows: 0 m_ReceiveShadows: 0 m_MotionVectors: 0 @@ -498,6 +706,27 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014082726766} m_Mesh: {fileID: 4300000, guid: 7f7c3987753e1bf41bee70661b3eff03, type: 3} +--- !u!33 &33000012298580722 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010714816488} + m_Mesh: {fileID: 4300014, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} +--- !u!33 &33000012464504980 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014169611568} + m_Mesh: {fileID: 4300012, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} +--- !u!33 &33000012558278368 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010746370754} + m_Mesh: {fileID: 4300016, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} --- !u!33 &33000013208543088 MeshFilter: m_ObjectHideFlags: 1 @@ -515,7 +744,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.0165, y: 0.033, z: 0.035} + m_Size: {x: 0.0345, y: 0.069, z: 0.01} m_Center: {x: 0, y: 0, z: 0} --- !u!65 &65000011941282114 BoxCollider: @@ -527,7 +756,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.06, y: 0.005, z: 0.06} + m_Size: {x: 0.17, y: 0.005, z: 0.19} m_Center: {x: 0, y: 0, z: 0} --- !u!65 &65000012740030200 BoxCollider: @@ -539,7 +768,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.0165, y: 0.033, z: 0.035} + m_Size: {x: 0.0345, y: 0.069, z: 0.01} m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114000010373680160 MonoBehaviour: @@ -559,7 +788,7 @@ MonoBehaviour: m_HighlightGradientPair: a: {r: 0, g: 0, b: 0, a: 0} b: {r: 0, g: 0, b: 0, a: 0} - m_ButtonMeshRenderer: {fileID: 23000013664958186} + m_ButtonMeshRenderer: {fileID: 23000013623333764} m_IconContainer: {fileID: 224000013783073276} m_ContentContainer: {fileID: 224000013167097666} m_CanvasGroup: {fileID: 225000010875730614} @@ -607,23 +836,6 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: A ---- !u!114 &114000010887893374 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011810879300} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RunInEditMode: 0 - m_SmoothRotation: 1 - m_TightenRotation: 1 - m_SmoothPosition: 1 - m_TightenPosition: 1 - m_Target: {fileID: 4000012504767854} --- !u!114 &114000011073612486 MonoBehaviour: m_ObjectHideFlags: 1 @@ -665,10 +877,10 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_GradientButton: {fileID: 114000010373680160} - m_SmoothMotion: {fileID: 114000010887893374} + m_SmoothMotion: {fileID: 0} m_LeftPinnedToolActionButton: {fileID: 114000011926581952} m_RightPinnedToolActionButton: {fileID: 114000013773965116} - m_ContentContainer: {fileID: 4000013747407424} + m_ContentContainer: {fileID: 4000012190781878} m_RootCollider: {fileID: 65000011941282114} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} @@ -868,7 +1080,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: fc47de3bcfede8d49b869829e6ff0c0a, type: 3} + m_Sprite: {fileID: 21300000, guid: ea362006918ddee41a65752e3722d093, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -893,7 +1105,7 @@ MonoBehaviour: m_Right: 0 m_Top: 0 m_Bottom: 0 - m_ChildAlignment: 0 + m_ChildAlignment: 4 m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 @@ -941,7 +1153,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: fc47de3bcfede8d49b869829e6ff0c0a, type: 3} + m_Sprite: {fileID: 21300000, guid: ea362006918ddee41a65752e3722d093, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -1086,8 +1298,8 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0.00000023841858} - m_SizeDelta: {x: 0.01564002, y: 0.015769958} + m_AnchoredPosition: {x: -0.00236129, y: -0.0002999992} + m_SizeDelta: {x: 0.0413, y: 0.0413} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011060550722 RectTransform: @@ -1096,7 +1308,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014093660532} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.15000011} m_LocalScale: {x: 0.425, y: 0.50000024, z: 0.42500025} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] @@ -1153,7 +1365,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013929112766} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.0030208803} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: @@ -1163,8 +1375,8 @@ RectTransform: m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0.02634, y: 0.02648} + m_AnchoredPosition: {x: -2.3283064e-10, y: -0.0012286394} + m_SizeDelta: {x: 0.0681, y: 0.0715} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013167097666 RectTransform: @@ -1172,10 +1384,10 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012194113842} - m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.85, y: 0.8500012, z: 0.13000014} - m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.1471} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: - {fileID: 224000012760332454} - {fileID: 4000012190781878} @@ -1183,8 +1395,8 @@ RectTransform: m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0.0009338602} - m_SizeDelta: {x: 100, y: 100} + m_AnchoredPosition: {x: -0.00039896322, y: -9.1830804e-10} + m_SizeDelta: {x: 0.09, y: 0.09} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013218953584 RectTransform: @@ -1201,8 +1413,8 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0.00000023841858} - m_SizeDelta: {x: 0.01564002, y: 0.015769958} + m_AnchoredPosition: {x: 0.0023612897, y: -0.0002999992} + m_SizeDelta: {x: 0.0413, y: 0.0413} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013783073276 RectTransform: @@ -1317,7 +1529,7 @@ CanvasGroup: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013126942410} m_Enabled: 1 - m_Alpha: 1 + m_Alpha: 0 m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 @@ -1328,7 +1540,7 @@ CanvasGroup: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013979951132} m_Enabled: 1 - m_Alpha: 1 + m_Alpha: 0 m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 From cf75d42aad6768a514a38bb70ee2471b9422aef5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 7 Apr 2017 17:17:52 -0700 Subject: [PATCH 101/870] Remove RadialMenu slot scaling on hide; allows the new PinnedToolButtons to properly align with radial menu content when the radial menu is hidden --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 7a7d5e373..d93c957a0 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -451,9 +451,7 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) const float kFasterMotionMultiplier = 2f; var transitionAmount = Time.unscaledDeltaTime; var positionWait = (orderIndex + 4) * 0.25f; // pad the order index for a faster start to the transition - var currentScale = transform.localScale; var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); - var targetScale = makeSemiTransparent ? semiTransparentTargetScale : Vector3.one; var currentFrameColor = m_FrameMaterial.color; var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); var targetFrameColor = m_CanvasGroup.interactable ? (makeSemiTransparent ? m_SemiTransparentFrameColor : s_FrameOpaqueColor) : transparentFrameColor; @@ -473,14 +471,12 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, transitionAmount)); m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, transitionAmount)); var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - transform.localScale = Vector3.Lerp(currentScale, targetScale, shapedTransitionAmount); m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconScale, shapedTransitionAmount); transitionAmount += Time.unscaledDeltaTime * positionWait * 3f; CorrectIconRotation(); yield return null; } - transform.localScale = targetScale; m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); From 6189d7160d10aebe3cfa302e1dabebd043b59073 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 7 Apr 2017 17:19:56 -0700 Subject: [PATCH 102/870] Use IUsesMenuOrigins to assign alternateMenu origin to PinnedToolButtons, remove manual assignment of parents EditorVR.Tools; Correct pinned tool button rotations --- Scripts/Core/EditorVR.Tools.cs | 2 -- Scripts/UI/PinnedToolButton.cs | 40 +++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index c96fff1c5..7ef5ca06c 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -140,7 +140,6 @@ internal void SpawnDefaultTools(IProxy proxy) selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); selectionToolButton.order = 0; // The "active" tool occupies the zeroth position - selectionToolButtonTransform.SetParent(mainMenuActivator.transform, false); selectionToolButton.node = deviceData.node; } @@ -286,7 +285,6 @@ void AddPinnedToolButton(DeviceData deviceData, Type toolType) var pinnedToolButton = evr.m_Menus.SpawnPinnedToolButton(deviceData.inputDevice); pinnedToolButtons.Add(toolType, pinnedToolButton); - pinnedToolButton.transform.SetParent(deviceData.mainMenuActivator.transform, false); pinnedToolButton.node = deviceData.node; pinnedToolButton.toolType = toolType; // Assign Tool Type before assigning order pinnedToolButton.order = 0; // Zeroth position is the active tool position diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index bd0b330ee..acfe7b623 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces + public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces, IUsesMenuOrigins { public static Vector3 activePosition { @@ -39,6 +39,7 @@ public Type toolType { if (isSelectionTool) { + activeButtonCount = 1; tooltipText = k_SelectionToolTipText; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair } @@ -61,7 +62,6 @@ public Type toolType } } } - Type m_ToolType; public int order { @@ -84,13 +84,12 @@ public int order // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = 0 - (activeButtonCount * 0.5f) * kRotationSpacing; + var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newTargetRotation)); //transform.localRotation = newLocalRotation; } } - int m_Order; /// /// GradientPair should be set with new random gradientPair each time a new Tool is associated with this Button @@ -105,7 +104,6 @@ private set customToolTipHighlightColor = value; } } - GradientPair m_GradientPair; /// /// Type, that if not null, denotes that preview-mode is enabled @@ -138,7 +136,21 @@ public Type previewToolType m_GradientButton.highlighted = m_previewToolType != null; } } - Type m_previewToolType; + + public Transform alternateMenuOrigin + { + get { return m_AlternateMenuOrigin; } + set + { + if (m_AlternateMenuOrigin == value) + return; + + m_AlternateMenuOrigin = value; + transform.SetParent(m_AlternateMenuOrigin); + transform.localPosition = Vector3.zero; + transform.localRotation = Quaternion.identity; + } + } [SerializeField] GradientButton m_GradientButton; @@ -168,6 +180,11 @@ public Type previewToolType Coroutine m_PositionCoroutine; Coroutine m_VisibilityCoroutine; Vector3 m_InactivePosition; // Inactive button offset from the main menu activator + Transform m_AlternateMenuOrigin; + Type m_previewToolType; + GradientPair m_GradientPair; + int m_Order; + Type m_ToolType; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -182,6 +199,7 @@ public Type previewToolType public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } public Action DeletePinnedToolButton { get; set; } public int activeButtonCount { get; set; } + public Transform menuOrigin { get; set; } private bool activeTool { @@ -202,14 +220,16 @@ void Start() Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); + transform.parent = alternateMenuOrigin; + if (m_ToolType == null) { - transform.localPosition = m_InactivePosition; + //transform.localPosition = m_InactivePosition; m_GradientButton.gameObject.SetActive(false); } else { - transform.localPosition = activePosition; + //transform.localPosition = activePosition; } var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, 0); @@ -279,8 +299,8 @@ IEnumerator AnimatePosition(Quaternion targetRotation) var currentRotation = transform.localRotation; while (duration < 1) { - duration += Time.unscaledDeltaTime * 3; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 6); + duration += Time.unscaledDeltaTime * 6; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); CorrectIconRotation(); //transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); From a1625b413831e96476cc5a30bb055946101bbc58 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 7 Apr 2017 17:20:48 -0700 Subject: [PATCH 103/870] Reduce position offset for PinnedToolButtons, in relation to RadialMenuContent --- Prefabs/UI/PinnedToolButton.prefab | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index c49d39aeb..e856cf5e9 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -419,7 +419,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010797218832} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.05} + m_LocalPosition: {x: 0, y: 0, z: -0.24310015} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: [] @@ -520,7 +520,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011695512812} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0.00078000035, z: -0.012670009} + m_LocalPosition: {x: 0, y: 0, z: -0.18990004} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: [] @@ -546,7 +546,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011810879300} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.000000026077032} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: From 53ad4ac8e60ade7b286b3e57464c8e957e3948bc Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 7 Apr 2017 19:04:10 -0700 Subject: [PATCH 104/870] Add initial highlighting support to PinnedToolButtons --- Prefabs/UI/PinnedToolButton.prefab | 2 + Scripts/Core/EditorVR.Tools.cs | 29 ++++++++--- Scripts/UI/PinnedToolButton.cs | 83 +++++++++++++++++++++++++++++- 3 files changed, 107 insertions(+), 7 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index e856cf5e9..fb61cc89f 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -882,6 +882,8 @@ MonoBehaviour: m_RightPinnedToolActionButton: {fileID: 114000013773965116} m_ContentContainer: {fileID: 4000012190781878} m_RootCollider: {fileID: 65000011941282114} + m_FrameRenderer: {fileID: 23000013529982034} + m_InsetMeshRenderer: {fileID: 23000013623333764} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} --- !u!114 &114000011796366970 diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 7ef5ca06c..4c7fd24b0 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -141,6 +141,7 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); selectionToolButton.order = 0; // The "active" tool occupies the zeroth position selectionToolButton.node = deviceData.node; + selectionToolButton.highlightPinnedToolButtons = HighlightPinnedToolButtons; } evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); @@ -283,12 +284,13 @@ void AddPinnedToolButton(DeviceData deviceData, Type toolType) pair.Value.order++; } - var pinnedToolButton = evr.m_Menus.SpawnPinnedToolButton(deviceData.inputDevice); - pinnedToolButtons.Add(toolType, pinnedToolButton); - pinnedToolButton.node = deviceData.node; - pinnedToolButton.toolType = toolType; // Assign Tool Type before assigning order - pinnedToolButton.order = 0; // Zeroth position is the active tool position - pinnedToolButton.DeletePinnedToolButton = DeletePinnedToolButton; + var button = evr.m_Menus.SpawnPinnedToolButton(deviceData.inputDevice); + pinnedToolButtons.Add(toolType, button); + button.node = deviceData.node; + button.toolType = toolType; // Assign Tool Type before assigning order + button.order = 0; // Zeroth position is the active tool position + button.DeletePinnedToolButton = DeletePinnedToolButton; + button.highlightPinnedToolButtons = HighlightPinnedToolButtons; } void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) @@ -500,6 +502,21 @@ internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Ty return pinnedToolButton; } + + internal void HighlightPinnedToolButtons (Transform rayOrigin, bool enableHighlight) + { + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + { + var buttons = deviceData.pinnedToolButtons; + foreach (var pair in buttons) + { + pair.Value.highlighted = enableHighlight; + } + } + }); + } } } } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index acfe7b623..c0b035695 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections; +using System.Runtime.CompilerServices; using System.Text; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; @@ -12,6 +13,10 @@ namespace UnityEditor.Experimental.EditorVR.Menus { public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces, IUsesMenuOrigins { + static Color s_FrameOpaqueColor; + static Color s_SemiTransparentFrameColor; + static Vector3 s_ActivePosition; + public static Vector3 activePosition { private get { return s_ActivePosition; } @@ -20,8 +25,9 @@ public static Vector3 activePosition s_ActivePosition = value; } } - static Vector3 s_ActivePosition; + const string k_MaterialColorProperty = "_Color"; + const string k_MaterialAlphaProperty = "_Alpha"; const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; public Type toolType @@ -170,6 +176,12 @@ public Transform alternateMenuOrigin [SerializeField] Collider m_RootCollider; + [SerializeField] + MeshRenderer m_FrameRenderer; + + [SerializeField] + MeshRenderer m_InsetMeshRenderer; + [SerializeField] Transform m_TooltipTarget; @@ -179,12 +191,16 @@ public Transform alternateMenuOrigin string m_TooltipText; Coroutine m_PositionCoroutine; Coroutine m_VisibilityCoroutine; + Coroutine m_HighlightCoroutine; Vector3 m_InactivePosition; // Inactive button offset from the main menu activator Transform m_AlternateMenuOrigin; Type m_previewToolType; GradientPair m_GradientPair; int m_Order; Type m_ToolType; + Material m_FrameMaterial; + bool m_Highlighted; + Material m_InsetMaterial; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -200,6 +216,7 @@ public Transform alternateMenuOrigin public Action DeletePinnedToolButton { get; set; } public int activeButtonCount { get; set; } public Transform menuOrigin { get; set; } + public Action highlightPinnedToolButtons { get; set; } private bool activeTool { @@ -214,6 +231,19 @@ private bool activeTool } } + public bool highlighted + { + set + { + //if (m_Highlighted == value || !gameObject.activeSelf) + //return; + + this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value)); + } + + //get { return m_Highlighted; } + } + void Start() { //m_GradientButton.onClick += SelectTool; // TODO remove after action button refactor @@ -239,6 +269,15 @@ void Start() m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); this.ConnectInterfaces(m_SmoothMotion); + m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); + var frameMaterialColor = m_FrameMaterial.color; + s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); + s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); + + m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); + //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); + m_GradientButton.hoverEnter += BackgroundHoverEnter; // Display the foreground button actions m_GradientButton.hoverExit += ActionButtonHoverExit; @@ -350,6 +389,8 @@ void HoverButton() m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; } + + highlightPinnedToolButtons(rayOrigin, true); } void ActionButtonClicked(PinnedToolActionButton button) @@ -385,6 +426,7 @@ void ActionButtonHoverExit() m_RightPinnedToolActionButton.visible = false; //m_GradientButton.visible = true; m_GradientButton.highlighted = false; + highlightPinnedToolButtons(rayOrigin, false); } m_GradientButton.UpdateMaterialColors(); @@ -431,6 +473,45 @@ public void CorrectIconRotation() var yaw = transform.localRotation.eulerAngles.y; tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; } + + IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) + { + Debug.LogWarning("AnimateSemiTransparent : " + makeSemiTransparent); + const float kFasterMotionMultiplier = 2f; + var transitionAmount = Time.unscaledDeltaTime; + var positionWait = (order + 1) * 0.25f; // pad the order index for a faster start to the transition + //var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); + var currentFrameColor = m_FrameMaterial.color; + var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); + var targetFrameColor = makeSemiTransparent ? s_SemiTransparentFrameColor : s_FrameOpaqueColor; + var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); + var targetInsetAlpha = makeSemiTransparent ? 0.25f : 1f; + //var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); + //var targetIconColor = makeSemiTransparent ? s_SemiTransparentFrameColor : Color.white; + //var currentInsetScale = m_MenuInset.localScale; + //var targetInsetScale = makeSemiTransparent ? m_HighlightedInsetLocalScale * 4 : m_VisibleInsetLocalScale; + //var currentIconScale = m_IconContainer.localScale; + //var semiTransparentTargetIconScale = Vector3.one * 1.5f; + //var targetIconScale = makeSemiTransparent ? semiTransparentTargetIconScale : Vector3.one; + while (transitionAmount < 1) + { + m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, transparentFrameColor, transitionAmount)); + //m_MenuInset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, transitionAmount * 2f); + //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, transitionAmount)); + //m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, transitionAmount)); + //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; + //m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconScale, shapedTransitionAmount); + transitionAmount += Time.unscaledDeltaTime * 4f; + CorrectIconRotation(); + yield return null; + } + + m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); + //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); + //m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + //m_MenuInset.localScale = targetInsetScale; + //m_IconContainer.localScale = targetIconScale; + } } } #endif From 11ea26ab4c68237ae6770773d085c26793011a45 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 15:50:08 -0700 Subject: [PATCH 105/870] Move UI-specific textures from Prefabs/Textures into Prefabs/UI/Textures --- Prefabs/{ => UI}/Textures.meta | 0 Prefabs/{ => UI}/Textures/Dotted Line.png | 0 Prefabs/{ => UI}/Textures/Dotted Line.png.meta | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Prefabs/{ => UI}/Textures.meta (100%) rename Prefabs/{ => UI}/Textures/Dotted Line.png (100%) rename Prefabs/{ => UI}/Textures/Dotted Line.png.meta (100%) diff --git a/Prefabs/Textures.meta b/Prefabs/UI/Textures.meta similarity index 100% rename from Prefabs/Textures.meta rename to Prefabs/UI/Textures.meta diff --git a/Prefabs/Textures/Dotted Line.png b/Prefabs/UI/Textures/Dotted Line.png similarity index 100% rename from Prefabs/Textures/Dotted Line.png rename to Prefabs/UI/Textures/Dotted Line.png diff --git a/Prefabs/Textures/Dotted Line.png.meta b/Prefabs/UI/Textures/Dotted Line.png.meta similarity index 100% rename from Prefabs/Textures/Dotted Line.png.meta rename to Prefabs/UI/Textures/Dotted Line.png.meta From c7d96ba55bf8f0e3829f2c1c7413336254bf9358 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 15:51:39 -0700 Subject: [PATCH 106/870] Add new Unity logo icon sprite to Prefabs/UI/Textures --- Prefabs/UI/Textures/UnityIcon.png | 3 ++ Prefabs/UI/Textures/UnityIcon.png.meta | 58 ++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 Prefabs/UI/Textures/UnityIcon.png create mode 100644 Prefabs/UI/Textures/UnityIcon.png.meta diff --git a/Prefabs/UI/Textures/UnityIcon.png b/Prefabs/UI/Textures/UnityIcon.png new file mode 100644 index 000000000..f724b59a3 --- /dev/null +++ b/Prefabs/UI/Textures/UnityIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9b1b8834bed0b5bb590af2b7caa63d2b68d7e702eff2f5d504784311f5a2fec +size 12925 diff --git a/Prefabs/UI/Textures/UnityIcon.png.meta b/Prefabs/UI/Textures/UnityIcon.png.meta new file mode 100644 index 000000000..497a256fe --- /dev/null +++ b/Prefabs/UI/Textures/UnityIcon.png.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 05f6f0555fbf99a429004b50ccd6ffa9 +timeCreated: 1491864084 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 2 + aniso: 3 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 5 + buildTargetSettings: [] + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: EditorVR + userData: + assetBundleName: + assetBundleVariant: From 913c47cc29c535427156a38c1a405fa1a2e83fcd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 16:43:53 -0700 Subject: [PATCH 107/870] Refactor PinnedTool functionality into its own EVR nested module; preparing for removal from EditorVR.Tools --- Scripts/Core/EditorVR.PinnedTools.cs | 153 ++++++++++++++++++++++ Scripts/Core/EditorVR.PinnedTools.cs.meta | 37 ++++++ 2 files changed, 190 insertions(+) create mode 100644 Scripts/Core/EditorVR.PinnedTools.cs create mode 100644 Scripts/Core/EditorVR.PinnedTools.cs.meta diff --git a/Scripts/Core/EditorVR.PinnedTools.cs b/Scripts/Core/EditorVR.PinnedTools.cs new file mode 100644 index 000000000..b806c9fc3 --- /dev/null +++ b/Scripts/Core/EditorVR.PinnedTools.cs @@ -0,0 +1,153 @@ +#if UNITY_EDITOR && UNITY_EDITORVR +using System; +using System.Linq; +using UnityEditor.Experimental.EditorVR.Menus; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Core +{ + partial class EditorVR + { + class PinnedTools : Nested, IInterfaceConnector + { + public void ConnectInterface(object obj, Transform rayOrigin = null) + { + var mainMenu = obj as IMainMenu; + if (mainMenu != null) + mainMenu.previewToolInPinnedToolButton = PreviewToolInPinnedToolButton; + } + + public void DisconnectInterface(object obj) + { + } + + void AddPinnedToolButton(DeviceData deviceData, Type toolType) + { + var pinnedToolButtons = deviceData.pinnedToolButtons; + if (pinnedToolButtons.ContainsKey(toolType)) // Return if tooltype already occupies a pinned tool button + return; + + // Before adding new button, offset each button to a position greater than the zeroth/active tool position + foreach (var pair in pinnedToolButtons) + { + pair.Value.order++; + } + + var button = evr.m_Menus.SpawnPinnedToolButton(deviceData.inputDevice); + pinnedToolButtons.Add(toolType, button); + button.node = deviceData.node; + button.toolType = toolType; // Assign Tool Type before assigning order + button.order = 0; // Zeroth position is the active tool position + button.DeletePinnedToolButton = DeletePinnedToolButton; + button.highlightPinnedToolButtons = HighlightPinnedToolButtons; + } + + void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) + { + Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); + const int kMaxButtonCount = 6; + var order = 0; + var buttons = deviceData.pinnedToolButtons; + var buttonCount = buttons.Count; + + if (buttonCount >= kMaxButtonCount) + { + Debug.LogError("Attempting to add buttons beyond max count! Handle for removing highest ordered button and adding this new button!"); + return; + } + + foreach (var pair in buttons) + { + var button = pair.Value; + button.rayOrigin = rayOrigin; + button.activeButtonCount = buttonCount; // Used to position buttons relative to count + button.order = button.toolType == activeToolType ? 0 : ++order; + + if (button.order == 0) + deviceData.proxy.HighlightDevice(deviceData.node, button.gradientPair); // Perform the higlight on the node with the button's gradient pair + } + } + + void DeletePinnedToolButton(Transform rayOrigin, PinnedToolButton buttonToDelete) + { + // Remove the pinned tool from the device data collection + // re-order the current buttons + // Highlight the device if the top/selected tool was the one that was closed + + Debug.LogError("DeletePinnedToolButton called"); + + //var result = false; + //var deviceInputModule = evr.m_DeviceInputModule; + Type selectedButtontype = null; + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + { + var buttons = deviceData.pinnedToolButtons; + var selectedButtonOrder = buttons.Count; + foreach (var pair in deviceData.pinnedToolButtons) + { + var button = pair.Value; + if (button != buttonToDelete) + { + // Identify the new selected button + selectedButtonOrder = button.order < selectedButtonOrder ? button.order : selectedButtonOrder; + selectedButtontype = selectedButtonOrder == button.order ? button.toolType : selectedButtontype; + } + } + + + Debug.LogError("Removing button : " + buttonToDelete.toolType); + buttons.Remove(buttonToDelete.toolType); + evr.m_Tools.SelectTool(rayOrigin, buttonToDelete.toolType); + SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, selectedButtontype); + } + }); + } + + internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType) + { + // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions + if (!toolType.GetInterfaces().Contains(typeof(ITool))) + return null; + + PinnedToolButton pinnedToolButton = null; + Rays.ForEachProxyDevice((deviceData) => + { + if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device + { + var pinnedToolButtons = deviceData.pinnedToolButtons; + foreach (var pair in pinnedToolButtons) + { + var button = pair.Value; + if (button.order == 0) + { + pinnedToolButton = button; + pinnedToolButton.previewToolType = toolType; + break; + } + } + } + }); + + return pinnedToolButton; + } + + internal void HighlightPinnedToolButtons (Transform rayOrigin, bool enableHighlight) + { + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + { + var buttons = deviceData.pinnedToolButtons; + foreach (var pair in buttons) + { + pair.Value.highlighted = enableHighlight; + } + } + }); + } + } + } +} +#endif diff --git a/Scripts/Core/EditorVR.PinnedTools.cs.meta b/Scripts/Core/EditorVR.PinnedTools.cs.meta new file mode 100644 index 000000000..d306a5dcb --- /dev/null +++ b/Scripts/Core/EditorVR.PinnedTools.cs.meta @@ -0,0 +1,37 @@ +fileFormatVersion: 2 +guid: 061ac5b0e630d8045b62569c35881b57 +timeCreated: 1479964689 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_TrackedObjectActionMap: {fileID: 11400000, guid: fda722c992454454aa59f3760898d74a, + type: 2} + - m_StandardToolActionMap: {fileID: 11400000, guid: f904ed06397c2fc4f81263e88804a0af, + type: 2} + - m_DirectSelectActionMap: {fileID: 11400000, guid: dc1ccafeffffc62419a3265a080a94a3, + type: 2} + - m_ProxyRayPrefab: {fileID: 114000010564953552, guid: 6c037b4595ca1ab4c921efeac9524073, + type: 2} + - m_EventCameraPrefab: {fileID: 20000012271368486, guid: 6078fbea960c1014cba733bb3ec1d7ad, + type: 2} + - m_MainMenuActivatorPrefab: {fileID: 114000011125667836, guid: a943a77cb6a6bd04da2b86b34ade4596, + type: 2} + - m_KeyboardMalletPrefab: {fileID: 114000013972379212, guid: 55c3df0d3b957354fa26bae2b39cffb3, + type: 2} + - m_NumericKeyboardPrefab: {fileID: 114000012169358554, guid: 5f76c682f089562449adab190d7a8fc4, + type: 2} + - m_StandardKeyboardPrefab: {fileID: 114000012076762946, guid: 6a5c5a798b3bb39408f3dbf2bfa77923, + type: 2} + - m_PlayerModelPrefab: {fileID: 1000013280737546, guid: 3dbbb2baa83f3994e94fe56a60c73252, + type: 2} + - m_PreviewCameraPrefab: {fileID: 1000010893495554, guid: 66d2f6b9efc6b7842bea782607a65bd2, + type: 2} + - m_ProxyExtras: {instanceID: 0} + - m_PinnedToolButtonPrefab: {fileID: 114000011260412956, guid: 7221a75a049ac3949a505c7c2f06bd8e, + type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 85e69776ff0b0f38771a1c2132562fbb46404ac5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 16:51:52 -0700 Subject: [PATCH 108/870] Remove previewToolInPinnedToolButton assignment in EditorVR.Menus; handled in EditorVR.Tools now --- Scripts/Core/EditorVR.Menus.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index e3bfd002c..b34ab9bef 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -346,7 +346,6 @@ internal IMainMenu SpawnMainMenu(Type type, InputDevice device, bool visible, ou input = evr.m_DeviceInputModule.CreateActionMapInputForObject(mainMenu, device); evr.m_Interfaces.ConnectInterfaces(mainMenu, device); mainMenu.visible = visible; - //mainMenu.previewToolInPinnedToolButton = evr.m_Tools.PreviewToolInPinnedToolButton; // Handled in EditorVR.Tools ConnectInterfaces now return mainMenu; } From 164a2ccfa125d0998c54e1470e4f6cb6ccb02013 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 17:01:15 -0700 Subject: [PATCH 109/870] Cache Tools & PinnedTools in EditorVR --- Scripts/Core/EditorVR.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 8d4deeafb..7138dfaf7 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -50,6 +50,8 @@ sealed partial class EditorVR : MonoBehaviour DeviceInputModule m_DeviceInputModule; Viewer m_Viewer; MultipleRayInputModule m_MultipleRayInputModule; + Tools m_Tools; + PinnedTools m_PinnedTools; bool m_HasDeserialized; @@ -125,6 +127,8 @@ void Awake() m_DirectSelection = GetNestedModule(); m_Menus = GetNestedModule(); m_UI = GetNestedModule(); + m_Tools = GetNestedModule(); + m_PinnedTools = GetNestedModule(); AddModule(); AddModule(); From 6b1b71e902f9f1233e7c9fa77f2ab6cedd966c08 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 17:03:21 -0700 Subject: [PATCH 110/870] Remove PinnedTools logic from EditorVR.Tools; update PinnedTool functions access modifiers --- Scripts/Core/EditorVR.PinnedTools.cs | 4 +- Scripts/Core/EditorVR.Tools.cs | 140 +-------------------------- 2 files changed, 7 insertions(+), 137 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedTools.cs b/Scripts/Core/EditorVR.PinnedTools.cs index b806c9fc3..03b26987b 100644 --- a/Scripts/Core/EditorVR.PinnedTools.cs +++ b/Scripts/Core/EditorVR.PinnedTools.cs @@ -21,7 +21,7 @@ public void DisconnectInterface(object obj) { } - void AddPinnedToolButton(DeviceData deviceData, Type toolType) + internal void AddPinnedToolButton(DeviceData deviceData, Type toolType) { var pinnedToolButtons = deviceData.pinnedToolButtons; if (pinnedToolButtons.ContainsKey(toolType)) // Return if tooltype already occupies a pinned tool button @@ -42,7 +42,7 @@ void AddPinnedToolButton(DeviceData deviceData, Type toolType) button.highlightPinnedToolButtons = HighlightPinnedToolButtons; } - void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) + internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) { Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); const int kMaxButtonCount = 6; diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index b826c4900..390633e96 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -50,10 +50,6 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) linkedObjectList.Add(linkedObject); linkedObject.linkedObjects = linkedObjectList; } - - var mainMenu = obj as IMainMenu; - if (mainMenu != null) - mainMenu.previewToolInPinnedToolButton = PreviewToolInPinnedToolButton; } public void DisconnectInterface(object obj) @@ -141,7 +137,7 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); selectionToolButton.order = 0; // The "active" tool occupies the zeroth position selectionToolButton.node = deviceData.node; - selectionToolButton.highlightPinnedToolButtons = HighlightPinnedToolButtons; + selectionToolButton.highlightPinnedToolButtons = evr.m_PinnedTools.HighlightPinnedToolButtons; } evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); @@ -199,7 +195,7 @@ bool IsToolActive(Transform targetRayOrigin, Type toolType) return result; } - bool SelectTool(Transform rayOrigin, Type toolType) + internal bool SelectTool(Transform rayOrigin, Type toolType) { //Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); //if (toolType == typeof(SelectionTool)) @@ -207,6 +203,7 @@ bool SelectTool(Transform rayOrigin, Type toolType) var result = false; var deviceInputModule = evr.m_DeviceInputModule; + var pinnedTools = evr.m_PinnedTools; Rays.ForEachProxyDevice(deviceData => { if (deviceData.rayOrigin == rayOrigin) @@ -254,11 +251,11 @@ bool SelectTool(Transform rayOrigin, Type toolType) AddToolToStack(dd, newTool); if (!setSelectAsCurrentTool) - AddPinnedToolButton(deviceData, toolType); + pinnedTools.AddPinnedToolButton(deviceData, toolType); } } - SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, toolType); + pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, toolType); deviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; } @@ -271,90 +268,6 @@ bool SelectTool(Transform rayOrigin, Type toolType) return result; } - void AddPinnedToolButton(DeviceData deviceData, Type toolType) - { - var pinnedToolButtons = deviceData.pinnedToolButtons; - if (pinnedToolButtons.ContainsKey(toolType)) // Return if tooltype already occupies a pinned tool button - return; - - // Before adding new button, offset each button to a position greater than the zeroth/active tool position - foreach (var pair in pinnedToolButtons) - { - pair.Value.order++; - } - - var button = evr.m_Menus.SpawnPinnedToolButton(deviceData.inputDevice); - pinnedToolButtons.Add(toolType, button); - button.node = deviceData.node; - button.toolType = toolType; // Assign Tool Type before assigning order - button.order = 0; // Zeroth position is the active tool position - button.DeletePinnedToolButton = DeletePinnedToolButton; - button.highlightPinnedToolButtons = HighlightPinnedToolButtons; - } - - void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) - { - Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); - const int kMaxButtonCount = 6; - var order = 0; - var buttons = deviceData.pinnedToolButtons; - var buttonCount = buttons.Count; - - if (buttonCount >= kMaxButtonCount) - { - Debug.LogError("Attempting to add buttons beyond max count! Handle for removing highest ordered button and adding this new button!"); - return; - } - - foreach (var pair in buttons) - { - var button = pair.Value; - button.rayOrigin = rayOrigin; - button.activeButtonCount = buttonCount; // Used to position buttons relative to count - button.order = button.toolType == activeToolType ? 0 : ++order; - - if (button.order == 0) - deviceData.proxy.HighlightDevice(deviceData.node, button.gradientPair); // Perform the higlight on the node with the button's gradient pair - } - } - - void DeletePinnedToolButton(Transform rayOrigin, PinnedToolButton buttonToDelete) - { - // Remove the pinned tool from the device data collection - // re-order the current buttons - // Highlight the device if the top/selected tool was the one that was closed - - Debug.LogError("DeletePinnedToolButton called"); - - //var result = false; - //var deviceInputModule = evr.m_DeviceInputModule; - Type selectedButtontype = null; - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - { - var buttons = deviceData.pinnedToolButtons; - var selectedButtonOrder = buttons.Count; - foreach (var pair in deviceData.pinnedToolButtons) - { - var button = pair.Value; - if (button != buttonToDelete) - { - // Identify the new selected button - selectedButtonOrder = button.order < selectedButtonOrder ? button.order : selectedButtonOrder; - selectedButtontype = selectedButtonOrder == button.order ? button.toolType : selectedButtontype; - } - } - - - Debug.LogError("Removing button : " + buttonToDelete.toolType); - buttons.Remove(buttonToDelete.toolType); - SelectTool(rayOrigin, buttonToDelete.toolType); - SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, selectedButtontype); - } - }); - } - void DespawnTool(DeviceData deviceData, ITool tool) { if (!IsPermanentTool(tool.GetType())) @@ -473,49 +386,6 @@ internal void UpdatePlayerHandleMaps(List maps) } } } - - internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType) - { - // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions - if (!toolType.GetInterfaces().Contains(typeof(ITool))) - return null; - - PinnedToolButton pinnedToolButton = null; - Rays.ForEachProxyDevice((deviceData) => - { - if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device - { - var pinnedToolButtons = deviceData.pinnedToolButtons; - foreach (var pair in pinnedToolButtons) - { - var button = pair.Value; - if (button.order == 0) - { - pinnedToolButton = button; - pinnedToolButton.previewToolType = toolType; - break; - } - } - } - }); - - return pinnedToolButton; - } - - internal void HighlightPinnedToolButtons (Transform rayOrigin, bool enableHighlight) - { - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - { - var buttons = deviceData.pinnedToolButtons; - foreach (var pair in buttons) - { - pair.Value.highlighted = enableHighlight; - } - } - }); - } } } } From d176d6a0255d259dd4c8a43e8b4282ebb4e3a9f0 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Apr 2017 17:09:28 -0700 Subject: [PATCH 111/870] Hide main menu when hovering over any UI --- Scripts/Core/EditorVR.Menus.cs | 14 ++++++++------ Scripts/Core/EditorVR.Tools.cs | 2 -- Scripts/Core/EditorVR.cs | 3 +++ Scripts/UI/MainMenuActivator.cs | 12 ------------ 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index b34ab9bef..f73791bfc 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -26,7 +26,7 @@ class Menus : Nested, IInterfaceConnector, ILateBindInterfaceMethods internal enum MenuHideFlags { Hidden = 1 << 0, - OverActivator = 1 << 1, + OverUI = 1 << 1, NearWorkspace = 1 << 2, } @@ -228,7 +228,7 @@ internal void UpdateMenuVisibilities() } // Apply state to UI visibility - Rays.ForEachProxyDevice((deviceData) => + Rays.ForEachProxyDevice(deviceData => { var mainMenu = deviceData.mainMenu; mainMenu.visible = deviceData.menuHideFlags[mainMenu] == 0; @@ -244,28 +244,30 @@ internal void UpdateMenuVisibilities() evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); } - internal void OnMainMenuActivatorHoverStarted(Transform rayOrigin) + internal static void OnUIHoverStarted(GameObject go, RayEventData rayEventData) { + var rayOrigin = rayEventData.rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) { var menus = new List(deviceData.menuHideFlags.Keys); foreach (var menu in menus) { - deviceData.menuHideFlags[menu] |= MenuHideFlags.OverActivator; + deviceData.menuHideFlags[menu] |= MenuHideFlags.OverUI; } } } - internal void OnMainMenuActivatorHoverEnded(Transform rayOrigin) + internal static void OnUIHoverEnded(GameObject go, RayEventData rayEventData) { + var rayOrigin = rayEventData.rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) { var menus = new List(deviceData.menuHideFlags.Keys); foreach (var menu in menus) { - deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverActivator; + deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverUI; } } } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 12a5b8dca..18f39f36f 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -120,8 +120,6 @@ internal void SpawnDefaultTools(IProxy proxy) var mainMenuActivator = evrMenus.SpawnMainMenuActivator(inputDevice); deviceData.mainMenuActivator = mainMenuActivator; mainMenuActivator.selected += evrMenus.OnMainMenuActivatorSelected; - mainMenuActivator.hoverStarted += evrMenus.OnMainMenuActivatorHoverStarted; - mainMenuActivator.hoverEnded += evrMenus.OnMainMenuActivatorHoverEnded; var pinnedToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); deviceData.previousToolButton = pinnedToolButton; diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 64fa23d7e..2c3fe1d69 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -143,6 +143,9 @@ void Awake() m_UI.Initialize(); + m_MultipleRayInputModule.rayEntered += Menus.OnUIHoverStarted; + m_MultipleRayInputModule.rayExited += Menus.OnUIHoverEnded; + m_KeyboardModule = AddModule(); var dragAndDropModule = AddModule(); diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index 42f672cae..f66dccb6b 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -66,17 +66,10 @@ public bool activatorButtonMoveAway public Transform rayOrigin { private get; set; } public Transform menuOrigin { private get; set; } - public event Action hoverStarted; - public event Action hoverEnded; public event Action selected; public void OnPointerEnter(PointerEventData eventData) { - // A child may have used the event, but still reflect that is was hovered - var rayEventData = eventData as RayEventData; - if (rayEventData != null && hoverStarted != null) - hoverStarted(rayEventData.rayOrigin); - if (eventData.used) return; @@ -89,11 +82,6 @@ public void OnPointerEnter(PointerEventData eventData) public void OnPointerExit(PointerEventData eventData) { - // A child may have used the event, but still reflect that is was hovered - var rayEventData = eventData as RayEventData; - if (rayEventData != null && hoverEnded != null) - hoverEnded(rayEventData.rayOrigin); - if (eventData.used) return; From a8cb07275ef24d58e641fefeace728a7ae75f4b6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 17:15:50 -0700 Subject: [PATCH 112/870] Add pinned tool button menu hiding functions to EditorVR.PinnedTools --- Scripts/Core/EditorVR.PinnedTools.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Scripts/Core/EditorVR.PinnedTools.cs b/Scripts/Core/EditorVR.PinnedTools.cs index 03b26987b..d96f037c4 100644 --- a/Scripts/Core/EditorVR.PinnedTools.cs +++ b/Scripts/Core/EditorVR.PinnedTools.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR && UNITY_EDITORVR using System; +using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Menus; using UnityEngine; @@ -147,6 +148,32 @@ internal void HighlightPinnedToolButtons (Transform rayOrigin, bool enableHighli } }); } + + void OnButtonActivatorHoverStarted(Transform rayOrigin) + { + var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); + if (deviceData != null) + { + var menus = new List(deviceData.menuHideFlags.Keys); + foreach (var menu in menus) + { + deviceData.menuHideFlags[menu] |= Menus.MenuHideFlags.OverActivator; + } + } + } + + void OnButtonActivatorHoverEnded(Transform rayOrigin) + { + var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); + if (deviceData != null) + { + var menus = new List(deviceData.menuHideFlags.Keys); + foreach (var menu in menus) + { + deviceData.menuHideFlags[menu] &= ~Menus.MenuHideFlags.OverActivator; + } + } + } } } } From e6f28bf3634b5facd91bbfa254699d4649cf44d7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 18:41:15 -0700 Subject: [PATCH 113/870] Remove & refactor MainMenuActivator related functions out of EditorVR.Menus, and into EditorVR.PinnedTools --- Scripts/Core/EditorVR.Menus.cs | 46 ---------------------------- Scripts/Core/EditorVR.PinnedTools.cs | 24 +++++++++++++-- Scripts/Core/EditorVR.Tools.cs | 9 +++--- 3 files changed, 27 insertions(+), 52 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index b34ab9bef..eb8faac4d 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -244,32 +244,6 @@ internal void UpdateMenuVisibilities() evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); } - internal void OnMainMenuActivatorHoverStarted(Transform rayOrigin) - { - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); - if (deviceData != null) - { - var menus = new List(deviceData.menuHideFlags.Keys); - foreach (var menu in menus) - { - deviceData.menuHideFlags[menu] |= MenuHideFlags.OverActivator; - } - } - } - - internal void OnMainMenuActivatorHoverEnded(Transform rayOrigin) - { - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); - if (deviceData != null) - { - var menus = new List(deviceData.menuHideFlags.Keys); - foreach (var menu in menus) - { - deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverActivator; - } - } - } - internal void UpdateAlternateMenuOnSelectionChanged(Transform rayOrigin) { SetAlternateMenuVisibility(rayOrigin, Selection.gameObjects.Length > 0); @@ -288,26 +262,6 @@ internal void SetAlternateMenuVisibility(Transform rayOrigin, bool visible) }); } - internal void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetRayOrigin) - { - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); - if (deviceData != null) - { - var mainMenu = deviceData.mainMenu; - if (mainMenu != null) - { - var menuHideFlags = deviceData.menuHideFlags; - menuHideFlags[mainMenu] ^= MenuHideFlags.Hidden; - - var customMenu = deviceData.customMenu; - if (customMenu != null) - menuHideFlags[customMenu] &= ~MenuHideFlags.Hidden; - - mainMenu.targetRayOrigin = targetRayOrigin; - } - } - } - internal GameObject InstantiateMenuUI(Transform rayOrigin, IMenu prefab) { GameObject go = null; diff --git a/Scripts/Core/EditorVR.PinnedTools.cs b/Scripts/Core/EditorVR.PinnedTools.cs index d96f037c4..8eabe310a 100644 --- a/Scripts/Core/EditorVR.PinnedTools.cs +++ b/Scripts/Core/EditorVR.PinnedTools.cs @@ -149,7 +149,7 @@ internal void HighlightPinnedToolButtons (Transform rayOrigin, bool enableHighli }); } - void OnButtonActivatorHoverStarted(Transform rayOrigin) + internal void OnButtonHoverStarted(Transform rayOrigin) { var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) @@ -162,7 +162,7 @@ void OnButtonActivatorHoverStarted(Transform rayOrigin) } } - void OnButtonActivatorHoverEnded(Transform rayOrigin) + internal void OnButtonHoverEnded(Transform rayOrigin) { var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) @@ -174,6 +174,26 @@ void OnButtonActivatorHoverEnded(Transform rayOrigin) } } } + + internal void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetRayOrigin) + { + var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); + if (deviceData != null) + { + var mainMenu = deviceData.mainMenu; + if (mainMenu != null) + { + var menuHideFlags = deviceData.menuHideFlags; + menuHideFlags[mainMenu] ^= Menus.MenuHideFlags.Hidden; + + var customMenu = deviceData.customMenu; + if (customMenu != null) + menuHideFlags[customMenu] &= ~Menus.MenuHideFlags.Hidden; + + mainMenu.targetRayOrigin = targetRayOrigin; + } + } + } } } } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 390633e96..5c8c285e4 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -117,11 +117,12 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.mainMenu = mainMenu; deviceData.menuHideFlags[mainMenu] = Menus.MenuHideFlags.Hidden; + var pinnedTools = evr.m_PinnedTools; var mainMenuActivator = evrMenus.SpawnMainMenuActivator(inputDevice); deviceData.mainMenuActivator = mainMenuActivator; - mainMenuActivator.selected += evrMenus.OnMainMenuActivatorSelected; - mainMenuActivator.hoverStarted += evrMenus.OnMainMenuActivatorHoverStarted; - mainMenuActivator.hoverEnded += evrMenus.OnMainMenuActivatorHoverEnded; + mainMenuActivator.selected += pinnedTools.OnMainMenuActivatorSelected; + mainMenuActivator.hoverStarted += pinnedTools.OnButtonHoverStarted; + mainMenuActivator.hoverEnded += pinnedTools.OnButtonHoverEnded; var alternateMenu = evrMenus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); deviceData.alternateMenu = alternateMenu; @@ -137,7 +138,7 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); selectionToolButton.order = 0; // The "active" tool occupies the zeroth position selectionToolButton.node = deviceData.node; - selectionToolButton.highlightPinnedToolButtons = evr.m_PinnedTools.HighlightPinnedToolButtons; + selectionToolButton.highlightPinnedToolButtons = pinnedTools.HighlightPinnedToolButtons; } evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); From cffb42cfedce80c991485e03f1bd1ad43980b220 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 18:49:10 -0700 Subject: [PATCH 114/870] Cleanup EditorVR.Tools warning --- Scripts/Core/EditorVR.Tools.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 5c8c285e4..214a79d30 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -132,7 +132,6 @@ internal void SpawnDefaultTools(IProxy proxy) var toolButtonActivePosition = new Vector3(0f, 0f, -0.035f); // Frontmost active button offset from the main menu activator PinnedToolButton.activePosition = toolButtonActivePosition; // Shared active button position var selectionToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); - var selectionToolButtonTransform = selectionToolButton.transform; deviceData.pinnedToolButtons = new Dictionary(); selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); From 7d6d5d39b4f6ea502234747ccdf153aa21b96697 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 18:49:38 -0700 Subject: [PATCH 115/870] Use previously cached tools module in EditorVR --- Scripts/Core/EditorVR.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 7138dfaf7..b847ac6e8 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -137,13 +137,11 @@ void Awake() m_Viewer.preserveCameraRig = preserveLayout; m_Viewer.InitializeCamera(); - var tools = GetNestedModule(); - m_DeviceInputModule = AddModule(); m_DeviceInputModule.InitializePlayerHandle(); m_DeviceInputModule.CreateDefaultActionMapInputs(); m_DeviceInputModule.processInput = ProcessInput; - m_DeviceInputModule.updatePlayerHandleMaps = tools.UpdatePlayerHandleMaps; + m_DeviceInputModule.updatePlayerHandleMaps = m_Tools.UpdatePlayerHandleMaps; m_UI.Initialize(); From 67638d2a6fb5534be0a4db494a6a258d06a86c39 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 21:04:13 -0700 Subject: [PATCH 116/870] Move spawning of MainMenuActivator and PinnedToolButtons from EditorVR.Menus into EditorVR.PinnedTools --- Scripts/Core/EditorVR.Menus.cs | 27 ++++++++++----------------- Scripts/Core/EditorVR.PinnedTools.cs | 20 +++++++++++++++++++- Scripts/Core/EditorVR.Tools.cs | 4 ++-- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index eb8faac4d..d4ba0dade 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -177,10 +177,19 @@ void UpdateAlternateMenuForDevice(DeviceData deviceData) var alternateMenu = deviceData.alternateMenu; alternateMenu.visible = deviceData.menuHideFlags[alternateMenu] == 0 && !(deviceData.currentTool is IExclusiveMode); - // Move the activator button to an alternate position if the alternate menu will be shown + // Move the activator & pinned tool buttons to an alternate position if the alternate menu will be shown var mainMenuActivator = deviceData.mainMenuActivator; if (mainMenuActivator != null) mainMenuActivator.activatorButtonMoveAway = alternateMenu.visible; + + var pinnedToolButtons = deviceData.pinnedToolButtons; + if (pinnedToolButtons != null && pinnedToolButtons.Count > 0) + { + foreach (var button in pinnedToolButtons) + { + button.Value.moveToAlternatePosition = alternateMenu.visible; + } + } } internal void UpdateMenuVisibilities() @@ -319,22 +328,6 @@ internal IAlternateMenu SpawnAlternateMenu(Type type, InputDevice device, out Ac return alternateMenu; } - internal MainMenuActivator SpawnMainMenuActivator(InputDevice device) - { - var mainMenuActivator = ObjectUtils.Instantiate(evr.m_MainMenuActivatorPrefab.gameObject).GetComponent(); - evr.m_Interfaces.ConnectInterfaces(mainMenuActivator, device); - - return mainMenuActivator; - } - - public PinnedToolButton SpawnPinnedToolButton(InputDevice device) - { - var button = ObjectUtils.Instantiate(evr.m_PinnedToolButtonPrefab.gameObject).GetComponent(); - evr.m_Interfaces.ConnectInterfaces(button, device); - - return button; - } - internal void UpdateAlternateMenuActions() { var actionsModule = evr.GetModule(); diff --git a/Scripts/Core/EditorVR.PinnedTools.cs b/Scripts/Core/EditorVR.PinnedTools.cs index 8eabe310a..c636ed4a4 100644 --- a/Scripts/Core/EditorVR.PinnedTools.cs +++ b/Scripts/Core/EditorVR.PinnedTools.cs @@ -3,7 +3,9 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Menus; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using UnityEngine.InputNew; namespace UnityEditor.Experimental.EditorVR.Core { @@ -22,6 +24,22 @@ public void DisconnectInterface(object obj) { } + internal MainMenuActivator SpawnMainMenuActivator(InputDevice device) + { + var mainMenuActivator = ObjectUtils.Instantiate(evr.m_MainMenuActivatorPrefab.gameObject).GetComponent(); + evr.m_Interfaces.ConnectInterfaces(mainMenuActivator, device); + + return mainMenuActivator; + } + + internal PinnedToolButton SpawnPinnedToolButton(InputDevice device) + { + var button = ObjectUtils.Instantiate(evr.m_PinnedToolButtonPrefab.gameObject).GetComponent(); + evr.m_Interfaces.ConnectInterfaces(button, device); + + return button; + } + internal void AddPinnedToolButton(DeviceData deviceData, Type toolType) { var pinnedToolButtons = deviceData.pinnedToolButtons; @@ -34,7 +52,7 @@ internal void AddPinnedToolButton(DeviceData deviceData, Type toolType) pair.Value.order++; } - var button = evr.m_Menus.SpawnPinnedToolButton(deviceData.inputDevice); + var button = SpawnPinnedToolButton(deviceData.inputDevice); pinnedToolButtons.Add(toolType, button); button.node = deviceData.node; button.toolType = toolType; // Assign Tool Type before assigning order diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 214a79d30..2123dcfe6 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -118,7 +118,7 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.menuHideFlags[mainMenu] = Menus.MenuHideFlags.Hidden; var pinnedTools = evr.m_PinnedTools; - var mainMenuActivator = evrMenus.SpawnMainMenuActivator(inputDevice); + var mainMenuActivator = pinnedTools.SpawnMainMenuActivator(inputDevice); deviceData.mainMenuActivator = mainMenuActivator; mainMenuActivator.selected += pinnedTools.OnMainMenuActivatorSelected; mainMenuActivator.hoverStarted += pinnedTools.OnButtonHoverStarted; @@ -131,7 +131,7 @@ internal void SpawnDefaultTools(IProxy proxy) var toolButtonActivePosition = new Vector3(0f, 0f, -0.035f); // Frontmost active button offset from the main menu activator PinnedToolButton.activePosition = toolButtonActivePosition; // Shared active button position - var selectionToolButton = evrMenus.SpawnPinnedToolButton(inputDevice); + var selectionToolButton = pinnedTools.SpawnPinnedToolButton(inputDevice); deviceData.pinnedToolButtons = new Dictionary(); selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); From c7a9b60b6410618b4e3f0c8015b985c8336ac06b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Apr 2017 21:05:30 -0700 Subject: [PATCH 117/870] Add functionality to move pinned tool buttons to alternate position when in context (radial menu is active/inactive) --- Prefabs/UI/PinnedToolButton.prefab | 3 +- Scripts/UI/PinnedToolButton.cs | 59 +++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index fb61cc89f..1bc665ede 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -459,7 +459,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010204453368} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.025} m_LocalScale: {x: 0.465, y: 0.615, z: 0.465} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: @@ -886,6 +886,7 @@ MonoBehaviour: m_InsetMeshRenderer: {fileID: 23000013623333764} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} + m_AlternateLocalPosition: {x: 0, y: 0, z: 0} --- !u!114 &114000011796366970 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index c0b035695..b05ad31e0 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -188,19 +188,26 @@ public Transform alternateMenuOrigin [SerializeField] Transform m_TooltipSource; - string m_TooltipText; + [SerializeField] + Vector3 m_AlternateLocalPosition; + Coroutine m_PositionCoroutine; Coroutine m_VisibilityCoroutine; Coroutine m_HighlightCoroutine; - Vector3 m_InactivePosition; // Inactive button offset from the main menu activator - Transform m_AlternateMenuOrigin; - Type m_previewToolType; - GradientPair m_GradientPair; + Coroutine m_ActivatorMoveCoroutine; + + string m_TooltipText; + bool m_Highlighted; + bool _mMoveToAlternatePosition; int m_Order; + Type m_previewToolType; Type m_ToolType; + GradientPair m_GradientPair; + Transform m_AlternateMenuOrigin; Material m_FrameMaterial; - bool m_Highlighted; Material m_InsetMaterial; + Vector3 m_InactivePosition; // Inactive button offset from the main menu activator + Vector3 m_OriginalLocalPosition; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -244,6 +251,27 @@ public bool highlighted //get { return m_Highlighted; } } + public bool moveToAlternatePosition + { + get { return _mMoveToAlternatePosition; } + set + { + if (_mMoveToAlternatePosition == value) + return; + + _mMoveToAlternatePosition = value; + + this.StopCoroutine(ref m_ActivatorMoveCoroutine); + + m_ActivatorMoveCoroutine = StartCoroutine(AnimateMoveActivatorButton(_mMoveToAlternatePosition)); + } + } + + void Awake() + { + m_OriginalLocalPosition = transform.localPosition; + } + void Start() { //m_GradientButton.onClick += SelectTool; // TODO remove after action button refactor @@ -512,6 +540,25 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) //m_MenuInset.localScale = targetInsetScale; //m_IconContainer.localScale = targetIconScale; } + + IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) + { + var amount = 0f; + var currentPosition = transform.localPosition; + var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; + var speed = moveToAlternatePosition ? 5 : 5; // perform faster is returning to original position + + while (amount < 1f) + { + amount += Time.unscaledDeltaTime * speed; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); + yield return null; + } + + transform.localPosition = targetPosition; + m_ActivatorMoveCoroutine = null; + } } } #endif From 4c1a83bd338f3628bb230222822af908124e0aa3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Apr 2017 10:53:23 -0700 Subject: [PATCH 118/870] Add ability to set icon sprite in GradientButton --- Scripts/UI/GradientButton.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index a312f1ad6..f6d0ed068 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -110,6 +110,15 @@ Vector3 highlightScale get { return invertHighlightScale ? m_OriginalContentContainerLocalScale : m_HighlightContentContainerLocalScale; } } + public Sprite icon + { + set + { + m_Icon.sprite = value; + m_OriginalIconSprite = value; + } + } + public GradientPair normalGradientPair { get { return m_NormalGradientPair; } set { m_NormalGradientPair = value; } } [SerializeField] GradientPair m_NormalGradientPair; @@ -117,7 +126,7 @@ Vector3 highlightScale public GradientPair highlightGradientPair { get { return m_HighlightGradientPair; } set { m_HighlightGradientPair = value; } } [SerializeField] GradientPair m_HighlightGradientPair; - + // The inner-button's background gradient MeshRenderer [SerializeField] MeshRenderer m_ButtonMeshRenderer; From 2d24a749342f2552b4a2d5a0ea2efc5703f06570 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Apr 2017 10:54:14 -0700 Subject: [PATCH 119/870] Add ability to set icon sprite in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index b05ad31e0..45a30c6b5 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -224,6 +224,7 @@ public Transform alternateMenuOrigin public int activeButtonCount { get; set; } public Transform menuOrigin { get; set; } public Action highlightPinnedToolButtons { get; set; } + public Sprite icon { set { m_GradientButton.icon = value; } } private bool activeTool { From ad1a4ad7f7758d6c5929e6a94026013c6a8babd0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Apr 2017 14:25:43 -0700 Subject: [PATCH 120/870] Fix PinnedToolButton prefab contents naming --- Prefabs/UI/PinnedToolButton.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 1bc665ede..bcd0adc0b 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -389,7 +389,7 @@ GameObject: - 114: {fileID: 114000010373680160} - 65: {fileID: 65000011941282114} m_Layer: 5 - m_Name: Base + m_Name: GradientButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 From 6369b1cdf04f65bd9ce182ebc39c38db021daed3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Apr 2017 17:55:11 -0700 Subject: [PATCH 121/870] Refactor MainMenuActivator logic into existing PinnedToolButton logic; Partially remove MainMenuActivator logic --- Scripts/Core/EditorVR.PinnedTools.cs | 62 +++++++++---- Scripts/Core/EditorVR.Tools.cs | 49 ++++++---- Scripts/UI/PinnedToolButton.cs | 134 ++++++++++++++++----------- 3 files changed, 159 insertions(+), 86 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedTools.cs b/Scripts/Core/EditorVR.PinnedTools.cs index c636ed4a4..dcc545ba5 100644 --- a/Scripts/Core/EditorVR.PinnedTools.cs +++ b/Scripts/Core/EditorVR.PinnedTools.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Menus; +using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -23,7 +24,7 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) public void DisconnectInterface(object obj) { } - +/* TODO remove after removal of main menu activator codebase internal MainMenuActivator SpawnMainMenuActivator(InputDevice device) { var mainMenuActivator = ObjectUtils.Instantiate(evr.m_MainMenuActivatorPrefab.gameObject).GetComponent(); @@ -31,7 +32,7 @@ internal MainMenuActivator SpawnMainMenuActivator(InputDevice device) return mainMenuActivator; } - +*/ internal PinnedToolButton SpawnPinnedToolButton(InputDevice device) { var button = ObjectUtils.Instantiate(evr.m_PinnedToolButtonPrefab.gameObject).GetComponent(); @@ -40,32 +41,40 @@ internal PinnedToolButton SpawnPinnedToolButton(InputDevice device) return button; } - internal void AddPinnedToolButton(DeviceData deviceData, Type toolType) + internal PinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType) { var pinnedToolButtons = deviceData.pinnedToolButtons; if (pinnedToolButtons.ContainsKey(toolType)) // Return if tooltype already occupies a pinned tool button - return; + return null; // Before adding new button, offset each button to a position greater than the zeroth/active tool position foreach (var pair in pinnedToolButtons) { - pair.Value.order++; + if (pair.Value.order != PinnedToolButton.menuButtonOrderPosition) // don't move the main menu button + pair.Value.order++; } var button = SpawnPinnedToolButton(deviceData.inputDevice); pinnedToolButtons.Add(toolType, button); button.node = deviceData.node; button.toolType = toolType; // Assign Tool Type before assigning order - button.order = 0; // Zeroth position is the active tool position + button.activeButtonCount = () => deviceData.pinnedToolButtons.Count; // Used to position buttons relative to count + button.order = PinnedToolButton.activeToolOrderPosition; // first position is the active tool position button.DeletePinnedToolButton = DeletePinnedToolButton; - button.highlightPinnedToolButtons = HighlightPinnedToolButtons; + button.highlightAllToolButtons = HighlightAllToolButtons; + button.clicked = ToolButtonClicked; + //button.selected += OnMainMenuActivatorSelected; + button.hoverEnter += OnButtonHoverEnter; + button.hoverExit += OnButtonHoverExit; + + return button; } internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) { Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); const int kMaxButtonCount = 6; - var order = 0; + var inactiveButtonInitialOrderPosition = PinnedToolButton.activeToolOrderPosition; var buttons = deviceData.pinnedToolButtons; var buttonCount = buttons.Count; @@ -79,8 +88,11 @@ internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform r { var button = pair.Value; button.rayOrigin = rayOrigin; - button.activeButtonCount = buttonCount; // Used to position buttons relative to count - button.order = button.toolType == activeToolType ? 0 : ++order; + + if (button.toolType == typeof(IMainMenu)) + button.order = PinnedToolButton.menuButtonOrderPosition; + else + button.order = button.toolType == activeToolType ? PinnedToolButton.activeToolOrderPosition : ++inactiveButtonInitialOrderPosition; if (button.order == 0) deviceData.proxy.HighlightDevice(deviceData.node, button.gradientPair); // Perform the higlight on the node with the button's gradient pair @@ -152,7 +164,15 @@ internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Ty return pinnedToolButton; } - internal void HighlightPinnedToolButtons (Transform rayOrigin, bool enableHighlight) + internal void ToolButtonClicked(Transform rayOrigin, Type toolType) + { + if (toolType == typeof(IMainMenu)) + OnMainMenuActivatorSelected(rayOrigin); + else + evr.m_Tools.SelectTool(rayOrigin, toolType); + } + + internal void HighlightAllToolButtons (Transform rayOrigin, bool enableHighlight) { Rays.ForEachProxyDevice(deviceData => { @@ -167,7 +187,7 @@ internal void HighlightPinnedToolButtons (Transform rayOrigin, bool enableHighli }); } - internal void OnButtonHoverStarted(Transform rayOrigin) + internal void OnButtonHoverEnter(Transform rayOrigin) { var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) @@ -180,7 +200,7 @@ internal void OnButtonHoverStarted(Transform rayOrigin) } } - internal void OnButtonHoverEnded(Transform rayOrigin) + internal void OnButtonHoverExit(Transform rayOrigin) { var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) @@ -193,9 +213,19 @@ internal void OnButtonHoverEnded(Transform rayOrigin) } } - internal void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetRayOrigin) + internal void OnMainMenuActivatorSelected(Transform rayOrigin) { - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); + Debug.LogError("OnMainMenuActivatorSelected called!"); + var targetToolRayOrigin = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin != rayOrigin).rayOrigin; + var deviceData = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin == rayOrigin); + if (targetToolRayOrigin == null) + Debug.LogError("????????????????????????????????????????????????????????????"); + + foreach (var origin in deviceData.proxy.rayOrigins.Values) + { + targetToolRayOrigin = origin != rayOrigin ? origin : null; // Assign the opposite hand's rayOrigin + } + if (deviceData != null) { var mainMenu = deviceData.mainMenu; @@ -208,7 +238,7 @@ internal void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetR if (customMenu != null) menuHideFlags[customMenu] &= ~Menus.MenuHideFlags.Hidden; - mainMenu.targetRayOrigin = targetRayOrigin; + mainMenu.targetRayOrigin = targetToolRayOrigin; } } } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 2123dcfe6..2d333c698 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -117,27 +117,43 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.mainMenu = mainMenu; deviceData.menuHideFlags[mainMenu] = Menus.MenuHideFlags.Hidden; - var pinnedTools = evr.m_PinnedTools; - var mainMenuActivator = pinnedTools.SpawnMainMenuActivator(inputDevice); - deviceData.mainMenuActivator = mainMenuActivator; - mainMenuActivator.selected += pinnedTools.OnMainMenuActivatorSelected; - mainMenuActivator.hoverStarted += pinnedTools.OnButtonHoverStarted; - mainMenuActivator.hoverEnded += pinnedTools.OnButtonHoverEnded; - var alternateMenu = evrMenus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); deviceData.alternateMenu = alternateMenu; deviceData.menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; alternateMenu.itemWasSelected += evrMenus.UpdateAlternateMenuOnSelectionChanged; - var toolButtonActivePosition = new Vector3(0f, 0f, -0.035f); // Frontmost active button offset from the main menu activator - PinnedToolButton.activePosition = toolButtonActivePosition; // Shared active button position - var selectionToolButton = pinnedTools.SpawnPinnedToolButton(inputDevice); + // Setup PinnedToolButtons + var pinnedTools = evr.m_PinnedTools; deviceData.pinnedToolButtons = new Dictionary(); - selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default - deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); - selectionToolButton.order = 0; // The "active" tool occupies the zeroth position - selectionToolButton.node = deviceData.node; - selectionToolButton.highlightPinnedToolButtons = pinnedTools.HighlightPinnedToolButtons; + pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)).order = PinnedToolButton.menuButtonOrderPosition; // Setup Main Menu button + pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool)); + pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); + //mainMenuButton.order = PinnedToolButton.menuButtonOrderPosition; + //mainMenuButton.toolType = typeof(IMainMenu); // Selection tool is visible & persistent by default + //deviceData.pinnedToolButtons.Add(mainMenuButton.toolType, mainMenuButton); + //mainMenuButton.order = 0; // The main menu button permanently occupies position 0 + //mainMenuButton.node = deviceData.node; + //mainMenuButton.highlightAllToolButtons = pinnedTools.HighlightAllToolButtons; + //mainMenuButton.clicked = pinnedTools.ToolButtonClicked; + //mainMenuButton.selected += pinnedTools.OnMainMenuActivatorSelected; + //mainMenuButton.hoverEnter += pinnedTools.OnButtonHoverEnter; + //mainMenuButton.hoverExit += pinnedTools.OnButtonHoverExit; + /* + var mainMenuActivator = pinnedTools.SpawnMainMenuActivator(inputDevice); + deviceData.mainMenuActivator = mainMenuActivator; + mainMenuActivator.selected += pinnedTools.OnMainMenuActivatorSelected; + mainMenuActivator.hoverEnter += pinnedTools.OnButtonHoverEnter; + mainMenuActivator.hoverExit += pinnedTools.OnButtonHoverExit; + */ + + // Setup the Select tool button + ///var selectionToolButton = pinnedTools.SpawnPinnedToolButton(inputDevice); + //selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default + //deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); + //selectionToolButton.order = 1; // The "active" tool occupies position 1 + //selectionToolButton.node = deviceData.node; + //selectionToolButton.highlightAllToolButtons = pinnedTools.HighlightAllToolButtons; + //selectionToolButton.clicked = pinnedTools.ToolButtonClicked; } evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); @@ -153,6 +169,7 @@ internal void SpawnDefaultTools(IProxy proxy) /// Returns tool that was spawned or null if the spawn failed. ToolData SpawnTool(Type toolType, out HashSet usedDevices, InputDevice device = null) { + Debug.LogError("SPAWN TOOL CALLED!"); usedDevices = new HashSet(); if (!typeof(ITool).IsAssignableFrom(toolType)) return null; @@ -197,7 +214,7 @@ bool IsToolActive(Transform targetRayOrigin, Type toolType) internal bool SelectTool(Transform rayOrigin, Type toolType) { - //Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); + Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); //if (toolType == typeof(SelectionTool)) //Debug.LogError("!!!!! SelectionTool detected"); diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 45a30c6b5..ee3761ca4 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -1,34 +1,29 @@ #if UNITY_EDITOR using System; using System.Collections; -using System.Runtime.CompilerServices; using System.Text; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using UnityEngine.EventSystems; namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, ISelectTool, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces, IUsesMenuOrigins + public sealed class PinnedToolButton : MonoBehaviour, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces, IUsesMenuOrigins { static Color s_FrameOpaqueColor; static Color s_SemiTransparentFrameColor; - static Vector3 s_ActivePosition; - - public static Vector3 activePosition - { - private get { return s_ActivePosition; } - set - { - s_ActivePosition = value; - } - } + public static int menuButtonOrderPosition { get { return 0; } } + public static int activeToolOrderPosition { get { return 1; } } + public static Vector3 toolButtonActivePosition { get { return new Vector3(0f, 0f, -0.035f); } } // Shared active button offset from the alternate menu const string k_MaterialColorProperty = "_Color"; const string k_MaterialAlphaProperty = "_Alpha"; const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; + const string k_MainMenuTipText = "Main Menu (cannot be closed)"; public Type toolType { @@ -43,10 +38,10 @@ public Type toolType m_ToolType = value; if (m_ToolType != null) { - if (isSelectionTool) + if (isSelectionTool || isMainMenu) { - activeButtonCount = 1; - tooltipText = k_SelectionToolTipText; + //activeButtonCount = 1; + tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair } else @@ -75,7 +70,7 @@ public int order set { m_Order = value; // Position of this button in relation to other pinned tool buttons - m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive + //m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive activeTool = activeTool; const float kSmoothingMax = 50f; const int kSmoothingIncreaseFactor = 10; @@ -90,7 +85,7 @@ public int order // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; + var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount() * 0.5f) * kRotationSpacing; var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newTargetRotation)); //transform.localRotation = newLocalRotation; @@ -136,7 +131,7 @@ public Type previewToolType m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); customToolTipHighlightColor = gradientPair; this.HideTooltip(this); - tooltipText = isSelectionTool ? tooltipText = k_SelectionToolTipText : toolType.Name; + tooltipText = (isSelectionTool || isMainMenu) ? (isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText) : toolType.Name; } m_GradientButton.highlighted = m_previewToolType != null; @@ -206,7 +201,7 @@ public Transform alternateMenuOrigin Transform m_AlternateMenuOrigin; Material m_FrameMaterial; Material m_InsetMaterial; - Vector3 m_InactivePosition; // Inactive button offset from the main menu activator + //Vector3 m_InactivePosition; // Inactive button offset from the main menu activator Vector3 m_OriginalLocalPosition; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } @@ -220,11 +215,18 @@ public Transform alternateMenuOrigin public Action hideTooltip { private get; set; } public GradientPair customToolTipHighlightColor { get; set; } public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } + public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } public Action DeletePinnedToolButton { get; set; } - public int activeButtonCount { get; set; } + public Func activeButtonCount { get; set; } public Transform menuOrigin { get; set; } - public Action highlightPinnedToolButtons { get; set; } + public Action highlightAllToolButtons { get; set; } public Sprite icon { set { m_GradientButton.icon = value; } } + public Action OpenMenu { get; set; } + public Action clicked { get; set; } + + public event Action hoverEnter; + public event Action hoverExit; + public event Action selected; private bool activeTool { @@ -275,7 +277,7 @@ void Awake() void Start() { - //m_GradientButton.onClick += SelectTool; // TODO remove after action button refactor + //m_GradientButton.onClick += ButtonClicked; // TODO remove after action button refactor Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); @@ -307,15 +309,16 @@ void Start() m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - m_GradientButton.hoverEnter += BackgroundHoverEnter; // Display the foreground button actions - m_GradientButton.hoverExit += ActionButtonHoverExit; + m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions + m_GradientButton.hoverExit += OnActionButtonHoverExit; + m_GradientButton.click += OnBackgroundButtonClick; m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; m_LeftPinnedToolActionButton.hoverEnter = HoverButton; - m_LeftPinnedToolActionButton.hoverExit = ActionButtonHoverExit; + m_LeftPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; m_RightPinnedToolActionButton.clicked = ActionButtonClicked; m_RightPinnedToolActionButton.hoverEnter = HoverButton; - m_RightPinnedToolActionButton.hoverExit = ActionButtonHoverExit; + m_RightPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; // Assign the select action button to the side closest to the opposite hand, that allows the arrow to also point in the direction the var leftHand = node == Node.LeftHand; @@ -336,13 +339,6 @@ void Start() //m_GradientButton.gameObject.SetActive(false); } - void SelectTool() - { - this.SelectTool(rayOrigin, m_ToolType); // SelectTool will set button order to 0 - activeTool = activeTool; - //SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); - } - // Create periodic table-style names for types string GetTypeAbbreviation(Type type) { @@ -381,7 +377,12 @@ IEnumerator AnimatePosition(Quaternion targetRotation) m_PositionCoroutine = null; } - void BackgroundHoverEnter () + bool AllowOnlySelectButton (PinnedToolActionButton.ButtonType buttonType) + { + return buttonType == PinnedToolActionButton.ButtonType.SelectTool; + } + + void OnBackgroundHoverEnter () { //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) //{ @@ -399,7 +400,13 @@ void BackgroundHoverEnter () void HoverButton() { - if (isSelectionTool) + if (order < 2 || toolType == typeof(IMainMenu)) // The main menu and the active tool occupy orders 0 and 1; don't show any action buttons for buttons in either position + { + m_RightPinnedToolActionButton.visible = false; + m_LeftPinnedToolActionButton.visible = false; + m_RootCollider.enabled = true; + } + else if (isSelectionTool) { if (activeTool) { @@ -409,41 +416,46 @@ void HoverButton() } else { - m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? true : false; - m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? true : false; + m_RightPinnedToolActionButton.visible = AllowOnlySelectButton(m_RightPinnedToolActionButton.buttonType) ? true : false; + m_LeftPinnedToolActionButton.visible = AllowOnlySelectButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; } } else { // Hide the select action button if this tool button is already the selected tool, else show the close button - m_RightPinnedToolActionButton.visible = m_RightPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; - m_LeftPinnedToolActionButton.visible = m_LeftPinnedToolActionButton.buttonType == PinnedToolActionButton.ButtonType.SelectTool ? !activeTool : true; + m_RightPinnedToolActionButton.visible = AllowOnlySelectButton(m_RightPinnedToolActionButton.buttonType) ? !activeTool : true; + m_LeftPinnedToolActionButton.visible = AllowOnlySelectButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; } - highlightPinnedToolButtons(rayOrigin, true); + highlightAllToolButtons(rayOrigin, true); } void ActionButtonClicked(PinnedToolActionButton button) { Debug.LogError("Action Button clicked!"); - if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool) + if (order != 1) // Buttons in the first position are active tools, and cannot be selected when clicked { - m_LeftPinnedToolActionButton.highlighted = false; - m_RightPinnedToolActionButton.highlighted = false; - ActionButtonHoverExit(); - SelectTool(); - } - else - { - if (!isSelectionTool) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateClose()); + if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool) + { + m_LeftPinnedToolActionButton.highlighted = false; + m_RightPinnedToolActionButton.highlighted = false; + OnActionButtonHoverExit(); + clicked(rayOrigin, m_ToolType); // ButtonClicked will set button order to 0 + activeTool = activeTool; + //SetButtonGradients(this.ButtonClicked(rayOrigin, m_ToolType)); + } else - Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); + { + if (!isSelectionTool) + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateClose()); + else + Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); + } } } - void ActionButtonHoverExit() + void OnActionButtonHoverExit() { - Debug.LogWarning("ActionButtonHoverExit : " + name + " : " + toolType); + Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons // Hide both action buttons if the user is no longer hovering over the button @@ -455,7 +467,21 @@ void ActionButtonHoverExit() m_RightPinnedToolActionButton.visible = false; //m_GradientButton.visible = true; m_GradientButton.highlighted = false; - highlightPinnedToolButtons(rayOrigin, false); + highlightAllToolButtons(rayOrigin, false); + } + + m_GradientButton.UpdateMaterialColors(); + } + + void OnBackgroundButtonClick() + { + Debug.LogWarning("OnBackgroundButtonClick : " + name + " : " + toolType); + // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons + + // Hide both action buttons if the user is no longer hovering over the button + if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + { + clicked(rayOrigin, m_ToolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons } m_GradientButton.UpdateMaterialColors(); From e81a2f0243394989389327c7aa73882cb1e040a1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Apr 2017 18:11:46 -0700 Subject: [PATCH 122/870] Remove previous MainMenuActivator & PinnedToolButton implementation in EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 2d333c698..8fe689cb0 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -126,34 +126,8 @@ internal void SpawnDefaultTools(IProxy proxy) var pinnedTools = evr.m_PinnedTools; deviceData.pinnedToolButtons = new Dictionary(); pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)).order = PinnedToolButton.menuButtonOrderPosition; // Setup Main Menu button - pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool)); - pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); - //mainMenuButton.order = PinnedToolButton.menuButtonOrderPosition; - //mainMenuButton.toolType = typeof(IMainMenu); // Selection tool is visible & persistent by default - //deviceData.pinnedToolButtons.Add(mainMenuButton.toolType, mainMenuButton); - //mainMenuButton.order = 0; // The main menu button permanently occupies position 0 - //mainMenuButton.node = deviceData.node; - //mainMenuButton.highlightAllToolButtons = pinnedTools.HighlightAllToolButtons; - //mainMenuButton.clicked = pinnedTools.ToolButtonClicked; - //mainMenuButton.selected += pinnedTools.OnMainMenuActivatorSelected; - //mainMenuButton.hoverEnter += pinnedTools.OnButtonHoverEnter; - //mainMenuButton.hoverExit += pinnedTools.OnButtonHoverExit; - /* - var mainMenuActivator = pinnedTools.SpawnMainMenuActivator(inputDevice); - deviceData.mainMenuActivator = mainMenuActivator; - mainMenuActivator.selected += pinnedTools.OnMainMenuActivatorSelected; - mainMenuActivator.hoverEnter += pinnedTools.OnButtonHoverEnter; - mainMenuActivator.hoverExit += pinnedTools.OnButtonHoverExit; - */ - - // Setup the Select tool button - ///var selectionToolButton = pinnedTools.SpawnPinnedToolButton(inputDevice); - //selectionToolButton.toolType = typeof(SelectionTool); // Selection tool is visible & persistent by default - //deviceData.pinnedToolButtons.Add(selectionToolButton.toolType, selectionToolButton); - //selectionToolButton.order = 1; // The "active" tool occupies position 1 - //selectionToolButton.node = deviceData.node; - //selectionToolButton.highlightAllToolButtons = pinnedTools.HighlightAllToolButtons; - //selectionToolButton.clicked = pinnedTools.ToolButtonClicked; + pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool)); // Setup SelectionTool button + pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); // Initialize PinnedToolButtons } evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); @@ -214,7 +188,7 @@ bool IsToolActive(Transform targetRayOrigin, Type toolType) internal bool SelectTool(Transform rayOrigin, Type toolType) { - Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); + //Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); //if (toolType == typeof(SelectionTool)) //Debug.LogError("!!!!! SelectionTool detected"); From 64afa488829f4ee0533e73c2e0f3c7e7c3c5e6b1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Apr 2017 18:16:34 -0700 Subject: [PATCH 123/870] Rename EditorVR.PinnedTools to EditorVR.ToolButtons --- .../Core/{EditorVR.PinnedTools.cs => EditorVR.ToolButtons.cs} | 2 +- ...torVR.PinnedTools.cs.meta => EditorVR.ToolButtons.cs.meta} | 0 Scripts/Core/EditorVR.Tools.cs | 4 ++-- Scripts/Core/EditorVR.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename Scripts/Core/{EditorVR.PinnedTools.cs => EditorVR.ToolButtons.cs} (99%) rename Scripts/Core/{EditorVR.PinnedTools.cs.meta => EditorVR.ToolButtons.cs.meta} (100%) diff --git a/Scripts/Core/EditorVR.PinnedTools.cs b/Scripts/Core/EditorVR.ToolButtons.cs similarity index 99% rename from Scripts/Core/EditorVR.PinnedTools.cs rename to Scripts/Core/EditorVR.ToolButtons.cs index dcc545ba5..5b2d486e5 100644 --- a/Scripts/Core/EditorVR.PinnedTools.cs +++ b/Scripts/Core/EditorVR.ToolButtons.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - class PinnedTools : Nested, IInterfaceConnector + class ToolButtons : Nested, IInterfaceConnector { public void ConnectInterface(object obj, Transform rayOrigin = null) { diff --git a/Scripts/Core/EditorVR.PinnedTools.cs.meta b/Scripts/Core/EditorVR.ToolButtons.cs.meta similarity index 100% rename from Scripts/Core/EditorVR.PinnedTools.cs.meta rename to Scripts/Core/EditorVR.ToolButtons.cs.meta diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 8fe689cb0..b259b0305 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -123,7 +123,7 @@ internal void SpawnDefaultTools(IProxy proxy) alternateMenu.itemWasSelected += evrMenus.UpdateAlternateMenuOnSelectionChanged; // Setup PinnedToolButtons - var pinnedTools = evr.m_PinnedTools; + var pinnedTools = evr.m_ToolButtons; deviceData.pinnedToolButtons = new Dictionary(); pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)).order = PinnedToolButton.menuButtonOrderPosition; // Setup Main Menu button pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool)); // Setup SelectionTool button @@ -194,7 +194,7 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) var result = false; var deviceInputModule = evr.m_DeviceInputModule; - var pinnedTools = evr.m_PinnedTools; + var pinnedTools = evr.m_ToolButtons; Rays.ForEachProxyDevice(deviceData => { if (deviceData.rayOrigin == rayOrigin) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index b847ac6e8..85a68d5b8 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -51,7 +51,7 @@ sealed partial class EditorVR : MonoBehaviour Viewer m_Viewer; MultipleRayInputModule m_MultipleRayInputModule; Tools m_Tools; - PinnedTools m_PinnedTools; + ToolButtons m_ToolButtons; bool m_HasDeserialized; @@ -128,7 +128,7 @@ void Awake() m_Menus = GetNestedModule(); m_UI = GetNestedModule(); m_Tools = GetNestedModule(); - m_PinnedTools = GetNestedModule(); + m_ToolButtons = GetNestedModule(); AddModule(); AddModule(); From 7198f3d0a2d60afd918f96ab60baa39cc650447e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 11:21:42 -0700 Subject: [PATCH 124/870] Initially setup PinnedToolButtons with the SelectionTool --- Scripts/Core/EditorVR.Tools.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index b259b0305..074f9d670 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -127,7 +127,7 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.pinnedToolButtons = new Dictionary(); pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)).order = PinnedToolButton.menuButtonOrderPosition; // Setup Main Menu button pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool)); // Setup SelectionTool button - pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); // Initialize PinnedToolButtons + pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(SelectionTool)); // Initialize PinnedToolButtons } evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); From 8d712046aa667a788e6f56696ff66972e9345386 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 11:28:05 -0700 Subject: [PATCH 125/870] Remove remaining animated scale field from RadialMenuSlot --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index d93c957a0..2e8d15ef3 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -451,7 +451,6 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) const float kFasterMotionMultiplier = 2f; var transitionAmount = Time.unscaledDeltaTime; var positionWait = (orderIndex + 4) * 0.25f; // pad the order index for a faster start to the transition - var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); var currentFrameColor = m_FrameMaterial.color; var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); var targetFrameColor = m_CanvasGroup.interactable ? (makeSemiTransparent ? m_SemiTransparentFrameColor : s_FrameOpaqueColor) : transparentFrameColor; From 31ea47bbf4339877d381582da96bf2c9a55d3815 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 12 Apr 2017 12:04:13 -0700 Subject: [PATCH 126/870] Hide main menu when opening main menu on opposite hand; Fix default proxy ray width issue at large scales --- Scripts/Core/EditorVR.Menus.cs | 22 ++++++++++++++-------- Scripts/Proxies/DefaultProxyRay.cs | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index f73791bfc..f0b7d6301 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -292,20 +292,26 @@ internal void SetAlternateMenuVisibility(Transform rayOrigin, bool visible) internal void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetRayOrigin) { - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); - if (deviceData != null) + foreach (var deviceData in evr.m_DeviceData) { var mainMenu = deviceData.mainMenu; + var menuHideFlags = deviceData.menuHideFlags; if (mainMenu != null) { - var menuHideFlags = deviceData.menuHideFlags; - menuHideFlags[mainMenu] ^= MenuHideFlags.Hidden; + if (deviceData.rayOrigin == rayOrigin) + { + menuHideFlags[mainMenu] ^= MenuHideFlags.Hidden; - var customMenu = deviceData.customMenu; - if (customMenu != null) - menuHideFlags[customMenu] &= ~MenuHideFlags.Hidden; + var customMenu = deviceData.customMenu; + if (customMenu != null) + menuHideFlags[customMenu] &= ~MenuHideFlags.Hidden; - mainMenu.targetRayOrigin = targetRayOrigin; + mainMenu.targetRayOrigin = targetRayOrigin; + } + else + { + menuHideFlags[mainMenu] |= MenuHideFlags.Hidden; + } } } } diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index bf501191e..277b0ea29 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -179,9 +179,9 @@ private IEnumerator ShowRay() { m_Tip.transform.localScale = m_TipStartScale; - float viewerScale; + float viewerScale = this.GetViewerScale(); float scaledWidth; - var currentWidth = m_LineRenderer.widthStart; + var currentWidth = m_LineRenderer.widthStart / viewerScale; var smoothVelocity = 0f; const float kSmoothTime = 0.3125f; var currentDuration = 0f; From 99ce39aa6007efffbec13249a63f0b730b147907 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 12 Apr 2017 12:44:11 -0700 Subject: [PATCH 127/870] Exclude manipulator from menu hiding --- Scripts/Core/EditorVR.Menus.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index f0b7d6301..0415085d2 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -246,6 +246,9 @@ internal void UpdateMenuVisibilities() internal static void OnUIHoverStarted(GameObject go, RayEventData rayEventData) { + if (go.GetComponentInParent() != null || go == evr.gameObject) + return; + var rayOrigin = rayEventData.rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) From e6d0bf7eb4bb4018ebc8ca5b87c6ee6bf17bdbcd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 16:06:59 -0700 Subject: [PATCH 128/870] Add null check for HighlightMaterials collection in TwoHandedProxyBase --- Scripts/Proxies/TwoHandedProxyBase.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs b/Scripts/Proxies/TwoHandedProxyBase.cs index a94cbc42d..0bb13f09f 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs +++ b/Scripts/Proxies/TwoHandedProxyBase.cs @@ -246,6 +246,9 @@ void AssignDeviceHighlightMaterials(Node node, List deviceRenderers, M public void HighlightDevice (Node deviceNode, GradientPair gradientPair) { + if (m_HighlightMaterials == null) + return; + Debug.LogWarning("HighlightDevice called!!!"); Material deviceMaterial = null; From aa594c7117c2d99b0282ddb38ea1e6581a9803ed Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 16:09:19 -0700 Subject: [PATCH 129/870] Add IPinnedToolButton interface; used in PinnedToolButtons, allowing for custom pinned tool button implementations that pair visually/functionally with custom alternate menu implementations --- Scripts/UI/Interfaces/IPinnedToolButton.cs | 33 +++++++++++++++++++ .../UI/Interfaces/IPinnedToolButton.cs.meta | 12 +++++++ 2 files changed, 45 insertions(+) create mode 100644 Scripts/UI/Interfaces/IPinnedToolButton.cs create mode 100644 Scripts/UI/Interfaces/IPinnedToolButton.cs.meta diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs new file mode 100644 index 000000000..949f33302 --- /dev/null +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -0,0 +1,33 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; +using UnityEditor.Experimental.EditorVR.Helpers; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Gives decorated class Pinned Tool Button functionality + /// + public interface IPinnedToolButton + { + int menuButtonOrderPosition { get; } + int activeToolOrderPosition { get; } + int order { get; set; } + int activeButtonCount { get; set; } + bool highlighted { set; } + bool moveToAlternatePosition { set; } + Type toolType { get; set; } + Type previewToolType { get; set; } + Vector3 toolButtonActivePosition { get; } // Shared active button offset from the alternate menu + GradientPair gradientPair { set; } + + event Action hoverEnter; + event Action hoverExit; + event Action selected; + } + + public static class IPinnedToolButtonMethods + { + } +} +#endif diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs.meta b/Scripts/UI/Interfaces/IPinnedToolButton.cs.meta new file mode 100644 index 000000000..9df92622a --- /dev/null +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a1232671f976b344c93899d619cd68f0 +timeCreated: 1491960255 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 13f0c6a00649970d7ee89a542b1219a5754e1717 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 16:11:08 -0700 Subject: [PATCH 130/870] Implement IPinnedToolButton interface in PinnedToolButton controller --- Scripts/UI/PinnedToolButton.cs | 95 +++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index ee3761ca4..9506c9dc0 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -4,26 +4,25 @@ using System.Text; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; -using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -using UnityEngine.EventSystems; namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces, IUsesMenuOrigins + public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces, IUsesMenuOrigins { static Color s_FrameOpaqueColor; static Color s_SemiTransparentFrameColor; - public static int menuButtonOrderPosition { get { return 0; } } - public static int activeToolOrderPosition { get { return 1; } } - public static Vector3 toolButtonActivePosition { get { return new Vector3(0f, 0f, -0.035f); } } // Shared active button offset from the alternate menu + const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation + const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation + private const float k_alternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu const string k_MaterialColorProperty = "_Color"; const string k_MaterialAlphaProperty = "_Alpha"; const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; const string k_MainMenuTipText = "Main Menu (cannot be closed)"; + readonly Vector3 k_ToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); public Type toolType { @@ -41,6 +40,7 @@ public Type toolType if (isSelectionTool || isMainMenu) { //activeButtonCount = 1; + order= isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair } @@ -85,7 +85,7 @@ public int order // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount() * 0.5f) * kRotationSpacing; + var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newTargetRotation)); //transform.localRotation = newLocalRotation; @@ -99,7 +99,7 @@ public int order public GradientPair gradientPair { get { return m_GradientPair; } - private set + set { m_GradientPair = value; customToolTipHighlightColor = value; @@ -112,6 +112,7 @@ private set /// public Type previewToolType { + get { return m_previewToolType; } set { m_previewToolType = value; @@ -203,6 +204,7 @@ public Transform alternateMenuOrigin Material m_InsetMaterial; //Vector3 m_InactivePosition; // Inactive button offset from the main menu activator Vector3 m_OriginalLocalPosition; + Vector3 m_OriginalLocalScale; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -216,13 +218,16 @@ public Transform alternateMenuOrigin public GradientPair customToolTipHighlightColor { get; set; } public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } - public Action DeletePinnedToolButton { get; set; } - public Func activeButtonCount { get; set; } + public Action deletePinnedToolButton { get; set; } + public int activeButtonCount { get; set; } public Transform menuOrigin { get; set; } public Action highlightAllToolButtons { get; set; } public Sprite icon { set { m_GradientButton.icon = value; } } public Action OpenMenu { get; set; } - public Action clicked { get; set; } + public Action selectTool { get; set; } + public int menuButtonOrderPosition { get { return k_MenuButtonOrderPosition; } } + public int activeToolOrderPosition { get { return k_ActiveToolOrderPosition; } } + public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu public event Action hoverEnter; public event Action hoverExit; @@ -230,7 +235,7 @@ public Transform alternateMenuOrigin private bool activeTool { - get { return m_Order == 0; } + get { return m_Order == activeToolOrderPosition; } set { m_GradientButton.normalGradientPair = value ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; @@ -273,6 +278,7 @@ public bool moveToAlternatePosition void Awake() { m_OriginalLocalPosition = transform.localPosition; + m_OriginalLocalScale = transform.localScale; } void Start() @@ -377,7 +383,7 @@ IEnumerator AnimatePosition(Quaternion targetRotation) m_PositionCoroutine = null; } - bool AllowOnlySelectButton (PinnedToolActionButton.ButtonType buttonType) + bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) { return buttonType == PinnedToolActionButton.ButtonType.SelectTool; } @@ -386,7 +392,7 @@ void OnBackgroundHoverEnter () { //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) //{ - Debug.LogError("Background button was hovered, now triggereing the foreground action button visuals"); + Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); //m_RootCollider.enabled = false; m_GradientButton.highlighted = true; //m_GradientButton.visible = false; @@ -400,30 +406,33 @@ void OnBackgroundHoverEnter () void HoverButton() { - if (order < 2 || toolType == typeof(IMainMenu)) // The main menu and the active tool occupy orders 0 and 1; don't show any action buttons for buttons in either position + if (order < 2 && (isSelectionTool || isMainMenu)) // The main menu and the active tool occupy orders 0 and 1; don't show any action buttons for buttons in either position { m_RightPinnedToolActionButton.visible = false; m_LeftPinnedToolActionButton.visible = false; - m_RootCollider.enabled = true; + //m_RootCollider.enabled = true; + StartCoroutine(DelayedCollderEnable()); } else if (isSelectionTool) { + /* if (activeTool) { m_RightPinnedToolActionButton.visible = false; m_LeftPinnedToolActionButton.visible = false; - m_RootCollider.enabled = true; + StartCoroutine(DelayedCollderEnable()); } else + */ { - m_RightPinnedToolActionButton.visible = AllowOnlySelectButton(m_RightPinnedToolActionButton.buttonType) ? true : false; - m_LeftPinnedToolActionButton.visible = AllowOnlySelectButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; + m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? true : false; + m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; } } else { - // Hide the select action button if this tool button is already the selected tool, else show the close button - m_RightPinnedToolActionButton.visible = AllowOnlySelectButton(m_RightPinnedToolActionButton.buttonType) ? !activeTool : true; - m_LeftPinnedToolActionButton.visible = AllowOnlySelectButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; + // Hide the select action button if this tool button is already the selected tool, else show the close button for inactive tools + m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? !activeTool : true; + m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; } highlightAllToolButtons(rayOrigin, true); @@ -431,25 +440,30 @@ void HoverButton() void ActionButtonClicked(PinnedToolActionButton button) { - Debug.LogError("Action Button clicked!"); - if (order != 1) // Buttons in the first position are active tools, and cannot be selected when clicked + Debug.LogError("Action Button selectTool!"); + if (order > menuButtonOrderPosition) { - if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool) + // TODO: SELECT ACTION BUTTONS should be able to be interacted with due to their being hidden, so no need to handle for that case + // Buttons in the activeToolOrderPosition cannot be selected when selectTool + if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool && order > activeToolOrderPosition) { - m_LeftPinnedToolActionButton.highlighted = false; - m_RightPinnedToolActionButton.highlighted = false; - OnActionButtonHoverExit(); - clicked(rayOrigin, m_ToolType); // ButtonClicked will set button order to 0 + selectTool(rayOrigin, m_ToolType); // ButtonClicked will set button order to 0 activeTool = activeTool; //SetButtonGradients(this.ButtonClicked(rayOrigin, m_ToolType)); } - else + else // Handle action buttons assigned Close-Tool functionality { - if (!isSelectionTool) + //if (!isSelectionTool) this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateClose()); - else - Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); + //else + //Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); + + deletePinnedToolButton(rayOrigin, this); } + + OnActionButtonHoverExit(); + m_LeftPinnedToolActionButton.highlighted = false; + m_RightPinnedToolActionButton.highlighted = false; } } @@ -481,7 +495,7 @@ void OnBackgroundButtonClick() // Hide both action buttons if the user is no longer hovering over the button if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) { - clicked(rayOrigin, m_ToolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons + selectTool(rayOrigin, m_ToolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons } m_GradientButton.UpdateMaterialColors(); @@ -512,11 +526,10 @@ IEnumerator AnimateClose() transform.localScale = targetScale; m_VisibilityCoroutine = null; - DeletePinnedToolButton(rayOrigin, this); ObjectUtils.Destroy(gameObject, 0.1f); } - public void CorrectIconRotation() + void CorrectIconRotation() { const float kIconLookForwardOffset = 0.5f; var iconLookDirection = m_ContentContainer.transform.position + transform.parent.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation @@ -573,6 +586,8 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) var amount = 0f; var currentPosition = transform.localPosition; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; + var currentLocalScale = transform.localScale; + var targetLocalScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var speed = moveToAlternatePosition ? 5 : 5; // perform faster is returning to original position while (amount < 1f) @@ -580,12 +595,20 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) amount += Time.unscaledDeltaTime * speed; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); + transform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedAmount); yield return null; } transform.localPosition = targetPosition; + transform.localScale = targetLocalScale; m_ActivatorMoveCoroutine = null; } + + IEnumerator DelayedCollderEnable() + { + yield return null; + m_RootCollider.enabled = true; + } } } #endif From a4592ccf705599920e3d04a731aa1825cc119002 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 16:16:01 -0700 Subject: [PATCH 131/870] Reconcile remaining outlying MainMenuActivator logic with PinnedToolButton logic --- Scripts/Core/EditorVR.ToolButtons.cs | 33 ++++++++++++++++++---------- Scripts/Core/EditorVR.Tools.cs | 23 +++++++++++++------ 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/Scripts/Core/EditorVR.ToolButtons.cs b/Scripts/Core/EditorVR.ToolButtons.cs index 5b2d486e5..6a464e360 100644 --- a/Scripts/Core/EditorVR.ToolButtons.cs +++ b/Scripts/Core/EditorVR.ToolButtons.cs @@ -43,6 +43,7 @@ internal PinnedToolButton SpawnPinnedToolButton(InputDevice device) internal PinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType) { + Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); var pinnedToolButtons = deviceData.pinnedToolButtons; if (pinnedToolButtons.ContainsKey(toolType)) // Return if tooltype already occupies a pinned tool button return null; @@ -50,7 +51,7 @@ internal PinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolTy // Before adding new button, offset each button to a position greater than the zeroth/active tool position foreach (var pair in pinnedToolButtons) { - if (pair.Value.order != PinnedToolButton.menuButtonOrderPosition) // don't move the main menu button + if (pair.Value.order != pair.Value.menuButtonOrderPosition) // don't move the main menu button pair.Value.order++; } @@ -58,11 +59,10 @@ internal PinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolTy pinnedToolButtons.Add(toolType, button); button.node = deviceData.node; button.toolType = toolType; // Assign Tool Type before assigning order - button.activeButtonCount = () => deviceData.pinnedToolButtons.Count; // Used to position buttons relative to count - button.order = PinnedToolButton.activeToolOrderPosition; // first position is the active tool position - button.DeletePinnedToolButton = DeletePinnedToolButton; + //button.order = button.activeToolOrderPosition; // first position is the active tool position + button.deletePinnedToolButton = DeletePinnedToolButton; button.highlightAllToolButtons = HighlightAllToolButtons; - button.clicked = ToolButtonClicked; + button.selectTool = ToolButtonClicked; //button.selected += OnMainMenuActivatorSelected; button.hoverEnter += OnButtonHoverEnter; button.hoverExit += OnButtonHoverExit; @@ -73,10 +73,11 @@ internal PinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolTy internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) { Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); + activeToolType = activeToolType == typeof(IMainMenu) ? typeof(SelectionTool) : activeToolType; // Assign SelectionTool if setting up for IMainMenu const int kMaxButtonCount = 6; - var inactiveButtonInitialOrderPosition = PinnedToolButton.activeToolOrderPosition; var buttons = deviceData.pinnedToolButtons; - var buttonCount = buttons.Count; + var inactiveButtonInitialOrderPosition = -1; + var buttonCount = buttons.Count; // Position buttons relative to count if (buttonCount >= kMaxButtonCount) { @@ -87,12 +88,20 @@ internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform r foreach (var pair in buttons) { var button = pair.Value; + inactiveButtonInitialOrderPosition = inactiveButtonInitialOrderPosition == -1 ? button.activeToolOrderPosition : inactiveButtonInitialOrderPosition; button.rayOrigin = rayOrigin; + button.activeButtonCount = buttonCount; if (button.toolType == typeof(IMainMenu)) - button.order = PinnedToolButton.menuButtonOrderPosition; + { + Debug.LogError("Setting up main menu button"); + button.order = button.menuButtonOrderPosition; + } else - button.order = button.toolType == activeToolType ? PinnedToolButton.activeToolOrderPosition : ++inactiveButtonInitialOrderPosition; + { + button.order = button.toolType == activeToolType ? button.activeToolOrderPosition : ++inactiveButtonInitialOrderPosition; + Debug.LogError("Setting up button : " + button.toolType + " - ORDER : " + button.order); + } if (button.order == 0) deviceData.proxy.HighlightDevice(deviceData.node, button.gradientPair); // Perform the higlight on the node with the button's gradient pair @@ -105,7 +114,7 @@ void DeletePinnedToolButton(Transform rayOrigin, PinnedToolButton buttonToDelete // re-order the current buttons // Highlight the device if the top/selected tool was the one that was closed - Debug.LogError("DeletePinnedToolButton called"); + Debug.LogError("deletePinnedToolButton called"); //var result = false; //var deviceInputModule = evr.m_DeviceInputModule; @@ -128,9 +137,9 @@ void DeletePinnedToolButton(Transform rayOrigin, PinnedToolButton buttonToDelete } - Debug.LogError("Removing button : " + buttonToDelete.toolType); + Debug.LogError("Removing button : " + buttonToDelete.toolType + " - Setting new active button of type : " + selectedButtontype); buttons.Remove(buttonToDelete.toolType); - evr.m_Tools.SelectTool(rayOrigin, buttonToDelete.toolType); + evr.m_Tools.SelectTool(rayOrigin, selectedButtontype); SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, selectedButtontype); } }); diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 074f9d670..804dae21c 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -122,12 +122,13 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; alternateMenu.itemWasSelected += evrMenus.UpdateAlternateMenuOnSelectionChanged; - // Setup PinnedToolButtons var pinnedTools = evr.m_ToolButtons; deviceData.pinnedToolButtons = new Dictionary(); - pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)).order = PinnedToolButton.menuButtonOrderPosition; // Setup Main Menu button + var mainMenuButton = pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)); // Setup Main Menu button + pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool)); // Setup SelectionTool button - pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(SelectionTool)); // Initialize PinnedToolButtons + // Initialize PinnedToolButtons; set SelectionTool as the active tool type + pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(SelectionTool)); } evr.m_DeviceInputModule.UpdatePlayerHandleMaps(); @@ -143,7 +144,7 @@ internal void SpawnDefaultTools(IProxy proxy) /// Returns tool that was spawned or null if the spawn failed. ToolData SpawnTool(Type toolType, out HashSet usedDevices, InputDevice device = null) { - Debug.LogError("SPAWN TOOL CALLED!"); + Debug.LogError("SPAWN TOOL CALLED! : " + toolType); usedDevices = new HashSet(); if (!typeof(ITool).IsAssignableFrom(toolType)) return null; @@ -199,12 +200,15 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) { if (deviceData.rayOrigin == rayOrigin) { - Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString()); + Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " : setting type to : " + toolType); var spawnTool = true; + var pinnedToolButtonAdded = false; var setSelectAsCurrentTool = toolType == typeof(SelectionTool);//deviceData.currentTool is ILocomotor; // If this tool was on the current device already, then simply remove it - if (deviceData.currentTool != null && (deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool)) + var isSelectOrMainMenu = (deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool) || toolType == typeof(IMainMenu); + var permanentTool = IsPermanentTool(toolType); // TODO initially set spawnTool to this permatool value + if (deviceData.currentTool != null && isSelectOrMainMenu) { Debug.LogError("Despawing tool !!!! : toolType == typeof(SelectionTool) : " + (toolType == typeof(SelectionTool)).ToString()); DespawnTool(deviceData, deviceData.currentTool); @@ -213,8 +217,9 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) spawnTool = false; } - if (spawnTool) + if (spawnTool && !permanentTool) { + Debug.LogError("SPAWN TOOL : " + toolType); // Spawn tool and collect all devices that this tool will need HashSet usedDevices; var device = deviceData.inputDevice; @@ -242,11 +247,15 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) AddToolToStack(dd, newTool); if (!setSelectAsCurrentTool) + { + pinnedToolButtonAdded = true; pinnedTools.AddPinnedToolButton(deviceData, toolType); + } } } pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, toolType); + deviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; } From 09b512f9d8ae5c64976421c85a71ae9577070b87 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 17:05:14 -0700 Subject: [PATCH 132/870] Initialize PinnedToolButtons at correct location/position based on the visibility of the alternate menu --- Scripts/Core/EditorVR.ToolButtons.cs | 9 +++++++++ Scripts/UI/PinnedToolActionButton.cs | 4 ++-- Scripts/UI/PinnedToolButton.cs | 12 +++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Scripts/Core/EditorVR.ToolButtons.cs b/Scripts/Core/EditorVR.ToolButtons.cs index 6a464e360..bb0cba4f4 100644 --- a/Scripts/Core/EditorVR.ToolButtons.cs +++ b/Scripts/Core/EditorVR.ToolButtons.cs @@ -57,6 +57,15 @@ internal PinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolTy var button = SpawnPinnedToolButton(deviceData.inputDevice); pinnedToolButtons.Add(toolType, button); + + // Initialize button in alternate position if the alternate menu is hidden + PinnedToolButton mainMenu = null; + if (toolType == typeof(IMainMenu)) + mainMenu = button; + else + pinnedToolButtons.TryGetValue(typeof(IMainMenu), out mainMenu); + + button.moveToAlternatePosition = mainMenu ? mainMenu.moveToAlternatePosition : false; button.node = deviceData.node; button.toolType = toolType; // Assign Tool Type before assigning order //button.order = button.activeToolOrderPosition; // first position is the active tool position diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs index 51c1e5e89..ed43a329f 100644 --- a/Scripts/UI/PinnedToolActionButton.cs +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -428,7 +428,7 @@ IEnumerator IconContainerContentsEndHighlight() /// public void OnPointerEnter(PointerEventData eventData) { - Debug.LogError("OnPointerEnter"); + //Debug.LogError("OnPointerEnter"); highlighted = true; eventData.Use(); hoverEnter(); @@ -439,7 +439,7 @@ public void OnPointerEnter(PointerEventData eventData) /// public void OnPointerExit(PointerEventData eventData) { - Debug.LogError("OnPointerExit"); + //Debug.LogError("OnPointerExit"); highlighted = false; eventData.Use(); hoverExit(); diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 9506c9dc0..8b6151208 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -37,6 +37,8 @@ public Type toolType m_ToolType = value; if (m_ToolType != null) { + transform.localScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + transform.localPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; if (isSelectionTool || isMainMenu) { //activeButtonCount = 1; @@ -194,7 +196,7 @@ public Transform alternateMenuOrigin string m_TooltipText; bool m_Highlighted; - bool _mMoveToAlternatePosition; + bool m_MoveToAlternatePosition; int m_Order; Type m_previewToolType; Type m_ToolType; @@ -261,17 +263,17 @@ public bool highlighted public bool moveToAlternatePosition { - get { return _mMoveToAlternatePosition; } + get { return m_MoveToAlternatePosition; } set { - if (_mMoveToAlternatePosition == value) + if (m_MoveToAlternatePosition == value) return; - _mMoveToAlternatePosition = value; + m_MoveToAlternatePosition = value; this.StopCoroutine(ref m_ActivatorMoveCoroutine); - m_ActivatorMoveCoroutine = StartCoroutine(AnimateMoveActivatorButton(_mMoveToAlternatePosition)); + m_ActivatorMoveCoroutine = StartCoroutine(AnimateMoveActivatorButton(m_MoveToAlternatePosition)); } } From 21ebc5cebd5490f37f9500b7978df3df6b310117 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 17:27:05 -0700 Subject: [PATCH 133/870] Refactor remaining EditorVR direct references to PinnedToolButton type into IPinnedToolButton --- Menus/MainMenu/MainMenu.cs | 2 +- Menus/MainMenu/Scripts/MainMenuButton.cs | 6 +++--- Scripts/Core/EditorVR.ToolButtons.cs | 17 ++++++++--------- Scripts/Core/EditorVR.Tools.cs | 2 +- Scripts/Core/EditorVR.cs | 2 +- Scripts/Interfaces/IMainMenu.cs | 2 +- Scripts/UI/Interfaces/IPinnedToolButton.cs | 16 +++++++++++----- Scripts/UI/PinnedToolButton.cs | 4 ++-- 8 files changed, 28 insertions(+), 23 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index a535f94cf..5236be1b3 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -71,7 +71,7 @@ public bool visible public List menuActions { get; set; } public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } - public Func previewToolInPinnedToolButton { private get; set; } + public Func previewToolInPinnedToolButton { private get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 33b18bca2..2af0224e2 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -19,12 +19,12 @@ sealed class MainMenuButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler Transform m_HoveringRayOrigin; Color m_OriginalColor; - PinnedToolButton m_HighlightedPinnedToolbutton; + IPinnedToolButton m_HighlightedPinnedToolbutton; /// /// Highlights a pinned tool button when this menu button is highlighted /// - public Func previewToolInPinnedToolButton { private get; set; } + public Func previewToolInPinnedToolButton { private get; set; } public Type toolType { get; set; } @@ -75,7 +75,7 @@ public void OnRayExit(RayEventData eventData) m_HoveringRayOrigin = null; // Disable preview-mode on pinned tool button - if (m_HighlightedPinnedToolbutton) + if (m_HighlightedPinnedToolbutton != null) m_HighlightedPinnedToolbutton.previewToolType = null; } } diff --git a/Scripts/Core/EditorVR.ToolButtons.cs b/Scripts/Core/EditorVR.ToolButtons.cs index bb0cba4f4..80d748c46 100644 --- a/Scripts/Core/EditorVR.ToolButtons.cs +++ b/Scripts/Core/EditorVR.ToolButtons.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -33,15 +32,15 @@ internal MainMenuActivator SpawnMainMenuActivator(InputDevice device) return mainMenuActivator; } */ - internal PinnedToolButton SpawnPinnedToolButton(InputDevice device) + internal IPinnedToolButton SpawnPinnedToolButton(InputDevice device) { - var button = ObjectUtils.Instantiate(evr.m_PinnedToolButtonPrefab.gameObject).GetComponent(); + var button = ObjectUtils.Instantiate(evr.m_PinnedToolButtonPrefab.gameObject).GetComponent(); evr.m_Interfaces.ConnectInterfaces(button, device); return button; } - internal PinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType) + internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType) { Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); var pinnedToolButtons = deviceData.pinnedToolButtons; @@ -59,13 +58,13 @@ internal PinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolTy pinnedToolButtons.Add(toolType, button); // Initialize button in alternate position if the alternate menu is hidden - PinnedToolButton mainMenu = null; + IPinnedToolButton mainMenu = null; if (toolType == typeof(IMainMenu)) mainMenu = button; else pinnedToolButtons.TryGetValue(typeof(IMainMenu), out mainMenu); - button.moveToAlternatePosition = mainMenu ? mainMenu.moveToAlternatePosition : false; + button.moveToAlternatePosition = mainMenu != null && mainMenu.moveToAlternatePosition; button.node = deviceData.node; button.toolType = toolType; // Assign Tool Type before assigning order //button.order = button.activeToolOrderPosition; // first position is the active tool position @@ -117,7 +116,7 @@ internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform r } } - void DeletePinnedToolButton(Transform rayOrigin, PinnedToolButton buttonToDelete) + void DeletePinnedToolButton(Transform rayOrigin, IPinnedToolButton buttonToDelete) { // Remove the pinned tool from the device data collection // re-order the current buttons @@ -154,13 +153,13 @@ void DeletePinnedToolButton(Transform rayOrigin, PinnedToolButton buttonToDelete }); } - internal PinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType) + internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType) { // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions if (!toolType.GetInterfaces().Contains(typeof(ITool))) return null; - PinnedToolButton pinnedToolButton = null; + IPinnedToolButton pinnedToolButton = null; Rays.ForEachProxyDevice((deviceData) => { if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 804dae21c..31a5ffdd2 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -123,7 +123,7 @@ internal void SpawnDefaultTools(IProxy proxy) alternateMenu.itemWasSelected += evrMenus.UpdateAlternateMenuOnSelectionChanged; var pinnedTools = evr.m_ToolButtons; - deviceData.pinnedToolButtons = new Dictionary(); + deviceData.pinnedToolButtons = new Dictionary(); var mainMenuButton = pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)); // Setup Main Menu button pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool)); // Setup SelectionTool button diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 85a68d5b8..c16bd4d0d 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -94,7 +94,7 @@ class DeviceData public ActionMapInput alternateMenuInput; public ITool currentTool; public IMenu customMenu; - public Dictionary pinnedToolButtons; + public Dictionary pinnedToolButtons; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); } diff --git a/Scripts/Interfaces/IMainMenu.cs b/Scripts/Interfaces/IMainMenu.cs index 82b9d6770..80f389f28 100644 --- a/Scripts/Interfaces/IMainMenu.cs +++ b/Scripts/Interfaces/IMainMenu.cs @@ -38,7 +38,7 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Returns the unoccupied pinned tool button that will display the menu-button-tool preview while the button is highlighted /// The returned PinnedToolButton has its preview mode disabled upon a ray exit of the menu button /// - Func previewToolInPinnedToolButton { set; } + Func previewToolInPinnedToolButton { set; } } } #endif diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 949f33302..ee10e409a 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -8,22 +8,28 @@ namespace UnityEditor.Experimental.EditorVR /// /// Gives decorated class Pinned Tool Button functionality /// - public interface IPinnedToolButton + public interface IPinnedToolButton : IUsesMenuOrigins { int menuButtonOrderPosition { get; } int activeToolOrderPosition { get; } int order { get; set; } - int activeButtonCount { get; set; } + int activeButtonCount { set; } bool highlighted { set; } - bool moveToAlternatePosition { set; } + bool moveToAlternatePosition { get; set; } + Transform rayOrigin { get; set; } Type toolType { get; set; } - Type previewToolType { get; set; } + Type previewToolType { set; } Vector3 toolButtonActivePosition { get; } // Shared active button offset from the alternate menu - GradientPair gradientPair { set; } + Node node { set; } + GradientPair gradientPair { get; } event Action hoverEnter; event Action hoverExit; event Action selected; + + Action selectTool { set; } + Action deletePinnedToolButton { set; } + Action highlightAllToolButtons { set; } } public static class IPinnedToolButtonMethods diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 8b6151208..b844fea77 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces, IUsesMenuOrigins + public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces { static Color s_FrameOpaqueColor; static Color s_SemiTransparentFrameColor; @@ -220,7 +220,7 @@ public Transform alternateMenuOrigin public GradientPair customToolTipHighlightColor { get; set; } public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } - public Action deletePinnedToolButton { get; set; } + public Action deletePinnedToolButton { get; set; } public int activeButtonCount { get; set; } public Transform menuOrigin { get; set; } public Action highlightAllToolButtons { get; set; } From 5c4dd74749b9d363abb6aed4cabb80ec4b9ab611 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 17:33:59 -0700 Subject: [PATCH 134/870] Rename EditorVR.ToolButtons to EditorVR.PinnedToolButtons; change relevant references throughout --- ...{EditorVR.ToolButtons.cs => EditorVR.PinnedToolButtons.cs} | 2 +- ...ToolButtons.cs.meta => EditorVR.PinnedToolButtons.cs.meta} | 0 Scripts/Core/EditorVR.Tools.cs | 4 ++-- Scripts/Core/EditorVR.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename Scripts/Core/{EditorVR.ToolButtons.cs => EditorVR.PinnedToolButtons.cs} (99%) rename Scripts/Core/{EditorVR.ToolButtons.cs.meta => EditorVR.PinnedToolButtons.cs.meta} (100%) diff --git a/Scripts/Core/EditorVR.ToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs similarity index 99% rename from Scripts/Core/EditorVR.ToolButtons.cs rename to Scripts/Core/EditorVR.PinnedToolButtons.cs index 80d748c46..b6c3d1a64 100644 --- a/Scripts/Core/EditorVR.ToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - class ToolButtons : Nested, IInterfaceConnector + class PinnedToolButtons : Nested, IInterfaceConnector { public void ConnectInterface(object obj, Transform rayOrigin = null) { diff --git a/Scripts/Core/EditorVR.ToolButtons.cs.meta b/Scripts/Core/EditorVR.PinnedToolButtons.cs.meta similarity index 100% rename from Scripts/Core/EditorVR.ToolButtons.cs.meta rename to Scripts/Core/EditorVR.PinnedToolButtons.cs.meta diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 31a5ffdd2..7b7e2ff28 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -122,7 +122,7 @@ internal void SpawnDefaultTools(IProxy proxy) deviceData.menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; alternateMenu.itemWasSelected += evrMenus.UpdateAlternateMenuOnSelectionChanged; - var pinnedTools = evr.m_ToolButtons; + var pinnedTools = evr.m_PinnedToolButtons; deviceData.pinnedToolButtons = new Dictionary(); var mainMenuButton = pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)); // Setup Main Menu button pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); @@ -195,7 +195,7 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) var result = false; var deviceInputModule = evr.m_DeviceInputModule; - var pinnedTools = evr.m_ToolButtons; + var pinnedTools = evr.m_PinnedToolButtons; Rays.ForEachProxyDevice(deviceData => { if (deviceData.rayOrigin == rayOrigin) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index c16bd4d0d..453b91efa 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -51,7 +51,7 @@ sealed partial class EditorVR : MonoBehaviour Viewer m_Viewer; MultipleRayInputModule m_MultipleRayInputModule; Tools m_Tools; - ToolButtons m_ToolButtons; + PinnedToolButtons m_PinnedToolButtons; bool m_HasDeserialized; @@ -128,7 +128,7 @@ void Awake() m_Menus = GetNestedModule(); m_UI = GetNestedModule(); m_Tools = GetNestedModule(); - m_ToolButtons = GetNestedModule(); + m_PinnedToolButtons = GetNestedModule(); AddModule(); AddModule(); From d689c9962ced8a78830ef373a332853698426baf Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 17:49:43 -0700 Subject: [PATCH 135/870] Remove remaining references to MainMenuActivator in EditorVR --- Scripts/Core/EditorVR.Menus.cs | 9 +-------- Scripts/Core/EditorVR.cs | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index d4ba0dade..fadb1d0f3 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -14,9 +14,6 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - [SerializeField] - MainMenuActivator m_MainMenuActivatorPrefab; - [SerializeField] PinnedToolButton m_PinnedToolButtonPrefab; @@ -177,11 +174,7 @@ void UpdateAlternateMenuForDevice(DeviceData deviceData) var alternateMenu = deviceData.alternateMenu; alternateMenu.visible = deviceData.menuHideFlags[alternateMenu] == 0 && !(deviceData.currentTool is IExclusiveMode); - // Move the activator & pinned tool buttons to an alternate position if the alternate menu will be shown - var mainMenuActivator = deviceData.mainMenuActivator; - if (mainMenuActivator != null) - mainMenuActivator.activatorButtonMoveAway = alternateMenu.visible; - + // Move the pinned tool buttons to an alternate position if the alternate menu will be shown var pinnedToolButtons = deviceData.pinnedToolButtons; if (pinnedToolButtons != null && pinnedToolButtons.Count > 0) { diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 453b91efa..3e6ab979b 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -86,7 +86,6 @@ class DeviceData public Transform rayOrigin; public readonly Stack toolData = new Stack(); public ActionMapInput uiInput; - public MainMenuActivator mainMenuActivator; public ActionMapInput directSelectInput; public IMainMenu mainMenu; public ActionMapInput mainMenuInput; From 45df1309c1821a30563f8aa441617cb48c20624d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 17:50:37 -0700 Subject: [PATCH 136/870] Delete MainMenuActivator class; functionality handled in PinnedToolButtons now --- Scripts/UI/MainMenuActivator.cs | 154 --------------------------- Scripts/UI/MainMenuActivator.cs.meta | 12 --- 2 files changed, 166 deletions(-) delete mode 100644 Scripts/UI/MainMenuActivator.cs delete mode 100644 Scripts/UI/MainMenuActivator.cs.meta diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs deleted file mode 100644 index 42f672cae..000000000 --- a/Scripts/UI/MainMenuActivator.cs +++ /dev/null @@ -1,154 +0,0 @@ -#if UNITY_EDITOR -using System; -using System.Collections; -using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Modules; -using UnityEngine; -using UnityEngine.EventSystems; - -namespace UnityEditor.Experimental.EditorVR.Menus -{ - sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IUsesRayOrigin - { - readonly Vector3 m_OriginalActivatorLocalPosition = new Vector3(0f, 0f, -0.075f); - static readonly float kAlternateLocationOffset = 0.06f; - - public Transform alternateMenuOrigin - { - get { return m_AlternateMenuOrigin; } - set - { - m_AlternateMenuOrigin = value; - transform.SetParent(m_AlternateMenuOrigin); - transform.localPosition = m_OriginalActivatorLocalPosition; - transform.localRotation = Quaternion.identity; - transform.localScale = Vector3.one; - - m_OriginalActivatorIconLocalScale = m_Icon.localScale; - m_OriginalActivatorIconLocalPosition = m_Icon.localPosition; - m_HighlightedActivatorIconLocalScale = m_HighlightedPRS.localScale; - m_HighlightedActivatorIconLocalPosition = m_HighlightedPRS.localPosition; - m_AlternateActivatorLocalPosition = m_OriginalActivatorLocalPosition + Vector3.back * kAlternateLocationOffset; - } - } - Transform m_AlternateMenuOrigin; - - public bool activatorButtonMoveAway - { - get { return m_ActivatorButtonMoveAway; } - set - { - if (m_ActivatorButtonMoveAway == value) - return; - - m_ActivatorButtonMoveAway = value; - - this.StopCoroutine(ref m_ActivatorMoveCoroutine); - - m_ActivatorMoveCoroutine = StartCoroutine(AnimateMoveActivatorButton(m_ActivatorButtonMoveAway)); - } - } - bool m_ActivatorButtonMoveAway; - - [SerializeField] - Transform m_Icon; - [SerializeField] - Transform m_HighlightedPRS; - - Vector3 m_OriginalActivatorIconLocalScale; - Vector3 m_OriginalActivatorIconLocalPosition; - Vector3 m_HighlightedActivatorIconLocalScale; - Vector3 m_HighlightedActivatorIconLocalPosition; - Coroutine m_HighlightCoroutine; - Coroutine m_ActivatorMoveCoroutine; - Vector3 m_AlternateActivatorLocalPosition; - - public Transform rayOrigin { private get; set; } - public Transform menuOrigin { private get; set; } - - public event Action hoverStarted; - public event Action hoverEnded; - public event Action selected; - - public void OnPointerEnter(PointerEventData eventData) - { - // A child may have used the event, but still reflect that is was hovered - var rayEventData = eventData as RayEventData; - if (rayEventData != null && hoverStarted != null) - hoverStarted(rayEventData.rayOrigin); - - if (eventData.used) - return; - - if (m_HighlightCoroutine != null) - StopCoroutine(m_HighlightCoroutine); - - m_HighlightCoroutine = null; - m_HighlightCoroutine = StartCoroutine(Highlight()); - } - - public void OnPointerExit(PointerEventData eventData) - { - // A child may have used the event, but still reflect that is was hovered - var rayEventData = eventData as RayEventData; - if (rayEventData != null && hoverEnded != null) - hoverEnded(rayEventData.rayOrigin); - - if (eventData.used) - return; - - if (m_HighlightCoroutine != null) - StopCoroutine(m_HighlightCoroutine); - - m_HighlightCoroutine = null; - m_HighlightCoroutine = StartCoroutine(Highlight(false)); - } - - public void OnPointerClick(PointerEventData eventData) - { - var rayEventData = eventData as RayEventData; - if (selected != null) - selected(rayOrigin, rayEventData != null ? rayEventData.rayOrigin : null); - } - - IEnumerator Highlight(bool transitionIn = true) - { - var amount = 0f; - var currentScale = m_Icon.localScale; - var currentPosition = m_Icon.localPosition; - var targetScale = transitionIn == true ? m_HighlightedActivatorIconLocalScale : m_OriginalActivatorIconLocalScale; - var targetLocalPosition = transitionIn == true ? m_HighlightedActivatorIconLocalPosition : m_OriginalActivatorIconLocalPosition; - var speed = (currentScale.x + 0.5f / targetScale.x) * 4; // perform faster is returning to original position - - while (amount < 1f) - { - amount += Time.unscaledDeltaTime * speed; - m_Icon.localScale = Vector3.Lerp(currentScale, targetScale, Mathf.SmoothStep(0f, 1f, amount)); - m_Icon.localPosition = Vector3.Lerp(currentPosition, targetLocalPosition, Mathf.SmoothStep(0f, 1f, amount)); - yield return null; - } - - m_Icon.localScale = targetScale; - m_Icon.localPosition = targetLocalPosition; - } - - IEnumerator AnimateMoveActivatorButton(bool moveAway = true) - { - var amount = 0f; - var currentPosition = transform.localPosition; - var targetPosition = moveAway ? m_AlternateActivatorLocalPosition : m_OriginalActivatorLocalPosition; - var speed = (currentPosition.z / targetPosition.z) * (moveAway ? 10 : 3); // perform faster is returning to original position - - while (amount < 1f) - { - amount += Time.unscaledDeltaTime * speed; - transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, Mathf.SmoothStep(0f, 1f, amount)); - yield return null; - } - - transform.localPosition = targetPosition; - m_ActivatorMoveCoroutine = null; - } - } -} -#endif diff --git a/Scripts/UI/MainMenuActivator.cs.meta b/Scripts/UI/MainMenuActivator.cs.meta deleted file mode 100644 index 1fb9085d4..000000000 --- a/Scripts/UI/MainMenuActivator.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d6f3e100bf7b5f54d9ad1b115494abed -timeCreated: 1473752920 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 1a4e2c2f7c1b3246bd1a0b46dd7c3607391469a4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 17:52:28 -0700 Subject: [PATCH 137/870] Delete MainMenuActivator prefab & material --- Prefabs/UI/MainMenuActivator.prefab | 246 ------------------ Prefabs/UI/MainMenuActivator.prefab.meta | 8 - .../UI/Materials/MainMenuActivatorBase.mat | 145 ----------- .../Materials/MainMenuActivatorBase.mat.meta | 8 - 4 files changed, 407 deletions(-) delete mode 100644 Prefabs/UI/MainMenuActivator.prefab delete mode 100644 Prefabs/UI/MainMenuActivator.prefab.meta delete mode 100644 Prefabs/UI/Materials/MainMenuActivatorBase.mat delete mode 100644 Prefabs/UI/Materials/MainMenuActivatorBase.mat.meta diff --git a/Prefabs/UI/MainMenuActivator.prefab b/Prefabs/UI/MainMenuActivator.prefab deleted file mode 100644 index c28b9b68c..000000000 --- a/Prefabs/UI/MainMenuActivator.prefab +++ /dev/null @@ -1,246 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1000010175483050} - m_IsPrefabParent: 1 ---- !u!1 &1000010175483050 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 4000012631310542} - - 114: {fileID: 114000011125667836} - - 114: {fileID: 114000010478179432} - - 65: {fileID: 65000010634631396} - m_Layer: 5 - m_Name: MainMenuActivator - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000012610842486 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 4000011430756646} - m_Layer: 5 - m_Name: AlternatePRS - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000012969383024 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 4000010854155806} - - 33: {fileID: 33000010759220136} - - 23: {fileID: 23000012609994424} - m_Layer: 5 - m_Name: UnityBrandLogoIcon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000013938143622 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 4: {fileID: 4000010187138780} - - 33: {fileID: 33000010285903528} - - 23: {fileID: 23000010303846554} - m_Layer: 5 - m_Name: Base - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &4000010187138780 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013938143622} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 4000012631310542} - m_RootOrder: 0 ---- !u!4 &4000010854155806 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012969383024} - m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} - m_LocalPosition: {x: 0, y: -0.0004316, z: 0.00012} - m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} - m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} - m_Children: [] - m_Father: {fileID: 4000012631310542} - m_RootOrder: 2 ---- !u!4 &4000011430756646 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012610842486} - m_LocalRotation: {x: -0, y: 1, z: -0, w: 0} - m_LocalPosition: {x: 0, y: -0.0004316, z: 0.0017} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} - m_Children: [] - m_Father: {fileID: 4000012631310542} - m_RootOrder: 1 ---- !u!4 &4000012631310542 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010175483050} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 4000010187138780} - - {fileID: 4000011430756646} - - {fileID: 4000010854155806} - m_Father: {fileID: 0} - m_RootOrder: 0 ---- !u!23 &23000010303846554 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013938143622} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: f529aa3f46751284da61273e4baa271b, type: 2} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!23 &23000012609994424 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012969383024} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 1dfad94589adaf04dae2a9dd716551bb, type: 2} - m_SubsetIndices: - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingOrder: 0 ---- !u!33 &33000010285903528 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013938143622} - m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} ---- !u!33 &33000010759220136 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012969383024} - m_Mesh: {fileID: 4300002, guid: e79b2c051ae02c2428934660d028c602, type: 3} ---- !u!65 &65000010634631396 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010175483050} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 0.06, y: 0.001, z: 0.06} - m_Center: {x: 0, y: -0.002, z: 0} ---- !u!114 &114000010478179432 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010175483050} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RunInEditMode: 0 - m_SelectionFlags: 3 ---- !u!114 &114000011125667836 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010175483050} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d6f3e100bf7b5f54d9ad1b115494abed, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RunInEditMode: 0 - m_Icon: {fileID: 4000010854155806} - m_HighlightedPRS: {fileID: 4000011430756646} diff --git a/Prefabs/UI/MainMenuActivator.prefab.meta b/Prefabs/UI/MainMenuActivator.prefab.meta deleted file mode 100644 index ff8ce2588..000000000 --- a/Prefabs/UI/MainMenuActivator.prefab.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: a943a77cb6a6bd04da2b86b34ade4596 -timeCreated: 1474325477 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Prefabs/UI/Materials/MainMenuActivatorBase.mat b/Prefabs/UI/Materials/MainMenuActivatorBase.mat deleted file mode 100644 index 50dd53d36..000000000 --- a/Prefabs/UI/Materials/MainMenuActivatorBase.mat +++ /dev/null @@ -1,145 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: MainMenuActivatorBase - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _EMISSION - m_LightmapFlags: 1 - m_CustomRenderQueue: 9000 - stringTagMap: {} - m_SavedProperties: - serializedVersion: 2 - m_TexEnvs: - - first: - name: _BumpMap - second: - m_Texture: {fileID: 2800000, guid: 06dc8da358c6ebb4dad67b286b513f95, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailAlbedoMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailMask - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailNormalMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _EmissionMap - second: - m_Texture: {fileID: 2800000, guid: 3cd61233b718b974e99810df6209b4c4, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _MainTex - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _MetallicGlossMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _OcclusionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _ParallaxMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _SpecGlossMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - first: - name: _BumpScale - second: 2 - - first: - name: _Cutoff - second: 0.5 - - first: - name: _DetailNormalMapScale - second: 1 - - first: - name: _DstBlend - second: 0 - - first: - name: _GlossMapScale - second: 0.414 - - first: - name: _Glossiness - second: 0.5 - - first: - name: _GlossyReflections - second: 1 - - first: - name: _InvFade - second: 1 - - first: - name: _Metallic - second: 0.256 - - first: - name: _Mode - second: 0 - - first: - name: _OcclusionStrength - second: 1 - - first: - name: _Parallax - second: 0.02 - - first: - name: _SmoothnessTextureChannel - second: 0 - - first: - name: _SpecularHighlights - second: 1 - - first: - name: _SrcBlend - second: 1 - - first: - name: _UVSec - second: 0 - - first: - name: _ZWrite - second: 1 - m_Colors: - - first: - name: _Color - second: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - - first: - name: _EmisColor - second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 0} - - first: - name: _EmissionColor - second: {r: 0, g: 0, b: 0, a: 1} - - first: - name: _SpecColor - second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - - first: - name: _TintColor - second: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} diff --git a/Prefabs/UI/Materials/MainMenuActivatorBase.mat.meta b/Prefabs/UI/Materials/MainMenuActivatorBase.mat.meta deleted file mode 100644 index d86b82198..000000000 --- a/Prefabs/UI/Materials/MainMenuActivatorBase.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f529aa3f46751284da61273e4baa271b -timeCreated: 1469840733 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: From f219dd09d3b798d30f5367aa94c8d20baec23536 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 19:19:19 -0700 Subject: [PATCH 138/870] Add animated button base alpha change on highlight --- Scripts/UI/PinnedToolButton.cs | 44 +++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index b844fea77..74671ed57 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -252,9 +252,11 @@ public bool highlighted { set { - //if (m_Highlighted == value || !gameObject.activeSelf) - //return; + if (m_Highlighted == value || !gameObject.activeSelf) + return; + m_Highlighted = value; + //Debug.LogError(Time.frameCount + " : Highlighting : " + toolType); this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value)); } @@ -281,6 +283,12 @@ void Awake() { m_OriginalLocalPosition = transform.localPosition; m_OriginalLocalScale = transform.localScale; + + m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); + var frameMaterialColor = m_FrameMaterial.color; + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); + s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); + s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); } void Start() @@ -308,12 +316,6 @@ void Start() m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); this.ConnectInterfaces(m_SmoothMotion); - m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); - var frameMaterialColor = m_FrameMaterial.color; - s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); - s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); - m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); @@ -394,7 +396,7 @@ void OnBackgroundHoverEnter () { //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) //{ - Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); + //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); //m_RootCollider.enabled = false; m_GradientButton.highlighted = true; //m_GradientButton.visible = false; @@ -546,13 +548,16 @@ void CorrectIconRotation() IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) { - Debug.LogWarning("AnimateSemiTransparent : " + makeSemiTransparent); - const float kFasterMotionMultiplier = 2f; - var transitionAmount = Time.unscaledDeltaTime; - var positionWait = (order + 1) * 0.25f; // pad the order index for a faster start to the transition + //if (!makeSemiTransparent) + //yield return new WaitForSeconds(1f); // Pause before making opaque + + //Debug.LogWarning("AnimateSemiTransparent : " + makeSemiTransparent); + //const float kFasterMotionMultiplier = 2f; + var transitionAmount = 0f; + //var positionWait = (order + 1) * 0.25f; // pad the order index for a faster start to the transition //var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); + //var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); var currentFrameColor = m_FrameMaterial.color; - var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); var targetFrameColor = makeSemiTransparent ? s_SemiTransparentFrameColor : s_FrameOpaqueColor; var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); var targetInsetAlpha = makeSemiTransparent ? 0.25f : 1f; @@ -565,19 +570,20 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) //var targetIconScale = makeSemiTransparent ? semiTransparentTargetIconScale : Vector3.one; while (transitionAmount < 1) { - m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, transparentFrameColor, transitionAmount)); + transitionAmount += Time.unscaledDeltaTime * 4f; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); //m_MenuInset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, transitionAmount * 2f); - //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, transitionAmount)); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); //m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, transitionAmount)); //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; //m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconScale, shapedTransitionAmount); - transitionAmount += Time.unscaledDeltaTime * 4f; - CorrectIconRotation(); + //CorrectIconRotation(); yield return null; } m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); - //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); //m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); //m_MenuInset.localScale = targetInsetScale; //m_IconContainer.localScale = targetIconScale; From 20ca7faf70aabef2b6222f92f39f821d4da80283 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 22:34:10 -0700 Subject: [PATCH 139/870] Add sprite icon support, and inset+mask animation to PinnedToolButton --- Prefabs/UI/PinnedToolButton.prefab | 8 ++-- Scripts/UI/Interfaces/IPinnedToolButton.cs | 1 + Scripts/UI/PinnedToolButton.cs | 43 ++++++++++++++++------ 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index bcd0adc0b..4f0eea85e 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -287,7 +287,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!1 &1000013816124996 GameObject: m_ObjectHideFlags: 1 @@ -532,8 +532,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010714816488} - m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} - m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalRotation: {x: -0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] @@ -887,6 +887,8 @@ MonoBehaviour: m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} m_AlternateLocalPosition: {x: 0, y: 0, z: 0} + m_Inset: {fileID: 4000013614942004} + m_InsetMask: {fileID: 4000011771676402} --- !u!114 &114000011796366970 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index ee10e409a..7c9433019 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -20,6 +20,7 @@ public interface IPinnedToolButton : IUsesMenuOrigins Type toolType { get; set; } Type previewToolType { set; } Vector3 toolButtonActivePosition { get; } // Shared active button offset from the alternate menu + Sprite icon { set; } Node node { set; } GradientPair gradientPair { get; } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 74671ed57..b39b4740f 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -42,7 +42,7 @@ public Type toolType if (isSelectionTool || isMainMenu) { //activeButtonCount = 1; - order= isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; + order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair } @@ -54,7 +54,6 @@ public Type toolType gradientPair = UnityBrandColorScheme.GetRandomGradient(); } - m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); activeTool = true; m_GradientButton.visible = true; } @@ -189,6 +188,12 @@ public Transform alternateMenuOrigin [SerializeField] Vector3 m_AlternateLocalPosition; + [SerializeField] + Transform m_Inset; + + [SerializeField] + Transform m_InsetMask; + Coroutine m_PositionCoroutine; Coroutine m_VisibilityCoroutine; Coroutine m_HighlightCoroutine; @@ -224,7 +229,6 @@ public Transform alternateMenuOrigin public int activeButtonCount { get; set; } public Transform menuOrigin { get; set; } public Action highlightAllToolButtons { get; set; } - public Sprite icon { set { m_GradientButton.icon = value; } } public Action OpenMenu { get; set; } public Action selectTool { get; set; } public int menuButtonOrderPosition { get { return k_MenuButtonOrderPosition; } } @@ -263,6 +267,17 @@ public bool highlighted //get { return m_Highlighted; } } + public Sprite icon + { + set + { + if (value) + m_GradientButton.icon = value; + else + m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); // Set backup tool abbreviation if no icon is set + } + } + public bool moveToAlternatePosition { get { return m_MoveToAlternatePosition; } @@ -371,9 +386,10 @@ IEnumerator AnimatePosition(Quaternion targetRotation) //var currentPosition = transform.localPosition; //var targetPosition = activeTool ? activePosition : m_InactivePosition; var currentRotation = transform.localRotation; + var positionWait = (order + 2) * 0.125f; while (duration < 1) { - duration += Time.unscaledDeltaTime * 6; + duration += Time.unscaledDeltaTime * 4f * positionWait; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); CorrectIconRotation(); @@ -479,7 +495,7 @@ void OnActionButtonHoverExit() // Hide both action buttons if the user is no longer hovering over the button if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) { - Debug.LogWarning("!!!"); + //Debug.LogWarning("!!!"); //m_ButtonCollider.enabled = true; m_LeftPinnedToolActionButton.visible = false; m_RightPinnedToolActionButton.visible = false; @@ -563,8 +579,10 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) var targetInsetAlpha = makeSemiTransparent ? 0.25f : 1f; //var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); //var targetIconColor = makeSemiTransparent ? s_SemiTransparentFrameColor : Color.white; - //var currentInsetScale = m_MenuInset.localScale; - //var targetInsetScale = makeSemiTransparent ? m_HighlightedInsetLocalScale * 4 : m_VisibleInsetLocalScale; + var currentInsetScale = m_Inset.localScale; + var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; + var currentInsetMaskScale = m_InsetMask.localScale; + var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; //var currentIconScale = m_IconContainer.localScale; //var semiTransparentTargetIconScale = Vector3.one * 1.5f; //var targetIconScale = makeSemiTransparent ? semiTransparentTargetIconScale : Vector3.one; @@ -573,7 +591,8 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) transitionAmount += Time.unscaledDeltaTime * 4f; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); - //m_MenuInset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, transitionAmount * 2f); + m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); + m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3) * 3f); m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); //m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, transitionAmount)); //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; @@ -584,8 +603,10 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); + m_Inset.localScale = targetInsetScale; + m_InsetMask.localScale = targetInsetMaskScale; //m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - //m_MenuInset.localScale = targetInsetScale; + //m_Inset.localScale = targetInsetScale; //m_IconContainer.localScale = targetIconScale; } @@ -596,8 +617,8 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; var currentLocalScale = transform.localScale; var targetLocalScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - var speed = moveToAlternatePosition ? 5 : 5; // perform faster is returning to original position - + var speed = moveToAlternatePosition ? 5f : 4.5f; // perform faster is returning to original position + speed += (order + 1) * 0.275f; while (amount < 1f) { amount += Time.unscaledDeltaTime * speed; From 3124ede8fd0c53616f5d4a669f87ce87edccdeb0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 22:35:57 -0700 Subject: [PATCH 140/870] Add new IMenuIcon interface, used in tools/objects that implement a sprite icon that can be utilized in menus --- Scripts/UI/Interfaces/IMenuIcon.cs | 17 +++++++++++++++++ Scripts/UI/Interfaces/IMenuIcon.cs.meta | 12 ++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Scripts/UI/Interfaces/IMenuIcon.cs create mode 100644 Scripts/UI/Interfaces/IMenuIcon.cs.meta diff --git a/Scripts/UI/Interfaces/IMenuIcon.cs b/Scripts/UI/Interfaces/IMenuIcon.cs new file mode 100644 index 000000000..afbdf05a2 --- /dev/null +++ b/Scripts/UI/Interfaces/IMenuIcon.cs @@ -0,0 +1,17 @@ +#if UNITY_EDITOR +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Declares a class as a menu UI element that can be represented via an icon/sprite + /// + public interface IMenuIcon + { + /// + /// The icon representing this Action that can be displayed in menus + /// + Sprite icon { get; } + } +} +#endif diff --git a/Scripts/UI/Interfaces/IMenuIcon.cs.meta b/Scripts/UI/Interfaces/IMenuIcon.cs.meta new file mode 100644 index 000000000..1715c8351 --- /dev/null +++ b/Scripts/UI/Interfaces/IMenuIcon.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e62d8dc5daf1256428483cbdb9d2d592 +timeCreated: 1492055798 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 5ab7f64c8e73ba60aee55e76218ea91305c1c877 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 22:37:05 -0700 Subject: [PATCH 141/870] Implement IMenuIcon and assign icon sprites to MakeCubeTool & MakeSphereTool --- Tools/Temp/MakeCubeTool.cs | 3 ++- Tools/Temp/MakeCubeTool.cs.meta | 4 ++-- Tools/Temp/MakeSphereTool.cs | 12 ++++++++---- Tools/Temp/MakeSphereTool.cs.meta | 3 ++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Tools/Temp/MakeCubeTool.cs b/Tools/Temp/MakeCubeTool.cs index d0c2661e1..9f531e8d2 100644 --- a/Tools/Temp/MakeCubeTool.cs +++ b/Tools/Temp/MakeCubeTool.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Cube", "Create", "Create cubes in the scene")] //[MainMenuItem(false)] - sealed class MakeCubeTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesSpatialHash + sealed class MakeCubeTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesSpatialHash, IMenuIcon { class CubeToolAction : IAction { @@ -23,6 +23,7 @@ public void ExecuteAction() {} public List actions { get; private set; } public Transform rayOrigin { get; set; } + public Sprite icon { get { return m_Icon; } } void Awake() { diff --git a/Tools/Temp/MakeCubeTool.cs.meta b/Tools/Temp/MakeCubeTool.cs.meta index 128087ccf..d3efa4c93 100644 --- a/Tools/Temp/MakeCubeTool.cs.meta +++ b/Tools/Temp/MakeCubeTool.cs.meta @@ -1,11 +1,11 @@ fileFormatVersion: 2 guid: 27a3d8dde627a4d409b0dace5c1f3d4d -timeCreated: 1476985571 +timeCreated: 1492060299 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - - m_Icon: {fileID: 21300000, guid: 15545907e08dab74692cb3d226382ced, type: 3} + - m_Icon: {fileID: 21300000, guid: 9d5301bda303a4b4bb1fff77569cd5bc, type: 3} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Tools/Temp/MakeSphereTool.cs b/Tools/Temp/MakeSphereTool.cs index b0498eb7c..38e202e29 100644 --- a/Tools/Temp/MakeSphereTool.cs +++ b/Tools/Temp/MakeSphereTool.cs @@ -7,9 +7,16 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Sphere", "Create", "Create spheres in the scene")] //[MainMenuItem(false)] - sealed class MakeSphereTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash + sealed class MakeSphereTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash, IMenuIcon { + [SerializeField] + private ActionMap m_ActionMap; + + [SerializeField] + Sprite m_Icon; + public Transform rayOrigin { get; set; } + public Sprite icon { get { return m_Icon; } } public ActionMap actionMap { @@ -17,9 +24,6 @@ public ActionMap actionMap set { m_ActionMap = value; } } - [SerializeField] - private ActionMap m_ActionMap; - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var standardAlt = (StandardAlt)input; diff --git a/Tools/Temp/MakeSphereTool.cs.meta b/Tools/Temp/MakeSphereTool.cs.meta index 7fa4c0e7b..d61eedcd7 100644 --- a/Tools/Temp/MakeSphereTool.cs.meta +++ b/Tools/Temp/MakeSphereTool.cs.meta @@ -1,11 +1,12 @@ fileFormatVersion: 2 guid: 6b7e16bac5117eb42925bb96b0937dbc -timeCreated: 1466723731 +timeCreated: 1492060363 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} + - m_Icon: {fileID: 21300000, guid: b63a9c85c7c044f44843bbf507c72b18, type: 3} executionOrder: 0 icon: {instanceID: 0} userData: From e12b30bf8c6756da88d5a6963797a9a74c0c4454 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 22:38:58 -0700 Subject: [PATCH 142/870] Implement initial IMenuIcon support for ITools throughout EditorVR; utilized by the PinnedToolButtons --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 3 ++- Scripts/Core/EditorVR.Tools.cs | 18 ++++++++++-------- Scripts/Core/EditorVR.cs | 3 +++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index b6c3d1a64..486a3c8f5 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -40,7 +40,7 @@ internal IPinnedToolButton SpawnPinnedToolButton(InputDevice device) return button; } - internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType) + internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType, Sprite buttonIcon) { Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); var pinnedToolButtons = deviceData.pinnedToolButtons; @@ -67,6 +67,7 @@ internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolT button.moveToAlternatePosition = mainMenu != null && mainMenu.moveToAlternatePosition; button.node = deviceData.node; button.toolType = toolType; // Assign Tool Type before assigning order + button.icon = buttonIcon; //button.order = button.activeToolOrderPosition; // first position is the active tool position button.deletePinnedToolButton = DeletePinnedToolButton; button.highlightAllToolButtons = HighlightAllToolButtons; diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 7b7e2ff28..04db66d22 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -19,6 +19,7 @@ internal class ToolData { public ITool tool; public ActionMapInput input; + public Sprite icon; } internal List allTools { get; private set; } @@ -87,13 +88,13 @@ internal void SpawnDefaultTools(IProxy proxy) continue; HashSet devices; - var toolData = SpawnTool(typeof(SelectionTool), out devices, inputDevice); - AddToolToDeviceData(toolData, devices); - var selectionTool = (SelectionTool)toolData.tool; + var selectionToolData = SpawnTool(typeof(SelectionTool), out devices, inputDevice); + AddToolToDeviceData(selectionToolData, devices); + var selectionTool = (SelectionTool)selectionToolData.tool; selectionTool.hovered += lockModule.OnHovered; selectionTool.isRayActive = isRayActive; - toolData = SpawnTool(typeof(VacuumTool), out devices, inputDevice); + var toolData = SpawnTool(typeof(VacuumTool), out devices, inputDevice); AddToolToDeviceData(toolData, devices); var vacuumTool = (VacuumTool)toolData.tool; vacuumTool.defaultOffset = WorkspaceModule.DefaultWorkspaceOffset; @@ -124,9 +125,9 @@ internal void SpawnDefaultTools(IProxy proxy) var pinnedTools = evr.m_PinnedToolButtons; deviceData.pinnedToolButtons = new Dictionary(); - var mainMenuButton = pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu)); // Setup Main Menu button + var mainMenuButton = pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu), evr.m_UnityIcon); // Setup Main Menu button pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); - pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool)); // Setup SelectionTool button + pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool), selectionToolData.icon); // Setup SelectionTool button // Initialize PinnedToolButtons; set SelectionTool as the active tool type pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(SelectionTool)); } @@ -164,7 +165,8 @@ ToolData SpawnTool(Type toolType, out HashSet usedDevices, InputDev evr.m_Interfaces.ConnectInterfaces(tool, device); - return new ToolData { tool = tool, input = actionMapInput }; + var icon = tool as IMenuIcon; + return new ToolData { tool = tool, input = actionMapInput, icon = icon != null ? icon.icon : null}; } void AddToolToDeviceData(ToolData toolData, HashSet devices) @@ -249,7 +251,7 @@ internal bool SelectTool(Transform rayOrigin, Type toolType) if (!setSelectAsCurrentTool) { pinnedToolButtonAdded = true; - pinnedTools.AddPinnedToolButton(deviceData, toolType); + pinnedTools.AddPinnedToolButton(deviceData, toolType, newTool.icon); } } } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 3e6ab979b..ab0ab9672 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -30,6 +30,9 @@ sealed partial class EditorVR : MonoBehaviour [SerializeField] ProxyExtras m_ProxyExtras; + [SerializeField] + Sprite m_UnityIcon; + Dictionary m_Modules = new Dictionary(); Interfaces m_Interfaces; From e835a299eb3e3fec71e37381553278904746c06c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 22:40:11 -0700 Subject: [PATCH 143/870] Assign UnityLogoIcon sprite to EditorVR; utilized by Unity menu buttons; currently implemented in the PinnedToolButtons --- Scripts/Core/EditorVR.cs.meta | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/Scripts/Core/EditorVR.cs.meta b/Scripts/Core/EditorVR.cs.meta index 0401a79ad..9ef5b084e 100644 --- a/Scripts/Core/EditorVR.cs.meta +++ b/Scripts/Core/EditorVR.cs.meta @@ -1,35 +1,22 @@ fileFormatVersion: 2 guid: 1d288f1a40f3bc54bb07e9a5eb99d137 -timeCreated: 1479964689 +timeCreated: 1492057075 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - - m_TrackedObjectActionMap: {fileID: 11400000, guid: fda722c992454454aa59f3760898d74a, - type: 2} - - m_StandardToolActionMap: {fileID: 11400000, guid: f904ed06397c2fc4f81263e88804a0af, - type: 2} - - m_DirectSelectActionMap: {fileID: 11400000, guid: dc1ccafeffffc62419a3265a080a94a3, + - m_PinnedToolButtonPrefab: {fileID: 114000011260412956, guid: 7221a75a049ac3949a505c7c2f06bd8e, type: 2} - m_ProxyRayPrefab: {fileID: 114000010564953552, guid: 6c037b4595ca1ab4c921efeac9524073, type: 2} - m_EventCameraPrefab: {fileID: 20000012271368486, guid: 6078fbea960c1014cba733bb3ec1d7ad, type: 2} - - m_MainMenuActivatorPrefab: {fileID: 114000011125667836, guid: a943a77cb6a6bd04da2b86b34ade4596, - type: 2} - - m_KeyboardMalletPrefab: {fileID: 114000013972379212, guid: 55c3df0d3b957354fa26bae2b39cffb3, - type: 2} - - m_NumericKeyboardPrefab: {fileID: 114000012169358554, guid: 5f76c682f089562449adab190d7a8fc4, - type: 2} - - m_StandardKeyboardPrefab: {fileID: 114000012076762946, guid: 6a5c5a798b3bb39408f3dbf2bfa77923, + - m_PreviewCameraPrefab: {fileID: 1000010893495554, guid: 66d2f6b9efc6b7842bea782607a65bd2, type: 2} - m_PlayerModelPrefab: {fileID: 1000013280737546, guid: 3dbbb2baa83f3994e94fe56a60c73252, type: 2} - - m_PreviewCameraPrefab: {fileID: 1000010893495554, guid: 66d2f6b9efc6b7842bea782607a65bd2, - type: 2} - m_ProxyExtras: {instanceID: 0} - - m_PinnedToolButtonPrefab: {fileID: 114000011260412956, guid: 7221a75a049ac3949a505c7c2f06bd8e, - type: 2} + - m_UnityIcon: {fileID: 21300000, guid: 05f6f0555fbf99a429004b50ccd6ffa9, type: 3} executionOrder: 0 icon: {instanceID: 0} userData: From 0c1e3710a9e4dc33b89b67e3a089548ce285d3b7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Apr 2017 22:40:55 -0700 Subject: [PATCH 144/870] Implement IMenuIcon in SelectionTool; assign proxy sprite to class --- Tools/SelectionTool/SelectionTool.cs | 6 +++++- Tools/SelectionTool/SelectionTool.cs.meta | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 2f1a7aca6..2aa68b8f6 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -9,8 +9,11 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject + ICanGrabObject, IMenuIcon { + [SerializeField] + Sprite m_Icon; + GameObject m_PressedObject; public ActionMap actionMap { get { return m_ActionMap; } } @@ -22,6 +25,7 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR readonly Dictionary m_SelectionHoverGameObjects = new Dictionary(); public Transform rayOrigin { private get; set; } + public Sprite icon { get { return m_Icon; } } public Func isRayActive; public event Action hovered; diff --git a/Tools/SelectionTool/SelectionTool.cs.meta b/Tools/SelectionTool/SelectionTool.cs.meta index e40af8371..5ce7996a4 100644 --- a/Tools/SelectionTool/SelectionTool.cs.meta +++ b/Tools/SelectionTool/SelectionTool.cs.meta @@ -1,13 +1,12 @@ fileFormatVersion: 2 guid: aab8fcc587f237c4cb48fb7bc8a59909 -timeCreated: 1473145505 +timeCreated: 1492056870 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: + - m_Icon: {fileID: 21300000, guid: b19d9dcbe6f40f64c9ae7fec6f0d13c2, type: 3} - m_ActionMap: {fileID: 11400000, guid: 9bdc23bc93bcec343934b99348f0ecf4, type: 2} - - m_RadialMenuPrefab: {fileID: 114000012127715022, guid: 7cc49adc1d2485a4e812f2c7d9697c2f, - type: 2} executionOrder: 0 icon: {instanceID: 0} userData: From 1980f3d8662ff00c0c47a8f7d88ba5fe74c8663a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 13 Apr 2017 15:48:28 -0700 Subject: [PATCH 145/870] Add animation and visuals functionality to PinnedToolButtons that matches the RadialMenu aesthetic --- Prefabs/UI/PinnedToolButton.prefab | 71 +++++++------- Scripts/UI/PinnedToolButton.cs | 145 ++++++++++++++++++----------- 2 files changed, 123 insertions(+), 93 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 4f0eea85e..368191d52 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -49,7 +49,7 @@ GameObject: m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 m_Component: - - 224: {fileID: 224000013783073276} + - 4: {fileID: 4000010081970184} - 225: {fileID: 225000010875730614} m_Layer: 5 m_Name: IconContainer @@ -412,6 +412,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!4 &4000010081970184 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010351058842} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.0012000204, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000010630333128} + - {fileID: 224000013933582366} + m_Father: {fileID: 224000013167097666} + m_RootOrder: 1 --- !u!4 &4000010683372396 Transform: m_ObjectHideFlags: 1 @@ -448,10 +463,9 @@ Transform: m_LocalPosition: {x: 0, y: -0.0012, z: 0} m_LocalScale: {x: 2.7019417, y: 2.7019417, z: 2.7019417} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 224000013783073276} + m_Children: [] m_Father: {fileID: 224000013167097666} - m_RootOrder: 1 + m_RootOrder: 2 --- !u!4 &4000012504767854 Transform: m_ObjectHideFlags: 1 @@ -789,7 +803,7 @@ MonoBehaviour: a: {r: 0, g: 0, b: 0, a: 0} b: {r: 0, g: 0, b: 0, a: 0} m_ButtonMeshRenderer: {fileID: 23000013623333764} - m_IconContainer: {fileID: 224000013783073276} + m_IconContainer: {fileID: 4000010081970184} m_ContentContainer: {fileID: 224000013167097666} m_CanvasGroup: {fileID: 225000010875730614} m_Text: {fileID: 114000010635728284} @@ -815,7 +829,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: @@ -849,7 +863,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: @@ -880,7 +894,8 @@ MonoBehaviour: m_SmoothMotion: {fileID: 0} m_LeftPinnedToolActionButton: {fileID: 114000011926581952} m_RightPinnedToolActionButton: {fileID: 114000013773965116} - m_ContentContainer: {fileID: 4000012190781878} + m_IconContainer: {fileID: 4000010081970184} + m_IconContainerCanvasGroup: {fileID: 225000010875730614} m_RootCollider: {fileID: 65000011941282114} m_FrameRenderer: {fileID: 23000013529982034} m_InsetMeshRenderer: {fileID: 23000013623333764} @@ -889,6 +904,7 @@ MonoBehaviour: m_AlternateLocalPosition: {x: 0, y: 0, z: 0} m_Inset: {fileID: 4000013614942004} m_InsetMask: {fileID: 4000011771676402} + m_ButtonIcon: {fileID: 114000011073612486} --- !u!114 &114000011796366970 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1277,15 +1293,15 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013805247488} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000010135} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000027384143} + m_LocalScale: {x: 2.7019417, y: 2.7019424, z: 2.7019436} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 224000013783073276} + m_Father: {fileID: 4000010081970184} m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.00000032782555, y: 0.00000014901161} + m_AnchoredPosition: {x: -7.8898665e-11, y: 0.00000038940925} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010919883134 @@ -1395,6 +1411,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: - {fileID: 224000012760332454} + - {fileID: 4000010081970184} - {fileID: 4000012190781878} m_Father: {fileID: 4000013747407424} m_RootOrder: 0 @@ -1421,26 +1438,6 @@ RectTransform: m_AnchoredPosition: {x: 0.0023612897, y: -0.0002999992} m_SizeDelta: {x: 0.0413, y: 0.0413} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000013783073276 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010351058842} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 224000010630333128} - - {fileID: 224000013933582366} - m_Father: {fileID: 4000012190781878} - m_RootOrder: 0 - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -8.731149e-10, y: -2.3283064e-10} - m_SizeDelta: {x: 0.02307, y: 0.02307} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013910327088 RectTransform: m_ObjectHideFlags: 1 @@ -1466,16 +1463,16 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013816124996} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.00000013408862} - m_LocalScale: {x: 0.00008, y: 0.00008, z: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 0.00021615531, y: 0.00021615547, z: 2.7019436} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 224000013783073276} + m_Father: {fileID: 4000010081970184} m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.00008, y: 0.0005} - m_SizeDelta: {x: 268.38452, y: 268.38452} + m_AnchoredPosition: {x: 0.00020984784, y: 0.0013569929} + m_SizeDelta: {x: 224.9724, y: 224.9724} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013975901740 RectTransform: diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index b39b4740f..0d9b69c0a 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -7,6 +7,7 @@ using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Menus { @@ -37,8 +38,6 @@ public Type toolType m_ToolType = value; if (m_ToolType != null) { - transform.localScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - transform.localPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; if (isSelectionTool || isMainMenu) { //activeButtonCount = 1; @@ -56,6 +55,10 @@ public Type toolType activeTool = true; m_GradientButton.visible = true; + + var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow(targetPosition, targetScale)); } else { @@ -168,7 +171,10 @@ public Transform alternateMenuOrigin PinnedToolActionButton m_RightPinnedToolActionButton; [SerializeField] - Transform m_ContentContainer; + Transform m_IconContainer; + + [SerializeField] + CanvasGroup m_IconContainerCanvasGroup; [SerializeField] Collider m_RootCollider; @@ -194,6 +200,9 @@ public Transform alternateMenuOrigin [SerializeField] Transform m_InsetMask; + [SerializeField] + Image m_ButtonIcon; + Coroutine m_PositionCoroutine; Coroutine m_VisibilityCoroutine; Coroutine m_HighlightCoroutine; @@ -212,6 +221,7 @@ public Transform alternateMenuOrigin //Vector3 m_InactivePosition; // Inactive button offset from the main menu activator Vector3 m_OriginalLocalPosition; Vector3 m_OriginalLocalScale; + Material m_IconMaterial; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -239,7 +249,7 @@ public Transform alternateMenuOrigin public event Action hoverExit; public event Action selected; - private bool activeTool + bool activeTool { get { return m_Order == activeToolOrderPosition; } set @@ -304,6 +314,8 @@ void Awake() m_FrameMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); + + m_IconMaterial = MaterialUtils.GetMaterialClone(m_ButtonIcon); } void Start() @@ -364,6 +376,13 @@ void Start() //m_GradientButton.gameObject.SetActive(false); } + void OnDestroy() + { + ObjectUtils.Destroy(m_InsetMaterial); + ObjectUtils.Destroy(m_IconMaterial); + ObjectUtils.Destroy(m_FrameMaterial); + } + // Create periodic table-style names for types string GetTypeAbbreviation(Type type) { @@ -380,29 +399,6 @@ string GetTypeAbbreviation(Type type) return abbreviation.ToString(); } - IEnumerator AnimatePosition(Quaternion targetRotation) - { - var duration = 0f; - //var currentPosition = transform.localPosition; - //var targetPosition = activeTool ? activePosition : m_InactivePosition; - var currentRotation = transform.localRotation; - var positionWait = (order + 2) * 0.125f; - while (duration < 1) - { - duration += Time.unscaledDeltaTime * 4f * positionWait; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); - transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); - CorrectIconRotation(); - //transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); - yield return null; - } - - //transform.localPosition = targetPosition; - transform.localRotation = targetRotation; - CorrectIconRotation(); - m_PositionCoroutine = null; - } - bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) { return buttonType == PinnedToolActionButton.ButtonType.SelectTool; @@ -474,7 +470,7 @@ void ActionButtonClicked(PinnedToolActionButton button) else // Handle action buttons assigned Close-Tool functionality { //if (!isSelectionTool) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateClose()); + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndClose()); //else //Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); @@ -521,15 +517,30 @@ void OnBackgroundButtonClick() m_GradientButton.UpdateMaterialColors(); } - void CloseButton() + IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) { - // TODO add full close functionality - gameObject.SetActive(false); + m_RootCollider.enabled = false; + var duration = 0f; + while (duration < 1) + { + duration += Time.unscaledDeltaTime * 3f; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); + m_IconContainerCanvasGroup.alpha = Mathf.Lerp(0f, 1f, durationShaped); + m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, Vector3.one, durationShaped * 2f); + transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); + transform.localScale = Vector3.Lerp(Vector3.zero, targetScale, durationShaped); + yield return null; + } - // perform a graceful hiding of visuals, then destroy this button gameobject + m_IconContainerCanvasGroup.alpha = 1f; + m_IconContainer.localScale = Vector3.one; + transform.localPosition = targetPosition; + transform.localScale = targetScale; + m_RootCollider.enabled = true; + m_VisibilityCoroutine = null; } - IEnumerator AnimateClose() + IEnumerator AnimateHideAndClose() { this.HideTooltip(this); m_RootCollider.enabled = false; @@ -549,17 +560,27 @@ IEnumerator AnimateClose() ObjectUtils.Destroy(gameObject, 0.1f); } - void CorrectIconRotation() + IEnumerator AnimatePosition(Quaternion targetRotation) { - const float kIconLookForwardOffset = 0.5f; - var iconLookDirection = m_ContentContainer.transform.position + transform.parent.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation - m_ContentContainer.LookAt(iconLookDirection); - m_ContentContainer.localEulerAngles = new Vector3(0f, 0f, m_ContentContainer.localEulerAngles.z); - var angle = m_ContentContainer.localEulerAngles.z; - m_TooltipTarget.localEulerAngles = new Vector3(90f, 0f, angle); + var duration = 0f; + //var currentPosition = transform.localPosition; + //var targetPosition = activeTool ? activePosition : m_InactivePosition; + var currentRotation = transform.localRotation; + var positionWait = (order + 5) * 0.1f; + while (duration < 1) + { + duration += Time.unscaledDeltaTime * 4f * positionWait; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); + transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); + CorrectIconRotation(); + //transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); + yield return null; + } - var yaw = transform.localRotation.eulerAngles.y; - tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; + //transform.localPosition = targetPosition; + transform.localRotation = targetRotation; + CorrectIconRotation(); + m_PositionCoroutine = null; } IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) @@ -577,27 +598,27 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) var targetFrameColor = makeSemiTransparent ? s_SemiTransparentFrameColor : s_FrameOpaqueColor; var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); var targetInsetAlpha = makeSemiTransparent ? 0.25f : 1f; - //var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); - //var targetIconColor = makeSemiTransparent ? s_SemiTransparentFrameColor : Color.white; + var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); + var targetIconColor = makeSemiTransparent ? s_SemiTransparentFrameColor : Color.white; var currentInsetScale = m_Inset.localScale; var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; var currentInsetMaskScale = m_InsetMask.localScale; var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; - //var currentIconScale = m_IconContainer.localScale; - //var semiTransparentTargetIconScale = Vector3.one * 1.5f; - //var targetIconScale = makeSemiTransparent ? semiTransparentTargetIconScale : Vector3.one; + var currentIconScale = m_IconContainer.localScale; + var targetIconScale = makeSemiTransparent ? Vector3.one * 1.25f : Vector3.one; + var speedMultiplier = makeSemiTransparent ? 4f : 6f; // Slower transparent fade; faster opaque fade while (transitionAmount < 1) { - transitionAmount += Time.unscaledDeltaTime * 4f; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + transitionAmount += Time.unscaledDeltaTime * speedMultiplier; + var shapedAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(transitionAmount), 3); m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); - m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3) * 3f); + m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); - //m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, transitionAmount)); + m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount)); //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - //m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconScale, shapedTransitionAmount); - //CorrectIconRotation(); + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconScale, shapedAmount); + CorrectIconRotation(); yield return null; } @@ -605,9 +626,8 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); m_Inset.localScale = targetInsetScale; m_InsetMask.localScale = targetInsetMaskScale; - //m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - //m_Inset.localScale = targetInsetScale; - //m_IconContainer.localScale = targetIconScale; + m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + m_IconContainer.localScale = targetIconScale; } IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) @@ -638,6 +658,19 @@ IEnumerator DelayedCollderEnable() yield return null; m_RootCollider.enabled = true; } + + void CorrectIconRotation() + { + const float kIconLookForwardOffset = 0.5f; + var iconLookDirection = m_IconContainer.transform.position + transform.parent.parent.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation + m_IconContainer.LookAt(iconLookDirection); + m_IconContainer.localEulerAngles = new Vector3(0f, 0f, m_IconContainer.localEulerAngles.z); + var angle = m_IconContainer.localEulerAngles.z; + m_TooltipTarget.localEulerAngles = new Vector3(90f, 0f, angle); + + var yaw = transform.localRotation.eulerAngles.y; + tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; + } } } #endif From 66c4becc85cacb8f6cce3041b66ac009a70ab4a5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 13 Apr 2017 18:43:30 -0700 Subject: [PATCH 146/870] Setup icon/text scaling & color changes based on semiTransparent & highlight states --- Prefabs/UI/PinnedToolButton.prefab | 4 ++-- Scripts/UI/PinnedToolButton.cs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 368191d52..59d5fa8a9 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -804,7 +804,7 @@ MonoBehaviour: b: {r: 0, g: 0, b: 0, a: 0} m_ButtonMeshRenderer: {fileID: 23000013623333764} m_IconContainer: {fileID: 4000010081970184} - m_ContentContainer: {fileID: 224000013167097666} + m_ContentContainer: {fileID: 4000010081970184} m_CanvasGroup: {fileID: 225000010875730614} m_Text: {fileID: 114000010635728284} m_Icon: {fileID: 114000011073612486} @@ -1463,7 +1463,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013816124996} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.00021615531, y: 0.00021615547, z: 2.7019436} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 0d9b69c0a..63ed00e7f 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -18,7 +18,7 @@ public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, IToolt const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation - private const float k_alternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu + const float k_alternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu const string k_MaterialColorProperty = "_Color"; const string k_MaterialAlphaProperty = "_Alpha"; const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; @@ -521,7 +521,7 @@ IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) { m_RootCollider.enabled = false; var duration = 0f; - while (duration < 1) + while (duration < 2) { duration += Time.unscaledDeltaTime * 3f; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); @@ -569,7 +569,7 @@ IEnumerator AnimatePosition(Quaternion targetRotation) var positionWait = (order + 5) * 0.1f; while (duration < 1) { - duration += Time.unscaledDeltaTime * 4f * positionWait; + duration += Time.unscaledDeltaTime * 5f * positionWait; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); CorrectIconRotation(); @@ -605,8 +605,8 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) var currentInsetMaskScale = m_InsetMask.localScale; var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; var currentIconScale = m_IconContainer.localScale; - var targetIconScale = makeSemiTransparent ? Vector3.one * 1.25f : Vector3.one; - var speedMultiplier = makeSemiTransparent ? 4f : 6f; // Slower transparent fade; faster opaque fade + var targetIconScale = makeSemiTransparent ? Vector3.one * 1.375f : Vector3.one; + var speedMultiplier = makeSemiTransparent ? 4f : 6.5f; // Slower transparent fade; faster opaque fade while (transitionAmount < 1) { transitionAmount += Time.unscaledDeltaTime * speedMultiplier; From 8a2b43b4e071d5d30dcc9cb97f5ce0289f1fcf4f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 13:43:05 -0700 Subject: [PATCH 147/870] Fix outstanding post-development merge issues throughout; Add temp tools back into project, for testing menus --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 6 +++--- Scripts/Core/EditorVR.Tools.cs | 12 ++++++------ Scripts/Core/EditorVR.cs | 12 ------------ Tools/Temp.meta | 9 +++++++++ Tools/Temp/MakeCubeTool.cs.meta | 13 +++++++++++++ Tools/Temp/MakeSphereTool.cs | 2 +- Tools/Temp/MakeSphereTool.cs.meta | 14 ++++++++++++++ Tools/Temp/ToolFourDemo.cs | 2 +- Tools/Temp/ToolOneDemo.cs | 2 +- Tools/Temp/ToolThreeDemo.cs | 2 +- Tools/Temp/ToolTwoDemo.cs | 2 +- 11 files changed, 50 insertions(+), 26 deletions(-) create mode 100644 Tools/Temp.meta create mode 100644 Tools/Temp/MakeCubeTool.cs.meta create mode 100644 Tools/Temp/MakeSphereTool.cs.meta diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 486a3c8f5..69e3324ed 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -42,7 +42,7 @@ internal IPinnedToolButton SpawnPinnedToolButton(InputDevice device) internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType, Sprite buttonIcon) { - Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); + Debug.LogWarning("SPAWNING pinned tool button for type of : " + toolType); var pinnedToolButtons = deviceData.pinnedToolButtons; if (pinnedToolButtons.ContainsKey(toolType)) // Return if tooltype already occupies a pinned tool button return null; @@ -148,7 +148,7 @@ void DeletePinnedToolButton(Transform rayOrigin, IPinnedToolButton buttonToDelet Debug.LogError("Removing button : " + buttonToDelete.toolType + " - Setting new active button of type : " + selectedButtontype); buttons.Remove(buttonToDelete.toolType); - evr.m_Tools.SelectTool(rayOrigin, selectedButtontype); + Tools.SelectTool(rayOrigin, selectedButtontype); SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, selectedButtontype); } }); @@ -187,7 +187,7 @@ internal void ToolButtonClicked(Transform rayOrigin, Type toolType) if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); else - evr.m_Tools.SelectTool(rayOrigin, toolType); + Tools.SelectTool(rayOrigin, toolType); } internal void HighlightAllToolButtons (Transform rayOrigin, bool enableHighlight) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index b721baac6..9938b5065 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -75,7 +75,7 @@ internal static void SpawnDefaultTools(IProxy proxy) var lockModule = evr.GetModule(); var defaultTools = evr.m_DefaultTools; var directSelection = evr.GetNestedModule(); - Debug.LogError("get selection tool icon selectionToolData.icon for pinned tool buttons now that selection tool is a DefaultTool"); + Debug.LogWarning("get selection tool icon selectionToolData.icon for pinned tool buttons now that selection tool is a DefaultTool"); foreach (var deviceData in evr.m_DeviceData) { @@ -125,7 +125,7 @@ internal static void SpawnDefaultTools(IProxy proxy) deviceData.menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; alternateMenu.itemWasSelected += Menus.UpdateAlternateMenuOnSelectionChanged; - var pinnedTools = evr.m_PinnedToolButtons; + var pinnedTools = evr.GetNestedModule(); //evr.m_PinnedToolButtons; deviceData.pinnedToolButtons = new Dictionary(); var mainMenuButton = pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu), evr.m_UnityIcon); // Setup Main Menu button pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); @@ -147,7 +147,7 @@ internal static void SpawnDefaultTools(IProxy proxy) /// Returns tool that was spawned or null if the spawn failed. static ToolData SpawnTool(Type toolType, out HashSet usedDevices, InputDevice device = null) { - Debug.LogError("SPAWN TOOL CALLED! : " + toolType); + Debug.LogWarning("SPAWN TOOL CALLED! : " + toolType); usedDevices = new HashSet(); if (!typeof(ITool).IsAssignableFrom(toolType)) return null; @@ -199,7 +199,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) var result = false; var deviceInputModule = evr.GetModule(); - var pinnedTools = evr.m_PinnedToolButtons; // TODO: Convert to module fetch + var pinnedTools = evr.GetNestedModule();// m_PinnedToolButtons; // TODO: Convert to module fetch Debug.LogError("Convert pinnedTools to new GetModule method"); Rays.ForEachProxyDevice(deviceData => { @@ -212,7 +212,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) // If this tool was on the current device already, then simply remove it var isSelectOrMainMenu = (deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool) || toolType == typeof(IMainMenu); - var permanentTool = IsPermanentTool(toolType); // TODO initially set spawnTool to this permatool value + var defaultTool = IsDefaultTool(toolType); // TODO initially set spawnTool to this default/permatool value if (deviceData.currentTool != null && isSelectOrMainMenu) { Debug.LogError("Despawing tool !!!! : toolType == typeof(SelectionTool) : " + (toolType == typeof(SelectionTool)).ToString()); @@ -222,7 +222,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) spawnTool = false; } - if (spawnTool && !permanentTool) + if (spawnTool && !defaultTool) { Debug.LogError("SPAWN TOOL : " + toolType); // Spawn tool and collect all devices that this tool will need diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 1a9a33763..adf3d4262 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -22,12 +22,6 @@ sealed partial class EditorVR : MonoBehaviour const string k_SerializedPreferences = "EditorVR.SerializedPreferences"; const string k_VRPlayerTag = "VRPlayer"; - //[SerializeField] // TODO: REFACTOR AFTER MERGE - //GameObject m_PlayerModelPrefab; // TODO: REFACTOR AFTER MERGE - - //[SerializeField] // TODO: REFACTOR AFTER MERGE - //ProxyExtras m_ProxyExtras; // TODO: REFACTOR AFTER MERGE - [SerializeField] Sprite m_UnityIcon; // TODO: Refactor, possibly move to proxy extras @@ -41,9 +35,6 @@ sealed partial class EditorVR : MonoBehaviour readonly List m_DeviceData = new List(); - //Tools m_Tools; // TODO: REFACTOR AFTER MERGE - //PinnedToolButtons m_PinnedToolButtons; // TODO: REFACTOR AFTER MERGE - bool m_HasDeserialized; static HideFlags defaultHideFlags @@ -115,9 +106,6 @@ void Awake() } LateBindNestedModules(nestedClassTypes); - //m_Tools = GetNestedModule(); // TODO: REFACTOR AFTER MERGE - //m_PinnedToolButtons = GetNestedModule(); // TODO: REFACTOR AFTER MERGE - AddModule(); AddModule(); diff --git a/Tools/Temp.meta b/Tools/Temp.meta new file mode 100644 index 000000000..9f38a6a32 --- /dev/null +++ b/Tools/Temp.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: daaa9a496c116a84f9bc157fa45ddb28 +folderAsset: yes +timeCreated: 1467308457 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/MakeCubeTool.cs.meta b/Tools/Temp/MakeCubeTool.cs.meta new file mode 100644 index 000000000..6ca2d5e7c --- /dev/null +++ b/Tools/Temp/MakeCubeTool.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 27a3d8dde627a4d409b0dace5c1f3d4d +timeCreated: 1492543194 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_Icon: {fileID: 21300000, guid: 9d5301bda303a4b4bb1fff77569cd5bc, type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/MakeSphereTool.cs b/Tools/Temp/MakeSphereTool.cs index 38e202e29..4541f69af 100644 --- a/Tools/Temp/MakeSphereTool.cs +++ b/Tools/Temp/MakeSphereTool.cs @@ -26,7 +26,7 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (StandardAlt)input; + var standardAlt = (Standard)input; if (standardAlt.action.wasJustPressed) { Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; diff --git a/Tools/Temp/MakeSphereTool.cs.meta b/Tools/Temp/MakeSphereTool.cs.meta new file mode 100644 index 000000000..72dc4fe38 --- /dev/null +++ b/Tools/Temp/MakeSphereTool.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 6b7e16bac5117eb42925bb96b0937dbc +timeCreated: 1492543195 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} + - m_Icon: {fileID: 21300000, guid: b63a9c85c7c044f44843bbf507c72b18, type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/ToolFourDemo.cs b/Tools/Temp/ToolFourDemo.cs index 36bb6ac9b..6bdb70304 100644 --- a/Tools/Temp/ToolFourDemo.cs +++ b/Tools/Temp/ToolFourDemo.cs @@ -22,7 +22,7 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (StandardAlt)input; + var standardAlt = (Standard)input; if (standardAlt.action.wasJustPressed) { Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; diff --git a/Tools/Temp/ToolOneDemo.cs b/Tools/Temp/ToolOneDemo.cs index bb38a480a..bf36622e1 100644 --- a/Tools/Temp/ToolOneDemo.cs +++ b/Tools/Temp/ToolOneDemo.cs @@ -22,7 +22,7 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (StandardAlt)input; + var standardAlt = (Standard)input; if (standardAlt.action.wasJustPressed) { Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; diff --git a/Tools/Temp/ToolThreeDemo.cs b/Tools/Temp/ToolThreeDemo.cs index cf07f4162..bea07ef02 100644 --- a/Tools/Temp/ToolThreeDemo.cs +++ b/Tools/Temp/ToolThreeDemo.cs @@ -22,7 +22,7 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (StandardAlt)input; + var standardAlt = (Standard)input; if (standardAlt.action.wasJustPressed) { Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; diff --git a/Tools/Temp/ToolTwoDemo.cs b/Tools/Temp/ToolTwoDemo.cs index a82ed2556..4617f2a6f 100644 --- a/Tools/Temp/ToolTwoDemo.cs +++ b/Tools/Temp/ToolTwoDemo.cs @@ -22,7 +22,7 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (StandardAlt)input; + var standardAlt = (Standard)input; if (standardAlt.action.wasJustPressed) { Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; From 42dcee2b8c92d191df6a022d27af5317ff5b7372 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 15:15:22 -0700 Subject: [PATCH 148/870] Fix PinnedToolButton icons no longer being set back to their original icon after previewing a tool on a button --- Scripts/UI/GradientButton.cs | 4 ++-- Scripts/UI/PinnedToolButton.cs | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index f6d0ed068..56f3cb0d3 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -520,7 +520,7 @@ void SwapIconSprite() public void SetContent(string displayedText) { m_AlternateIconSprite = null; - m_IconSprite = null; + iconSprite = null; m_Icon.enabled = false; m_Text.text = displayedText.Substring(0, 2); } @@ -533,7 +533,7 @@ public void SetContent(string displayedText) public void SetContent(Sprite icon, Sprite alternateIcon = null) { m_Icon.enabled = true; - m_IconSprite = icon; + iconSprite = icon; m_AlternateIconSprite = alternateIcon; m_Text.text = string.Empty; } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 63ed00e7f..99486f758 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -133,7 +133,7 @@ public Type previewToolType else { activeTool = activeTool; - m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); + icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button customToolTipHighlightColor = gradientPair; this.HideTooltip(this); tooltipText = (isSelectionTool || isMainMenu) ? (isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText) : toolType.Name; @@ -222,6 +222,7 @@ public Transform alternateMenuOrigin Vector3 m_OriginalLocalPosition; Vector3 m_OriginalLocalScale; Material m_IconMaterial; + Sprite m_Icon; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -279,10 +280,14 @@ public bool highlighted public Sprite icon { + get { return m_Icon; } + set { - if (value) - m_GradientButton.icon = value; + m_Icon = value; + + if (m_Icon) + m_GradientButton.SetContent(m_Icon); else m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); // Set backup tool abbreviation if no icon is set } From f40b8a577aa6f3801af0b32c01e6dd1c9c03d2a6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 15:16:27 -0700 Subject: [PATCH 149/870] Fix exceptions in temporary MakeSphereTool, after converting to Standard action map input --- Tools/Temp/MakeSphereTool.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Tools/Temp/MakeSphereTool.cs b/Tools/Temp/MakeSphereTool.cs index 4541f69af..965112859 100644 --- a/Tools/Temp/MakeSphereTool.cs +++ b/Tools/Temp/MakeSphereTool.cs @@ -7,27 +7,18 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Sphere", "Create", "Create spheres in the scene")] //[MainMenuItem(false)] - sealed class MakeSphereTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash, IMenuIcon + sealed class MakeSphereTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesSpatialHash, IMenuIcon { - [SerializeField] - private ActionMap m_ActionMap; - [SerializeField] Sprite m_Icon; public Transform rayOrigin { get; set; } public Sprite icon { get { return m_Icon; } } - public ActionMap actionMap - { - get { return m_ActionMap; } - set { m_ActionMap = value; } - } - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (Standard)input; - if (standardAlt.action.wasJustPressed) + var standardInput = (Standard)input; + if (standardInput.action.wasJustPressed) { Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; if (rayOrigin) @@ -35,7 +26,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.AddToSpatialHash(sphere.gameObject); - consumeControl(standardAlt.action); + consumeControl(standardInput.action); } } } From 7b7e1d06f7fcca589b8edd42306852b0db993c48 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 15:40:27 -0700 Subject: [PATCH 150/870] Cleanup MakeSphere and MakeCube tools --- Tools/Temp/MakeCubeTool.cs | 17 ----------------- Tools/Temp/MakeSphereTool.cs | 1 - 2 files changed, 18 deletions(-) diff --git a/Tools/Temp/MakeCubeTool.cs b/Tools/Temp/MakeCubeTool.cs index 9f531e8d2..f0077b4b1 100644 --- a/Tools/Temp/MakeCubeTool.cs +++ b/Tools/Temp/MakeCubeTool.cs @@ -1,6 +1,4 @@ #if UNITY_EDITOR -using System; -using System.Collections.Generic; using UnityEngine; using UnityEngine.InputNew; @@ -10,27 +8,12 @@ namespace UnityEditor.Experimental.EditorVR.Tools //[MainMenuItem(false)] sealed class MakeCubeTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesSpatialHash, IMenuIcon { - class CubeToolAction : IAction - { - public Sprite icon { get; internal set; } - public void ExecuteAction() {} - } - [SerializeField] Sprite m_Icon; - readonly CubeToolAction m_CubeToolAction = new CubeToolAction(); - - public List actions { get; private set; } public Transform rayOrigin { get; set; } public Sprite icon { get { return m_Icon; } } - void Awake() - { - m_CubeToolAction.icon = m_Icon; - actions = new List() { m_CubeToolAction }; - } - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var standardInput = (Standard)input; diff --git a/Tools/Temp/MakeSphereTool.cs b/Tools/Temp/MakeSphereTool.cs index 965112859..0acf45709 100644 --- a/Tools/Temp/MakeSphereTool.cs +++ b/Tools/Temp/MakeSphereTool.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using System; using UnityEngine; using UnityEngine.InputNew; From cffebd32ff74aa15732594fca40a98c76a3cbdfe Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 15:57:45 -0700 Subject: [PATCH 151/870] Move UnityIcon inspector reference out of EditorVR and into EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 3 +++ Scripts/Core/EditorVR.cs | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 9938b5065..a1bfdc940 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -13,6 +13,9 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { + [SerializeField] + Sprite m_UnityIcon; + class Tools : Nested, IInterfaceConnector { internal class ToolData diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index adf3d4262..6f96789c5 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -22,9 +22,6 @@ sealed partial class EditorVR : MonoBehaviour const string k_SerializedPreferences = "EditorVR.SerializedPreferences"; const string k_VRPlayerTag = "VRPlayer"; - [SerializeField] - Sprite m_UnityIcon; // TODO: Refactor, possibly move to proxy extras - Dictionary m_NestedModules = new Dictionary(); Dictionary m_Modules = new Dictionary(); From 6f8419fd894acb25992192dbb8dcf9aa3a6f4633 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 16:56:56 -0700 Subject: [PATCH 152/870] Remove ProcessInput functionality from temp tools --- Tools/Temp/ToolFourDemo.cs | 11 ----------- Tools/Temp/ToolOneDemo.cs | 11 ----------- Tools/Temp/ToolThreeDemo.cs | 11 ----------- Tools/Temp/ToolTwoDemo.cs | 11 ----------- 4 files changed, 44 deletions(-) diff --git a/Tools/Temp/ToolFourDemo.cs b/Tools/Temp/ToolFourDemo.cs index 6bdb70304..25795e8f1 100644 --- a/Tools/Temp/ToolFourDemo.cs +++ b/Tools/Temp/ToolFourDemo.cs @@ -22,17 +22,6 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (Standard)input; - if (standardAlt.action.wasJustPressed) - { - Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; - if (rayOrigin) - sphere.position = rayOrigin.position + rayOrigin.forward * 5f; - - this.AddToSpatialHash(sphere.gameObject); - - consumeControl(standardAlt.action); - } } } } diff --git a/Tools/Temp/ToolOneDemo.cs b/Tools/Temp/ToolOneDemo.cs index bf36622e1..bf61419b5 100644 --- a/Tools/Temp/ToolOneDemo.cs +++ b/Tools/Temp/ToolOneDemo.cs @@ -22,17 +22,6 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (Standard)input; - if (standardAlt.action.wasJustPressed) - { - Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; - if (rayOrigin) - sphere.position = rayOrigin.position + rayOrigin.forward * 5f; - - this.AddToSpatialHash(sphere.gameObject); - - consumeControl(standardAlt.action); - } } } } diff --git a/Tools/Temp/ToolThreeDemo.cs b/Tools/Temp/ToolThreeDemo.cs index bea07ef02..86acb5528 100644 --- a/Tools/Temp/ToolThreeDemo.cs +++ b/Tools/Temp/ToolThreeDemo.cs @@ -22,17 +22,6 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (Standard)input; - if (standardAlt.action.wasJustPressed) - { - Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; - if (rayOrigin) - sphere.position = rayOrigin.position + rayOrigin.forward * 5f; - - this.AddToSpatialHash(sphere.gameObject); - - consumeControl(standardAlt.action); - } } } } diff --git a/Tools/Temp/ToolTwoDemo.cs b/Tools/Temp/ToolTwoDemo.cs index 4617f2a6f..2aebd209d 100644 --- a/Tools/Temp/ToolTwoDemo.cs +++ b/Tools/Temp/ToolTwoDemo.cs @@ -22,17 +22,6 @@ public ActionMap actionMap public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var standardAlt = (Standard)input; - if (standardAlt.action.wasJustPressed) - { - Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; - if (rayOrigin) - sphere.position = rayOrigin.position + rayOrigin.forward * 5f; - - this.AddToSpatialHash(sphere.gameObject); - - consumeControl(standardAlt.action); - } } } } From e5fb3cfcdc9c10afee13f13b22bc945845e191b3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 16:57:46 -0700 Subject: [PATCH 153/870] Remove unnecessary using from SmoothMotion --- Scripts/Helpers/SmoothMotion.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/Helpers/SmoothMotion.cs b/Scripts/Helpers/SmoothMotion.cs index a441573bb..c116c0cf6 100644 --- a/Scripts/Helpers/SmoothMotion.cs +++ b/Scripts/Helpers/SmoothMotion.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using System; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Helpers From e5730d793a520ae8d95a26ca778d68d981b542a4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 17:11:50 -0700 Subject: [PATCH 154/870] Correct updating of PinnedToolButton icon rotations when adding new buttons --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 4 ++-- Scripts/UI/PinnedToolButton.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 69e3324ed..f41e9136d 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -103,13 +103,13 @@ internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform r if (button.toolType == typeof(IMainMenu)) { - Debug.LogError("Setting up main menu button"); + Debug.LogWarning("Setting up main menu button"); button.order = button.menuButtonOrderPosition; } else { button.order = button.toolType == activeToolType ? button.activeToolOrderPosition : ++inactiveButtonInitialOrderPosition; - Debug.LogError("Setting up button : " + button.toolType + " - ORDER : " + button.order); + Debug.LogWarning("Setting up button : " + button.toolType + " - ORDER : " + button.order); } if (button.order == 0) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 99486f758..aeddd927d 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -667,7 +667,7 @@ IEnumerator DelayedCollderEnable() void CorrectIconRotation() { const float kIconLookForwardOffset = 0.5f; - var iconLookDirection = m_IconContainer.transform.position + transform.parent.parent.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation + var iconLookDirection = m_IconContainer.transform.position + transform.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation m_IconContainer.LookAt(iconLookDirection); m_IconContainer.localEulerAngles = new Vector3(0f, 0f, m_IconContainer.localEulerAngles.z); var angle = m_IconContainer.localEulerAngles.z; From c2e9a3a639fbd6f37c7ba373c9ef8d3d5e706ff1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 17:41:26 -0700 Subject: [PATCH 155/870] Correct Unity tool button icon rotation --- Prefabs/UI/Textures/UnityIcon.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Prefabs/UI/Textures/UnityIcon.png b/Prefabs/UI/Textures/UnityIcon.png index f724b59a3..e5639fdc2 100644 --- a/Prefabs/UI/Textures/UnityIcon.png +++ b/Prefabs/UI/Textures/UnityIcon.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9b1b8834bed0b5bb590af2b7caa63d2b68d7e702eff2f5d504784311f5a2fec -size 12925 +oid sha256:e84e553e4a6e78eafdea2d5422af8d235041f8267abc10b1bf93ba6db12c0439 +size 18354 From 8d49229b2a9f3b5256b2168a4aeedcf113968e1b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 17:41:55 -0700 Subject: [PATCH 156/870] Add new tool icon sprites --- Tools/SelectionTool/SelectionToolIcon.png | 3 + .../SelectionTool/SelectionToolIcon.png.meta | 64 +++++++++++++++++++ Tools/Temp/MakeCubeToolIcon.png | 3 + Tools/Temp/MakeCubeToolIcon.png.meta | 64 +++++++++++++++++++ Tools/Temp/MakeSphereToolIcon.png | 3 + Tools/Temp/MakeSphereToolIcon.png.meta | 64 +++++++++++++++++++ Tools/Temp/TempToolIcon.png | 3 + Tools/Temp/TempToolIcon.png.meta | 64 +++++++++++++++++++ 8 files changed, 268 insertions(+) create mode 100644 Tools/SelectionTool/SelectionToolIcon.png create mode 100644 Tools/SelectionTool/SelectionToolIcon.png.meta create mode 100644 Tools/Temp/MakeCubeToolIcon.png create mode 100644 Tools/Temp/MakeCubeToolIcon.png.meta create mode 100644 Tools/Temp/MakeSphereToolIcon.png create mode 100644 Tools/Temp/MakeSphereToolIcon.png.meta create mode 100644 Tools/Temp/TempToolIcon.png create mode 100644 Tools/Temp/TempToolIcon.png.meta diff --git a/Tools/SelectionTool/SelectionToolIcon.png b/Tools/SelectionTool/SelectionToolIcon.png new file mode 100644 index 000000000..7c0ba70e1 --- /dev/null +++ b/Tools/SelectionTool/SelectionToolIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:005868ccd75153f646bfd28e344c705e9cf53a8e12f4b0be3a20ed9d60f50bec +size 13465 diff --git a/Tools/SelectionTool/SelectionToolIcon.png.meta b/Tools/SelectionTool/SelectionToolIcon.png.meta new file mode 100644 index 000000000..f840961d1 --- /dev/null +++ b/Tools/SelectionTool/SelectionToolIcon.png.meta @@ -0,0 +1,64 @@ +fileFormatVersion: 2 +guid: 6226464a462df6949a63407a4aed1753 +timeCreated: 1472714033 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 2 + aniso: 3 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 5 + buildTargetSettings: + - buildTarget: Standalone + maxTextureSize: 512 + textureFormat: 2 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: EditorVR + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/MakeCubeToolIcon.png b/Tools/Temp/MakeCubeToolIcon.png new file mode 100644 index 000000000..5ec0317fc --- /dev/null +++ b/Tools/Temp/MakeCubeToolIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b2faf7fd9a724b5351a653f71d8861a5ece438f8349ac8928b1f8efaae8bd90 +size 10771 diff --git a/Tools/Temp/MakeCubeToolIcon.png.meta b/Tools/Temp/MakeCubeToolIcon.png.meta new file mode 100644 index 000000000..9ecc9535b --- /dev/null +++ b/Tools/Temp/MakeCubeToolIcon.png.meta @@ -0,0 +1,64 @@ +fileFormatVersion: 2 +guid: f1cdb8f0b38ef8249b0748264b4db7a4 +timeCreated: 1472714033 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 2 + aniso: 3 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 5 + buildTargetSettings: + - buildTarget: Standalone + maxTextureSize: 512 + textureFormat: 2 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: EditorVR + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/MakeSphereToolIcon.png b/Tools/Temp/MakeSphereToolIcon.png new file mode 100644 index 000000000..70324cf04 --- /dev/null +++ b/Tools/Temp/MakeSphereToolIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fe931d032a22ae880b6da6325eb903c5463624c7b968095bed251b3c628894e +size 14560 diff --git a/Tools/Temp/MakeSphereToolIcon.png.meta b/Tools/Temp/MakeSphereToolIcon.png.meta new file mode 100644 index 000000000..cb1f1ac1f --- /dev/null +++ b/Tools/Temp/MakeSphereToolIcon.png.meta @@ -0,0 +1,64 @@ +fileFormatVersion: 2 +guid: aee6b5d653e81ab4aaab2a359a4e6b4b +timeCreated: 1472714033 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 2 + aniso: 3 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 5 + buildTargetSettings: + - buildTarget: Standalone + maxTextureSize: 512 + textureFormat: 2 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: EditorVR + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/Temp/TempToolIcon.png b/Tools/Temp/TempToolIcon.png new file mode 100644 index 000000000..7c0ba70e1 --- /dev/null +++ b/Tools/Temp/TempToolIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:005868ccd75153f646bfd28e344c705e9cf53a8e12f4b0be3a20ed9d60f50bec +size 13465 diff --git a/Tools/Temp/TempToolIcon.png.meta b/Tools/Temp/TempToolIcon.png.meta new file mode 100644 index 000000000..7b67033c5 --- /dev/null +++ b/Tools/Temp/TempToolIcon.png.meta @@ -0,0 +1,64 @@ +fileFormatVersion: 2 +guid: 1576c75f020bdf04d8e3876527ab767e +timeCreated: 1472714033 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 2 + aniso: 3 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 5 + buildTargetSettings: + - buildTarget: Standalone + maxTextureSize: 512 + textureFormat: 2 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: EditorVR + userData: + assetBundleName: + assetBundleVariant: From 785078cde5e196978cc87d9b7e00e75c3e87471e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 17:42:33 -0700 Subject: [PATCH 157/870] Adjust icon container y position for better framing in PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 59d5fa8a9..5d1eda011 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -419,7 +419,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010351058842} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -0.0012000204, z: 0} + m_LocalPosition: {x: -2.0372681e-10, y: -0.0027, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: From 1679898d0bb14213113e9507e774b7be9ecd0f01 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 17:42:58 -0700 Subject: [PATCH 158/870] Assign icon sprites to relevant tool controllers --- Tools/SelectionTool/SelectionTool.cs.meta | 4 ++-- Tools/Temp/MakeCubeTool.cs.meta | 4 ++-- Tools/Temp/MakeSphereTool.cs.meta | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Tools/SelectionTool/SelectionTool.cs.meta b/Tools/SelectionTool/SelectionTool.cs.meta index 5ce7996a4..2da0979de 100644 --- a/Tools/SelectionTool/SelectionTool.cs.meta +++ b/Tools/SelectionTool/SelectionTool.cs.meta @@ -1,11 +1,11 @@ fileFormatVersion: 2 guid: aab8fcc587f237c4cb48fb7bc8a59909 -timeCreated: 1492056870 +timeCreated: 1492561521 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - - m_Icon: {fileID: 21300000, guid: b19d9dcbe6f40f64c9ae7fec6f0d13c2, type: 3} + - m_Icon: {fileID: 21300000, guid: 6226464a462df6949a63407a4aed1753, type: 3} - m_ActionMap: {fileID: 11400000, guid: 9bdc23bc93bcec343934b99348f0ecf4, type: 2} executionOrder: 0 icon: {instanceID: 0} diff --git a/Tools/Temp/MakeCubeTool.cs.meta b/Tools/Temp/MakeCubeTool.cs.meta index 6ca2d5e7c..1a778c2f6 100644 --- a/Tools/Temp/MakeCubeTool.cs.meta +++ b/Tools/Temp/MakeCubeTool.cs.meta @@ -1,11 +1,11 @@ fileFormatVersion: 2 guid: 27a3d8dde627a4d409b0dace5c1f3d4d -timeCreated: 1492543194 +timeCreated: 1492561820 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - - m_Icon: {fileID: 21300000, guid: 9d5301bda303a4b4bb1fff77569cd5bc, type: 3} + - m_Icon: {fileID: 21300000, guid: f1cdb8f0b38ef8249b0748264b4db7a4, type: 3} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Tools/Temp/MakeSphereTool.cs.meta b/Tools/Temp/MakeSphereTool.cs.meta index 72dc4fe38..4ba2d465e 100644 --- a/Tools/Temp/MakeSphereTool.cs.meta +++ b/Tools/Temp/MakeSphereTool.cs.meta @@ -1,12 +1,11 @@ fileFormatVersion: 2 guid: 6b7e16bac5117eb42925bb96b0937dbc -timeCreated: 1492543195 +timeCreated: 1492561816 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} - - m_Icon: {fileID: 21300000, guid: b63a9c85c7c044f44843bbf507c72b18, type: 3} + - m_Icon: {fileID: 21300000, guid: aee6b5d653e81ab4aaab2a359a4e6b4b, type: 3} executionOrder: 0 icon: {instanceID: 0} userData: From 2a9ef6d9cb424393eee598665cba14fe34f2e7f2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 18:34:12 -0700 Subject: [PATCH 159/870] Set correct material on PinnedToolActionButton contents --- Prefabs/UI/PinnedToolButton.prefab | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 5d1eda011..41c69e273 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -41,7 +41,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000010351058842 GameObject: m_ObjectHideFlags: 1 @@ -828,7 +828,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -862,7 +862,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -1374,10 +1374,10 @@ RectTransform: - {fileID: 224000013910327088} m_Father: {fileID: 224000012760332454} m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0.017025, y: -0.03575} + m_SizeDelta: {x: 0.03405, y: 0.0715} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012760332454 RectTransform: @@ -1508,10 +1508,10 @@ RectTransform: - {fileID: 224000010555036514} m_Father: {fileID: 224000012760332454} m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0.051074997, y: -0.03575} + m_SizeDelta: {x: 0.03405, y: 0.0715} m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000010875730614 CanvasGroup: From 7aacf989b65573fd8888a63acd0907466a91236d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 18:34:57 -0700 Subject: [PATCH 160/870] Set larger initial scale of PinnedToolButton icons when creating new buttons --- Scripts/UI/PinnedToolButton.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index aeddd927d..255cb7de2 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -24,6 +24,7 @@ public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, IToolt const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; const string k_MainMenuTipText = "Main Menu (cannot be closed)"; readonly Vector3 k_ToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); + readonly Vector3 k_SemiTransparentIconContainerScale = new Vector3(1.375f, 1.375f, 1f); public Type toolType { @@ -55,6 +56,7 @@ public Type toolType activeTool = true; m_GradientButton.visible = true; + m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; @@ -531,14 +533,14 @@ IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) duration += Time.unscaledDeltaTime * 3f; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); m_IconContainerCanvasGroup.alpha = Mathf.Lerp(0f, 1f, durationShaped); - m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, Vector3.one, durationShaped * 2f); + m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, k_SemiTransparentIconContainerScale, durationShaped * 2f); transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); transform.localScale = Vector3.Lerp(Vector3.zero, targetScale, durationShaped); yield return null; } m_IconContainerCanvasGroup.alpha = 1f; - m_IconContainer.localScale = Vector3.one; + m_IconContainer.localScale = k_SemiTransparentIconContainerScale; transform.localPosition = targetPosition; transform.localScale = targetScale; m_RootCollider.enabled = true; @@ -610,7 +612,7 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) var currentInsetMaskScale = m_InsetMask.localScale; var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; var currentIconScale = m_IconContainer.localScale; - var targetIconScale = makeSemiTransparent ? Vector3.one * 1.375f : Vector3.one; + var targetIconContainerScale = makeSemiTransparent ? k_SemiTransparentIconContainerScale : Vector3.one; var speedMultiplier = makeSemiTransparent ? 4f : 6.5f; // Slower transparent fade; faster opaque fade while (transitionAmount < 1) { @@ -620,9 +622,9 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); - m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount)); + m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconScale, shapedAmount); + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); CorrectIconRotation(); yield return null; } @@ -632,7 +634,7 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) m_Inset.localScale = targetInsetScale; m_InsetMask.localScale = targetInsetMaskScale; m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - m_IconContainer.localScale = targetIconScale; + m_IconContainer.localScale = targetIconContainerScale; } IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) From c01af5523a96c149175528b5bf8efc7072fe1a0e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 19:01:41 -0700 Subject: [PATCH 161/870] Set shader that allows UI coloring in PinnedToolButtonUIContent material --- Prefabs/UI/Materials/PinnedToolButtonUIContent.mat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat b/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat index f9bb7abd2..7e37682e3 100644 --- a/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat +++ b/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat @@ -7,7 +7,7 @@ Material: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: PinnedToolButtonUIContent - m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 10760, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _ALPHABLEND_ON _EMISSION m_LightmapFlags: 1 m_CustomRenderQueue: 9503 From 24e31dba4a90da40456f72be7ff29436a7b2804a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 19:02:27 -0700 Subject: [PATCH 162/870] Refine positions and set new materials on PinnedToolButton prefab contents --- Prefabs/UI/PinnedToolButton.prefab | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 41c69e273..3c6a5d308 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -41,7 +41,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!1 &1000010351058842 GameObject: m_ObjectHideFlags: 1 @@ -828,7 +828,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -862,7 +862,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_RunInEditMode: 0 - m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -1365,7 +1365,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013126942410} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.0018000894} + m_LocalPosition: {x: 0, y: 0, z: 0.001} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: @@ -1374,10 +1374,10 @@ RectTransform: - {fileID: 224000013910327088} m_Father: {fileID: 224000012760332454} m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0.017025, y: -0.03575} - m_SizeDelta: {x: 0.03405, y: 0.0715} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012760332454 RectTransform: @@ -1386,7 +1386,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013929112766} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.0030208803} + m_LocalPosition: {x: 0, y: 0, z: -0.003020957} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: @@ -1499,7 +1499,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013979951132} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.0018000002} + m_LocalPosition: {x: 0, y: 0, z: 0.001} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: @@ -1508,10 +1508,10 @@ RectTransform: - {fileID: 224000010555036514} m_Father: {fileID: 224000012760332454} m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0.051074997, y: -0.03575} - m_SizeDelta: {x: 0.03405, y: 0.0715} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000010875730614 CanvasGroup: @@ -1531,7 +1531,7 @@ CanvasGroup: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013126942410} m_Enabled: 1 - m_Alpha: 0 + m_Alpha: 1 m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 @@ -1542,7 +1542,7 @@ CanvasGroup: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013979951132} m_Enabled: 1 - m_Alpha: 0 + m_Alpha: 1 m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 From 854af1a1fe1205a1d641c7980f0c7c34f3b5e26e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 19:33:59 -0700 Subject: [PATCH 163/870] Setup mask sprite for PinnedToolActionButtons --- Prefabs/UI/PinnedToolButton.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 3c6a5d308..640eac106 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -925,7 +925,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 15545907e08dab74692cb3d226382ced, type: 3} + m_Sprite: {fileID: 0} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 From a9227e66e93a91230046fbd705007c5ac2a4c747 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 21:17:55 -0700 Subject: [PATCH 164/870] Remove previous PinnedToolsbuttons module implementation in EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index a1bfdc940..3d484abc1 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -202,8 +202,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) var result = false; var deviceInputModule = evr.GetModule(); - var pinnedTools = evr.GetNestedModule();// m_PinnedToolButtons; // TODO: Convert to module fetch - Debug.LogError("Convert pinnedTools to new GetModule method"); + var pinnedTools = evr.GetNestedModule(); Rays.ForEachProxyDevice(deviceData => { if (deviceData.rayOrigin == rayOrigin) From 5b316039b2f1da9bd00ea260655be9c35614ceef Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 21:19:08 -0700 Subject: [PATCH 165/870] Add transition container contents animation speed modifier property to GradientButton --- Scripts/UI/GradientButton.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 56f3cb0d3..855bb94b5 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -182,6 +182,7 @@ public Sprite icon Vector3 m_IconPressedLocalPosition; Sprite m_OriginalIconSprite; Vector3 m_OriginalLocalScale; + float m_ContainerContentsAnimationSpeedMultiplier = 1f; // The initial button reveal coroutines, before highlighting occurs Coroutine m_VisibilityCoroutine; @@ -193,6 +194,8 @@ public Sprite icon public bool invertHighlightScale { private get; set; } + public float containerContentsAnimationSpeedMultiplier { set { m_ContainerContentsAnimationSpeedMultiplier = value; }} + void Awake() { m_OriginalIconSprite = m_Icon.sprite; @@ -412,7 +415,7 @@ IEnumerator IconContainerContentsBeginHighlight(bool pressed = false) var transitionAddMultiplier = !pressed ? 2 : 5; // Faster transition in for highlight; slower for pressed highlight while (transitionAmount < 1) { - transitionAmount += Time.unscaledDeltaTime * transitionAddMultiplier; + transitionAmount += Time.unscaledDeltaTime * transitionAddMultiplier * m_ContainerContentsAnimationSpeedMultiplier; foreach (var graphic in m_HighlightItems) { From 6b2e8cd617c40f695143ab3bbf245400e7150e51 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 21:20:45 -0700 Subject: [PATCH 166/870] Prevent active PinnedToolButton from becoming semi transparent on HoverExit (staying opaque to denote that the tool is active) --- Scripts/UI/PinnedToolButton.cs | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 255cb7de2..74c42cc7c 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -54,7 +54,7 @@ public Type toolType gradientPair = UnityBrandColorScheme.GetRandomGradient(); } - activeTool = true; + activeTool = activeTool; m_GradientButton.visible = true; m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); @@ -94,7 +94,7 @@ public int order var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newTargetRotation)); - //transform.localRotation = newLocalRotation; + this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); } } @@ -126,7 +126,7 @@ public Type previewToolType if (m_previewToolType != null) // Show the highlight if the preview type is valid; hide otherwise { // Show the grayscale highlight when previewing a tool on this button - m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; + //m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); tooltipText = "Assign " + m_previewToolType.Name; customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; @@ -134,7 +134,7 @@ public Type previewToolType } else { - activeTool = activeTool; + activeTool = activeTool; // Set active tool back to pre-preview state icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button customToolTipHighlightColor = gradientPair; this.HideTooltip(this); @@ -257,9 +257,12 @@ bool activeTool get { return m_Order == activeToolOrderPosition; } set { - m_GradientButton.normalGradientPair = value ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.highlightGradientPair = value ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; - m_GradientButton.invertHighlightScale = value; + m_GradientButton.normalGradientPair = gradientPair; + m_GradientButton.highlightGradientPair = gradientPair; + + if (activeTool) // TODO REMOVE IF NOT NEEDED + m_GradientButton.invertHighlightScale = value; + m_GradientButton.highlighted = true; m_GradientButton.highlighted = false; } @@ -274,6 +277,7 @@ public bool highlighted m_Highlighted = value; //Debug.LogError(Time.frameCount + " : Highlighting : " + toolType); + this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value)); } @@ -323,6 +327,9 @@ void Awake() s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); m_IconMaterial = MaterialUtils.GetMaterialClone(m_ButtonIcon); + + m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); + //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); } void Start() @@ -350,12 +357,10 @@ void Start() m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); this.ConnectInterfaces(m_SmoothMotion); - m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); - //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions m_GradientButton.hoverExit += OnActionButtonHoverExit; m_GradientButton.click += OnBackgroundButtonClick; + m_GradientButton.containerContentsAnimationSpeedMultiplier = 2.5f; m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; m_LeftPinnedToolActionButton.hoverEnter = HoverButton; @@ -595,6 +600,9 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) //if (!makeSemiTransparent) //yield return new WaitForSeconds(1f); // Pause before making opaque + if (makeSemiTransparent && activeTool) + yield break; + //Debug.LogWarning("AnimateSemiTransparent : " + makeSemiTransparent); //const float kFasterMotionMultiplier = 2f; var transitionAmount = 0f; @@ -635,6 +643,9 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) m_InsetMask.localScale = targetInsetMaskScale; m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); m_IconContainer.localScale = targetIconContainerScale; + + //if (makeSemiTransparent) + //activeTool = activeTool; } IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) From b9e3736aa193fe4762aa5d441f71827ef218ea5b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 22:00:04 -0700 Subject: [PATCH 167/870] Add display of ToolTips below PinnedToolButtons --- Scripts/UI/PinnedToolButton.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 74c42cc7c..5829f5264 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -350,8 +350,8 @@ void Start() //transform.localPosition = activePosition; } - var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, 0); - var tooltipXOffset = node == Node.LeftHand ? -0.05f : 0.05f; + var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); + var tooltipXOffset = node == Node.LeftHand ? -0.15f : 0.15f; tooltipSource.localPosition = tooltipSourcePosition; tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); @@ -687,7 +687,7 @@ void CorrectIconRotation() m_TooltipTarget.localEulerAngles = new Vector3(90f, 0f, angle); var yaw = transform.localRotation.eulerAngles.y; - tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; + //tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; } } } From e6cd68864c78f1d6ef2aebc1ba8c3e968db3691f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 22:10:43 -0700 Subject: [PATCH 168/870] Set PinnedToolButton icons back to original size after previewing a different tool type on the button --- Scripts/UI/PinnedToolButton.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 5829f5264..17b83c44b 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -128,20 +128,21 @@ public Type previewToolType // Show the grayscale highlight when previewing a tool on this button //m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); - tooltipText = "Assign " + m_previewToolType.Name; - customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; - this.ShowTooltip(this); + //tooltipText = "Assign " + m_previewToolType.Name; + //customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; + //this.ShowTooltip(this); } else { activeTool = activeTool; // Set active tool back to pre-preview state icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button - customToolTipHighlightColor = gradientPair; - this.HideTooltip(this); - tooltipText = (isSelectionTool || isMainMenu) ? (isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText) : toolType.Name; + //customToolTipHighlightColor = gradientPair; + //this.HideTooltip(this); + //tooltipText = (isSelectionTool || isMainMenu) ? (isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText) : toolType.Name; } m_GradientButton.highlighted = m_previewToolType != null; + this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); } } From 053ecfb25d141b88b16638e97e0299a5f67e6362 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Apr 2017 22:11:19 -0700 Subject: [PATCH 169/870] Center select and delete button sprites on their corresponding PinnedToolActionButton backgrounds --- Prefabs/UI/PinnedToolButton.prefab | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 640eac106..39f3687ee 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -41,7 +41,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000010351058842 GameObject: m_ObjectHideFlags: 1 @@ -1319,7 +1319,7 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.00236129, y: -0.0002999992} + m_AnchoredPosition: {x: 0, y: -0.0002999992} m_SizeDelta: {x: 0.0413, y: 0.0413} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011060550722 @@ -1374,10 +1374,10 @@ RectTransform: - {fileID: 224000013910327088} m_Father: {fileID: 224000012760332454} m_RootOrder: 0 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0.017025, y: -0.03575} + m_SizeDelta: {x: 0.03405, y: 0.0715} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012760332454 RectTransform: @@ -1435,7 +1435,7 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.0023612897, y: -0.0002999992} + m_AnchoredPosition: {x: 0, y: -0.0002999992} m_SizeDelta: {x: 0.0413, y: 0.0413} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013910327088 @@ -1508,10 +1508,10 @@ RectTransform: - {fileID: 224000010555036514} m_Father: {fileID: 224000012760332454} m_RootOrder: 1 - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0.051074997, y: -0.03575} + m_SizeDelta: {x: 0.03405, y: 0.0715} m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000010875730614 CanvasGroup: From 9c0e262fa51a0e808a81a6e783e9afb3262ed604 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Apr 2017 17:43:29 -0700 Subject: [PATCH 170/870] Add ability to enable device highlight pulsing via an optional param; proxy devices will now retain their highlight border after selecting a tool --- Scripts/Interfaces/IProxy.cs | 2 +- Scripts/Proxies/TwoHandedProxyBase.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/Interfaces/IProxy.cs b/Scripts/Interfaces/IProxy.cs index 80695ab66..2a9564b9c 100644 --- a/Scripts/Interfaces/IProxy.cs +++ b/Scripts/Interfaces/IProxy.cs @@ -93,7 +93,7 @@ Dictionary fieldGrabOrigins /// Node = device node on which to display the highlight /// GradientPair = gradientPair used in the highlight visuals /// - void HighlightDevice (Node node, GradientPair gradientPair); + void HighlightDevice (Node node, GradientPair gradientPair, bool pulseOnThenOff = false); } } #endif diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs b/Scripts/Proxies/TwoHandedProxyBase.cs index 0bb13f09f..0e281ef98 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs +++ b/Scripts/Proxies/TwoHandedProxyBase.cs @@ -244,7 +244,7 @@ void AssignDeviceHighlightMaterials(Node node, List deviceRenderers, M } } - public void HighlightDevice (Node deviceNode, GradientPair gradientPair) + public void HighlightDevice (Node deviceNode, GradientPair gradientPair, bool pulseOnThenOff = false) { if (m_HighlightMaterials == null) return; @@ -270,7 +270,7 @@ public void HighlightDevice (Node deviceNode, GradientPair gradientPair) this.RestartCoroutine(ref m_HighlightCoroutine, ShowHighlight(deviceMaterial, gradientPair)); } - IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair) + IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair, bool pulseOnThenOff = false) { // IF the highlight is already running, lerp the gradientPair color to the new target colors // If the highlight is not already running, just set the gradientPair colors, then lerp in alpha @@ -314,7 +314,7 @@ IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair) yield return null; } - while (duration > 0) + while (pulseOnThenOff && duration > 0) { duration -= Time.unscaledDeltaTime * 0.5f; var durationShaped = Mathf.Pow(duration, 2); @@ -323,7 +323,7 @@ IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair) } //deviceMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - deviceMaterial.SetFloat(k_MaterialThicknessProperty, 0f); + deviceMaterial.SetFloat(k_MaterialThicknessProperty, pulseOnThenOff ? 0f : k_TargetHighlightThicknessAmount); m_HighlightCoroutine = null; } From 2f8486794ea8f848ed8ab52e86ddc7697d4fa50d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 19 Apr 2017 18:15:17 -0700 Subject: [PATCH 171/870] Add a distance check to only hide menus when they are close to UI --- Menus/MainMenu/MainMenu.cs | 2 + Menus/MainMenu/Scripts/MainMenuUI.cs | 7 +- Menus/RadialMenu/RadialMenu.cs | 2 + Scripts/Core/EditorVR.Menus.cs | 138 +++--------------- Scripts/Core/EditorVR.cs | 2 +- Scripts/Interfaces/ILinkedObject.cs | 2 +- Scripts/Interfaces/IMenu.cs | 2 + .../MultipleRayInputModule.cs | 4 + .../CreatePrimitiveMenu.cs | 2 + 9 files changed, 43 insertions(+), 118 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index ee2604c34..643721478 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -74,6 +74,8 @@ public bool visible public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } + public float hideDistance { get { return m_MainMenuUI.menuHeight; } } + void Start() { m_MainMenuUI = this.InstantiateUI(m_MainMenuPrefab.gameObject).GetComponent(); diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 1f1b765a8..b142fae19 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -88,7 +88,7 @@ public int targetFaceIndex Coroutine m_VisibilityCoroutine; Coroutine m_FrameRevealCoroutine; int m_Direction; - GradientPair m_GradientPair; + float m_MenuHeight; Transform[] m_MenuFaceContentTransforms; Vector3[] m_MenuFaceContentOriginalLocalPositions; @@ -156,6 +156,8 @@ public bool visible } } + public float menuHeight { get { return m_MenuHeight; } } + int currentFaceIndex { get @@ -203,6 +205,9 @@ public void Setup() m_MenuFaceContentOriginalLocalScale = m_MenuFaceContentTransforms[0].localScale; m_MenuFaceContentHiddenLocalScale = new Vector3(0f, m_MenuFaceContentOriginalLocalScale.y * 0.5f, m_MenuFaceContentOriginalLocalScale.z); + var bounds = ObjectUtils.GetBounds(gameObject); + m_MenuHeight = bounds.size.y; + transform.localScale = Vector3.zero; m_AlternateMenu.localScale = Vector3.zero; } diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index a3b27090d..3404ff0b2 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -69,6 +69,8 @@ public bool visible public GameObject menuContent { get { return m_RadialMenuUI.gameObject; } } + public float hideDistance {get { return Mathf.Infinity; } } + void Start() { m_RadialMenuUI = this.InstantiateUI(m_RadialMenuPrefab.gameObject).GetComponent(); diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index b23a5ec81..c70445c20 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; @@ -26,15 +27,15 @@ class Menus : Nested, IInterfaceConnector, ILateBindInterfaceMethods internal enum MenuHideFlags { Hidden = 1 << 0, - OverUI = 1 << 1, - NearWorkspace = 1 << 2, + OverUI = 1 << 1 } + const float k_MenuHideMargin = 0.1f; + readonly Dictionary m_SettingsMenuProviders = new Dictionary(); List m_MainMenuTools; // Local method use only -- created here to reduce garbage collection - readonly List m_UpdateVisibilityMenus = new List(); readonly List m_ActiveDeviceData = new List(); public Menus() @@ -69,105 +70,6 @@ public void LateBindInterfaceMethods(Tools provider) m_MainMenuTools = provider.allTools.Where(t => !Tools.IsDefaultTool(t)).ToList(); // Don't show tools that can't be selected/toggled } - internal void UpdateMenuVisibilityNearWorkspaces() - { - var workspaces = evr.GetModule().workspaces; - Rays.ForEachProxyDevice(deviceData => - { - m_UpdateVisibilityMenus.Clear(); - m_UpdateVisibilityMenus.AddRange(deviceData.menuHideFlags.Keys); - for (int i = 0; i < m_UpdateVisibilityMenus.Count; i++) - { - var menu = m_UpdateVisibilityMenus[i]; - var menuSizes = deviceData.menuSizes; - var menuBounds = ObjectUtils.GetBounds(menu.menuContent); - var menuBoundsSize = menuBounds.size; - float size; // Because menus can change size, store the maximum size to avoid ping ponging visibility - if (!menuSizes.TryGetValue(menu, out size)) - { - size = menuBoundsSize.AveragedComponents(); - menuSizes[menu] = size; - } - - var menuHideFlags = deviceData.menuHideFlags; - var flags = menuHideFlags[menu]; - var currentMaxComponent = menuBoundsSize.AveragedComponents(); - if (currentMaxComponent > size && flags == 0) - { - size = currentMaxComponent; - menuSizes[menu] = currentMaxComponent; - } - - var intersection = false; - for (int j = 0; j < workspaces.Count; j++) - { - var workspace = workspaces[j]; - var workspaceTransform = workspace.transform; - var outerBounds = workspaceTransform.TransformBounds(workspace.outerBounds); - var workspaceVerticalOrentationDot = Vector3.Dot(Vector3.up, workspaceTransform.forward); - const float kWorkspaceVerticalOrientationDotThreshold = 0.85f; - const float kWorkspaceVerticalOrientationDotRange = 1f - kWorkspaceVerticalOrientationDotThreshold; - if (workspaceVerticalOrentationDot > kWorkspaceVerticalOrientationDotThreshold) - { - // Increase the height of the workspace if the top-panel is rotated parallel to the Y-axis - // Extend the height of the workspace, to include potential front-panel blendshape bounds additions not accounted for in the bounds for better UX usability - var lerpAmount = Mathf.Abs(kWorkspaceVerticalOrientationDotThreshold - workspaceVerticalOrentationDot) / kWorkspaceVerticalOrientationDotRange; - var currentBounds = outerBounds.extents; - const float kBoundsHeightIncrease = 0.075f; - currentBounds.y += Mathf.Lerp(0f, kBoundsHeightIncrease, lerpAmount); - outerBounds.extents = currentBounds; - } - - if (flags == 0) - { - var extentsReduction = menu is IMainMenu ? 0.85f : 0.65f; - outerBounds.extents -= Vector3.one * size * extentsReduction; - } - - if (menuBounds.Intersects(outerBounds)) - { - var standardWorkspace = workspace as Workspace; - var rayOrigin = deviceData.rayOrigin; - var deviceForwardVector = rayOrigin.forward; - var workspaceTopFaceForwardVector = workspaceTransform.up; - if (standardWorkspace) - { - var frontPanelTransform = standardWorkspace.frontPanel; - var frontPanelForwardVector = frontPanelTransform.forward; - var topPanelPosition = standardWorkspace.topPanel.position; - var devicePositionTopPanelDot = Vector3.Dot(workspaceTopFaceForwardVector, topPanelPosition - rayOrigin.position); - if (devicePositionTopPanelDot > -0.02f && devicePositionTopPanelDot < 0.095f // Verify that the device is within the front-panel's top & bottom boundaries - && Vector3.Dot(frontPanelForwardVector, workspaceTopFaceForwardVector) > -0.7f // Verify the front-panel is not parallel with the workspace top-panel - && Vector3.Dot(frontPanelForwardVector, frontPanelTransform.position - rayOrigin.position) > 0 // Verify that the device is in front of the front-panel - && Vector3.Dot(frontPanelForwardVector, deviceForwardVector) > 0.75f) // Verify that the device is pointing towards the front-panel - { - // If the device is in front of the front-panel, pointing at the front-panel, and the front-panel is not parallel to the top-panel, allow for valid intersection - intersection = true; - } - - // Handle for top-panel user interactions if the user is not attempting to interact with the front-face of a standard workspace - else if (Vector3.Dot(deviceForwardVector, workspaceTopFaceForwardVector) < -0.35f // verify that the user is pointing at the top of the workspace - && Vector3.Dot(workspaceTopFaceForwardVector, topPanelPosition - rayOrigin.position) < 0) // Verify that the device is in front of the top-panel) - { - // Hide the menu if the device is above the top of the workspace, within the intersection range, and pointing towards the workspace - intersection = true; - } - } - - // Support non-standard workspace menu hiding - else if (Vector3.Dot(deviceForwardVector, workspaceTopFaceForwardVector) < -0.35f) - intersection = true; - - if (intersection) - break; - } - } - - menuHideFlags[menu] = intersection ? flags | MenuHideFlags.NearWorkspace : flags & ~MenuHideFlags.NearWorkspace; - } - }); - } - static void UpdateAlternateMenuForDevice(DeviceData deviceData) { var alternateMenu = deviceData.alternateMenu; @@ -242,31 +144,37 @@ internal void UpdateMenuVisibilities() internal static void OnUIHoverStarted(GameObject go, RayEventData rayEventData) { - if (go.GetComponentInParent() != null || go == evr.gameObject) - return; + OnHover(go, rayEventData, false); + } - var rayOrigin = rayEventData.rayOrigin; - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); - if (deviceData != null) - { - var menus = new List(deviceData.menuHideFlags.Keys); - foreach (var menu in menus) - { - deviceData.menuHideFlags[menu] |= MenuHideFlags.OverUI; - } - } + internal static void OnUIHovering(GameObject go, RayEventData rayEventData) + { + OnHover(go, rayEventData, false); } internal static void OnUIHoverEnded(GameObject go, RayEventData rayEventData) { + OnHover(go, rayEventData, true); + } + + static void OnHover(GameObject go, RayEventData rayEventData, bool ended) + { + if (go == evr.gameObject) + return; + var rayOrigin = rayEventData.rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) { + var scaledPointerDistance = rayEventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); + var isManipulator = go.GetComponentInParent() != null; var menus = new List(deviceData.menuHideFlags.Keys); foreach (var menu in menus) { - deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverUI; + if (ended || isManipulator || scaledPointerDistance > menu.hideDistance + k_MenuHideMargin) + deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverUI; + else + deviceData.menuHideFlags[menu] |= MenuHideFlags.OverUI; } } } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index f047d0599..56dc4137a 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -123,6 +123,7 @@ void Awake() var multipleRayInputModule = GetModule(); multipleRayInputModule.rayEntered += Menus.OnUIHoverStarted; + multipleRayInputModule.rayHovering += Menus.OnUIHovering; multipleRayInputModule.rayExited += Menus.OnUIHoverEnded; var dragAndDropModule = AddModule(); @@ -310,7 +311,6 @@ void Update() GetModule().ProcessInput(); var menus = GetNestedModule(); - menus.UpdateMenuVisibilityNearWorkspaces(); menus.UpdateMenuVisibilities(); GetNestedModule().UpdateManipulatorVisibilites(); diff --git a/Scripts/Interfaces/ILinkedObject.cs b/Scripts/Interfaces/ILinkedObject.cs index 96ee4e8c8..3f1950717 100644 --- a/Scripts/Interfaces/ILinkedObject.cs +++ b/Scripts/Interfaces/ILinkedObject.cs @@ -20,7 +20,7 @@ public static class ILinkedObjectMethods internal static Func isSharedUpdater { get; set; } /// - /// Returns whether the specified ray origin is hovering over a UI element + /// Returns whether the current object is designated to do updates for all linked objects /// /// Object among the linked objects to check if it is the central one public static bool IsSharedUpdater(this ILinkedObject obj, ILinkedObject linkedObject) diff --git a/Scripts/Interfaces/IMenu.cs b/Scripts/Interfaces/IMenu.cs index 4bff07f5e..07b9e2c44 100644 --- a/Scripts/Interfaces/IMenu.cs +++ b/Scripts/Interfaces/IMenu.cs @@ -22,6 +22,8 @@ public interface IMenu /// Root GameObject for visible menu content /// GameObject menuContent { get; } + + float hideDistance { get; } } } #endif diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index 850a923ea..58e85ae96 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -50,6 +50,7 @@ public RaycastSource(IProxy proxy, Transform rayOrigin, Node node, UIActions act private ActionMap m_UIActionMap; public event Action rayEntered; + public event Action rayHovering; public event Action rayExited; public event Action dragStarted; public event Action dragEnded; @@ -260,6 +261,9 @@ void HandlePointerExitAndEnter(RayEventData eventData, GameObject newEnterTarget while (t != null) { ExecuteEvents.Execute(t.gameObject, cachedEventData, ExecuteRayEvents.rayHoverHandler); + if (rayHovering != null) + rayHovering(t.gameObject, cachedEventData); + t = t.parent; } return; diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs index 9394337bb..90c090e4d 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs @@ -12,6 +12,8 @@ sealed class CreatePrimitiveMenu : MonoBehaviour, IMenu public Action selectPrimitive; public Action close; + public float hideDistance {get { return Mathf.Infinity; } } + public bool visible { get { return gameObject.activeSelf; } From 5e4f421d57f58b121f0a52fba08cd8d3f9e85ca7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 20 Apr 2017 15:11:50 -0700 Subject: [PATCH 172/870] Add new CreatePrimitiveTool icon sprite --- .../CreatePrimitiveToolIcon.png | 3 + .../CreatePrimitiveToolIcon.png.meta | 64 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 Tools/CreatePrimitiveTool/CreatePrimitiveToolIcon.png create mode 100644 Tools/CreatePrimitiveTool/CreatePrimitiveToolIcon.png.meta diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveToolIcon.png b/Tools/CreatePrimitiveTool/CreatePrimitiveToolIcon.png new file mode 100644 index 000000000..d635b2771 --- /dev/null +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveToolIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccb69972fde2dcf2dd2b9be2dc7d8ec6c55088dcc52243b4a3743ca539bb93bd +size 5770 diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveToolIcon.png.meta b/Tools/CreatePrimitiveTool/CreatePrimitiveToolIcon.png.meta new file mode 100644 index 000000000..df1fac69b --- /dev/null +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveToolIcon.png.meta @@ -0,0 +1,64 @@ +fileFormatVersion: 2 +guid: 7f71d318c2ae666478a6e3a737d6d1ac +timeCreated: 1472714033 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 2 + aniso: 3 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 5 + buildTargetSettings: + - buildTarget: Standalone + maxTextureSize: 512 + textureFormat: 2 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: EditorVR + userData: + assetBundleName: + assetBundleVariant: From 6c5091cfd697e7612f05ba960d22143a8a01cb20 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 20 Apr 2017 15:12:31 -0700 Subject: [PATCH 173/870] Add IMenuIcon support to CreatePrimitiveTool; assign new icon sprite in inspector --- Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs | 7 ++++++- Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs.meta | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index 2c4ab961e..12a39b043 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -7,11 +7,14 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Primitive", "Create", "Create primitives in the scene")] sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, IConnectInterfaces, IInstantiateMenuUI, - IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool + IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, IMenuIcon { [SerializeField] CreatePrimitiveMenu m_MenuPrefab; + [SerializeField] + Sprite m_Icon; + const float k_DrawDistance = 0.075f; GameObject m_ToolMenu; @@ -28,6 +31,8 @@ sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, ICo public Transform rayOrigin { get; set; } + public Sprite icon { get { return m_Icon; } } + enum PrimitiveCreationStates { StartPoint, diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs.meta b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs.meta index b534d814f..405d9950d 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs.meta +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs.meta @@ -1,12 +1,13 @@ fileFormatVersion: 2 guid: a88637e6fe98dcd4da6c6238d3cfc5a4 -timeCreated: 1478782654 +timeCreated: 1492726047 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - m_MenuPrefab: {fileID: 114000010621161446, guid: 86d6b2e01d02faf42be52ce94b33817b, type: 2} + - m_Icon: {fileID: 21300000, guid: 7f71d318c2ae666478a6e3a737d6d1ac, type: 3} executionOrder: 0 icon: {instanceID: 0} userData: From beb78db15b0e4f8041d162911a5ca1a3eec603f3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 10:49:59 -0700 Subject: [PATCH 174/870] Enable device tool-gradient highlight/visuals only for the currently active tool; preview new tool icon/text in the active tool button, and not the main menu button; increase max pinned tool button count --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index f41e9136d..df421e288 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -83,7 +83,7 @@ internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform r { Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); activeToolType = activeToolType == typeof(IMainMenu) ? typeof(SelectionTool) : activeToolType; // Assign SelectionTool if setting up for IMainMenu - const int kMaxButtonCount = 6; + const int kMaxButtonCount = 16; var buttons = deviceData.pinnedToolButtons; var inactiveButtonInitialOrderPosition = -1; var buttonCount = buttons.Count; // Position buttons relative to count @@ -112,7 +112,7 @@ internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform r Debug.LogWarning("Setting up button : " + button.toolType + " - ORDER : " + button.order); } - if (button.order == 0) + if (button.order == button.activeToolOrderPosition) deviceData.proxy.HighlightDevice(deviceData.node, button.gradientPair); // Perform the higlight on the node with the button's gradient pair } } @@ -169,7 +169,7 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T foreach (var pair in pinnedToolButtons) { var button = pair.Value; - if (button.order == 0) + if (button.order == button.activeToolOrderPosition) { pinnedToolButton = button; pinnedToolButton.previewToolType = toolType; From ab87a7eb0b6b22a6e9ee093a11df8c238246f626 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 11:03:28 -0700 Subject: [PATCH 175/870] Disable functionality enabling/disabling main/parent PinnedToolButton collider; no longer needed due to change in visuals + button layout --- Scripts/UI/PinnedToolActionButton.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs index ed43a329f..dce503c16 100644 --- a/Scripts/UI/PinnedToolActionButton.cs +++ b/Scripts/UI/PinnedToolActionButton.cs @@ -201,7 +201,7 @@ public bool rotateIcon public Action clicked { get; set; } public Action hoverEnter { get; set; } public Action hoverExit { get; set; } - public Collider mainButtonCollider { get; set; } + //public Collider mainButtonCollider { get; set; } void Awake() { @@ -229,7 +229,7 @@ void OnDisable() //m_ContentContainer.gameObject.SetActive(false); //} - mainButtonCollider.enabled = true; + //mainButtonCollider.enabled = true; } /// @@ -237,7 +237,7 @@ void OnDisable() /// IEnumerator AnimateShow() { - mainButtonCollider.enabled = false; + //mainButtonCollider.enabled = false; const float kTargetTransitionAmount = 1f; var transitionAmount = Time.unscaledDeltaTime; From 8b4f2104a538ca8e1dc56579f05b7264809556df Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 11:10:14 -0700 Subject: [PATCH 176/870] Add support for displaying a Tool's icon in a PinnedToolButton during preview mode; allowing now for the icon or the text abbreviation to be displayed --- Scripts/UI/PinnedToolButton.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 17b83c44b..a5da86e0e 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -125,9 +125,24 @@ public Type previewToolType if (m_previewToolType != null) // Show the highlight if the preview type is valid; hide otherwise { + var tempToolGo = ObjectUtils.AddComponent(m_previewToolType, gameObject); + var tempTool = tempToolGo as ITool; + if (tempTool != null) + { + var iMenuIcon = tempTool as IMenuIcon; + if (iMenuIcon != null) + previewIcon = iMenuIcon.icon; + + ObjectUtils.Destroy(tempToolGo); + } + // Show the grayscale highlight when previewing a tool on this button //m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); + + if (!previewIcon) + m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); + //tooltipText = "Assign " + m_previewToolType.Name; //customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; //this.ShowTooltip(this); @@ -226,6 +241,7 @@ public Transform alternateMenuOrigin Vector3 m_OriginalLocalScale; Material m_IconMaterial; Sprite m_Icon; + Sprite m_PreviewIcon; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -300,6 +316,16 @@ public Sprite icon } } + public Sprite previewIcon + { + get { return m_PreviewIcon; } + set + { + m_PreviewIcon = value; + m_GradientButton.SetContent(m_PreviewIcon); + } + } + public bool moveToAlternatePosition { get { return m_MoveToAlternatePosition; } From 438c7300b599626c8f3c3a882abd65ba48428b13 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 11:59:50 -0700 Subject: [PATCH 177/870] Move visible button positions, as to reveal them animating outwards from the currently active tool button, instead of being centered; move position logic into the AnimatePosition function --- Scripts/UI/PinnedToolButton.cs | 54 ++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index a5da86e0e..7fcc84178 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -89,11 +89,11 @@ public int order // We move in counter-clockwise direction // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered - const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice - const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; - var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newTargetRotation)); + //const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice + //const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time + //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; + //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order, activeButtonCount)); this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); } } @@ -295,7 +295,23 @@ public bool highlighted m_Highlighted = value; //Debug.LogError(Time.frameCount + " : Highlighting : " + toolType); - this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value)); + var newOrderPosition = order; + var buttonCount = 2; // MainMenu + ActiveTool button count + var targetRotation = Quaternion.identity; + if (m_Highlighted) + { + buttonCount = activeButtonCount; + order = order; + } + else + { + // Set all buttons back to the center + // Tools with orders greater than that of the active tool should hide themseleves when the pinned tools arent being hovered + newOrderPosition = isMainMenu ? 0 : 1; + } + + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newOrderPosition, buttonCount)); + this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value && order < 1)); } //get { return m_Highlighted; } @@ -445,6 +461,9 @@ bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) void OnBackgroundHoverEnter () { + if (m_PositionCoroutine != null) + return; + //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) //{ //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); @@ -524,6 +543,9 @@ void ActionButtonClicked(PinnedToolActionButton button) void OnActionButtonHoverExit() { + if (m_PositionCoroutine != null) + return; + Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons @@ -599,16 +621,27 @@ IEnumerator AnimateHideAndClose() ObjectUtils.Destroy(gameObject, 0.1f); } - IEnumerator AnimatePosition(Quaternion targetRotation) + IEnumerator AnimatePosition(int orderPosition, int buttonCount) { + //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer highlighted + //gameObject.SetActive(true); + + //if (order != activeToolOrderPosition) + //m_RootCollider.enabled = false; + + const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice + const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time + var phaseOffset = kRotationSpacing * 0.5f - (2 * 0.5f) * kRotationSpacing; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + var targetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * orderPosition, Vector3.down); + var duration = 0f; //var currentPosition = transform.localPosition; //var targetPosition = activeTool ? activePosition : m_InactivePosition; var currentRotation = transform.localRotation; - var positionWait = (order + 5) * 0.1f; + var positionWait = 1f;// (order + 5) * 0.1f; while (duration < 1) { - duration += Time.unscaledDeltaTime * 5f * positionWait; + duration += Time.unscaledDeltaTime * 6f * positionWait; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); CorrectIconRotation(); @@ -616,6 +649,9 @@ IEnumerator AnimatePosition(Quaternion targetRotation) yield return null; } + //if (!m_Highlighted && orderPosition == 0 && buttonCount == 1 && !activeTool) // hide a button if it is not the active tool button and the buttons are no longer highlighted + //gameObject.SetActive(false); + //transform.localPosition = targetPosition; transform.localRotation = targetRotation; CorrectIconRotation(); From a1a1da39578bc8019e07f0c57e7a136da560172c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 12:03:59 -0700 Subject: [PATCH 178/870] Clear cached preview icon reference when setting standard PinnedToolButton icon; reverse gradient button highlight color states --- Scripts/UI/PinnedToolButton.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 7fcc84178..32b89d5a5 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -137,8 +137,7 @@ public Type previewToolType } // Show the grayscale highlight when previewing a tool on this button - //m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); + m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; if (!previewIcon) m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); @@ -151,6 +150,7 @@ public Type previewToolType { activeTool = activeTool; // Set active tool back to pre-preview state icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button + m_GradientButton.highlightGradientPair = gradientPair; //customToolTipHighlightColor = gradientPair; //this.HideTooltip(this); //tooltipText = (isSelectionTool || isMainMenu) ? (isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText) : toolType.Name; @@ -274,11 +274,11 @@ bool activeTool get { return m_Order == activeToolOrderPosition; } set { - m_GradientButton.normalGradientPair = gradientPair; - m_GradientButton.highlightGradientPair = gradientPair; + m_GradientButton.normalGradientPair = activeTool ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; + m_GradientButton.highlightGradientPair = activeTool ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; - if (activeTool) // TODO REMOVE IF NOT NEEDED - m_GradientButton.invertHighlightScale = value; + //if (activeTool) // TODO REMOVE IF NOT NEEDED + //m_GradientButton.invertHighlightScale = value; m_GradientButton.highlighted = true; m_GradientButton.highlighted = false; @@ -320,9 +320,9 @@ public bool highlighted public Sprite icon { get { return m_Icon; } - set { + m_PreviewIcon = null; // clear any cached preview icons m_Icon = value; if (m_Icon) From 49e7bf7f5f65ecbd01115b96ef44b977d4d7a8a4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 12:20:56 -0700 Subject: [PATCH 179/870] Disable previous implementation of enabling/disabling PinnedToolButton rootCollider, due to new PinnedToolActionButton visual changes --- Scripts/UI/PinnedToolButton.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 32b89d5a5..3d96ef391 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -194,8 +194,8 @@ public Transform alternateMenuOrigin [SerializeField] CanvasGroup m_IconContainerCanvasGroup; - [SerializeField] - Collider m_RootCollider; + //[SerializeField] + //Collider m_RootCollider; [SerializeField] MeshRenderer m_FrameRenderer; @@ -423,8 +423,8 @@ void Start() m_LeftPinnedToolActionButton.visible = false; m_RightPinnedToolActionButton.visible = false; - m_LeftPinnedToolActionButton.mainButtonCollider = m_RootCollider; - m_RightPinnedToolActionButton.mainButtonCollider = m_RootCollider; + //m_LeftPinnedToolActionButton.mainButtonCollider = m_RootCollider; + //m_RightPinnedToolActionButton.mainButtonCollider = m_RootCollider; //m_ButtonCollider.enabled = true; //m_GradientButton.click += OnClick; @@ -580,7 +580,7 @@ void OnBackgroundButtonClick() IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) { - m_RootCollider.enabled = false; + //m_RootCollider.enabled = false; var duration = 0f; while (duration < 2) { @@ -597,14 +597,14 @@ IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) m_IconContainer.localScale = k_SemiTransparentIconContainerScale; transform.localPosition = targetPosition; transform.localScale = targetScale; - m_RootCollider.enabled = true; + //m_RootCollider.enabled = true; m_VisibilityCoroutine = null; } IEnumerator AnimateHideAndClose() { this.HideTooltip(this); - m_RootCollider.enabled = false; + //m_RootCollider.enabled = false; var duration = 0f; var currentScale = transform.localScale; var targetScale = Vector3.zero; @@ -706,9 +706,6 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) m_InsetMask.localScale = targetInsetMaskScale; m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); m_IconContainer.localScale = targetIconContainerScale; - - //if (makeSemiTransparent) - //activeTool = activeTool; } IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) @@ -736,8 +733,8 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) IEnumerator DelayedCollderEnable() { - yield return null; - m_RootCollider.enabled = true; + yield return new WaitForSeconds(0.5f); + //m_RootCollider.enabled = true; } void CorrectIconRotation() From 04771b73e0d38a8906c33db0ef7cce267339a602 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 17:23:38 -0700 Subject: [PATCH 180/870] Enable GradientButton gameObject if visibility is being set to True, and the button gameObject is currently inactive --- Scripts/UI/GradientButton.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 855bb94b5..70a8332f3 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -94,6 +94,9 @@ public bool visible m_Visible = value; + if (m_Visible && !gameObject.activeSelf) + gameObject.SetActive(true); + this.StopCoroutine(ref m_VisibilityCoroutine); m_VisibilityCoroutine = value ? StartCoroutine(AnimateShow()) : StartCoroutine(AnimateHide()); } From 7910b1c192a52ab36408764556b329d9699e8740 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 17:24:51 -0700 Subject: [PATCH 181/870] Hide MainMenu tool button if hovering over the Active tool button, in order to show the inactive tool buttons; prevent MainMenu tool button hover from showing inactive tool buttons --- Scripts/UI/PinnedToolButton.cs | 77 ++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 27 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 3d96ef391..6a7e60c86 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -93,7 +93,8 @@ public int order //const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order, activeButtonCount)); + var aboluteMenuAndActiveToolButtonPosition = !highlighted || isMainMenu ? 2 : activeButtonCount; + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order, aboluteMenuAndActiveToolButtonPosition)); this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); } } @@ -287,12 +288,21 @@ bool activeTool public bool highlighted { + get { return m_Highlighted; } set { - if (m_Highlighted == value || !gameObject.activeSelf) + if (m_Highlighted == value || !gameObject.activeSelf || activeButtonCount <= k_ActiveToolOrderPosition + 1) return; m_Highlighted = value; + + if (isMainMenu) + { + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor * (value ? 0f : 1f)); + m_GradientButton.visible = !value; + return; + } + //Debug.LogError(Time.frameCount + " : Highlighting : " + toolType); var newOrderPosition = order; @@ -300,7 +310,8 @@ public bool highlighted var targetRotation = Quaternion.identity; if (m_Highlighted) { - buttonCount = activeButtonCount; + buttonCount = activeButtonCount - 1; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + newOrderPosition -= 1; order = order; } else @@ -464,6 +475,12 @@ void OnBackgroundHoverEnter () if (m_PositionCoroutine != null) return; + if (isMainMenu) + { + m_GradientButton.highlighted = true; + return; + } + //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) //{ //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); @@ -512,6 +529,35 @@ void HoverButton() highlightAllToolButtons(rayOrigin, true); } + void OnActionButtonHoverExit() + { + if (m_PositionCoroutine != null) + return; + + if (isMainMenu) + { + m_GradientButton.highlighted = false; + return; + } + + Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); + // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons + + // Hide both action buttons if the user is no longer hovering over the button + if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + { + //Debug.LogWarning("!!!"); + //m_ButtonCollider.enabled = true; + m_LeftPinnedToolActionButton.visible = false; + m_RightPinnedToolActionButton.visible = false; + //m_GradientButton.visible = true; + m_GradientButton.highlighted = false; + highlightAllToolButtons(rayOrigin, false); + } + + m_GradientButton.UpdateMaterialColors(); + } + void ActionButtonClicked(PinnedToolActionButton button) { Debug.LogError("Action Button selectTool!"); @@ -541,29 +587,6 @@ void ActionButtonClicked(PinnedToolActionButton button) } } - void OnActionButtonHoverExit() - { - if (m_PositionCoroutine != null) - return; - - Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); - // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons - - // Hide both action buttons if the user is no longer hovering over the button - if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) - { - //Debug.LogWarning("!!!"); - //m_ButtonCollider.enabled = true; - m_LeftPinnedToolActionButton.visible = false; - m_RightPinnedToolActionButton.visible = false; - //m_GradientButton.visible = true; - m_GradientButton.highlighted = false; - highlightAllToolButtons(rayOrigin, false); - } - - m_GradientButton.UpdateMaterialColors(); - } - void OnBackgroundButtonClick() { Debug.LogWarning("OnBackgroundButtonClick : " + name + " : " + toolType); @@ -631,7 +654,7 @@ IEnumerator AnimatePosition(int orderPosition, int buttonCount) const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = kRotationSpacing * 0.5f - (2 * 0.5f) * kRotationSpacing; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + var phaseOffset = kRotationSpacing * 0.5f - (buttonCount * 0.5f) * kRotationSpacing; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu var targetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * orderPosition, Vector3.down); var duration = 0f; From ee50894982bc20fd8246a3e8bf918bcc87c5f080 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 17:36:44 -0700 Subject: [PATCH 182/870] Simplify MainMenu absolute position logic when setting button order --- Scripts/UI/PinnedToolButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 6a7e60c86..6ac2333e6 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -93,8 +93,8 @@ public int order //const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); - var aboluteMenuAndActiveToolButtonPosition = !highlighted || isMainMenu ? 2 : activeButtonCount; - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order, aboluteMenuAndActiveToolButtonPosition)); + var aboluteMenuButtonCount = isMainMenu ? 2 : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order, aboluteMenuButtonCount)); this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); } } From 4a3ee5dd3ed89015b75f7ef7a5ce8f05c27553fc Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 18:28:11 -0700 Subject: [PATCH 183/870] Remove PinnedToolActionButton functionality in PinnedToolButton; only change highlight states of buttons onClick if the button clicked was not the MainMenu tool button. --- Scripts/UI/PinnedToolButton.cs | 80 ++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 6ac2333e6..420328af0 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -84,8 +84,8 @@ public int order //m_SmoothMotion.SetPositionSmoothing(smoothingFactor); //m_SmoothMotion.SetRotationSmoothing(smoothingFactor); //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); - m_LeftPinnedToolActionButton.visible = false; - m_RightPinnedToolActionButton.visible = false; + //m_LeftPinnedToolActionButton.visible = false; + //m_RightPinnedToolActionButton.visible = false; // We move in counter-clockwise direction // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered @@ -93,9 +93,12 @@ public int order //const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); - var aboluteMenuButtonCount = isMainMenu ? 2 : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton + var mainMenuAndActiveButtonCount = 2; + var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order, aboluteMenuButtonCount)); - this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); + + if (aboluteMenuButtonCount > mainMenuAndActiveButtonCount) + this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); } } @@ -183,11 +186,11 @@ public Transform alternateMenuOrigin [SerializeField] SmoothMotion m_SmoothMotion; - [SerializeField] - PinnedToolActionButton m_LeftPinnedToolActionButton; + //[SerializeField] + //PinnedToolActionButton m_LeftPinnedToolActionButton; - [SerializeField] - PinnedToolActionButton m_RightPinnedToolActionButton; + //[SerializeField] + //PinnedToolActionButton m_RightPinnedToolActionButton; [SerializeField] Transform m_IconContainer; @@ -416,23 +419,23 @@ void Start() m_GradientButton.click += OnBackgroundButtonClick; m_GradientButton.containerContentsAnimationSpeedMultiplier = 2.5f; - m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; - m_LeftPinnedToolActionButton.hoverEnter = HoverButton; - m_LeftPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; - m_RightPinnedToolActionButton.clicked = ActionButtonClicked; - m_RightPinnedToolActionButton.hoverEnter = HoverButton; - m_RightPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; + //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; + //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; + //m_LeftPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; + //m_RightPinnedToolActionButton.clicked = ActionButtonClicked; + //m_RightPinnedToolActionButton.hoverEnter = HoverButton; + //m_RightPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; // Assign the select action button to the side closest to the opposite hand, that allows the arrow to also point in the direction the - var leftHand = node == Node.LeftHand; - m_RightPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.SelectTool : PinnedToolActionButton.ButtonType.Close; - m_LeftPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.Close : PinnedToolActionButton.ButtonType.SelectTool; + //var leftHand = node == Node.LeftHand; + //m_RightPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.SelectTool : PinnedToolActionButton.ButtonType.Close; + //m_LeftPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.Close : PinnedToolActionButton.ButtonType.SelectTool; - m_RightPinnedToolActionButton.rotateIcon = leftHand ? false : true; - m_LeftPinnedToolActionButton.rotateIcon = leftHand ? false : true; + //m_RightPinnedToolActionButton.rotateIcon = leftHand ? false : true; + //m_LeftPinnedToolActionButton.rotateIcon = leftHand ? false : true; - m_LeftPinnedToolActionButton.visible = false; - m_RightPinnedToolActionButton.visible = false; + //m_LeftPinnedToolActionButton.visible = false; + //m_RightPinnedToolActionButton.visible = false; //m_LeftPinnedToolActionButton.mainButtonCollider = m_RootCollider; //m_RightPinnedToolActionButton.mainButtonCollider = m_RootCollider; @@ -499,8 +502,8 @@ void HoverButton() { if (order < 2 && (isSelectionTool || isMainMenu)) // The main menu and the active tool occupy orders 0 and 1; don't show any action buttons for buttons in either position { - m_RightPinnedToolActionButton.visible = false; - m_LeftPinnedToolActionButton.visible = false; + //m_RightPinnedToolActionButton.visible = false; + //m_LeftPinnedToolActionButton.visible = false; //m_RootCollider.enabled = true; StartCoroutine(DelayedCollderEnable()); } @@ -516,14 +519,14 @@ void HoverButton() else */ { - m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? true : false; - m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; + //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? true : false; + //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; } } else { // Hide the select action button if this tool button is already the selected tool, else show the close button for inactive tools - m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? !activeTool : true; - m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; + //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? !activeTool : true; + //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; } highlightAllToolButtons(rayOrigin, true); @@ -544,16 +547,16 @@ void OnActionButtonHoverExit() // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons // Hide both action buttons if the user is no longer hovering over the button - if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) - { + //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + //{ //Debug.LogWarning("!!!"); //m_ButtonCollider.enabled = true; - m_LeftPinnedToolActionButton.visible = false; - m_RightPinnedToolActionButton.visible = false; + //m_LeftPinnedToolActionButton.visible = false; + //m_RightPinnedToolActionButton.visible = false; //m_GradientButton.visible = true; m_GradientButton.highlighted = false; highlightAllToolButtons(rayOrigin, false); - } + //} m_GradientButton.UpdateMaterialColors(); } @@ -582,8 +585,8 @@ void ActionButtonClicked(PinnedToolActionButton button) } OnActionButtonHoverExit(); - m_LeftPinnedToolActionButton.highlighted = false; - m_RightPinnedToolActionButton.highlighted = false; + //m_LeftPinnedToolActionButton.highlighted = false; + //m_RightPinnedToolActionButton.highlighted = false; } } @@ -593,10 +596,13 @@ void OnBackgroundButtonClick() // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons // Hide both action buttons if the user is no longer hovering over the button - if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) - { + //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + //{ selectTool(rayOrigin, m_ToolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons - } + //} + + if (!isMainMenu) + highlightAllToolButtons(rayOrigin, true); m_GradientButton.UpdateMaterialColors(); } From 062e36efbda2366f744bec8688d7e0c57658ae88 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 18:45:45 -0700 Subject: [PATCH 184/870] Set MainMenu and active tool button frames to full opacity when setting their order --- Scripts/UI/PinnedToolButton.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 420328af0..f6d3a2d34 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -99,6 +99,8 @@ public int order if (aboluteMenuButtonCount > mainMenuAndActiveButtonCount) this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); + else + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); } } From 162e8e5dc80d782d3250a9ae221fd573e8c38d97 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 18:58:35 -0700 Subject: [PATCH 185/870] Disable PinnedToolActionButtons, and Refactor colliders in PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 52 +++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 39f3687ee..b4227a0f7 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -41,7 +41,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!1 &1000010351058842 GameObject: m_ObjectHideFlags: 1 @@ -323,7 +323,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000013979951132 GameObject: m_ObjectHideFlags: 1 @@ -388,6 +388,9 @@ GameObject: - 23: {fileID: 23000013566874788} - 114: {fileID: 114000010373680160} - 65: {fileID: 65000011941282114} + - 65: {fileID: 65000011946148642} + - 65: {fileID: 65000010009342954} + - 65: {fileID: 65000012371166842} m_Layer: 5 m_Name: GradientButton m_TagString: Untagged @@ -748,6 +751,18 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014093660532} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!65 &65000010009342954 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014093660532} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.18, y: 0.005, z: 0.06} + m_Center: {x: 0, y: 0, z: -0} --- !u!65 &65000010916098064 BoxCollider: m_ObjectHideFlags: 1 @@ -770,8 +785,32 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.17, y: 0.005, z: 0.19} - m_Center: {x: 0, y: 0, z: 0} + m_Size: {x: 0.145, y: 0.005, z: 0.23} + m_Center: {x: 0, y: 0, z: -0.015} +--- !u!65 &65000011946148642 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014093660532} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.2, y: 0.005, z: 0.1} + m_Center: {x: 0, y: 0, z: -0.08} +--- !u!65 &65000012371166842 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014093660532} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.16, y: 0.005, z: 0.04} + m_Center: {x: 0, y: 0, z: 0.05} --- !u!65 &65000012740030200 BoxCollider: m_ObjectHideFlags: 1 @@ -892,11 +931,8 @@ MonoBehaviour: m_RunInEditMode: 0 m_GradientButton: {fileID: 114000010373680160} m_SmoothMotion: {fileID: 0} - m_LeftPinnedToolActionButton: {fileID: 114000011926581952} - m_RightPinnedToolActionButton: {fileID: 114000013773965116} m_IconContainer: {fileID: 4000010081970184} m_IconContainerCanvasGroup: {fileID: 225000010875730614} - m_RootCollider: {fileID: 65000011941282114} m_FrameRenderer: {fileID: 23000013529982034} m_InsetMeshRenderer: {fileID: 23000013623333764} m_TooltipTarget: {fileID: 4000010683372396} @@ -1386,7 +1422,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013929112766} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.003020957} + m_LocalPosition: {x: 0, y: 0, z: -0.0030222163} m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: From e561c72a18944c26378c89c028670351d5d3019f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 20:36:45 -0700 Subject: [PATCH 186/870] Add shared closing of all PinnedToolButton functionality to PinnedToolButtons --- Scripts/UI/PinnedToolButton.cs | 39 +++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index f6d3a2d34..c1bd4fcb0 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -15,6 +15,7 @@ public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, IToolt { static Color s_FrameOpaqueColor; static Color s_SemiTransparentFrameColor; + static bool s_Hovered; const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation @@ -231,6 +232,7 @@ public Transform alternateMenuOrigin Coroutine m_VisibilityCoroutine; Coroutine m_HighlightCoroutine; Coroutine m_ActivatorMoveCoroutine; + Coroutine m_HoverCheckCoroutine; string m_TooltipText; bool m_Highlighted; @@ -480,6 +482,9 @@ void OnBackgroundHoverEnter () if (m_PositionCoroutine != null) return; + s_Hovered = true; + this.StopCoroutine(ref m_HoverCheckCoroutine); + if (isMainMenu) { m_GradientButton.highlighted = true; @@ -507,7 +512,7 @@ void HoverButton() //m_RightPinnedToolActionButton.visible = false; //m_LeftPinnedToolActionButton.visible = false; //m_RootCollider.enabled = true; - StartCoroutine(DelayedCollderEnable()); + //StartCoroutine(DelayedCollderEnable()); } else if (isSelectionTool) { @@ -534,7 +539,7 @@ void HoverButton() highlightAllToolButtons(rayOrigin, true); } - void OnActionButtonHoverExit() + void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) { if (m_PositionCoroutine != null) return; @@ -545,6 +550,9 @@ void OnActionButtonHoverExit() return; } + this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); + + return; Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons @@ -586,7 +594,7 @@ void ActionButtonClicked(PinnedToolActionButton button) deletePinnedToolButton(rayOrigin, this); } - OnActionButtonHoverExit(); + OnActionButtonHoverExit(false); //m_LeftPinnedToolActionButton.highlighted = false; //m_RightPinnedToolActionButton.highlighted = false; } @@ -762,11 +770,36 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) m_ActivatorMoveCoroutine = null; } +/* IEnumerator DelayedCollderEnable() { yield return new WaitForSeconds(0.5f); //m_RootCollider.enabled = true; } +*/ + + IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) + { + s_Hovered = false; + + if (waitBeforeClosingAllButtons) + { + var duration = Time.unscaledDeltaTime; + while (duration < 0.25f) + { + duration += Time.unscaledDeltaTime; + yield return null; + + if (s_Hovered) + yield break; + } + } + + // Only proceed if no other button is being hovered + m_GradientButton.highlighted = false; + highlightAllToolButtons(rayOrigin, false); + m_GradientButton.UpdateMaterialColors(); + } void CorrectIconRotation() { From 689d9585ded3be31eccb3cc1fee4bca054d159bf Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Apr 2017 21:05:41 -0700 Subject: [PATCH 187/870] Expand colliders on PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index b4227a0f7..03ad59df1 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -388,9 +388,9 @@ GameObject: - 23: {fileID: 23000013566874788} - 114: {fileID: 114000010373680160} - 65: {fileID: 65000011941282114} - - 65: {fileID: 65000011946148642} - - 65: {fileID: 65000010009342954} - 65: {fileID: 65000012371166842} + - 65: {fileID: 65000010009342954} + - 65: {fileID: 65000011946148642} m_Layer: 5 m_Name: GradientButton m_TagString: Untagged @@ -761,7 +761,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.18, y: 0.005, z: 0.06} + m_Size: {x: 0.205, y: 0.005, z: 0.06} m_Center: {x: 0, y: 0, z: -0} --- !u!65 &65000010916098064 BoxCollider: @@ -785,7 +785,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.145, y: 0.005, z: 0.23} + m_Size: {x: 0.165, y: 0.005, z: 0.23} m_Center: {x: 0, y: 0, z: -0.015} --- !u!65 &65000011946148642 BoxCollider: @@ -797,7 +797,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.2, y: 0.005, z: 0.1} + m_Size: {x: 0.225, y: 0.005, z: 0.1} m_Center: {x: 0, y: 0, z: -0.08} --- !u!65 &65000012371166842 BoxCollider: @@ -809,7 +809,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.16, y: 0.005, z: 0.04} + m_Size: {x: 0.18, y: 0.005, z: 0.04} m_Center: {x: 0, y: 0, z: 0.05} --- !u!65 &65000012740030200 BoxCollider: From 7506e11b6a49c7ee9de5e47d1dd37bbe3e3e8b38 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Apr 2017 11:21:06 -0700 Subject: [PATCH 188/870] Add new lerp-shaping to RadialMenu reveal visuals --- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index 28881df0e..e9a80a34f 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -282,12 +282,13 @@ IEnumerator AnimateShow() while (revealAmount < 1) { revealAmount += Time.unscaledDeltaTime * 8; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(revealAmount); for (int i = 0; i < m_RadialMenuSlots.Count; ++i) { if (i < m_Actions.Count) { - m_RadialMenuSlots[i].transform.localRotation = Quaternion.Lerp(hiddenSlotRotation, m_RadialMenuSlots[i].visibleLocalRotation, revealAmount * revealAmount); + m_RadialMenuSlots[i].transform.localRotation = Quaternion.Lerp(hiddenSlotRotation, m_RadialMenuSlots[i].visibleLocalRotation, shapedAmount); m_RadialMenuSlots[i].CorrectIconRotation(); } } From 769cf028da955b4a60e4bd529ac7007b6411b2a9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Apr 2017 12:01:15 -0700 Subject: [PATCH 189/870] Enable showing of PinnedToolButton icons when hovering the active tool button (not the MainMenu button) --- Scripts/UI/PinnedToolButton.cs | 44 ++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index c1bd4fcb0..ba8ff1a4c 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -94,14 +94,20 @@ public int order //const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); + + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); + m_IconContainerCanvasGroup.alpha = 1f; + var mainMenuAndActiveButtonCount = 2; var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order, aboluteMenuButtonCount)); + /* if (aboluteMenuButtonCount > mainMenuAndActiveButtonCount) this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); else m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); + */ } } @@ -164,7 +170,7 @@ public Type previewToolType } m_GradientButton.highlighted = m_previewToolType != null; - this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); + //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); } } @@ -325,11 +331,11 @@ public bool highlighted { // Set all buttons back to the center // Tools with orders greater than that of the active tool should hide themseleves when the pinned tools arent being hovered - newOrderPosition = isMainMenu ? 0 : 1; + newOrderPosition = isMainMenu ? 0 : k_ActiveToolOrderPosition; } this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newOrderPosition, buttonCount)); - this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value && order < 1)); + //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value && order < 1)); } //get { return m_Highlighted; } @@ -483,7 +489,6 @@ void OnBackgroundHoverEnter () return; s_Hovered = true; - this.StopCoroutine(ref m_HoverCheckCoroutine); if (isMainMenu) { @@ -500,11 +505,13 @@ void OnBackgroundHoverEnter () //Debug.LogWarning("Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); - HoverButton(); + highlightAllToolButtons(rayOrigin, true); + //HoverButton(); //m_ButtonCollider.enabled = false; //} } + /* void HoverButton() { if (order < 2 && (isSelectionTool || isMainMenu)) // The main menu and the active tool occupy orders 0 and 1; don't show any action buttons for buttons in either position @@ -516,7 +523,7 @@ void HoverButton() } else if (isSelectionTool) { - /* + if (activeTool) { m_RightPinnedToolActionButton.visible = false; @@ -524,7 +531,7 @@ void HoverButton() StartCoroutine(DelayedCollderEnable()); } else - */ + { //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? true : false; //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; @@ -538,6 +545,7 @@ void HoverButton() highlightAllToolButtons(rayOrigin, true); } + */ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) { @@ -608,31 +616,34 @@ void OnBackgroundButtonClick() // Hide both action buttons if the user is no longer hovering over the button //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) //{ - selectTool(rayOrigin, m_ToolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons //} + selectTool(rayOrigin, m_ToolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons + if (!isMainMenu) - highlightAllToolButtons(rayOrigin, true); + { + OnActionButtonHoverExit(false); + //highlightAllToolButtons(rayOrigin, true); + } m_GradientButton.UpdateMaterialColors(); } IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) { + m_IconContainerCanvasGroup.alpha = 1f; //m_RootCollider.enabled = false; var duration = 0f; while (duration < 2) { duration += Time.unscaledDeltaTime * 3f; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); - m_IconContainerCanvasGroup.alpha = Mathf.Lerp(0f, 1f, durationShaped); m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, k_SemiTransparentIconContainerScale, durationShaped * 2f); transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); transform.localScale = Vector3.Lerp(Vector3.zero, targetScale, durationShaped); yield return null; } - m_IconContainerCanvasGroup.alpha = 1f; m_IconContainer.localScale = k_SemiTransparentIconContainerScale; transform.localPosition = targetPosition; transform.localScale = targetScale; @@ -676,6 +687,8 @@ IEnumerator AnimatePosition(int orderPosition, int buttonCount) var duration = 0f; //var currentPosition = transform.localPosition; //var targetPosition = activeTool ? activePosition : m_InactivePosition; + var currentCanvasAlpha = m_IconContainerCanvasGroup.alpha; + var targetCanvasAlpha = orderPosition > k_ActiveToolOrderPosition - 1 || activeTool ? 1f : 0f; var currentRotation = transform.localRotation; var positionWait = 1f;// (order + 5) * 0.1f; while (duration < 1) @@ -683,6 +696,7 @@ IEnumerator AnimatePosition(int orderPosition, int buttonCount) duration += Time.unscaledDeltaTime * 6f * positionWait; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); + m_IconContainerCanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, targetCanvasAlpha, durationShaped); CorrectIconRotation(); //transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); yield return null; @@ -697,7 +711,7 @@ IEnumerator AnimatePosition(int orderPosition, int buttonCount) m_PositionCoroutine = null; } - IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) + IEnumerator AnimateSemiTransparentX(bool makeSemiTransparent) { //if (!makeSemiTransparent) //yield return new WaitForSeconds(1f); // Pause before making opaque @@ -790,8 +804,11 @@ IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) duration += Time.unscaledDeltaTime; yield return null; - if (s_Hovered) + if (s_Hovered || m_PositionCoroutine != null) + { + m_HoverCheckCoroutine = null; yield break; + } } } @@ -799,6 +816,7 @@ IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) m_GradientButton.highlighted = false; highlightAllToolButtons(rayOrigin, false); m_GradientButton.UpdateMaterialColors(); + m_HoverCheckCoroutine = null; } void CorrectIconRotation() From 1467567ad629d714b109a38747dede483f44ce87 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Apr 2017 19:12:59 -0700 Subject: [PATCH 190/870] Lerp ToopTip background color from UnityBrand darker, to the applicable Gradient, for more subtle appearance --- Scripts/Modules/TooltipModule/TooltipModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index 9f5bc0a1f..67f97b4fe 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -130,7 +130,7 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa m_CustomHighlightMaterial.SetColor(k_MaterialColorBottomProperty, customToolTipColor.customToolTipHighlightColor.b); } - m_TooltipBackgroundMaterial.SetColor("_Color", Color.Lerp(Color.clear, m_OriginalBackgroundColor, lerp)); + m_TooltipBackgroundMaterial.SetColor("_Color", Color.Lerp(UnityBrandColorScheme.darker, m_OriginalBackgroundColor, lerp)); var placement = tooltip as ITooltipPlacement; From fb0a2ff73523cdae8e9075ab52fdda4c92dfd9f6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Apr 2017 22:52:43 -0700 Subject: [PATCH 191/870] Add new secondary button + blendshapes to PinnedToolButtonMesh; Add new split-edge normals to PinnedToolButtons FBX mesh (properly handles UV's for blendshapes now) --- Models/PinnedToolButtonMesh.fbx | 4 ++-- Models/PinnedToolButtonMesh.fbx.meta | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Models/PinnedToolButtonMesh.fbx b/Models/PinnedToolButtonMesh.fbx index d255ab5c3..36d0f4f65 100644 --- a/Models/PinnedToolButtonMesh.fbx +++ b/Models/PinnedToolButtonMesh.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5954fc98d62cf08a7a29930db5b35bb5aef90ad20f220198eab7976624494b09 -size 24348 +oid sha256:327d5b3daf2659586e80256ecacef62bb4c3a78d868633e3518a1b657677dfa3 +size 37404 diff --git a/Models/PinnedToolButtonMesh.fbx.meta b/Models/PinnedToolButtonMesh.fbx.meta index 82432e39e..331d96b84 100644 --- a/Models/PinnedToolButtonMesh.fbx.meta +++ b/Models/PinnedToolButtonMesh.fbx.meta @@ -15,6 +15,10 @@ ModelImporter: 100014: PinnedToolButtonFaceMask 100016: PinnedToolButtonFrame 100018: PinnedToolButtonInset + 100020: PinnedToolCloseButtonFaceMask + 100022: PinnedToolCloseButtonInset + 100024: PinnedToolSecondaryButtonFaceMask + 100026: PinnedToolSecondaryButtonInset 400000: //RootNode 400002: RadialMenuFrameSegment.001 400004: RadialMenuSlotInset.001 @@ -25,6 +29,10 @@ ModelImporter: 400014: PinnedToolButtonFaceMask 400016: PinnedToolButtonFrame 400018: PinnedToolButtonInset + 400020: PinnedToolCloseButtonFaceMask + 400022: PinnedToolCloseButtonInset + 400024: PinnedToolSecondaryButtonFaceMask + 400026: PinnedToolSecondaryButtonInset 2300000: RadialMenuFrameSegment.001 2300002: RadialMenuSlotInset.001 2300004: RadialMenuSlotMask.002 @@ -34,6 +42,8 @@ ModelImporter: 2300012: PinnedToolButtonFaceMask 2300014: PinnedToolButtonFrame 2300016: PinnedToolButtonInset + 2300018: PinnedToolCloseButtonFaceMask + 2300020: PinnedToolCloseButtonInset 3300000: RadialMenuFrameSegment.001 3300002: RadialMenuSlotInset.001 3300004: RadialMenuSlotMask.002 @@ -43,6 +53,8 @@ ModelImporter: 3300012: PinnedToolButtonFaceMask 3300014: PinnedToolButtonFrame 3300016: PinnedToolButtonInset + 3300018: PinnedToolCloseButtonFaceMask + 3300020: PinnedToolCloseButtonInset 4300000: RadialMenuFrameSegment.001 4300002: RadialMenuSlotInset.001 4300004: RadialMenuSlotMask.002 @@ -52,8 +64,20 @@ ModelImporter: 4300012: PinnedToolButtonFrame 4300014: PinnedToolButtonInset 4300016: PinnedToolButtonFaceMask + 4300018: PinnedToolCloseButtonFaceMask + 4300020: PinnedToolCloseButtonInset + 4300022: PinnedToolSecondaryButtonFaceMask + 4300024: PinnedToolSecondaryButtonInset 9500000: //RootNode + 11100000: //RootNode 13700000: RadialMenuSlotMask.002 + 13700002: PinnedToolButtonFaceMask + 13700004: PinnedToolCloseButtonFaceMask + 13700006: PinnedToolButtonFrame + 13700008: PinnedToolButtonInset + 13700010: PinnedToolCloseButtonInset + 13700012: PinnedToolSecondaryButtonFaceMask + 13700014: PinnedToolSecondaryButtonInset materials: importMaterials: 0 materialName: 0 @@ -112,7 +136,7 @@ ModelImporter: rootMotionBoneName: hasTranslationDoF: 0 lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 0 + animationType: 1 humanoidOversampling: 1 additionalBone: 0 userData: From 774f64e3e2fa1790ee36f4433ad6d6aa43d6c722 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 26 Apr 2017 00:47:02 -0700 Subject: [PATCH 192/870] Setup secondary button visuals in PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 403 ++++++++++++++++++++++++++++- 1 file changed, 397 insertions(+), 6 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 03ad59df1..01a66f63e 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -75,6 +75,22 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 +--- !u!1 &1000010664688126 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012609671830} + - 137: {fileID: 137000012108747896} + m_Layer: 0 + m_Name: PinnedToolButtonFrame + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000010714816488 GameObject: m_ObjectHideFlags: 1 @@ -141,6 +157,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000011303308952 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000010261126032} + m_Layer: 0 + m_Name: PinnedToolButtonMesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000011695512812 GameObject: m_ObjectHideFlags: 1 @@ -180,12 +211,12 @@ GameObject: m_Component: - 4: {fileID: 4000013373873342} m_Layer: 0 - m_Name: PinnedToolButtonMesh + m_Name: PinnedToolButtonMeshOld m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000011923834384 GameObject: m_ObjectHideFlags: 1 @@ -203,6 +234,38 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000012048525766 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000013243584372} + - 137: {fileID: 137000012837336366} + m_Layer: 0 + m_Name: PinnedToolSecondaryButtonInset + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012104234552 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011544681006} + - 137: {fileID: 137000013542685126} + m_Layer: 0 + m_Name: PinnedToolButtonInset + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000012194113842 GameObject: m_ObjectHideFlags: 1 @@ -219,6 +282,22 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000012544181008 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011352500524} + - 137: {fileID: 137000011420067172} + m_Layer: 0 + m_Name: PinnedToolButtonFaceMask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000013126942410 GameObject: m_ObjectHideFlags: 1 @@ -237,6 +316,22 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000013163218754 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012297013730} + - 137: {fileID: 137000010072420284} + m_Layer: 0 + m_Name: PinnedToolSecondaryButtonFaceMask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000013207144374 GameObject: m_ObjectHideFlags: 1 @@ -430,6 +525,24 @@ Transform: - {fileID: 224000013933582366} m_Father: {fileID: 224000013167097666} m_RootOrder: 1 +--- !u!4 &4000010261126032 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011303308952} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000011352500524} + - {fileID: 4000012609671830} + - {fileID: 4000011544681006} + - {fileID: 4000012297013730} + - {fileID: 4000013243584372} + m_Father: {fileID: 4000012648346800} + m_RootOrder: 3 --- !u!4 &4000010683372396 Transform: m_ObjectHideFlags: 1 @@ -443,6 +556,32 @@ Transform: m_Children: [] m_Father: {fileID: 4000012648346800} m_RootOrder: 0 +--- !u!4 &4000011352500524 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012544181008} + m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000010261126032} + m_RootOrder: 0 +--- !u!4 &4000011544681006 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012104234552} + m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000010261126032} + m_RootOrder: 2 --- !u!4 &4000011771676402 Transform: m_ObjectHideFlags: 1 @@ -469,6 +608,19 @@ Transform: m_Children: [] m_Father: {fileID: 224000013167097666} m_RootOrder: 2 +--- !u!4 &4000012297013730 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013163218754} + m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0.00034302473, y: 0.0027439394, z: -0.24102145} + m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000010261126032} + m_RootOrder: 3 --- !u!4 &4000012504767854 Transform: m_ObjectHideFlags: 1 @@ -483,6 +635,19 @@ Transform: - {fileID: 4000012648346800} m_Father: {fileID: 0} m_RootOrder: 0 +--- !u!4 &4000012609671830 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010664688126} + m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000010261126032} + m_RootOrder: 1 --- !u!4 &4000012648346800 Transform: m_ObjectHideFlags: 1 @@ -497,6 +662,7 @@ Transform: - {fileID: 4000010683372396} - {fileID: 4000013378434912} - {fileID: 224000011060550722} + - {fileID: 4000010261126032} - {fileID: 4000013373873342} - {fileID: 4000013747407424} m_Father: {fileID: 4000012504767854} @@ -514,6 +680,19 @@ Transform: m_Children: [] m_Father: {fileID: 4000013373873342} m_RootOrder: 1 +--- !u!4 &4000013243584372 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012048525766} + m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000010261126032} + m_RootOrder: 4 --- !u!4 &4000013373873342 Transform: m_ObjectHideFlags: 1 @@ -529,7 +708,7 @@ Transform: - {fileID: 4000012896115128} - {fileID: 4000013614942004} m_Father: {fileID: 4000012648346800} - m_RootOrder: 3 + m_RootOrder: 4 --- !u!4 &4000013378434912 Transform: m_ObjectHideFlags: 1 @@ -569,7 +748,7 @@ Transform: m_Children: - {fileID: 224000013167097666} m_Father: {fileID: 4000012648346800} - m_RootOrder: 4 + m_RootOrder: 5 --- !u!23 &23000012760767544 MeshRenderer: m_ObjectHideFlags: 1 @@ -933,8 +1112,10 @@ MonoBehaviour: m_SmoothMotion: {fileID: 0} m_IconContainer: {fileID: 4000010081970184} m_IconContainerCanvasGroup: {fileID: 225000010875730614} - m_FrameRenderer: {fileID: 23000013529982034} - m_InsetMeshRenderer: {fileID: 23000013623333764} + m_FrameRenderer: {fileID: 137000012108747896} + m_InsetMeshRenderer: {fileID: 137000013542685126} + m_SecondaryInsetMeshRenderer: {fileID: 137000012837336366} + m_SecondaryInsetMaskMeshRenderer: {fileID: 137000010072420284} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} m_AlternateLocalPosition: {x: 0, y: 0, z: 0} @@ -1231,6 +1412,216 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_ShowMaskGraphic: 0 +--- !u!137 &137000010072420284 +SkinnedMeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013163218754} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 0 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300022, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} + m_Bones: [] + m_BlendShapeWeights: + - 71.5 + m_RootBone: {fileID: 0} + m_AABB: + m_Center: {x: 0.010867998, y: 0, z: -0.03129649} + m_Extent: {x: 0.046069227, y: 0, z: 0.04070674} + m_DirtyAABB: 0 +--- !u!137 &137000011420067172 +SkinnedMeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012544181008} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 0 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300016, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} + m_Bones: [] + m_BlendShapeWeights: [] + m_RootBone: {fileID: 0} + m_AABB: + m_Center: {x: 0.04259277, y: 0.006993944, z: -0.19421075} + m_Extent: {x: 0.034564152, y: 0.004250005, z: 0.035469398} + m_DirtyAABB: 0 +--- !u!137 &137000012108747896 +SkinnedMeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010664688126} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 5c092e872a72dd144a84ae7da8095049, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 0 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300012, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} + m_Bones: [] + m_BlendShapeWeights: + - 0 + - 39.4 + m_RootBone: {fileID: 0} + m_AABB: + m_Center: {x: 0.04595294, y: -0.0000000017462298, z: -0.19399026} + m_Extent: {x: 0.04595294, y: 0.0024999995, z: 0.046169735} + m_DirtyAABB: 0 +--- !u!137 &137000012837336366 +SkinnedMeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012048525766} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 0 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300024, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} + m_Bones: [] + m_BlendShapeWeights: + - 71.5 + m_RootBone: {fileID: 0} + m_AABB: + m_Center: {x: 0.057552528, y: 0.0014277332, z: -0.26775372} + m_Extent: {x: 0.04606923, y: 0.0015277368, z: 0.040706724} + m_DirtyAABB: 0 +--- !u!137 &137000013542685126 +SkinnedMeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012104234552} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedWireframeHidden: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + serializedVersion: 2 + m_Quality: 0 + m_UpdateWhenOffscreen: 0 + m_SkinnedMotionVectors: 1 + m_Mesh: {fileID: 4300014, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} + m_Bones: [] + m_BlendShapeWeights: + - 0 + m_RootBone: {fileID: 0} + m_AABB: + m_Center: {x: 0.04259277, y: -0.0013104333, z: -0.19421075} + m_Extent: {x: 0.034564152, y: 0.006972273, z: 0.035469398} + m_DirtyAABB: 0 --- !u!222 &222000011018194712 CanvasRenderer: m_ObjectHideFlags: 1 From c538996d3cd8704d61a6a1d9ba877822cb35abed Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 26 Apr 2017 00:47:44 -0700 Subject: [PATCH 193/870] Add initial secondary button visuals support to PinnedToolButton controller --- Scripts/UI/PinnedToolButton.cs | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index ba8ff1a4c..0f4259e93 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -211,10 +211,16 @@ public Transform alternateMenuOrigin //Collider m_RootCollider; [SerializeField] - MeshRenderer m_FrameRenderer; + SkinnedMeshRenderer m_FrameRenderer; [SerializeField] - MeshRenderer m_InsetMeshRenderer; + SkinnedMeshRenderer m_InsetMeshRenderer; + + [SerializeField] + SkinnedMeshRenderer m_SecondaryInsetMeshRenderer; + + [SerializeField] + SkinnedMeshRenderer m_SecondaryInsetMaskMeshRenderer; [SerializeField] Transform m_TooltipTarget; @@ -239,6 +245,7 @@ public Transform alternateMenuOrigin Coroutine m_HighlightCoroutine; Coroutine m_ActivatorMoveCoroutine; Coroutine m_HoverCheckCoroutine; + Coroutine m_SecondaryButtonVisibilityCoroutine; string m_TooltipText; bool m_Highlighted; @@ -509,6 +516,8 @@ void OnBackgroundHoverEnter () //HoverButton(); //m_ButtonCollider.enabled = false; //} + + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } /* @@ -831,6 +840,26 @@ void CorrectIconRotation() var yaw = transform.localRotation.eulerAngles.y; //tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; } + + IEnumerator ShowSecondaryButton() + { + var duration = 0f; + while (duration < 1f) + { + duration += Time.unscaledDeltaTime * 1.5f; + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 39.5f, duration)); + yield return null; + } + + while (duration > 0f) + { + duration -= Time.unscaledDeltaTime * 1.5f; + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 39.5f, duration)); + yield return null; + } + + m_SecondaryButtonVisibilityCoroutine = null; + } } } #endif From 8300d4473eaf1518b072c80dd93dd0fe12347121 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 26 Apr 2017 18:40:38 -0700 Subject: [PATCH 194/870] Set new colors on PinnedToolButton material. --- Prefabs/UI/Materials/PinnedToolButton.mat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Prefabs/UI/Materials/PinnedToolButton.mat b/Prefabs/UI/Materials/PinnedToolButton.mat index 93eac07b1..4d15ec81b 100644 --- a/Prefabs/UI/Materials/PinnedToolButton.mat +++ b/Prefabs/UI/Materials/PinnedToolButton.mat @@ -136,10 +136,10 @@ Material: second: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - first: name: _ColorBottom - second: {r: 1, g: 0, b: 0, a: 1} + second: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 1} - first: name: _ColorTop - second: {r: 0, g: 1, b: 1, a: 1} + second: {r: 0.011764706, g: 0.6627451, b: 0.95686275, a: 1} - first: name: _EmisColor second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 0} From c6152e424ec90a140c0682657bcecf9572112db6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 26 Apr 2017 18:41:32 -0700 Subject: [PATCH 195/870] Add new curated gradient pairs to UnityBrandColorScheme --- Scripts/Utilities/UnityBrandColorScheme.cs | 149 +++++++++++++++------ 1 file changed, 107 insertions(+), 42 deletions(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 6608b4229..2def717d9 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -13,71 +13,76 @@ public static class UnityBrandColorScheme /// /// Random used to aid in lack of repeating color choices /// - private static System.Random s_ColorRandom = new System.Random(); + static System.Random s_ColorRandom = new System.Random(); /// /// Collection of Unity brand color swatches /// - private static readonly List s_ColorSwatches = new List(); + static readonly List s_ColorSwatches = new List(); /// /// Cache standard color swatch collection size, to reduce further lookups /// - private static int s_ColorSwatchRange; - private static int s_RandomSwatchColorPosition; + static int s_ColorSwatchRange; + static int s_RandomSwatchColorPosition; /// /// Collection of Unity brand gradients, composed of unity-brand color swatches /// - private static readonly List s_Gradients = new List(); - private static int s_RandomGradientPairColorAPosition; - - private static Color s_Red; - private static Color s_RedLight; - private static Color s_RedDark; + static readonly List s_Gradients = new List(); + static int s_RandomGradientPairColorAPosition; - private static Color s_Magenta; - private static Color s_MagentaLight; - private static Color s_MagentaDark; + /// + /// Collection of curated Unity brand gradients; selected pairs of specific unity-brand color swatches + /// + static readonly List s_CuratedGradientPairs = new List(); + + static Color s_Red; + static Color s_RedLight; + static Color s_RedDark; - private static Color s_Purple; - private static Color s_PurpleLight; - private static Color s_PurpleDark; + static Color s_Magenta; + static Color s_MagentaLight; + static Color s_MagentaDark; - private static Color s_Blue; - private static Color s_BlueLight; - private static Color s_BlueDark; + static Color s_Purple; + static Color s_PurpleLight; + static Color s_PurpleDark; - private static Color s_Cyan; - private static Color s_CyanLight; - private static Color s_CyanDark; + static Color s_Blue; + static Color s_BlueLight; + static Color s_BlueDark; - private static Color s_Teal; - private static Color s_TealLight; - private static Color s_TealDark; + static Color s_Cyan; + static Color s_CyanLight; + static Color s_CyanDark; - private static Color s_Green; - private static Color s_GreenLight; - private static Color s_GreenDark; + static Color s_Teal; + static Color s_TealLight; + static Color s_TealDark; - private static Color s_Lime; - private static Color s_LimeLight; - private static Color s_LimeDark; + static Color s_Green; + static Color s_GreenLight; + static Color s_GreenDark; - private static Color s_Yellow; - private static Color s_YellowLight; - private static Color s_YellowDark; + static Color s_Lime; + static Color s_LimeLight; + static Color s_LimeDark; - private static Color s_Orange; - private static Color s_OrangeLight; - private static Color s_OrangeDark; + static Color s_Yellow; + static Color s_YellowLight; + static Color s_YellowDark; - private static Color s_DarkBlue; - private static Color s_DarkBlueLight; + static Color s_Orange; + static Color s_OrangeLight; + static Color s_OrangeDark; - private static Color s_Dark; - private static Color s_Darker; - private static Color s_Light; + static Color s_DarkBlue; + static Color s_DarkBlueLight; + + static Color s_Dark; + static Color s_Darker; + static Color s_Light; /// /// Collection of pre-defined Unity brand gradients @@ -235,6 +240,56 @@ private static void SetupUnityBrandColors() // Setup grayscale light/dark contrasting session gradient grayscaleSessionGradient = new GradientPair(MaterialUtils.HexToColor("898A8AFF"), s_Light); + + // Setup curated gradient pairs + s_CuratedGradientPairs.Add(new GradientPair(blueDark, cyan)); + s_CuratedGradientPairs.Add(new GradientPair(blueDark, darkBlue)); + s_CuratedGradientPairs.Add(new GradientPair(blueDark, redDark)); + s_CuratedGradientPairs.Add(new GradientPair(tealDark, redLight)); + s_CuratedGradientPairs.Add(new GradientPair(tealDark, magenta)); + s_CuratedGradientPairs.Add(new GradientPair(tealDark, teal)); + s_CuratedGradientPairs.Add(new GradientPair(tealDark, green)); + s_CuratedGradientPairs.Add(new GradientPair(tealDark, lime)); + s_CuratedGradientPairs.Add(new GradientPair(tealDark, yellowLight)); + s_CuratedGradientPairs.Add(new GradientPair(tealDark, darkBlue)); + s_CuratedGradientPairs.Add(new GradientPair(orangeDark, orangeLight)); + s_CuratedGradientPairs.Add(new GradientPair(orangeDark, redDark)); + s_CuratedGradientPairs.Add(new GradientPair(orangeDark, darker)); + s_CuratedGradientPairs.Add(new GradientPair(red, darker)); + s_CuratedGradientPairs.Add(new GradientPair(red, blue)); + s_CuratedGradientPairs.Add(new GradientPair(red, redLight)); + s_CuratedGradientPairs.Add(new GradientPair(red, yellow)); + s_CuratedGradientPairs.Add(new GradientPair(red, orange)); + s_CuratedGradientPairs.Add(new GradientPair(red, orangeLight)); + s_CuratedGradientPairs.Add(new GradientPair(red, darkBlue)); + s_CuratedGradientPairs.Add(new GradientPair(lime, darkBlue)); + s_CuratedGradientPairs.Add(new GradientPair(lime, orange)); + s_CuratedGradientPairs.Add(new GradientPair(lime, limeDark)); + s_CuratedGradientPairs.Add(new GradientPair(lime, greenDark)); + s_CuratedGradientPairs.Add(new GradientPair(lime, greenLight)); + s_CuratedGradientPairs.Add(new GradientPair(lime, teal)); + s_CuratedGradientPairs.Add(new GradientPair(lime, cyanDark)); + s_CuratedGradientPairs.Add(new GradientPair(lime, cyan)); + s_CuratedGradientPairs.Add(new GradientPair(lime, magenta)); + s_CuratedGradientPairs.Add(new GradientPair(lime, red)); + s_CuratedGradientPairs.Add(new GradientPair(lime, darker)); + s_CuratedGradientPairs.Add(new GradientPair(magenta, darkBlue)); + s_CuratedGradientPairs.Add(new GradientPair(magenta, orange)); + s_CuratedGradientPairs.Add(new GradientPair(magenta, yellow)); + s_CuratedGradientPairs.Add(new GradientPair(magenta, blueLight)); + s_CuratedGradientPairs.Add(new GradientPair(magenta, cyan)); + s_CuratedGradientPairs.Add(new GradientPair(magenta, purpleDark)); + s_CuratedGradientPairs.Add(new GradientPair(magenta, magentaDark)); + s_CuratedGradientPairs.Add(new GradientPair(magenta, darker)); + s_CuratedGradientPairs.Add(new GradientPair(blue, blueLight)); + s_CuratedGradientPairs.Add(new GradientPair(blue, magenta)); + s_CuratedGradientPairs.Add(new GradientPair(blue, purple)); + s_CuratedGradientPairs.Add(new GradientPair(blue, purpleDark)); + s_CuratedGradientPairs.Add(new GradientPair(blue, blueDark)); + s_CuratedGradientPairs.Add(new GradientPair(blue, cyanDark)); + s_CuratedGradientPairs.Add(new GradientPair(blue, lime)); + s_CuratedGradientPairs.Add(new GradientPair(blue, yellowLight)); + s_CuratedGradientPairs.Add(new GradientPair(blue, darkBlue)); } /// @@ -294,6 +349,16 @@ static bool SwatchesSimilar(Color swatchA, Color swatchB, float requiredMinimumD var difference = Mathf.Abs(swatchA.r - swatchB.r) + Mathf.Abs(swatchA.g - swatchB.g) + Mathf.Abs(swatchA.b - swatchB.b); return difference < requiredMinimumDifference; } + + /// + /// Fetch a custom-curated Unity brand-specific color scheme (pair of differing brand-swatches) + /// + /// Gradient pair of two curated brand-swatches + public static GradientPair GetRandomCuratedGradient() + { + var curatedGradientPair = s_CuratedGradientPairs[s_ColorRandom.Next(s_CuratedGradientPairs.Count - 1)]; + return curatedGradientPair; + } } } #endif From 1a8660a3027eb636291ab1a9a353da8731f822bf Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 26 Apr 2017 18:42:14 -0700 Subject: [PATCH 196/870] Add curated brand gradients to PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 0f4259e93..5fbe091aa 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -52,7 +52,7 @@ public Type toolType tooltipText = toolType.Name; // Tools other than select fetch a random gradientPair; also used by the device when highlighted - gradientPair = UnityBrandColorScheme.GetRandomGradient(); + gradientPair = UnityBrandColorScheme.GetRandomCuratedGradient(); } activeTool = activeTool; @@ -843,18 +843,19 @@ void CorrectIconRotation() IEnumerator ShowSecondaryButton() { - var duration = 0f; - while (duration < 1f) + var amount = 0f; + while (amount < 1f) { - duration += Time.unscaledDeltaTime * 1.5f; - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 39.5f, duration)); + amount += Time.unscaledDeltaTime * 1.5f; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 39.5f, shapedAmount)); yield return null; } - while (duration > 0f) + while (amount > 0f) { - duration -= Time.unscaledDeltaTime * 1.5f; - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 39.5f, duration)); + amount -= Time.unscaledDeltaTime * 1.5f; + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 39.5f, amount)); yield return null; } From 1c083c96b46e8abb722ca28f5c249512bd15af1a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 10:53:10 -0700 Subject: [PATCH 197/870] Add functionality for hiding secondary PinnedToolButton on HoverExit --- Scripts/UI/PinnedToolButton.cs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 5fbe091aa..c1eb63bf7 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -502,6 +502,10 @@ void OnBackgroundHoverEnter () m_GradientButton.highlighted = true; return; } + else + { + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); + } //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) //{ @@ -517,7 +521,6 @@ void OnBackgroundHoverEnter () //m_ButtonCollider.enabled = false; //} - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } /* @@ -568,6 +571,7 @@ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) } this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); return; Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); @@ -861,6 +865,21 @@ IEnumerator ShowSecondaryButton() m_SecondaryButtonVisibilityCoroutine = null; } + + IEnumerator HideSecondaryButton() + { + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + var amount = 0f; + while (amount < 1f) + { + amount += Time.unscaledDeltaTime * 1.5f; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); + yield return null; + } + + m_SecondaryButtonVisibilityCoroutine = null; + } } } #endif From 1b82b72b8d20c398e769e18955293ddd700c91c7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 12:10:53 -0700 Subject: [PATCH 198/870] Add additional animated show/hide support of secondary PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index c1eb63bf7..467551e86 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -848,18 +848,19 @@ void CorrectIconRotation() IEnumerator ShowSecondaryButton() { var amount = 0f; - while (amount < 1f) + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + while (amount < 0.25f) { - amount += Time.unscaledDeltaTime * 1.5f; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 39.5f, shapedAmount)); + amount += Time.unscaledDeltaTime; yield return null; } - while (amount > 0f) + amount = 0f; + while (amount < 1f) { - amount -= Time.unscaledDeltaTime * 1.5f; - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(0f, 39.5f, amount)); + amount += Time.unscaledDeltaTime * 10f; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 39.5f, shapedAmount)); yield return null; } @@ -872,7 +873,7 @@ IEnumerator HideSecondaryButton() var amount = 0f; while (amount < 1f) { - amount += Time.unscaledDeltaTime * 1.5f; + amount += Time.unscaledDeltaTime * 8f; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); yield return null; From e25ce6f0e5355e4d77061012be61f102e35621ba Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 12:12:02 -0700 Subject: [PATCH 199/870] Change m_ButtonMeshRenderer member type to Renderer, in order to support SkinnedMeshRenderers (PinnedToolButton inset) --- Scripts/UI/GradientButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 70a8332f3..79b8e793d 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -132,7 +132,7 @@ public Sprite icon // The inner-button's background gradient MeshRenderer [SerializeField] - MeshRenderer m_ButtonMeshRenderer; + Renderer m_ButtonMeshRenderer; // Transform-root of the contents in the icon container (icons, text, etc) [SerializeField] From b31dda1e3cbc8eb1b7d52839e89b51ccad71fbde Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 12:17:42 -0700 Subject: [PATCH 200/870] Add support for comparision of previously fetched curated gradients, before returning a new CuratedGradient --- Scripts/Utilities/UnityBrandColorScheme.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 2def717d9..030aa07b8 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -36,6 +36,8 @@ public static class UnityBrandColorScheme /// Collection of curated Unity brand gradients; selected pairs of specific unity-brand color swatches /// static readonly List s_CuratedGradientPairs = new List(); + static int s_RandomCuratedGradientPairPosition; + static int s_CuratedGradientPairsRange; static Color s_Red; static Color s_RedLight; @@ -290,6 +292,8 @@ private static void SetupUnityBrandColors() s_CuratedGradientPairs.Add(new GradientPair(blue, lime)); s_CuratedGradientPairs.Add(new GradientPair(blue, yellowLight)); s_CuratedGradientPairs.Add(new GradientPair(blue, darkBlue)); + + s_CuratedGradientPairsRange = s_CuratedGradientPairs.Count - 1; } /// @@ -356,8 +360,14 @@ static bool SwatchesSimilar(Color swatchA, Color swatchB, float requiredMinimumD /// Gradient pair of two curated brand-swatches public static GradientPair GetRandomCuratedGradient() { - var curatedGradientPair = s_CuratedGradientPairs[s_ColorRandom.Next(s_CuratedGradientPairs.Count - 1)]; - return curatedGradientPair; + var randomPosition = s_ColorRandom.Next(s_CuratedGradientPairsRange); + + while (randomPosition == s_RandomCuratedGradientPairPosition) + randomPosition = s_ColorRandom.Next(s_CuratedGradientPairsRange); + + s_RandomCuratedGradientPairPosition = randomPosition; + + return s_CuratedGradientPairs[s_RandomCuratedGradientPairPosition];; } } } From 4470525d9b0f297ff40b2b4ea88f601d9d2e0e3b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 12:25:32 -0700 Subject: [PATCH 201/870] Assign a new CuratedGradientPair to the EditorVR session gradient --- Scripts/Core/EditorVR.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 6f96789c5..dfa8d3ea3 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -166,7 +166,7 @@ void Awake() workspaceModule.workspaceDestroyed += vacuumables.OnWorkspaceDestroyed; workspaceModule.workspaceDestroyed += miniWorlds.OnWorkspaceDestroyed; - UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomGradient(); + UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedGradient(); var sceneObjectModule = AddModule(); sceneObjectModule.tryPlaceObject = (obj, targetScale) => From 9b764ff26a00a90f2a265225c01d336e5f0bc311 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 12:26:02 -0700 Subject: [PATCH 202/870] Assign inset SkinnedMeshRenderer to the gradient button in the PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 01a66f63e..a191cee2a 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -1020,7 +1020,7 @@ MonoBehaviour: m_HighlightGradientPair: a: {r: 0, g: 0, b: 0, a: 0} b: {r: 0, g: 0, b: 0, a: 0} - m_ButtonMeshRenderer: {fileID: 23000013623333764} + m_ButtonMeshRenderer: {fileID: 137000013542685126} m_IconContainer: {fileID: 4000010081970184} m_ContentContainer: {fileID: 4000010081970184} m_CanvasGroup: {fileID: 225000010875730614} From 3f14868a5c819a588cf315f698018c63163175ff Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 12:26:59 -0700 Subject: [PATCH 203/870] Initialize the secondary frame-extension blendshape to 0 in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 467551e86..404c683a9 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -436,6 +436,8 @@ void Start() m_GradientButton.click += OnBackgroundButtonClick; m_GradientButton.containerContentsAnimationSpeedMultiplier = 2.5f; + m_FrameRenderer.SetBlendShapeWeight(1, 0f); + //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; //m_LeftPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; From 757446eaa6354989eb5ca906386646a3331f9913 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 13:42:57 -0700 Subject: [PATCH 204/870] Add individual means of fetching a random light or dark curated UnityBrandColorGradient --- Scripts/Utilities/UnityBrandColorScheme.cs | 150 ++++++++++++++------- 1 file changed, 99 insertions(+), 51 deletions(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 030aa07b8..07abe59d4 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -36,8 +36,18 @@ public static class UnityBrandColorScheme /// Collection of curated Unity brand gradients; selected pairs of specific unity-brand color swatches /// static readonly List s_CuratedGradientPairs = new List(); - static int s_RandomCuratedGradientPairPosition; + static readonly List s_CuratedLightGradientPairs = new List(); + static readonly List s_CuratedDarkGradientPairs = new List(); + + /// + /// Cache curated gradients collection size, to reduce further lookups + /// static int s_CuratedGradientPairsRange; + static int s_RandomCuratedGradientPairPosition; + static int s_CuratedLightGradientPairsRange; + static int s_RandomCuratedLightGradientPairPosition; + static int s_CuratedDarkGradientPairsRange; + static int s_RandomCuratedDarkGradientPairPosition; static Color s_Red; static Color s_RedLight; @@ -243,57 +253,63 @@ private static void SetupUnityBrandColors() // Setup grayscale light/dark contrasting session gradient grayscaleSessionGradient = new GradientPair(MaterialUtils.HexToColor("898A8AFF"), s_Light); - // Setup curated gradient pairs - s_CuratedGradientPairs.Add(new GradientPair(blueDark, cyan)); - s_CuratedGradientPairs.Add(new GradientPair(blueDark, darkBlue)); - s_CuratedGradientPairs.Add(new GradientPair(blueDark, redDark)); - s_CuratedGradientPairs.Add(new GradientPair(tealDark, redLight)); - s_CuratedGradientPairs.Add(new GradientPair(tealDark, magenta)); - s_CuratedGradientPairs.Add(new GradientPair(tealDark, teal)); - s_CuratedGradientPairs.Add(new GradientPair(tealDark, green)); - s_CuratedGradientPairs.Add(new GradientPair(tealDark, lime)); - s_CuratedGradientPairs.Add(new GradientPair(tealDark, yellowLight)); - s_CuratedGradientPairs.Add(new GradientPair(tealDark, darkBlue)); - s_CuratedGradientPairs.Add(new GradientPair(orangeDark, orangeLight)); - s_CuratedGradientPairs.Add(new GradientPair(orangeDark, redDark)); - s_CuratedGradientPairs.Add(new GradientPair(orangeDark, darker)); - s_CuratedGradientPairs.Add(new GradientPair(red, darker)); - s_CuratedGradientPairs.Add(new GradientPair(red, blue)); - s_CuratedGradientPairs.Add(new GradientPair(red, redLight)); - s_CuratedGradientPairs.Add(new GradientPair(red, yellow)); - s_CuratedGradientPairs.Add(new GradientPair(red, orange)); - s_CuratedGradientPairs.Add(new GradientPair(red, orangeLight)); - s_CuratedGradientPairs.Add(new GradientPair(red, darkBlue)); - s_CuratedGradientPairs.Add(new GradientPair(lime, darkBlue)); - s_CuratedGradientPairs.Add(new GradientPair(lime, orange)); - s_CuratedGradientPairs.Add(new GradientPair(lime, limeDark)); - s_CuratedGradientPairs.Add(new GradientPair(lime, greenDark)); - s_CuratedGradientPairs.Add(new GradientPair(lime, greenLight)); - s_CuratedGradientPairs.Add(new GradientPair(lime, teal)); - s_CuratedGradientPairs.Add(new GradientPair(lime, cyanDark)); - s_CuratedGradientPairs.Add(new GradientPair(lime, cyan)); - s_CuratedGradientPairs.Add(new GradientPair(lime, magenta)); - s_CuratedGradientPairs.Add(new GradientPair(lime, red)); - s_CuratedGradientPairs.Add(new GradientPair(lime, darker)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, darkBlue)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, orange)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, yellow)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, blueLight)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, cyan)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, purpleDark)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, magentaDark)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, darker)); - s_CuratedGradientPairs.Add(new GradientPair(blue, blueLight)); - s_CuratedGradientPairs.Add(new GradientPair(blue, magenta)); - s_CuratedGradientPairs.Add(new GradientPair(blue, purple)); - s_CuratedGradientPairs.Add(new GradientPair(blue, purpleDark)); - s_CuratedGradientPairs.Add(new GradientPair(blue, blueDark)); - s_CuratedGradientPairs.Add(new GradientPair(blue, cyanDark)); - s_CuratedGradientPairs.Add(new GradientPair(blue, lime)); - s_CuratedGradientPairs.Add(new GradientPair(blue, yellowLight)); - s_CuratedGradientPairs.Add(new GradientPair(blue, darkBlue)); - + // Setup light-luma curated gradient pairs + s_CuratedDarkGradientPairs.Add(new GradientPair(blueDark, cyan)); + s_CuratedDarkGradientPairs.Add(new GradientPair(blueDark, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(blueDark, redDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, redLight)); + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, magenta)); + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, teal)); + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, green)); + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, lime)); + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, yellowLight)); + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(orangeDark, orangeLight)); + s_CuratedDarkGradientPairs.Add(new GradientPair(orangeDark, redDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(orangeDark, darker)); + s_CuratedDarkGradientPairs.Add(new GradientPair(red, darker)); + s_CuratedDarkGradientPairs.Add(new GradientPair(red, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(lime, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(lime, limeDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(lime, greenDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(lime, cyanDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(lime, darker)); + s_CuratedDarkGradientPairs.Add(new GradientPair(magenta, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(magenta, purpleDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(magenta, magentaDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(magenta, darker)); + s_CuratedDarkGradientPairs.Add(new GradientPair(blue, purpleDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(blue, cyanDark)); + s_CuratedDarkGradientPairs.Add(new GradientPair(blue, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(blue, blueDark)); + + // Setup light-luma curated gradient pairs + s_CuratedLightGradientPairs.Add(new GradientPair(red, blue)); + s_CuratedLightGradientPairs.Add(new GradientPair(lime, greenLight)); + s_CuratedLightGradientPairs.Add(new GradientPair(red, redLight)); + s_CuratedLightGradientPairs.Add(new GradientPair(red, yellow)); + s_CuratedLightGradientPairs.Add(new GradientPair(red, orange)); + s_CuratedLightGradientPairs.Add(new GradientPair(red, orangeLight)); + s_CuratedLightGradientPairs.Add(new GradientPair(lime, orange)); + s_CuratedLightGradientPairs.Add(new GradientPair(lime, teal)); + s_CuratedLightGradientPairs.Add(new GradientPair(lime, cyan)); + s_CuratedLightGradientPairs.Add(new GradientPair(lime, magenta)); + s_CuratedLightGradientPairs.Add(new GradientPair(lime, red)); + s_CuratedLightGradientPairs.Add(new GradientPair(magenta, orange)); + s_CuratedLightGradientPairs.Add(new GradientPair(magenta, yellow)); + s_CuratedLightGradientPairs.Add(new GradientPair(magenta, blueLight)); + s_CuratedLightGradientPairs.Add(new GradientPair(magenta, cyan)); + s_CuratedLightGradientPairs.Add(new GradientPair(blue, blueLight)); + s_CuratedLightGradientPairs.Add(new GradientPair(blue, magenta)); + s_CuratedLightGradientPairs.Add(new GradientPair(blue, purple)); + s_CuratedLightGradientPairs.Add(new GradientPair(blue, lime)); + s_CuratedLightGradientPairs.Add(new GradientPair(blue, yellowLight)); + + s_CuratedGradientPairs.AddRange(s_CuratedDarkGradientPairs); + s_CuratedGradientPairs.AddRange(s_CuratedLightGradientPairs); s_CuratedGradientPairsRange = s_CuratedGradientPairs.Count - 1; + s_CuratedLightGradientPairsRange = s_CuratedLightGradientPairs.Count - 1; + s_CuratedDarkGradientPairsRange = s_CuratedDarkGradientPairs.Count - 1; } /// @@ -369,6 +385,38 @@ public static GradientPair GetRandomCuratedGradient() return s_CuratedGradientPairs[s_RandomCuratedGradientPairPosition];; } + + /// + /// Fetch a custom-curated lighter-luma Unity brand-specific color scheme (pair of differing brand-swatches) + /// + /// Gradient pair of two curated lighter-luma brand-swatches + public static GradientPair GetRandomCuratedLightGradient() + { + var randomPosition = s_ColorRandom.Next(s_CuratedLightGradientPairsRange); + + while (randomPosition == s_RandomCuratedLightGradientPairPosition) + randomPosition = s_ColorRandom.Next(s_CuratedLightGradientPairsRange); + + s_RandomCuratedLightGradientPairPosition = randomPosition; + + return s_CuratedLightGradientPairs[s_RandomCuratedLightGradientPairPosition];; + } + + /// + /// Fetch a custom-curated darker-luma Unity brand-specific color scheme (pair of differing brand-swatches) + /// + /// Gradient pair of two curated darker-luma brand-swatches + public static GradientPair GetRandomCuratedDarkGradient() + { + var randomPosition = s_ColorRandom.Next(s_CuratedDarkGradientPairsRange); + + while (randomPosition == s_RandomCuratedDarkGradientPairPosition) + randomPosition = s_ColorRandom.Next(s_CuratedDarkGradientPairsRange); + + s_RandomCuratedDarkGradientPairPosition = randomPosition; + + return s_CuratedDarkGradientPairs[s_RandomCuratedDarkGradientPairPosition];; + } } } #endif From 270e076fa268ad8f5b1f2cd11d810e5b1a13de6e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 15:47:22 -0700 Subject: [PATCH 205/870] Refine available curated gradients in UnityBrandColorScheme --- Scripts/Utilities/UnityBrandColorScheme.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 07abe59d4..845998143 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -270,7 +270,6 @@ private static void SetupUnityBrandColors() s_CuratedDarkGradientPairs.Add(new GradientPair(red, darker)); s_CuratedDarkGradientPairs.Add(new GradientPair(red, darkBlue)); s_CuratedDarkGradientPairs.Add(new GradientPair(lime, darkBlue)); - s_CuratedDarkGradientPairs.Add(new GradientPair(lime, limeDark)); s_CuratedDarkGradientPairs.Add(new GradientPair(lime, greenDark)); s_CuratedDarkGradientPairs.Add(new GradientPair(lime, cyanDark)); s_CuratedDarkGradientPairs.Add(new GradientPair(lime, darker)); @@ -288,7 +287,7 @@ private static void SetupUnityBrandColors() s_CuratedLightGradientPairs.Add(new GradientPair(lime, greenLight)); s_CuratedLightGradientPairs.Add(new GradientPair(red, redLight)); s_CuratedLightGradientPairs.Add(new GradientPair(red, yellow)); - s_CuratedLightGradientPairs.Add(new GradientPair(red, orange)); + s_CuratedLightGradientPairs.Add(new GradientPair(lime, limeDark)); s_CuratedLightGradientPairs.Add(new GradientPair(red, orangeLight)); s_CuratedLightGradientPairs.Add(new GradientPair(lime, orange)); s_CuratedLightGradientPairs.Add(new GradientPair(lime, teal)); @@ -305,8 +304,10 @@ private static void SetupUnityBrandColors() s_CuratedLightGradientPairs.Add(new GradientPair(blue, lime)); s_CuratedLightGradientPairs.Add(new GradientPair(blue, yellowLight)); + // A common collection of curated gradient pairs that arent separated by their luma values s_CuratedGradientPairs.AddRange(s_CuratedDarkGradientPairs); s_CuratedGradientPairs.AddRange(s_CuratedLightGradientPairs); + s_CuratedGradientPairsRange = s_CuratedGradientPairs.Count - 1; s_CuratedLightGradientPairsRange = s_CuratedLightGradientPairs.Count - 1; s_CuratedDarkGradientPairsRange = s_CuratedDarkGradientPairs.Count - 1; From 195b3df660c467c270b4c9d72352effb7d2ba62e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 15:47:57 -0700 Subject: [PATCH 206/870] Fetch a dark curated gradient and assign as the session gradient in EditorVR --- Scripts/Core/EditorVR.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index dfa8d3ea3..0d9d21bd2 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -166,7 +166,7 @@ void Awake() workspaceModule.workspaceDestroyed += vacuumables.OnWorkspaceDestroyed; workspaceModule.workspaceDestroyed += miniWorlds.OnWorkspaceDestroyed; - UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedGradient(); + UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedDarkGradient(); var sceneObjectModule = AddModule(); sceneObjectModule.tryPlaceObject = (obj, targetScale) => From 230e329d7bad8c659645f156359c388b2d54a83b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 15:48:53 -0700 Subject: [PATCH 207/870] Prevent active tool and main menu from activating the secondary PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 404c683a9..b1cdf6df4 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -52,12 +52,12 @@ public Type toolType tooltipText = toolType.Name; // Tools other than select fetch a random gradientPair; also used by the device when highlighted - gradientPair = UnityBrandColorScheme.GetRandomCuratedGradient(); + gradientPair = UnityBrandColorScheme.GetRandomCuratedDarkGradient(); } activeTool = activeTool; m_GradientButton.visible = true; - m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); + //m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; @@ -573,7 +573,9 @@ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) } this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + + if (!activeTool) + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); return; Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); @@ -726,6 +728,7 @@ IEnumerator AnimatePosition(int orderPosition, int buttonCount) m_PositionCoroutine = null; } + /* IEnumerator AnimateSemiTransparentX(bool makeSemiTransparent) { //if (!makeSemiTransparent) @@ -775,6 +778,7 @@ IEnumerator AnimateSemiTransparentX(bool makeSemiTransparent) m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); m_IconContainer.localScale = targetIconContainerScale; } + */ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) { @@ -862,7 +866,7 @@ IEnumerator ShowSecondaryButton() { amount += Time.unscaledDeltaTime * 10f; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 39.5f, shapedAmount)); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 47.63f, shapedAmount)); yield return null; } From c3bb8ea6e03478d344ad8ef3cd5b2776d3c782b5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 15:50:26 -0700 Subject: [PATCH 208/870] Update colliders on PinnedToolButton prefab to accommodate new secondary button blendShape boundaries --- Prefabs/UI/PinnedToolButton.prefab | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index a191cee2a..a2485b00b 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -486,6 +486,7 @@ GameObject: - 65: {fileID: 65000012371166842} - 65: {fileID: 65000010009342954} - 65: {fileID: 65000011946148642} + - 65: {fileID: 65000012409633396} m_Layer: 5 m_Name: GradientButton m_TagString: Untagged @@ -990,6 +991,18 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.18, y: 0.005, z: 0.04} m_Center: {x: 0, y: 0, z: 0.05} +--- !u!65 &65000012409633396 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014093660532} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.235, y: 0.005, z: 0.1} + m_Center: {x: 0, y: 0, z: -0.15} --- !u!65 &65000012740030200 BoxCollider: m_ObjectHideFlags: 1 @@ -1448,7 +1461,7 @@ SkinnedMeshRenderer: m_Mesh: {fileID: 4300022, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} m_Bones: [] m_BlendShapeWeights: - - 71.5 + - 62 m_RootBone: {fileID: 0} m_AABB: m_Center: {x: 0.010867998, y: 0, z: -0.03129649} @@ -1532,7 +1545,7 @@ SkinnedMeshRenderer: m_Bones: [] m_BlendShapeWeights: - 0 - - 39.4 + - 47.63 m_RootBone: {fileID: 0} m_AABB: m_Center: {x: 0.04595294, y: -0.0000000017462298, z: -0.19399026} @@ -1574,7 +1587,7 @@ SkinnedMeshRenderer: m_Mesh: {fileID: 4300024, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} m_Bones: [] m_BlendShapeWeights: - - 71.5 + - 62 m_RootBone: {fileID: 0} m_AABB: m_Center: {x: 0.057552528, y: 0.0014277332, z: -0.26775372} From cf6fb67268b60538920697cda753298626cc9e29 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 16:59:08 -0700 Subject: [PATCH 209/870] Further refine the light and dark curated gradient collections in UnityBrandColorScheme --- Scripts/Utilities/UnityBrandColorScheme.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 845998143..338ec78bb 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -257,14 +257,11 @@ private static void SetupUnityBrandColors() s_CuratedDarkGradientPairs.Add(new GradientPair(blueDark, cyan)); s_CuratedDarkGradientPairs.Add(new GradientPair(blueDark, darkBlue)); s_CuratedDarkGradientPairs.Add(new GradientPair(blueDark, redDark)); - s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, redLight)); s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, magenta)); s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, teal)); s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, green)); s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, lime)); - s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, yellowLight)); s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, darkBlue)); - s_CuratedDarkGradientPairs.Add(new GradientPair(orangeDark, orangeLight)); s_CuratedDarkGradientPairs.Add(new GradientPair(orangeDark, redDark)); s_CuratedDarkGradientPairs.Add(new GradientPair(orangeDark, darker)); s_CuratedDarkGradientPairs.Add(new GradientPair(red, darker)); @@ -283,6 +280,9 @@ private static void SetupUnityBrandColors() s_CuratedDarkGradientPairs.Add(new GradientPair(blue, blueDark)); // Setup light-luma curated gradient pairs + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, redLight)); + s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, yellowLight)); + s_CuratedDarkGradientPairs.Add(new GradientPair(orangeDark, orangeLight)); s_CuratedLightGradientPairs.Add(new GradientPair(red, blue)); s_CuratedLightGradientPairs.Add(new GradientPair(lime, greenLight)); s_CuratedLightGradientPairs.Add(new GradientPair(red, redLight)); From 37c4331e0e20614a20b50a1c36343d681a37e5aa Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 16:59:51 -0700 Subject: [PATCH 210/870] Add animated blendshape support to the secondary PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index b1cdf6df4..62c7519d6 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -339,6 +339,7 @@ public bool highlighted // Set all buttons back to the center // Tools with orders greater than that of the active tool should hide themseleves when the pinned tools arent being hovered newOrderPosition = isMainMenu ? 0 : k_ActiveToolOrderPosition; + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); } this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newOrderPosition, buttonCount)); @@ -437,6 +438,8 @@ void Start() m_GradientButton.containerContentsAnimationSpeedMultiplier = 2.5f; m_FrameRenderer.SetBlendShapeWeight(1, 0f); + m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, 100f); + m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, 100f); //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; @@ -504,7 +507,7 @@ void OnBackgroundHoverEnter () m_GradientButton.highlighted = true; return; } - else + else if (!isSelectionTool) { this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } @@ -573,9 +576,7 @@ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) } this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); - - if (!activeTool) - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); return; Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); @@ -853,8 +854,12 @@ void CorrectIconRotation() IEnumerator ShowSecondaryButton() { - var amount = 0f; + const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; + const float kSecondaryButtonVisibleBlendShapeWeight = 46f; + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); + var amount = 0f; while (amount < 0.25f) { amount += Time.unscaledDeltaTime; @@ -866,7 +871,9 @@ IEnumerator ShowSecondaryButton() { amount += Time.unscaledDeltaTime * 10f; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 47.63f, shapedAmount)); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kFrameSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); + m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); + m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); yield return null; } @@ -875,13 +882,18 @@ IEnumerator ShowSecondaryButton() IEnumerator HideSecondaryButton() { + const float kSecondaryButtonHiddenBlendShapeWeight = 100f; + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); var amount = 0f; while (amount < 1f) { amount += Time.unscaledDeltaTime * 8f; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); + m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); + m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); yield return null; } From 5d8aa0547fc5820ab372da7914babe96d72ddc64 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 17:00:53 -0700 Subject: [PATCH 211/870] Add depth to the secondary PinnedToolButton FBX mesh --- Models/PinnedToolButtonMesh.fbx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Models/PinnedToolButtonMesh.fbx b/Models/PinnedToolButtonMesh.fbx index 36d0f4f65..889023c72 100644 --- a/Models/PinnedToolButtonMesh.fbx +++ b/Models/PinnedToolButtonMesh.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:327d5b3daf2659586e80256ecacef62bb4c3a78d868633e3518a1b657677dfa3 -size 37404 +oid sha256:a75a681515544c7d18d2dfefaf9cb0a4bcf4876c4c75fd97bd0bea98c3051750 +size 37244 From 7da1dc8c1d46121c53f57273ce05589da8c0cb18 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 17:19:02 -0700 Subject: [PATCH 212/870] Add support for animating alpha of secondary button UI canvas content in PinnedToolButton & prefab --- Prefabs/UI/PinnedToolButton.prefab | 633 +++++++++++++++++++++++------ Scripts/UI/PinnedToolButton.cs | 8 + 2 files changed, 510 insertions(+), 131 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index a2485b00b..4d9b0b0fd 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -11,48 +11,49 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 1000010204453368} m_IsPrefabParent: 1 ---- !u!1 &1000010187295322 +--- !u!1 &1000010001831882 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 m_Component: - - 4: {fileID: 4000012648346800} + - 224: {fileID: 224000010289694770} + - 222: {fileID: 222000010473341124} + - 114: {fileID: 114000011650556854} m_Layer: 5 - m_Name: RotationOffsetContainer + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000010204453368 +--- !u!1 &1000010187295322 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 m_Component: - - 4: {fileID: 4000012504767854} - - 114: {fileID: 114000011260412956} + - 4: {fileID: 4000012648346800} m_Layer: 5 - m_Name: PinnedToolButton + m_Name: RotationOffsetContainer m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000010351058842 +--- !u!1 &1000010204453368 GameObject: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 4 m_Component: - - 4: {fileID: 4000010081970184} - - 225: {fileID: 225000010875730614} + - 4: {fileID: 4000012504767854} + - 114: {fileID: 114000011260412956} m_Layer: 5 - m_Name: IconContainer + m_Name: PinnedToolButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -91,6 +92,31 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000010692782980 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000011571037388} + - 33: {fileID: 33000012601387000} + - 23: {fileID: 23000013593520400} + - 114: {fileID: 114000014181189902} + - 65: {fileID: 65000012469590154} + - 65: {fileID: 65000012136550866} + - 65: {fileID: 65000010544999880} + - 65: {fileID: 65000012534630730} + - 65: {fileID: 65000011774431502} + - 65: {fileID: 65000013092476136} + - 65: {fileID: 65000013413917816} + m_Layer: 5 + m_Name: GradientButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000010714816488 GameObject: m_ObjectHideFlags: 1 @@ -140,6 +166,22 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000011211658308 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012079080268} + - 225: {fileID: 225000012815828682} + m_Layer: 5 + m_Name: SecondaryUIContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000011241481320 GameObject: m_ObjectHideFlags: 1 @@ -172,6 +214,22 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000011490841208 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011872301252} + - 225: {fileID: 225000010727404378} + m_Layer: 5 + m_Name: IconContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000011695512812 GameObject: m_ObjectHideFlags: 1 @@ -202,6 +260,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000011851968468 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000013307387580} + - 222: {fileID: 222000013531508252} + - 114: {fileID: 114000013859744370} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000011915299818 GameObject: m_ObjectHideFlags: 1 @@ -298,6 +373,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1000013077063568 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 224: {fileID: 224000012246060254} + - 222: {fileID: 222000013219081446} + - 114: {fileID: 114000012344975988} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1000013126942410 GameObject: m_ObjectHideFlags: 1 @@ -366,23 +458,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!1 &1000013805247488 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 - m_Component: - - 224: {fileID: 224000010630333128} - - 222: {fileID: 222000013997269160} - - 114: {fileID: 114000011073612486} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000013816124996 GameObject: m_ObjectHideFlags: 1 @@ -399,7 +474,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!1 &1000013929112766 GameObject: m_ObjectHideFlags: 1 @@ -479,16 +554,16 @@ GameObject: serializedVersion: 4 m_Component: - 224: {fileID: 224000011060550722} - - 33: {fileID: 33000013208543088} - - 23: {fileID: 23000013566874788} - 114: {fileID: 114000010373680160} - 65: {fileID: 65000011941282114} - 65: {fileID: 65000012371166842} - 65: {fileID: 65000010009342954} - 65: {fileID: 65000011946148642} - 65: {fileID: 65000012409633396} + - 65: {fileID: 65000010321053192} + - 65: {fileID: 65000011573248474} m_Layer: 5 - m_Name: GradientButton + m_Name: SecondaryGradientButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -511,21 +586,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4000010081970184 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010351058842} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -2.0372681e-10, y: -0.0027, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 224000010630333128} - - {fileID: 224000013933582366} - m_Father: {fileID: 224000013167097666} - m_RootOrder: 1 --- !u!4 &4000010261126032 Transform: m_ObjectHideFlags: 1 @@ -543,7 +603,7 @@ Transform: - {fileID: 4000012297013730} - {fileID: 4000013243584372} m_Father: {fileID: 4000012648346800} - m_RootOrder: 3 + m_RootOrder: 4 --- !u!4 &4000010683372396 Transform: m_ObjectHideFlags: 1 @@ -576,8 +636,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012104234552} - m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} - m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalRotation: {x: -0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] @@ -596,14 +656,44 @@ Transform: m_Children: [] m_Father: {fileID: 4000013373873342} m_RootOrder: 0 +--- !u!4 &4000011872301252 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011490841208} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.0372681e-10, y: -0.0027, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000010289694770} + - {fileID: 224000013307387580} + m_Father: {fileID: 224000013167097666} + m_RootOrder: 1 +--- !u!4 &4000012079080268 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011211658308} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.0372681e-10, y: -0.0624, z: -0} + m_LocalScale: {x: 0.9999999, y: 1.0000001, z: 1.0000001} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 224000012246060254} + - {fileID: 224000013933582366} + m_Father: {fileID: 224000013167097666} + m_RootOrder: 3 --- !u!4 &4000012190781878 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014082726766} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0.0012, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.0372681e-10, y: -0.00120008, z: 0} m_LocalScale: {x: 2.7019417, y: 2.7019417, z: 2.7019417} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] @@ -615,8 +705,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013163218754} - m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} - m_LocalPosition: {x: -0.00034302473, y: 0.0027439394, z: -0.24102145} + m_LocalRotation: {x: -0, y: 0.09801716, z: -0, w: 0.9951847} + m_LocalPosition: {x: -0.00034302473, y: 0.002743939, z: -0.24102153} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] @@ -662,6 +752,7 @@ Transform: m_Children: - {fileID: 4000010683372396} - {fileID: 4000013378434912} + - {fileID: 224000011571037388} - {fileID: 224000011060550722} - {fileID: 4000010261126032} - {fileID: 4000013373873342} @@ -709,7 +800,7 @@ Transform: - {fileID: 4000012896115128} - {fileID: 4000013614942004} m_Father: {fileID: 4000012648346800} - m_RootOrder: 4 + m_RootOrder: 5 --- !u!4 &4000013378434912 Transform: m_ObjectHideFlags: 1 @@ -749,7 +840,7 @@ Transform: m_Children: - {fileID: 224000013167097666} m_Father: {fileID: 4000012648346800} - m_RootOrder: 5 + m_RootOrder: 6 --- !u!23 &23000012760767544 MeshRenderer: m_ObjectHideFlags: 1 @@ -808,12 +899,12 @@ MeshRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 ---- !u!23 &23000013566874788 +--- !u!23 &23000013593520400 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014093660532} + m_GameObject: {fileID: 1000010692782980} m_Enabled: 0 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -924,12 +1015,12 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010746370754} m_Mesh: {fileID: 4300016, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} ---- !u!33 &33000013208543088 +--- !u!33 &33000012601387000 MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014093660532} + m_GameObject: {fileID: 1000010692782980} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} --- !u!65 &65000010009342954 BoxCollider: @@ -939,6 +1030,30 @@ BoxCollider: m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Size: {x: 0.205, y: 0.005, z: 0.06} + m_Center: {x: 0, y: 0, z: -0} +--- !u!65 &65000010321053192 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014093660532} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Size: {x: 0.265, y: 0.005, z: 0.1} + m_Center: {x: 0, y: 0, z: -0.175} +--- !u!65 &65000010544999880 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_Material: {fileID: 0} + m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 m_Size: {x: 0.205, y: 0.005, z: 0.06} @@ -955,7 +1070,7 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.0345, y: 0.069, z: 0.01} m_Center: {x: 0, y: 0, z: 0} ---- !u!65 &65000011941282114 +--- !u!65 &65000011573248474 BoxCollider: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} @@ -963,8 +1078,32 @@ BoxCollider: m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Size: {x: 0.265, y: 0.005, z: 0.1} + m_Center: {x: 0, y: 0, z: -0.175} +--- !u!65 &65000011774431502 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_Material: {fileID: 0} + m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 + m_Size: {x: 0.235, y: 0.005, z: 0.1} + m_Center: {x: 0, y: 0, z: -0.15} +--- !u!65 &65000011941282114 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014093660532} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 m_Size: {x: 0.165, y: 0.005, z: 0.23} m_Center: {x: 0, y: 0, z: -0.015} --- !u!65 &65000011946148642 @@ -975,10 +1114,22 @@ BoxCollider: m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 2 m_Size: {x: 0.225, y: 0.005, z: 0.1} m_Center: {x: 0, y: 0, z: -0.08} +--- !u!65 &65000012136550866 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.18, y: 0.005, z: 0.04} + m_Center: {x: 0, y: 0, z: 0.05} --- !u!65 &65000012371166842 BoxCollider: m_ObjectHideFlags: 1 @@ -987,7 +1138,7 @@ BoxCollider: m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 2 m_Size: {x: 0.18, y: 0.005, z: 0.04} m_Center: {x: 0, y: 0, z: 0.05} @@ -999,10 +1150,34 @@ BoxCollider: m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 2 m_Size: {x: 0.235, y: 0.005, z: 0.1} m_Center: {x: 0, y: 0, z: -0.15} +--- !u!65 &65000012469590154 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.165, y: 0.005, z: 0.23} + m_Center: {x: 0, y: 0, z: -0.015} +--- !u!65 &65000012534630730 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.225, y: 0.005, z: 0.1} + m_Center: {x: 0, y: 0, z: -0.08} --- !u!65 &65000012740030200 BoxCollider: m_ObjectHideFlags: 1 @@ -1015,6 +1190,30 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.0345, y: 0.069, z: 0.01} m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65000013092476136 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.265, y: 0.005, z: 0.1} + m_Center: {x: 0, y: 0, z: -0.175} +--- !u!65 &65000013413917816 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.265, y: 0.005, z: 0.1} + m_Center: {x: 0, y: 0, z: -0.175} --- !u!114 &114000010373680160 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1028,23 +1227,22 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_NormalGradientPair: - a: {r: 0, g: 0, b: 0, a: 0} - b: {r: 0, g: 0, b: 0, a: 0} + a: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} + b: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_HighlightGradientPair: - a: {r: 0, g: 0, b: 0, a: 0} - b: {r: 0, g: 0, b: 0, a: 0} - m_ButtonMeshRenderer: {fileID: 137000013542685126} - m_IconContainer: {fileID: 4000010081970184} - m_ContentContainer: {fileID: 4000010081970184} - m_CanvasGroup: {fileID: 225000010875730614} + a: {r: 1, g: 0.92156863, b: 0.93333334, a: 1} + b: {r: 0.7176471, g: 0.10980392, b: 0.10980392, a: 1} + m_ButtonMeshRenderer: {fileID: 137000012837336366} + m_IconContainer: {fileID: 4000012079080268} + m_ContentContainer: {fileID: 4000012079080268} + m_CanvasGroup: {fileID: 225000012815828682} m_Text: {fileID: 114000010635728284} - m_Icon: {fileID: 114000011073612486} + m_Icon: {fileID: 114000012344975988} m_AlternateIconSprite: {fileID: 0} m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItems: - - {fileID: 114000011073612486} - - {fileID: 114000010635728284} + - {fileID: 114000011650556854} m_DelayBeforeReveal: 0 m_highlightZScaleMultiplier: 10 --- !u!114 &114000010635728284 @@ -1080,13 +1278,40 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: A ---- !u!114 &114000011073612486 + m_Text: close +--- !u!114 &114000011260412956 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010204453368} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d327b5d520391fe4da32c92a940cfbfa, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_GradientButton: {fileID: 114000014181189902} + m_SmoothMotion: {fileID: 0} + m_IconContainer: {fileID: 4000011872301252} + m_IconContainerCanvasGroup: {fileID: 225000010727404378} + m_FrameRenderer: {fileID: 137000012108747896} + m_InsetMeshRenderer: {fileID: 137000013542685126} + m_SecondaryButtonContainerCanvasGroup: {fileID: 225000012815828682} + m_SecondaryInsetMeshRenderer: {fileID: 137000012837336366} + m_SecondaryInsetMaskMeshRenderer: {fileID: 137000010072420284} + m_TooltipTarget: {fileID: 4000010683372396} + m_TooltipSource: {fileID: 4000013378434912} + m_AlternateLocalPosition: {x: 0, y: 0, z: 0} + m_Inset: {fileID: 4000013614942004} + m_InsetMask: {fileID: 4000011771676402} + m_ButtonIcon: {fileID: 114000011650556854} +--- !u!114 &114000011650556854 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013805247488} + m_GameObject: {fileID: 1000010001831882} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1109,32 +1334,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114000011260412956 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010204453368} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d327b5d520391fe4da32c92a940cfbfa, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RunInEditMode: 0 - m_GradientButton: {fileID: 114000010373680160} - m_SmoothMotion: {fileID: 0} - m_IconContainer: {fileID: 4000010081970184} - m_IconContainerCanvasGroup: {fileID: 225000010875730614} - m_FrameRenderer: {fileID: 137000012108747896} - m_InsetMeshRenderer: {fileID: 137000013542685126} - m_SecondaryInsetMeshRenderer: {fileID: 137000012837336366} - m_SecondaryInsetMaskMeshRenderer: {fileID: 137000010072420284} - m_TooltipTarget: {fileID: 4000010683372396} - m_TooltipSource: {fileID: 4000013378434912} - m_AlternateLocalPosition: {x: 0, y: 0, z: 0} - m_Inset: {fileID: 4000013614942004} - m_InsetMask: {fileID: 4000011771676402} - m_ButtonIcon: {fileID: 114000011073612486} --- !u!114 &114000011796366970 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1215,6 +1414,34 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114000012344975988 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013077063568} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 --- !u!114 &114000012662170858 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1412,6 +1639,40 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114000013859744370 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011851968468} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 007346dc664d64847a830c562c9659f9, type: 3} + m_FontSize: 250 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 0 + m_MaxSize: 250 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: A --- !u!114 &114000013866165818 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1425,6 +1686,38 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_ShowMaskGraphic: 0 +--- !u!114 &114000014181189902 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_NormalGradientPair: + a: {r: 0, g: 0, b: 0, a: 0} + b: {r: 0, g: 0, b: 0, a: 0} + m_HighlightGradientPair: + a: {r: 0, g: 0, b: 0, a: 0} + b: {r: 0, g: 0, b: 0, a: 0} + m_ButtonMeshRenderer: {fileID: 137000013542685126} + m_IconContainer: {fileID: 4000011872301252} + m_ContentContainer: {fileID: 4000011872301252} + m_CanvasGroup: {fileID: 225000010727404378} + m_Text: {fileID: 114000013859744370} + m_Icon: {fileID: 114000011650556854} + m_AlternateIconSprite: {fileID: 0} + m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightItems: + - {fileID: 114000011650556854} + - {fileID: 114000013859744370} + m_DelayBeforeReveal: 0 + m_highlightZScaleMultiplier: 10 --- !u!137 &137000010072420284 SkinnedMeshRenderer: m_ObjectHideFlags: 1 @@ -1461,7 +1754,7 @@ SkinnedMeshRenderer: m_Mesh: {fileID: 4300022, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} m_Bones: [] m_BlendShapeWeights: - - 62 + - 46 m_RootBone: {fileID: 0} m_AABB: m_Center: {x: 0.010867998, y: 0, z: -0.03129649} @@ -1545,7 +1838,7 @@ SkinnedMeshRenderer: m_Bones: [] m_BlendShapeWeights: - 0 - - 47.63 + - 61 m_RootBone: {fileID: 0} m_AABB: m_Center: {x: 0.04595294, y: -0.0000000017462298, z: -0.19399026} @@ -1587,7 +1880,7 @@ SkinnedMeshRenderer: m_Mesh: {fileID: 4300024, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} m_Bones: [] m_BlendShapeWeights: - - 62 + - 46 m_RootBone: {fileID: 0} m_AABB: m_Center: {x: 0.057552528, y: 0.0014277332, z: -0.26775372} @@ -1635,6 +1928,12 @@ SkinnedMeshRenderer: m_Center: {x: 0.04259277, y: -0.0013104333, z: -0.19421075} m_Extent: {x: 0.034564152, y: 0.006972273, z: 0.035469398} m_DirtyAABB: 0 +--- !u!222 &222000010473341124 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010001831882} --- !u!222 &222000011018194712 CanvasRenderer: m_ObjectHideFlags: 1 @@ -1671,18 +1970,24 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013207144374} +--- !u!222 &222000013219081446 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013077063568} --- !u!222 &222000013364307902 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011241481320} ---- !u!222 &222000013997269160 +--- !u!222 &222000013531508252 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013805247488} + m_GameObject: {fileID: 1000011851968468} --- !u!222 &222000014289754014 CanvasRenderer: m_ObjectHideFlags: 1 @@ -1708,41 +2013,41 @@ Canvas: m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 ---- !u!224 &224000010555036514 +--- !u!224 &224000010289694770 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010561241686} + m_GameObject: {fileID: 1000010001831882} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000010134187} - m_LocalScale: {x: 0.00008000002, y: 0.00008000015, z: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000027384143} + m_LocalScale: {x: 2.7019417, y: 2.7019424, z: 2.7019436} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 224000014065128128} - m_RootOrder: 2 + m_Father: {fileID: 4000011872301252} + m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} - m_SizeDelta: {x: 268.38452, y: 268.38452} + m_AnchoredPosition: {x: -7.8898665e-11, y: 0.00000038940925} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000010630333128 +--- !u!224 &224000010555036514 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013805247488} + m_GameObject: {fileID: 1000010561241686} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000027384143} - m_LocalScale: {x: 2.7019417, y: 2.7019424, z: 2.7019436} + m_LocalPosition: {x: 0, y: 0, z: -0.000010134187} + m_LocalScale: {x: 0.00008000002, y: 0.00008000015, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 4000010081970184} - m_RootOrder: 0 + m_Father: {fileID: 224000014065128128} + m_RootOrder: 2 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -7.8898665e-11, y: 0.00000038940925} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} + m_SizeDelta: {x: 268.38452, y: 268.38452} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010919883134 RectTransform: @@ -1770,6 +2075,24 @@ RectTransform: m_GameObject: {fileID: 1000014093660532} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.15000011} + m_LocalScale: {x: 0.42501074, y: 0.49999997, z: 0.42501074} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012648346800} + m_RootOrder: 3 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011571037388 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010692782980} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.15000011} m_LocalScale: {x: 0.425, y: 0.50000024, z: 0.42500025} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] @@ -1798,6 +2121,24 @@ RectTransform: m_AnchoredPosition: {x: 0.0000032186508, y: -0.000000029802322} m_SizeDelta: {x: -0.00001, y: -0.00007} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012246060254 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013077063568} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.000027384143} + m_LocalScale: {x: 2.7019417, y: 2.7019424, z: 2.7019436} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000012079080268} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -7.8898665e-11, y: 0.00000038940925} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012388631740 RectTransform: m_ObjectHideFlags: 1 @@ -1851,8 +2192,9 @@ RectTransform: m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: - {fileID: 224000012760332454} - - {fileID: 4000010081970184} + - {fileID: 4000011872301252} - {fileID: 4000012190781878} + - {fileID: 4000012079080268} m_Father: {fileID: 4000013747407424} m_RootOrder: 0 m_AnchorMin: {x: 0.5, y: 0.5} @@ -1878,6 +2220,24 @@ RectTransform: m_AnchoredPosition: {x: 0, y: -0.0002999992} m_SizeDelta: {x: 0.0413, y: 0.0413} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013307387580 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011851968468} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.00021615531, y: 0.00021615547, z: 2.7019436} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011872301252} + m_RootOrder: 1 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.00020984784, y: 0.0013569929} + m_SizeDelta: {x: 224.9724, y: 224.9724} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013910327088 RectTransform: m_ObjectHideFlags: 1 @@ -1907,7 +2267,7 @@ RectTransform: m_LocalScale: {x: 0.00021615531, y: 0.00021615547, z: 2.7019436} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] - m_Father: {fileID: 4000010081970184} + m_Father: {fileID: 4000012079080268} m_RootOrder: 1 m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -1953,12 +2313,12 @@ RectTransform: m_AnchoredPosition: {x: 0.051074997, y: -0.03575} m_SizeDelta: {x: 0.03405, y: 0.0715} m_Pivot: {x: 0.5, y: 0.5} ---- !u!225 &225000010875730614 +--- !u!225 &225000010727404378 CanvasGroup: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010351058842} + m_GameObject: {fileID: 1000011490841208} m_Enabled: 1 m_Alpha: 1 m_Interactable: 1 @@ -1975,6 +2335,17 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 +--- !u!225 &225000012815828682 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011211658308} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 --- !u!225 &225000013730456080 CanvasGroup: m_ObjectHideFlags: 1 diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 62c7519d6..e09856924 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -216,6 +216,9 @@ public Transform alternateMenuOrigin [SerializeField] SkinnedMeshRenderer m_InsetMeshRenderer; + [SerializeField] + CanvasGroup m_SecondaryButtonContainerCanvasGroup; + [SerializeField] SkinnedMeshRenderer m_SecondaryInsetMeshRenderer; @@ -441,6 +444,7 @@ void Start() m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, 100f); m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, 100f); + m_SecondaryButtonContainerCanvasGroup.alpha = 0f; //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; //m_LeftPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; @@ -859,6 +863,7 @@ IEnumerator ShowSecondaryButton() var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); + var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; var amount = 0f; while (amount < 0.25f) { @@ -874,6 +879,7 @@ IEnumerator ShowSecondaryButton() m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kFrameSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); + m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 1f, shapedAmount); yield return null; } @@ -886,6 +892,7 @@ IEnumerator HideSecondaryButton() var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); + var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; var amount = 0f; while (amount < 1f) { @@ -894,6 +901,7 @@ IEnumerator HideSecondaryButton() m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); + m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 0f, shapedAmount); yield return null; } From f800d59ff8259d962bfa10849df2aec68dc4a1e7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 22:36:43 -0700 Subject: [PATCH 213/870] Add additional curated dark gradient pairs to UnityBrandColorScheme --- Scripts/Utilities/UnityBrandColorScheme.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 8831bb143..6e95da4ac 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -295,7 +295,12 @@ private static void SetupUnityBrandColors() // Setup dark-luma curated gradient pairs s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, darkBlue)); s_CuratedDarkGradientPairs.Add(new GradientPair(blueDark, darkBlue)); - s_CuratedDarkGradientPairs.Add(new GradientPair(orangeDark, darker)); + s_CuratedDarkGradientPairs.Add(new GradientPair(redDark, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(yellowDark, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(cyanDark, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(greenDark, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(purpleDark, darkBlue)); + s_CuratedDarkGradientPairs.Add(new GradientPair(darkBlueLight, darkBlue)); // Setup light-luma curated gradient pairs s_CuratedLightGradientPairs.Add(new GradientPair(redLight, tealDark)); From bd4f750296a057dbcc769e6558e63bedc78cddeb Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 22:39:27 -0700 Subject: [PATCH 214/870] Add support for fetching the highlighted state of a GradientButton --- Scripts/UI/GradientButton.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 79b8e793d..c09008edd 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -50,6 +50,7 @@ public bool pressed public bool highlighted { + get { return m_Highlighted; } set { if (m_Highlighted == value) From 00812864f01ffd209e1e9c5bbcb842d50f3ddf31 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 22:44:07 -0700 Subject: [PATCH 215/870] Add new secondary PinnedToolButton material --- .../Materials/PinnedToolSecondaryButton.mat | 154 ++++++++++++++++++ .../PinnedToolSecondaryButton.mat.meta | 8 + 2 files changed, 162 insertions(+) create mode 100644 Prefabs/UI/Materials/PinnedToolSecondaryButton.mat create mode 100644 Prefabs/UI/Materials/PinnedToolSecondaryButton.mat.meta diff --git a/Prefabs/UI/Materials/PinnedToolSecondaryButton.mat b/Prefabs/UI/Materials/PinnedToolSecondaryButton.mat new file mode 100644 index 000000000..dd0fa94bf --- /dev/null +++ b/Prefabs/UI/Materials/PinnedToolSecondaryButton.mat @@ -0,0 +1,154 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: PinnedToolSecondaryButton + m_Shader: {fileID: 4800000, guid: c8cf0b95851289d40aecbbb604f214fd, type: 3} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION + m_LightmapFlags: 1 + m_CustomRenderQueue: -1 + stringTagMap: {} + m_SavedProperties: + serializedVersion: 2 + m_TexEnvs: + - first: + name: _BumpMap + second: + m_Texture: {fileID: 2800000, guid: 06dc8da358c6ebb4dad67b286b513f95, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailAlbedoMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailMask + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _DetailNormalMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _EmissionMap + second: + m_Texture: {fileID: 2800000, guid: 3cd61233b718b974e99810df6209b4c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MainTex + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _MetallicGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _OcclusionMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _ParallaxMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - first: + name: _SpecGlossMap + second: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - first: + name: _Alpha + second: 1 + - first: + name: _BumpScale + second: 2 + - first: + name: _Cutoff + second: 0.5 + - first: + name: _DetailNormalMapScale + second: 1 + - first: + name: _DstBlend + second: 10 + - first: + name: _GlossMapScale + second: 0.414 + - first: + name: _Glossiness + second: 0.5 + - first: + name: _GlossyReflections + second: 1 + - first: + name: _InvFade + second: 1 + - first: + name: _Metallic + second: 0.256 + - first: + name: _Mode + second: 3 + - first: + name: _OcclusionStrength + second: 1 + - first: + name: _Parallax + second: 0.02 + - first: + name: _SmoothnessTextureChannel + second: 0 + - first: + name: _SpecularHighlights + second: 1 + - first: + name: _SrcBlend + second: 1 + - first: + name: _UVSec + second: 0 + - first: + name: _ZWrite + second: 0 + m_Colors: + - first: + name: _Color + second: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + - first: + name: _ColorBottom + second: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + - first: + name: _ColorTop + second: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} + - first: + name: _EmisColor + second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 0} + - first: + name: _EmissionColor + second: {r: 0, g: 0, b: 0, a: 1} + - first: + name: _SpecColor + second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - first: + name: _TintColor + second: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} diff --git a/Prefabs/UI/Materials/PinnedToolSecondaryButton.mat.meta b/Prefabs/UI/Materials/PinnedToolSecondaryButton.mat.meta new file mode 100644 index 000000000..df7507b39 --- /dev/null +++ b/Prefabs/UI/Materials/PinnedToolSecondaryButton.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ef6d03792ba2890479b324aa1f065715 +timeCreated: 1469840733 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From 9f96e72508540c046b85108e53a02f27408f424f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 22:45:20 -0700 Subject: [PATCH 216/870] Add initial hover support to secondary PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index e09856924..74c3f8681 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -216,6 +216,9 @@ public Transform alternateMenuOrigin [SerializeField] SkinnedMeshRenderer m_InsetMeshRenderer; + [SerializeField] + GradientButton m_SecondaryGradientButton; + [SerializeField] CanvasGroup m_SecondaryButtonContainerCanvasGroup; @@ -444,6 +447,8 @@ void Start() m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, 100f); m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, 100f); + m_SecondaryGradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions + m_SecondaryGradientButton.hoverExit += OnActionButtonHoverExit; m_SecondaryButtonContainerCanvasGroup.alpha = 0f; //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; @@ -501,7 +506,7 @@ bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) void OnBackgroundHoverEnter () { - if (m_PositionCoroutine != null) + if (m_PositionCoroutine != null || m_SecondaryGradientButton.highlighted) return; s_Hovered = true; @@ -828,7 +833,7 @@ IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) duration += Time.unscaledDeltaTime; yield return null; - if (s_Hovered || m_PositionCoroutine != null) + if ((s_Hovered || m_PositionCoroutine != null) || m_SecondaryGradientButton.highlighted) { m_HoverCheckCoroutine = null; yield break; @@ -896,13 +901,20 @@ IEnumerator HideSecondaryButton() var amount = 0f; while (amount < 1f) { + yield return null; + + if (m_SecondaryGradientButton.highlighted) + { + m_SecondaryButtonVisibilityCoroutine = null; + yield break; + } + amount += Time.unscaledDeltaTime * 8f; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 0f, shapedAmount); - yield return null; } m_SecondaryButtonVisibilityCoroutine = null; From 48c4df9a9dc61e13afa9006e7d53eb805b359307 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 22:45:50 -0700 Subject: [PATCH 217/870] Adjust colliders and set new references in PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 33 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 4d9b0b0fd..be196e52a 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -1042,9 +1042,9 @@ BoxCollider: m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 0 + m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.265, y: 0.005, z: 0.1} + m_Size: {x: 0.265, y: 0.01, z: 0.1} m_Center: {x: 0, y: 0, z: -0.175} --- !u!65 &65000010544999880 BoxCollider: @@ -1078,9 +1078,9 @@ BoxCollider: m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 0 + m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.265, y: 0.005, z: 0.1} + m_Size: {x: 0.265, y: 0.01, z: 0.1} m_Center: {x: 0, y: 0, z: -0.175} --- !u!65 &65000011774431502 BoxCollider: @@ -1090,7 +1090,7 @@ BoxCollider: m_GameObject: {fileID: 1000010692782980} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 2 m_Size: {x: 0.235, y: 0.005, z: 0.1} m_Center: {x: 0, y: 0, z: -0.15} @@ -1150,10 +1150,10 @@ BoxCollider: m_GameObject: {fileID: 1000014093660532} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 0 + m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.235, y: 0.005, z: 0.1} - m_Center: {x: 0, y: 0, z: -0.15} + m_Size: {x: 0.238, y: 0.01, z: 0.11} + m_Center: {x: 0, y: 0, z: -0.14} --- !u!65 &65000012469590154 BoxCollider: m_ObjectHideFlags: 1 @@ -1176,8 +1176,8 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 0.225, y: 0.005, z: 0.1} - m_Center: {x: 0, y: 0, z: -0.08} + m_Size: {x: 0.225, y: 0.005, z: 0.06} + m_Center: {x: 0, y: 0, z: -0.06} --- !u!65 &65000012740030200 BoxCollider: m_ObjectHideFlags: 1 @@ -1198,7 +1198,7 @@ BoxCollider: m_GameObject: {fileID: 1000010692782980} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 2 m_Size: {x: 0.265, y: 0.005, z: 0.1} m_Center: {x: 0, y: 0, z: -0.175} @@ -1210,7 +1210,7 @@ BoxCollider: m_GameObject: {fileID: 1000010692782980} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 1 + m_Enabled: 0 serializedVersion: 2 m_Size: {x: 0.265, y: 0.005, z: 0.1} m_Center: {x: 0, y: 0, z: -0.175} @@ -1227,11 +1227,11 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_NormalGradientPair: - a: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} - b: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - m_HighlightGradientPair: a: {r: 1, g: 0.92156863, b: 0.93333334, a: 1} b: {r: 0.7176471, g: 0.10980392, b: 0.10980392, a: 1} + m_HighlightGradientPair: + a: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} + b: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_ButtonMeshRenderer: {fileID: 137000012837336366} m_IconContainer: {fileID: 4000012079080268} m_ContentContainer: {fileID: 4000012079080268} @@ -1297,6 +1297,7 @@ MonoBehaviour: m_IconContainerCanvasGroup: {fileID: 225000010727404378} m_FrameRenderer: {fileID: 137000012108747896} m_InsetMeshRenderer: {fileID: 137000013542685126} + m_SecondaryGradientButton: {fileID: 114000010373680160} m_SecondaryButtonContainerCanvasGroup: {fileID: 225000012815828682} m_SecondaryInsetMeshRenderer: {fileID: 137000012837336366} m_SecondaryInsetMaskMeshRenderer: {fileID: 137000010072420284} @@ -1857,7 +1858,7 @@ SkinnedMeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} + - {fileID: 2100000, guid: ef6d03792ba2890479b324aa1f065715, type: 2} m_SubsetIndices: m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} From 8ed8eb64bf1af9578caa5ef76c147fe9a5e364d1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 22:58:03 -0700 Subject: [PATCH 218/870] Add support for enabling/disabling secondary button collider depending on hover context --- Scripts/UI/PinnedToolButton.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 74c3f8681..1c748669e 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -46,6 +46,7 @@ public Type toolType order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair + secondaryButtonCollidersEnabled = false; } else { @@ -228,6 +229,9 @@ public Transform alternateMenuOrigin [SerializeField] SkinnedMeshRenderer m_SecondaryInsetMaskMeshRenderer; + [SerializeField] + Collider[] m_SecondaryButtonColliders; // disable for the main menu button & solitary active tool button + [SerializeField] Transform m_TooltipTarget; @@ -312,6 +316,17 @@ bool activeTool } } + private bool secondaryButtonCollidersEnabled + { + set + { + foreach (var collider in m_SecondaryButtonColliders) + { + collider.enabled = value; + } + } + } + public bool highlighted { get { return m_Highlighted; } @@ -337,14 +352,17 @@ public bool highlighted if (m_Highlighted) { buttonCount = activeButtonCount - 1; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); newOrderPosition -= 1; order = order; + secondaryButtonCollidersEnabled = true; } else { // Set all buttons back to the center // Tools with orders greater than that of the active tool should hide themseleves when the pinned tools arent being hovered newOrderPosition = isMainMenu ? 0 : k_ActiveToolOrderPosition; + secondaryButtonCollidersEnabled = false; this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); } From a6c4320b675567e84178be006270e73b54b01b00 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 23:12:46 -0700 Subject: [PATCH 219/870] Assign secondary button collider inspector references --- Prefabs/UI/PinnedToolButton.prefab | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index be196e52a..e18a1d1a9 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -1242,9 +1242,9 @@ MonoBehaviour: m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItems: - - {fileID: 114000011650556854} + - {fileID: 114000012344975988} m_DelayBeforeReveal: 0 - m_highlightZScaleMultiplier: 10 + m_highlightZScaleMultiplier: 25 --- !u!114 &114000010635728284 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1301,6 +1301,10 @@ MonoBehaviour: m_SecondaryButtonContainerCanvasGroup: {fileID: 225000012815828682} m_SecondaryInsetMeshRenderer: {fileID: 137000012837336366} m_SecondaryInsetMaskMeshRenderer: {fileID: 137000010072420284} + m_SecondaryButtonColliders: + - {fileID: 65000012409633396} + - {fileID: 65000010321053192} + - {fileID: 65000011573248474} m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} m_AlternateLocalPosition: {x: 0, y: 0, z: 0} From f31fce7e337f43db18986ed93f3a58e12d732b1e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 27 Apr 2017 23:13:02 -0700 Subject: [PATCH 220/870] Add close/delete functionality to secondary PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 1c748669e..15dac40a7 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -467,6 +467,7 @@ void Start() m_SecondaryGradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions m_SecondaryGradientButton.hoverExit += OnActionButtonHoverExit; + m_SecondaryGradientButton.click += OnSecondaryButtonClicked; m_SecondaryButtonContainerCanvasGroup.alpha = 0f; //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; @@ -674,6 +675,13 @@ void OnBackgroundButtonClick() m_GradientButton.UpdateMaterialColors(); } + void OnSecondaryButtonClicked() + { + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndClose()); + deletePinnedToolButton(rayOrigin, this); + OnActionButtonHoverExit(false); + } + IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) { m_IconContainerCanvasGroup.alpha = 1f; @@ -754,6 +762,9 @@ IEnumerator AnimatePosition(int orderPosition, int buttonCount) transform.localRotation = targetRotation; CorrectIconRotation(); m_PositionCoroutine = null; + + if (m_GradientButton.highlighted) + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } /* From e0335aeed3abc32654474efa029a46a15d1aa15b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 01:38:18 -0700 Subject: [PATCH 221/870] Refine curated GradientPairs --- Scripts/Utilities/UnityBrandColorScheme.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 6e95da4ac..f2d3a9b42 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -264,7 +264,6 @@ private static void SetupUnityBrandColors() s_CuratedGradientPairs.Add(new GradientPair(lime, limeDark)); s_CuratedGradientPairs.Add(new GradientPair(lime, magenta)); s_CuratedGradientPairs.Add(new GradientPair(magenta, purpleDark)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, darker)); s_CuratedGradientPairs.Add(new GradientPair(magenta, yellow)); s_CuratedGradientPairs.Add(new GradientPair(blue, purpleDark)); s_CuratedGradientPairs.Add(new GradientPair(blue, cyanDark)); @@ -272,7 +271,6 @@ private static void SetupUnityBrandColors() s_CuratedGradientPairs.Add(new GradientPair(blue, blueDark)); s_CuratedGradientPairs.Add(new GradientPair(red, darkBlue)); s_CuratedGradientPairs.Add(new GradientPair(blue, darkBlue)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, darkBlue)); s_CuratedGradientPairs.Add(new GradientPair(yellow, red)); s_CuratedGradientPairs.Add(new GradientPair(red, blue)); s_CuratedGradientPairs.Add(new GradientPair(magenta, cyan)); From 3b912a9fe4de7ff962488e137067fd4bcf05cf3e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 15:02:22 -0700 Subject: [PATCH 222/870] Fix issue preventing tools from being added to the left handed device --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index df421e288..eed50fb88 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -236,13 +236,6 @@ internal void OnMainMenuActivatorSelected(Transform rayOrigin) Debug.LogError("OnMainMenuActivatorSelected called!"); var targetToolRayOrigin = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin != rayOrigin).rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin == rayOrigin); - if (targetToolRayOrigin == null) - Debug.LogError("????????????????????????????????????????????????????????????"); - - foreach (var origin in deviceData.proxy.rayOrigins.Values) - { - targetToolRayOrigin = origin != rayOrigin ? origin : null; // Assign the opposite hand's rayOrigin - } if (deviceData != null) { From 8aec1c26c1e7af0c036b31562c5de6ef51730cf3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 15:03:51 -0700 Subject: [PATCH 223/870] Extend UV spacing for secondary button to better encompass 0-1 gradient layout --- Models/PinnedToolButtonMesh.fbx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Models/PinnedToolButtonMesh.fbx b/Models/PinnedToolButtonMesh.fbx index 889023c72..8aa62e46c 100644 --- a/Models/PinnedToolButtonMesh.fbx +++ b/Models/PinnedToolButtonMesh.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a75a681515544c7d18d2dfefaf9cb0a4bcf4876c4c75fd97bd0bea98c3051750 -size 37244 +oid sha256:bb90d5b7102916d92c8f962246cd667eacb318251054b50174664b9aad1fc441 +size 37180 From 15905b7e04e44141d51fe844e1261a54c9d1b9d8 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 19:44:05 -0700 Subject: [PATCH 224/870] Set the EditorVR session gradient via the new light curated gradients --- Scripts/Core/EditorVR.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index dfa8d3ea3..f1417d13f 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -166,7 +166,7 @@ void Awake() workspaceModule.workspaceDestroyed += vacuumables.OnWorkspaceDestroyed; workspaceModule.workspaceDestroyed += miniWorlds.OnWorkspaceDestroyed; - UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedGradient(); + UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedLightGradient(); var sceneObjectModule = AddModule(); sceneObjectModule.tryPlaceObject = (obj, targetScale) => From e764dc1752a544d3ce5b45cec20f5b96e6b33031 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 19:51:54 -0700 Subject: [PATCH 225/870] Prevent MainMenu from closing after selecting a new tool --- Scripts/Core/EditorVR.Tools.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 3d484abc1..aa14031e3 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -268,7 +268,8 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) } else { - deviceData.menuHideFlags[deviceData.mainMenu] |= Menus.MenuHideFlags.Hidden; + // TODO: Remove the below line after additional design review approval + //deviceData.menuHideFlags[deviceData.mainMenu] |= Menus.MenuHideFlags.Hidden; } }); From 387650c59144d32d52e0b7e64255031a8ec2aa92 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 19:52:58 -0700 Subject: [PATCH 226/870] Refactor "highlight" syntax to match the new "reveal" terminology used in PinnedToolButton --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 8 ++++---- Scripts/UI/Interfaces/IPinnedToolButton.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index eed50fb88..d5cfcf526 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -70,7 +70,7 @@ internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolT button.icon = buttonIcon; //button.order = button.activeToolOrderPosition; // first position is the active tool position button.deletePinnedToolButton = DeletePinnedToolButton; - button.highlightAllToolButtons = HighlightAllToolButtons; + button.highlightAllToolButtons = RevealAllToolButtons; button.selectTool = ToolButtonClicked; //button.selected += OnMainMenuActivatorSelected; button.hoverEnter += OnButtonHoverEnter; @@ -105,6 +105,7 @@ internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform r { Debug.LogWarning("Setting up main menu button"); button.order = button.menuButtonOrderPosition; + button.revealed = true; } else { @@ -145,7 +146,6 @@ void DeletePinnedToolButton(Transform rayOrigin, IPinnedToolButton buttonToDelet } } - Debug.LogError("Removing button : " + buttonToDelete.toolType + " - Setting new active button of type : " + selectedButtontype); buttons.Remove(buttonToDelete.toolType); Tools.SelectTool(rayOrigin, selectedButtontype); @@ -190,7 +190,7 @@ internal void ToolButtonClicked(Transform rayOrigin, Type toolType) Tools.SelectTool(rayOrigin, toolType); } - internal void HighlightAllToolButtons (Transform rayOrigin, bool enableHighlight) + internal void RevealAllToolButtons (Transform rayOrigin, bool reveal) { Rays.ForEachProxyDevice(deviceData => { @@ -199,7 +199,7 @@ internal void HighlightAllToolButtons (Transform rayOrigin, bool enableHighlight var buttons = deviceData.pinnedToolButtons; foreach (var pair in buttons) { - pair.Value.highlighted = enableHighlight; + pair.Value.revealed = reveal; } } }); diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 7c9433019..251e193da 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -14,7 +14,7 @@ public interface IPinnedToolButton : IUsesMenuOrigins int activeToolOrderPosition { get; } int order { get; set; } int activeButtonCount { set; } - bool highlighted { set; } + bool revealed { set; } bool moveToAlternatePosition { get; set; } Transform rayOrigin { get; set; } Type toolType { get; set; } From f30d1ee74aafbde079b238107df4d533373a1770 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 19:58:37 -0700 Subject: [PATCH 227/870] Add primary colliders enable/disable support to PinnedToolbutton; additional refactoring of "highlight" syntax to "reveal" --- Scripts/UI/PinnedToolButton.cs | 56 ++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 15dac40a7..1f55b6ba6 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -52,7 +52,7 @@ public Type toolType { tooltipText = toolType.Name; - // Tools other than select fetch a random gradientPair; also used by the device when highlighted + // Tools other than select fetch a random gradientPair; also used by the device when revealed gradientPair = UnityBrandColorScheme.GetRandomCuratedDarkGradient(); } @@ -217,6 +217,9 @@ public Transform alternateMenuOrigin [SerializeField] SkinnedMeshRenderer m_InsetMeshRenderer; + [SerializeField] + Collider[] m_PrimaryButtonColliders; + [SerializeField] GradientButton m_SecondaryGradientButton; @@ -258,7 +261,7 @@ public Transform alternateMenuOrigin Coroutine m_SecondaryButtonVisibilityCoroutine; string m_TooltipText; - bool m_Highlighted; + bool m_Revealed; bool m_MoveToAlternatePosition; int m_Order; Type m_previewToolType; @@ -316,7 +319,18 @@ bool activeTool } } - private bool secondaryButtonCollidersEnabled + bool primaryButtonCollidersEnabled + { + set + { + foreach (var collider in m_PrimaryButtonColliders) + { + collider.enabled = value; + } + } + } + + bool secondaryButtonCollidersEnabled { set { @@ -327,29 +341,34 @@ private bool secondaryButtonCollidersEnabled } } - public bool highlighted + public bool revealed { - get { return m_Highlighted; } + get { return m_Revealed; } set { - if (m_Highlighted == value || !gameObject.activeSelf || activeButtonCount <= k_ActiveToolOrderPosition + 1) + if (m_Revealed == value || !gameObject.activeSelf || activeButtonCount <= k_ActiveToolOrderPosition + 1) return; - m_Highlighted = value; + m_Revealed = value; if (isMainMenu) { m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor * (value ? 0f : 1f)); m_GradientButton.visible = !value; + primaryButtonCollidersEnabled = !m_Revealed; return; } + else + { + primaryButtonCollidersEnabled = m_Revealed; + } //Debug.LogError(Time.frameCount + " : Highlighting : " + toolType); var newOrderPosition = order; var buttonCount = 2; // MainMenu + ActiveTool button count var targetRotation = Quaternion.identity; - if (m_Highlighted) + if (m_Revealed) { buttonCount = activeButtonCount - 1; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); @@ -370,7 +389,7 @@ public bool highlighted //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value && order < 1)); } - //get { return m_Highlighted; } + //get { return m_Revealed; } } public Sprite icon @@ -540,7 +559,7 @@ void OnBackgroundHoverEnter () this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } - //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) //{ //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); //m_RootCollider.enabled = false; @@ -611,7 +630,7 @@ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons // Hide both action buttons if the user is no longer hovering over the button - //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) //{ //Debug.LogWarning("!!!"); //m_ButtonCollider.enabled = true; @@ -649,8 +668,8 @@ void ActionButtonClicked(PinnedToolActionButton button) } OnActionButtonHoverExit(false); - //m_LeftPinnedToolActionButton.highlighted = false; - //m_RightPinnedToolActionButton.highlighted = false; + //m_LeftPinnedToolActionButton.revealed = false; + //m_RightPinnedToolActionButton.revealed = false; } } @@ -660,7 +679,7 @@ void OnBackgroundButtonClick() // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons // Hide both action buttons if the user is no longer hovering over the button - //if (!m_LeftPinnedToolActionButton.highlighted && !m_RightPinnedToolActionButton.highlighted) + //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) //{ //} @@ -685,7 +704,6 @@ void OnSecondaryButtonClicked() IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) { m_IconContainerCanvasGroup.alpha = 1f; - //m_RootCollider.enabled = false; var duration = 0f; while (duration < 2) { @@ -700,14 +718,12 @@ IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) m_IconContainer.localScale = k_SemiTransparentIconContainerScale; transform.localPosition = targetPosition; transform.localScale = targetScale; - //m_RootCollider.enabled = true; m_VisibilityCoroutine = null; } IEnumerator AnimateHideAndClose() { this.HideTooltip(this); - //m_RootCollider.enabled = false; var duration = 0f; var currentScale = transform.localScale; var targetScale = Vector3.zero; @@ -726,7 +742,8 @@ IEnumerator AnimateHideAndClose() IEnumerator AnimatePosition(int orderPosition, int buttonCount) { - //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer highlighted + primaryButtonCollidersEnabled = false; + //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed //gameObject.SetActive(true); //if (order != activeToolOrderPosition) @@ -755,12 +772,13 @@ IEnumerator AnimatePosition(int orderPosition, int buttonCount) yield return null; } - //if (!m_Highlighted && orderPosition == 0 && buttonCount == 1 && !activeTool) // hide a button if it is not the active tool button and the buttons are no longer highlighted + //if (!m_Revealed && orderPosition == 0 && buttonCount == 1 && !activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed //gameObject.SetActive(false); //transform.localPosition = targetPosition; transform.localRotation = targetRotation; CorrectIconRotation(); + primaryButtonCollidersEnabled = true; m_PositionCoroutine = null; if (m_GradientButton.highlighted) From 0a582d363611ce7cfafe3453276a2b18a393c758 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 19:59:30 -0700 Subject: [PATCH 228/870] Assign primary colliders to PinnedToolButton prefab --- Prefabs/UI/PinnedToolButton.prefab | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index e18a1d1a9..1f08e23c8 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -111,7 +111,7 @@ GameObject: - 65: {fileID: 65000013092476136} - 65: {fileID: 65000013413917816} m_Layer: 5 - m_Name: GradientButton + m_Name: PrimaryGradientButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1297,6 +1297,11 @@ MonoBehaviour: m_IconContainerCanvasGroup: {fileID: 225000010727404378} m_FrameRenderer: {fileID: 137000012108747896} m_InsetMeshRenderer: {fileID: 137000013542685126} + m_PrimaryButtonColliders: + - {fileID: 65000012469590154} + - {fileID: 65000012136550866} + - {fileID: 65000010544999880} + - {fileID: 65000012534630730} m_SecondaryGradientButton: {fileID: 114000010373680160} m_SecondaryButtonContainerCanvasGroup: {fileID: 225000012815828682} m_SecondaryInsetMeshRenderer: {fileID: 137000012837336366} @@ -1308,8 +1313,8 @@ MonoBehaviour: m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} m_AlternateLocalPosition: {x: 0, y: 0, z: 0} - m_Inset: {fileID: 4000013614942004} - m_InsetMask: {fileID: 4000011771676402} + m_Inset: {fileID: 0} + m_InsetMask: {fileID: 0} m_ButtonIcon: {fileID: 114000011650556854} --- !u!114 &114000011650556854 MonoBehaviour: From 02f7f4d6f4d53144527a8bd61a4e92a72449a541 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 20:01:28 -0700 Subject: [PATCH 229/870] Hide the secondary PinnedToolButton only if it is not already being hovered --- Scripts/UI/PinnedToolButton.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 1f55b6ba6..b800f3d3e 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -623,7 +623,9 @@ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) } this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + + if (!m_SecondaryGradientButton.highlighted) + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); return; Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); From b301387645cf3e6ed8a9e747f6ae294b4bb60564 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 28 Apr 2017 20:11:15 -0700 Subject: [PATCH 230/870] Use the light curated gradientPairs for PinnedToolButtons --- Scripts/UI/PinnedToolButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index b800f3d3e..84dd4056f 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -53,7 +53,7 @@ public Type toolType tooltipText = toolType.Name; // Tools other than select fetch a random gradientPair; also used by the device when revealed - gradientPair = UnityBrandColorScheme.GetRandomCuratedDarkGradient(); + gradientPair = UnityBrandColorScheme.GetRandomCuratedLightGradient(); } activeTool = activeTool; From 096501cef966583927eceb862b9090f189ffe533 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 5 May 2017 03:15:28 -0700 Subject: [PATCH 231/870] Add new files relevant to spatial-selection ToolFlow changes --- Menus/PinnedToolMenu.meta | 9 + Menus/PinnedToolMenu/PinnedToolsMenu.cs | 267 ++++++++++++++++++ Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta | 18 ++ .../PinnedToolslMenuInput.asset | 90 ++++++ .../PinnedToolslMenuInput.asset.meta | 8 + Menus/PinnedToolMenu/PinnedToolslMenuInput.cs | 13 + .../PinnedToolslMenuInput.cs.meta | 12 + Menus/PinnedToolMenu/Prefabs.meta | 9 + .../Prefabs/PinnedToolsMenu.prefab | 102 +++++++ .../Prefabs/PinnedToolsMenu.prefab.meta | 8 + Menus/PinnedToolMenu/Scripts.meta | 9 + .../Scripts/PinnedToolsMenuUI.cs | 227 +++++++++++++++ .../Scripts/PinnedToolsMenuUI.cs.meta | 12 + Scripts/Interfaces/ISpatialScrolling.cs | 48 ++++ Scripts/Interfaces/ISpatialScrolling.cs.meta | 12 + Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 48 ++++ .../UI/Interfaces/IPinnedToolsMenu.cs.meta | 12 + 17 files changed, 904 insertions(+) create mode 100644 Menus/PinnedToolMenu.meta create mode 100644 Menus/PinnedToolMenu/PinnedToolsMenu.cs create mode 100644 Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta create mode 100644 Menus/PinnedToolMenu/PinnedToolslMenuInput.asset create mode 100644 Menus/PinnedToolMenu/PinnedToolslMenuInput.asset.meta create mode 100644 Menus/PinnedToolMenu/PinnedToolslMenuInput.cs create mode 100644 Menus/PinnedToolMenu/PinnedToolslMenuInput.cs.meta create mode 100644 Menus/PinnedToolMenu/Prefabs.meta create mode 100644 Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab create mode 100644 Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab.meta create mode 100644 Menus/PinnedToolMenu/Scripts.meta create mode 100644 Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs create mode 100644 Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs.meta create mode 100644 Scripts/Interfaces/ISpatialScrolling.cs create mode 100644 Scripts/Interfaces/ISpatialScrolling.cs.meta create mode 100644 Scripts/UI/Interfaces/IPinnedToolsMenu.cs create mode 100644 Scripts/UI/Interfaces/IPinnedToolsMenu.cs.meta diff --git a/Menus/PinnedToolMenu.meta b/Menus/PinnedToolMenu.meta new file mode 100644 index 000000000..de4fca9f2 --- /dev/null +++ b/Menus/PinnedToolMenu.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5cdcd46d07f897a41aa35d610b16f8e6 +folderAsset: yes +timeCreated: 1493921617 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs new file mode 100644 index 000000000..d3116907b --- /dev/null +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -0,0 +1,267 @@ +#if UNITY_EDITOR +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.UI; +using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; +using UnityEngine.InputNew; +using UnityEngine.UI; + +namespace UnityEditor.Experimental.EditorVR.Menus +{ + sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI + { + const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation + const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation + const int k_MaxButtonCount = 16; // + + [SerializeField] + ActionMap m_MainMenuActionMap; + + [SerializeField] + PinnedToolsMenuUI m_PinnedToolsMenuPrefab; + + [SerializeField] + PinnedToolButton m_PinnedToolButtonTemplate; + + PinnedToolsMenuUI m_PinnedToolsMenuUI; + + //public int menuButtonOrderPosition { get { return k_MenuButtonOrderPosition; } } + //public int activeToolOrderPosition { get { return k_ActiveToolOrderPosition; } } + + Transform m_RayOrigin; + + public Transform menuOrigin { get; set; } + public Dictionary pinnedToolButtons { get; set; } + public Dictionary icons { get; set; } + public int activeToolOrderPosition { get; private set; } + public bool revealed { get; set; } + public bool moveToAlternatePosition { get; set; } + public Type previewToolType { get; set; } + public Vector3 alternateMenuItem { get; private set; } + public Node node { set { m_PinnedToolsMenuUI.node = value; } } + public Action HighlightSingleButton { get; set; } + public Action SelectHighlightedButton { get; set; } + public Action deleteHighlightedButton { get; set; } + public Action onButtonHoverEnter { get; set; } + public Action onButtonHoverExit { get; set; } + public Action highlightDevice { get; set; } + public Action createPinnedToolButton { get; set; } + + Transform m_AlternateMenuOrigin; + + public Action selectTool + { + set { m_PinnedToolsMenuUI.selectTool = value; } + } + + public Transform rayOrigin + { + get { return m_RayOrigin; } + set + { + m_RayOrigin = value; + m_PinnedToolsMenuUI.rayOrigin = value; + } + } + + public ActionMap actionMap + { + get { return m_MainMenuActionMap; } + } + + public Transform alternateMenuOrigin + { + get { return m_AlternateMenuOrigin; } + set + { + if (m_AlternateMenuOrigin == value) + return; + + m_AlternateMenuOrigin = value; + + if (m_PinnedToolsMenuUI == null) + m_PinnedToolsMenuUI = this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); + + m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; + + var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; + pinnedToolsUITransform.SetParent(m_AlternateMenuOrigin); + pinnedToolsUITransform.localPosition = Vector3.zero; + pinnedToolsUITransform.localRotation = Quaternion.identity; + } + } + + public event Action hoverEnter; + public event Action hoverExit; + public event Action selected; + /* + public bool visible { get; set; } + public GameObject menuContent { get; private set; } + public List menuActions { get; set; } + public Transform rayOrigin { get; set; } + public event Action itemWasSelected; + */ + + void Awake() + { + pinnedToolButtons = new Dictionary(); + createPinnedToolButton = CreatePinnedToolButton; + } + + public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) + { + Debug.LogWarning("SPAWNING pinned tool button for type of : " + toolType); + //var pinnedToolButtons = deviceData.pinnedToolButtons; + if (pinnedToolButtons.ContainsKey(toolType) || pinnedToolButtons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button + return; + + // Before adding new button, offset each button to a position greater than the zeroth/active tool position + //foreach (var pair in pinnedToolButtons) + //{ + // if (pair.Value.order != pair.Value.menuButtonOrderPosition) // don't move the main menu button + // pair.Value.order++; + // } + + //var button = SpawnPinnedToolButton(deviceData.inputDevice); + //var buttonTransform = this.InstantiateUI(m_PinnedToolButtonTemplate.gameObject, m_PinnedToolsMenuUI.buttonContainer, false).transform; + var buttonTransform = ObjectUtils.Instantiate(m_PinnedToolButtonTemplate.gameObject, m_PinnedToolsMenuUI.buttonContainer, false).transform; + var button = buttonTransform.GetComponent(); + this.ConnectInterfaces(button); + pinnedToolButtons.Add(toolType, button); + + // Initialize button in alternate position if the alternate menu is hidden + /* + IPinnedToolButton mainMenu = null; + if (toolType == typeof(IMainMenu)) + mainMenu = button; + else + pinnedToolButtons.TryGetValue(typeof(IMainMenu), out mainMenu); + */ + + //button.moveToAlternatePosition = mainMenu != null && mainMenu.moveToAlternatePosition; + //button.node = deviceData.node; + button.rayOrigin = rayOrigin; + button.toolType = toolType; // Assign Tool Type before assigning order + button.icon = buttonIcon; + button.deleteHighlightedButton = deleteHighlightedButton; + button.highlightSingleButton = HighlightSingleButton; + button.selectHighlightedButton = SelectHighlightedButton; + //button.selected += OnMainMenuActivatorSelected; + button.hoverEnter += onButtonHoverExit; + button.hoverExit += onButtonHoverExit; + button.rayOrigin = rayOrigin; + + m_PinnedToolsMenuUI.AddButton(button, buttonTransform); + } + + Vector3 spatialScrollStartPosition; + Vector3? spatialDirection = null; + Vector3 previousWorldPosition; + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) + { + var buttonCount = pinnedToolButtons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + if (buttonCount <= k_ActiveToolOrderPosition + 1) + return; + + //Debug.LogError("PinnedToolButton"); + var pinnedToolInput = (PinnedToolslMenuInput) input; + + if (pinnedToolInput.show.wasJustPressed) + Debug.LogError("SHOW pressed in PinnedToolButton"); + + if (pinnedToolInput.select.wasJustPressed) + Debug.LogError("SELECT pressed in PinnedToolButton"); + + if (pinnedToolInput.show.wasJustPressed) + { + //Debug.LogError("Processing input in PinnedToolButton"); + //consumeControl(directSelectInput.select); + m_PinnedToolsMenuUI.allButtonsVisible = true; + spatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; + } + else if (pinnedToolInput.show.isHeld && !pinnedToolInput.select.isHeld && !pinnedToolInput.select.wasJustPressed) + { + if (pinnedToolInput.select.wasJustReleased) + { + //selectHighlightedButton(rayOrigin); + //OnActionButtonHoverExit(false); + deleteHighlightedButton(rayOrigin); + m_PinnedToolsMenuUI.allButtonsVisible = false; + spatialDirection = null; + return; + } + + // normalized input should loop after reaching the 0.15f length + var normalizedRepeatingPosition = processSpatialScrolling(spatialScrollStartPosition, m_PinnedToolsMenuUI.transform.position, 0.15f, true); + m_PinnedToolsMenuUI.HighlightSingleButton((int)(buttonCount * normalizedRepeatingPosition)); + consumeControl(pinnedToolInput.show); + consumeControl(pinnedToolInput.select); + } + else if (pinnedToolInput.show.wasJustReleased) + { + m_PinnedToolsMenuUI.allButtonsVisible = false; + m_PinnedToolsMenuUI.SelectHighlightedButton(); + spatialDirection = null; + consumeControl(pinnedToolInput.select); + } + + // cache current position for delta comparison on next frame for fine tuned scrolling with low velocity + previousWorldPosition = transform.position; + } + + // TODO ADD SUPPORT FOR VIEWERSCALE SIZE CHANGES + // TODO refact into ISpatialScrolling interface; allow axis locking/selection/isolation + float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange,bool velocitySensitive) + { + var normalizedLoopingPosition = 0f; + var directionVector = currentPosition - startingPosition; + const float kMaxFineTuneVelocity = 0.0005f; + //const float kMinFineTuneVelocity = 0.000001f; + if (spatialDirection == null) + { + const float newDirectionVectorThreshold = + 0.025f; // Initial magnitude beyond which spatial scrolling will be evaluated + directionVector = currentPosition - startingPosition; + if (Vector3.Magnitude(directionVector) > newDirectionVectorThreshold) + spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton + } + else + { + var rawVelocity = (previousWorldPosition - transform.position).sqrMagnitude; + var velocity = rawVelocity * Time.unscaledDeltaTime; + //Debug.LogError("" + velocity + " : Raw Velocity : " + rawVelocity + " : unscaled time : " + Time.unscaledDeltaTime); + + if (velocity < kMaxFineTuneVelocity) // && velocity > kMinFineTuneVelocity) + { + // OFfset the vector increasingly as velocity slows, in order to lessen the perceived scrolling magnitude + //spatialDirection -= spatialDirection.Value * ( 100f * (kMaxFineTuneVelocity - velocity)); // TODO: support this offset in either direction/inverse + //spatialScrollStartPosition -= spatialScrollStartPosition * ( 0.1f * (kMaxFineTuneVelocity - velocity)); + //repeatingScrollLengthRange += repeatingScrollLengthRange * (10000f * (kMaxFineTuneVelocity - velocity)); + //Debug.LogError("" + repeatingScrollLengthRange + ""); + } + + //Debug.LogError(directionVector.magnitude); + var projectedAmount = Vector3.Project(directionVector, spatialDirection.Value).magnitude; + normalizedLoopingPosition = (Mathf.Abs(projectedAmount) % repeatingScrollLengthRange) * (1 / repeatingScrollLengthRange); + + //Debug.LogError("" + velocity + ""); + //if (velocity < kMaxFineTuneVelocity && velocity > kMinFineTuneVelocity) + //{ + //Debug.LogError("" + projectedAmount + " : Spatial Direction : " + spatialDirection.Value); + // OFfset the vector increasingly as velocity slows, in order to lessen the perceived scrolling magnitude + //spatialDirection -= spatialDirection.Value * ( 100f * (kMaxFineTuneVelocity - velocity)); // TODO: support this offset in either direction/inverse + //spatialScrollStartPosition -= spatialScrollStartPosition * ( 0.1f * (kMaxFineTuneVelocity - velocity)); + //} + } + + return normalizedLoopingPosition; + } + } +} +#endif \ No newline at end of file diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta new file mode 100644 index 000000000..934380a96 --- /dev/null +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 800ff7c94496eac41ab0b6df27863704 +timeCreated: 1493960032 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_MainMenuActionMap: {fileID: 11400000, guid: 744d823602c92f94ebd746822bed646d, + type: 2} + - m_PinnedToolsMenuPrefab: {fileID: 114000010527895234, guid: 9df94b11e4f4ed848aa8c4055b378c6a, + type: 2} + - m_PinnedToolButtonTemplate: {fileID: 114000011260412956, guid: 7221a75a049ac3949a505c7c2f06bd8e, + type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset b/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset new file mode 100644 index 000000000..6726bbba2 --- /dev/null +++ b/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset @@ -0,0 +1,90 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} + m_Name: PinnedToolslMenuInput + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_Actions: + - {fileID: 114000014192420456} + - {fileID: 114000013122567660} + m_ControlSchemes: + - m_Name: PinnedToolsMenu + m_DeviceSlots: + - m_Key: 1 + m_Type: + m_TypeName: UnityEngine.InputNew.VRInputDevice, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_TagIndex: -1 + m_ActionMap: {fileID: 11400000} + m_Bindings: + - sources: + - controlIndex: 3 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 2 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + m_MapTypeName: PinnedToolslMenuInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + m_CustomNamespace: +--- !u!114 &114000013122567660 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Select + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 1 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Select + defaultValue: 0 +--- !u!114 &114000014192420456 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Show + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 0 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Show + defaultValue: 0 diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset.meta b/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset.meta new file mode 100644 index 000000000..b5a09f9b8 --- /dev/null +++ b/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 744d823602c92f94ebd746822bed646d +timeCreated: 1493933312 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs b/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs new file mode 100644 index 000000000..80a0d052c --- /dev/null +++ b/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs @@ -0,0 +1,13 @@ +using UnityEngine; +using UnityEngine.InputNew; + +// GENERATED FILE - DO NOT EDIT MANUALLY +namespace UnityEngine.InputNew +{ + public class PinnedToolslMenuInput : ActionMapInput { + public PinnedToolslMenuInput (ActionMap actionMap) : base (actionMap) { } + + public ButtonInputControl @show { get { return (ButtonInputControl)this[0]; } } + public ButtonInputControl @select { get { return (ButtonInputControl)this[1]; } } + } +} diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs.meta b/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs.meta new file mode 100644 index 000000000..0eec98803 --- /dev/null +++ b/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f01045237dd19eb4181c1e45f673ad95 +timeCreated: 1493935062 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/Prefabs.meta b/Menus/PinnedToolMenu/Prefabs.meta new file mode 100644 index 000000000..38843b35e --- /dev/null +++ b/Menus/PinnedToolMenu/Prefabs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7d382a4eedde9fa43a613dc983cf1290 +folderAsset: yes +timeCreated: 1493933238 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab new file mode 100644 index 000000000..4230f5d3a --- /dev/null +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -0,0 +1,102 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000014083153210} + m_IsPrefabParent: 1 +--- !u!1 &1000010819337252 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000012301197336} + - 114: {fileID: 114000011597863712} + m_Layer: 5 + m_Name: ButtonContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014083153210 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 4 + m_Component: + - 4: {fileID: 4000011260103804} + - 114: {fileID: 114000010527895234} + m_Layer: 0 + m_Name: PinnedToolsMenu + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000011260103804 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014083153210} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4000012301197336} + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!4 &4000012301197336 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010819337252} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_Children: [] + m_Father: {fileID: 4000011260103804} + m_RootOrder: 0 +--- !u!114 &114000010527895234 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014083153210} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cfe80f5c8b040574dbe8502d4830bf4b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ButtonContainer: {fileID: 4000012301197336} +--- !u!114 &114000011597863712 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010819337252} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_SmoothRotation: 1 + m_TightenRotation: 30 + m_SmoothPosition: 1 + m_TightenPosition: 50 + m_Target: {fileID: 0} diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab.meta b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab.meta new file mode 100644 index 000000000..1ad0a1691 --- /dev/null +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9df94b11e4f4ed848aa8c4055b378c6a +timeCreated: 1469754147 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/Scripts.meta b/Menus/PinnedToolMenu/Scripts.meta new file mode 100644 index 000000000..39fbd1700 --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e779def062376ae4cb10be42fcaa52b3 +folderAsset: yes +timeCreated: 1493933227 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs new file mode 100644 index 000000000..644bb63ac --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -0,0 +1,227 @@ +#if UNITY_EDITOR +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Security.Permissions; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Menus +{ + sealed class PinnedToolsMenuUI : MonoBehaviour, IInstantiateUI + { + const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation + const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation + + [SerializeField] + Transform m_ButtonContainer; + + bool m_AllButtonsVisible; + List m_OrderedButtons; + Coroutine m_ShowHideAllButtonsCoroutine; + int m_VisibleButtonCount; + + public Dictionary pinnedToolButtons { get; set; } + public Node node { get; set; } + public int maxButtonCount { get; set; } + public Transform buttonContainer { get { return m_ButtonContainer; } } + public Action selectTool { get; set; } + public Transform rayOrigin { get; set; } + + public bool allButtonsVisible + { + get { return m_AllButtonsVisible; } + set + { + //if (m_AllButtonsVisible == value) + //return; + + m_AllButtonsVisible = value; + + if (m_AllButtonsVisible) + ShowAllButtons(); + else + HideAllButtons(); + } + } + + private int visibleButtonCount + { + get + { + return m_VisibleButtonCount; + /* + int count = 0; + for (int i = 0; i < m_OrderedButtons.Count; ++i) + { + if (m_OrderedButtons[i].order > -1) + ++count; + } + + return count; + */ + } + } + + void Awake() + { + m_OrderedButtons = new List(); + Debug.LogError("PinnedToolsMenuUI initialized"); + } + + public void AddButton(IPinnedToolButton button, Transform buttonTransform) + { + button.allButtonsVisible = allButtonsVisible; + button.maxButtonCount = maxButtonCount; + button.selectTool = SelectTool; + button.visibileButtonCount = visibleButtonCount; + + var insertPosition = -1; + if (button.toolType == typeof(IMainMenu)) + insertPosition = k_MenuButtonOrderPosition; + else + insertPosition = k_ActiveToolOrderPosition; + + m_OrderedButtons.Insert(insertPosition, button); + m_VisibleButtonCount = m_VisibleButtonCount = m_OrderedButtons.Count; + + button.activeTool = true; + + buttonTransform.rotation = Quaternion.identity; + buttonTransform.localPosition = Vector3.zero; + buttonTransform.localScale = Vector3.zero; + + button.order = insertPosition; + + Debug.LogWarning("Setting up button : " + button.toolType + " - ORDER : " + button.order); + + if (m_OrderedButtons.Count > k_ActiveToolOrderPosition) + this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons()); + /* + foreach (var pair in pinnedToolButtons) + { + if (pair.Value.order != pair.Value.menuButtonOrderPosition) // don't move the main menu button + pair.Value.order++; + } + */ + } + + IEnumerator ShowThenHideAllButtons(bool waitBeforeClosingAllButtons = true) + { + SetupButtonOrder(); + + if (waitBeforeClosingAllButtons) + { + var duration = Time.unscaledDeltaTime; + while (duration < 1.25f) + { + duration += Time.unscaledDeltaTime; + yield return null; + } + } + + // Hide all but menu and active tool buttons after visually adding new button + allButtonsVisible = false; + + m_ShowHideAllButtonsCoroutine = null; + } + + IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType) + { + // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions + if (!toolType.GetInterfaces().Contains(typeof(ITool))) + return null; + + IPinnedToolButton pinnedToolButton = null; + /* + Rays.ForEachProxyDevice((deviceData) => + { + if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device + { + var pinnedToolButtons = deviceData.pinnedToolButtons; + foreach (var pair in pinnedToolButtons) + { + var button = pair.Value; + if (button.order == button.activeToolOrderPosition) + { + pinnedToolButton = button; + pinnedToolButton.previewToolType = toolType; + break; + } + } + } + }); + */ + return pinnedToolButton; + } + + void SetupButtonOrder() + { + for (int i = 0; i < m_OrderedButtons.Count; ++i) + { + var button = m_OrderedButtons[i]; + button.activeTool = i == k_ActiveToolOrderPosition; + button.order = i; + } + } + + void ShowAllButtons() + { + m_VisibleButtonCount = m_OrderedButtons.Count - 1; // subtract the menu button from the total + for (int i = 0; i < m_OrderedButtons.Count; ++i) + m_OrderedButtons[i].order = i == 0 ? -1 : i; // hide the menu buttons when revealing all tools buttons + + SetupButtonOrder(); + } + + void HideAllButtons() + { + Debug.LogError("Hiding all buttons"); + m_VisibleButtonCount = 2; // Show only the menu and active tool button + const int kInactiveButtonInitialOrderPosition = -1; + for (int i = 0; i < m_OrderedButtons.Count; ++i) + m_OrderedButtons[i].order = i > k_ActiveToolOrderPosition ? kInactiveButtonInitialOrderPosition : i; // maintain menu and active tool positions + } + + void SelectTool(IPinnedToolButton pinnedToolButton) + { + for (int i = 0; i < m_OrderedButtons.Count; ++i) + { + var button = m_OrderedButtons[i];; + if (button == pinnedToolButton && button.order > k_ActiveToolOrderPosition) + { + m_OrderedButtons.Remove(button); + m_OrderedButtons.Insert(k_ActiveToolOrderPosition, button); + } + } + + SetupButtonOrder(); // after setting the new order of the active tool button, reposition the buttons + selectTool(rayOrigin, pinnedToolButton.toolType); + } + + public void HighlightSingleButton(int buttonOrderPosition) + { + Debug.LogError("Highlighting SINGLE BUTTON at position : "+ buttonOrderPosition); + for (int i = 0; i < m_OrderedButtons.Count; ++i) + m_OrderedButtons[i].highlighted = i == buttonOrderPosition; + } + + public void SelectHighlightedButton() + { + for (int i = 0; i < m_OrderedButtons.Count; ++i) + { + var button = m_OrderedButtons[i]; + var isHighlighted = button.highlighted; + if (isHighlighted) + { + SelectTool(button); + return; + } + } + } + } +} +#endif diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs.meta b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs.meta new file mode 100644 index 000000000..72bf04aba --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cfe80f5c8b040574dbe8502d4830bf4b +timeCreated: 1493935919 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/ISpatialScrolling.cs b/Scripts/Interfaces/ISpatialScrolling.cs new file mode 100644 index 000000000..24e2bc537 --- /dev/null +++ b/Scripts/Interfaces/ISpatialScrolling.cs @@ -0,0 +1,48 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; +using UnityEditor.Experimental.EditorVR.Helpers; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Gives decorated class spatial scrolling functionality + /// + public interface ISpatialScrolling : IUsesMenuOrigins + { + /* + int menuButtonOrderPosition { get; } + int activeToolOrderPosition { get; } + int order { get; set; } + int activeButtonCount { set; } + bool revealed { set; } + bool moveToAlternatePosition { get; set; } + Transform rayOrigin { get; set; } + Type toolType { get; set; } + Type previewToolType { set; } + Vector3 toolButtonActivePosition { get; } // Shared active button offset from the alternate menu + Sprite icon { set; } + Node node { set; } + GradientPair gradientPair { get; } + + event Action hoverEnter; + event Action hoverExit; + event Action selected; + + Action selectTool { set; } + Action deletePinnedToolButton { set; } + Action revealAllToolButtons { set; } + */ + + Vector3 startingPosition { set; } + Vector3 currentPosition { set; } + + // start pos, current pos, world length before repeat, returns normalized repeating projection position + //Func + } + + public static class ISpatialScrollingMethods + { + } +} +#endif diff --git a/Scripts/Interfaces/ISpatialScrolling.cs.meta b/Scripts/Interfaces/ISpatialScrolling.cs.meta new file mode 100644 index 000000000..639b32f26 --- /dev/null +++ b/Scripts/Interfaces/ISpatialScrolling.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8360e5cd01a472d4294dcc004cf09274 +timeCreated: 1491960255 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs new file mode 100644 index 000000000..f17d81162 --- /dev/null +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -0,0 +1,48 @@ +#if UNITY_EDITOR +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor.Experimental.EditorVR.Helpers; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Gives decorated class Pinned Tools Menu functionality + /// + public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap + { + Dictionary pinnedToolButtons { set; } + Dictionary icons { set; } + int activeToolOrderPosition { get; } + //int activeButtonCount { set; } + bool revealed { set; } + bool moveToAlternatePosition { get; set; } + Transform rayOrigin { get; set; } + Type previewToolType { set; } + Vector3 alternateMenuItem { get; } // Shared active button offset from the alternate menu + Node node { set; } // Used for button and tooltip alignment + + event Action hoverEnter; + event Action hoverExit; + event Action selected; + + Action selectTool { set; } + //Action deletePinnedToolButton { set; } + //Action revealAllToolButtons { set; } + Action HighlightSingleButton { set; } + Action SelectHighlightedButton { set; } + Action deleteHighlightedButton { set; } + Action onButtonHoverEnter { get; set; } + Action onButtonHoverExit { get; set; } + Action highlightDevice { get; set; } + + // CONVERT INTO METHODS + Action createPinnedToolButton { get; set; } + } + + public static class IPinnedToolsMenuMethods + { + //public static void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) + } +} +#endif diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs.meta b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs.meta new file mode 100644 index 000000000..fbd29816a --- /dev/null +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 66a122613dd44d648b083c98430e592b +timeCreated: 1491960255 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 137e46ccd5edb793d986b98f3a121038e7341888 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 5 May 2017 03:16:24 -0700 Subject: [PATCH 232/870] Temporarily change BlinkLocomotion action map for spatial-selection testing --- .../BlinkLocomotionTool/BlinkLocomotion.asset | 31 +++++++++++++++++++ Tools/BlinkLocomotionTool/BlinkLocomotion.cs | 1 + 2 files changed, 32 insertions(+) diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.asset b/Tools/BlinkLocomotionTool/BlinkLocomotion.asset index 7f46963ce..fa9634f39 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotion.asset +++ b/Tools/BlinkLocomotionTool/BlinkLocomotion.asset @@ -18,6 +18,7 @@ MonoBehaviour: - {fileID: 114000011232169852} - {fileID: 114000013530790504} - {fileID: 114000011708774044} + - {fileID: 114000014215053452} m_ControlSchemes: - m_Name: BlinkLocomotion m_DeviceSlots: @@ -73,6 +74,15 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 + - sources: + - controlIndex: 17 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 m_MapTypeName: BlinkLocomotion, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: @@ -181,3 +191,24 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Yaw defaultValue: 0 +--- !u!114 &114000014215053452 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Trigger + m_EditorClassIdentifier: + m_RunInEditMode: 0 + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 5 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Trigger + defaultValue: 0 diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs b/Tools/BlinkLocomotionTool/BlinkLocomotion.cs index b1761f882..cb6532fe2 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotion.cs @@ -12,5 +12,6 @@ public BlinkLocomotion (ActionMap actionMap) : base (actionMap) { } public AxisInputControl @forward { get { return (AxisInputControl)this[2]; } } public ButtonInputControl @grip { get { return (ButtonInputControl)this[3]; } } public ButtonInputControl @thumb { get { return (ButtonInputControl)this[4]; } } + public ButtonInputControl @trigger { get { return (ButtonInputControl)this[5]; } } } } From 5c6f2f505cd98324ae183ab8b97cabd0fb1b3976 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 5 May 2017 03:17:47 -0700 Subject: [PATCH 233/870] Disable extra gradient pairs in UnityBrandColorScheme --- Scripts/Utilities/UnityBrandColorScheme.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 0376073c1..d298dde82 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -315,8 +315,8 @@ private static void SetupUnityBrandColors() s_CuratedLightGradientPairs.Add(new GradientPair(blueLight, yellow)); s_CuratedLightGradientPairs.Add(new GradientPair(blueLight, yellowDark)); s_CuratedLightGradientPairs.Add(new GradientPair(greenLight, red)); - s_CuratedLightGradientPairs.Add(new GradientPair(light, darker)); - s_CuratedLightGradientPairs.Add(new GradientPair(light, blueLight)); + //s_CuratedLightGradientPairs.Add(new GradientPair(light, darker)); + //s_CuratedLightGradientPairs.Add(new GradientPair(light, blueLight)); s_CuratedGradientPairsRange = s_CuratedGradientPairs.Count; s_CuratedLightGradientPairsRange = s_CuratedLightGradientPairs.Count; From bdb99a4f84475de6f397432f7f4d8476abf9bb38 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 5 May 2017 03:19:54 -0700 Subject: [PATCH 234/870] Add initial spatial-selection logic to various areas of EditorVR; the implementation recently had a PinnedToolButtonsMenu controller added & refactored into the architecture, and currently lacks a fully functioning implemenation at this time --- Scripts/Core/EditorVR.Menus.cs | 24 ++-- Scripts/Core/EditorVR.PinnedToolButtons.cs | 105 +++++++++++++++++- Scripts/Core/EditorVR.Tools.cs | 39 +++++-- Scripts/Core/EditorVR.cs | 17 ++- Scripts/UI/Interfaces/IPinnedToolButton.cs | 21 +++- Scripts/UI/PinnedToolButton.cs | 122 +++++++++++++++------ 6 files changed, 265 insertions(+), 63 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index bf71b5c23..74dc5ec97 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -171,14 +171,8 @@ static void UpdateAlternateMenuForDevice(DeviceData deviceData) alternateMenu.visible = deviceData.menuHideFlags[alternateMenu] == 0 && !(deviceData.currentTool is IExclusiveMode); // Move the pinned tool buttons to an alternate position if the alternate menu will be shown - var pinnedToolButtons = deviceData.pinnedToolButtons; - if (pinnedToolButtons != null && pinnedToolButtons.Count > 0) - { - foreach (var button in pinnedToolButtons) - { - button.Value.moveToAlternatePosition = alternateMenu.visible; - } - } + var pinnedToolsMenu = deviceData.pinnedToolsMenu; + pinnedToolsMenu.moveToAlternatePosition = alternateMenu.visible; } internal void UpdateMenuVisibilities() @@ -318,6 +312,20 @@ internal static IAlternateMenu SpawnAlternateMenu(Type type, InputDevice device, return alternateMenu; } + internal static IPinnedToolsMenu SpawnPinnedToolsMenu(Type type, InputDevice device, out ActionMapInput input) + { + input = null; + + if (!typeof(IPinnedToolsMenu).IsAssignableFrom(type)) + return null; + + var menu = (IPinnedToolsMenu)ObjectUtils.AddComponent(type, evr.gameObject); + input = evr.GetModule().CreateActionMapInputForObject(menu, device); + evr.m_Interfaces.ConnectInterfaces(menu, device); + + return menu; + } + internal static void UpdateAlternateMenuActions() { var actionsModule = evr.GetModule(); diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index d5cfcf526..f9657cefe 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -31,7 +32,6 @@ internal MainMenuActivator SpawnMainMenuActivator(InputDevice device) return mainMenuActivator; } -*/ internal IPinnedToolButton SpawnPinnedToolButton(InputDevice device) { var button = ObjectUtils.Instantiate(evr.m_PinnedToolButtonPrefab.gameObject).GetComponent(); @@ -39,7 +39,9 @@ internal IPinnedToolButton SpawnPinnedToolButton(InputDevice device) return button; } +*/ + /* internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType, Sprite buttonIcon) { Debug.LogWarning("SPAWNING pinned tool button for type of : " + toolType); @@ -70,15 +72,19 @@ internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolT button.icon = buttonIcon; //button.order = button.activeToolOrderPosition; // first position is the active tool position button.deletePinnedToolButton = DeletePinnedToolButton; - button.highlightAllToolButtons = RevealAllToolButtons; + button.revealAllToolButtons = RevealAllToolButtons; button.selectTool = ToolButtonClicked; + //button.highli = HighlightSingleButton; + button.selectHighlightedButton = SelectHighlightedButton; + button.deleteHighlightedButton = DeleteHighlightedButton; //button.selected += OnMainMenuActivatorSelected; - button.hoverEnter += OnButtonHoverEnter; - button.hoverExit += OnButtonHoverExit; + button.hoverEnter += onButtonHoverEnter; + button.hoverExit += onButtonHoverExit; return button; } - +*/ +/* internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) { Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); @@ -117,6 +123,18 @@ internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform r deviceData.proxy.HighlightDevice(deviceData.node, button.gradientPair); // Perform the higlight on the node with the button's gradient pair } } +*/ + + internal void HighlightDevice(Transform rayOrigin, GradientPair gradientPair) + { + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + { + deviceData.proxy.HighlightDevice(deviceData.node, gradientPair); + } + }); + } void DeletePinnedToolButton(Transform rayOrigin, IPinnedToolButton buttonToDelete) { @@ -133,6 +151,7 @@ void DeletePinnedToolButton(Transform rayOrigin, IPinnedToolButton buttonToDelet { if (deviceData.rayOrigin == rayOrigin) { + /* var buttons = deviceData.pinnedToolButtons; var selectedButtonOrder = buttons.Count; foreach (var pair in deviceData.pinnedToolButtons) @@ -149,7 +168,8 @@ void DeletePinnedToolButton(Transform rayOrigin, IPinnedToolButton buttonToDelet Debug.LogError("Removing button : " + buttonToDelete.toolType + " - Setting new active button of type : " + selectedButtontype); buttons.Remove(buttonToDelete.toolType); Tools.SelectTool(rayOrigin, selectedButtontype); - SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, selectedButtontype); + // TODO remove after refacter : SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, selectedButtontype); + */ } }); } @@ -165,6 +185,9 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T { if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device { + var pinnedToolsMenu = deviceData.pinnedToolsMenu; + pinnedToolsMenu.previewToolType = toolType; + /* var pinnedToolButtons = deviceData.pinnedToolButtons; foreach (var pair in pinnedToolButtons) { @@ -176,6 +199,7 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T break; } } + */ } }); @@ -184,12 +208,14 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T internal void ToolButtonClicked(Transform rayOrigin, Type toolType) { + Debug.LogError("TOOL BUTTON CLICKED : " + toolType.ToString()); if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); else Tools.SelectTool(rayOrigin, toolType); } + /* internal void RevealAllToolButtons (Transform rayOrigin, bool reveal) { Rays.ForEachProxyDevice(deviceData => @@ -204,6 +230,73 @@ internal void RevealAllToolButtons (Transform rayOrigin, bool reveal) } }); } + */ + + /* + // TODO: move into pinned tool button controller? + internal void HighlightSingleButton (Transform rayOrigin, int buttonOrderPosition, bool highlight = true) + { + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + { + var buttons = deviceData.pinnedToolButtons; + foreach (var pair in buttons) + { + var toolButton = pair.Value; + toolButton.highlighted = toolButton.order == buttonOrderPosition ? highlight : false; + } + } + }); + } + */ + + // TODO: move into pinned tool button controller + internal void DeleteHighlightedButton (Transform rayOrigin) + { + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + { + Debug.LogError("RE IMPLEMENT DELETING OF TOOL BUTTONS!!! after refactor"); + /* + var buttons = deviceData.pinnedToolButtons; + foreach (var pair in buttons) + { + var toolButton = pair.Value; + if (toolButton.highlighted == true) + { + DeletePinnedToolButton(rayOrigin, toolButton); + return; + } + } + */ + } + }); + } + + internal void SelectHighlightedButton (Transform rayOrigin) + { + Debug.LogError("SELECT HIGHLIGHTED BUTTON CALLED - ADD FUNCTIOALITY BACK IN!!!"); + /* + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + { + var buttons = deviceData.pinnedToolButtons; + foreach (var pair in buttons) + { + var toolButton = pair.Value; + if (toolButton.highlighted) + { + ToolButtonClicked(toolButton.rayOrigin, toolButton.toolType); + break; + } + } + } + }); + */ + } internal void OnButtonHoverEnter(Transform rayOrigin) { diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index aa14031e3..ef924ede4 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -78,6 +78,7 @@ internal static void SpawnDefaultTools(IProxy proxy) var lockModule = evr.GetModule(); var defaultTools = evr.m_DefaultTools; var directSelection = evr.GetNestedModule(); + var pinnedTools = evr.GetNestedModule(); Debug.LogWarning("get selection tool icon selectionToolData.icon for pinned tool buttons now that selection tool is a DefaultTool"); foreach (var deviceData in evr.m_DeviceData) @@ -128,13 +129,21 @@ internal static void SpawnDefaultTools(IProxy proxy) deviceData.menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; alternateMenu.itemWasSelected += Menus.UpdateAlternateMenuOnSelectionChanged; - var pinnedTools = evr.GetNestedModule(); //evr.m_PinnedToolButtons; - deviceData.pinnedToolButtons = new Dictionary(); - var mainMenuButton = pinnedTools.AddPinnedToolButton(deviceData, typeof(IMainMenu), evr.m_UnityIcon); // Setup Main Menu button - pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); - pinnedTools.AddPinnedToolButton(deviceData, typeof(SelectionTool), selectionToolData.icon); // Setup SelectionTool button - // Initialize PinnedToolButtons; set SelectionTool as the active tool type - pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(SelectionTool)); + // Setup PinnedToolsMenu + var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); + deviceData.pinnedToolsMenu = pinnedToolsMenu; + pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; + pinnedToolsMenu.selectTool = pinnedTools.ToolButtonClicked; + pinnedToolsMenu.onButtonHoverEnter = pinnedTools.OnButtonHoverEnter; + pinnedToolsMenu.onButtonHoverExit = pinnedTools.OnButtonHoverExit; + pinnedToolsMenu.highlightDevice = pinnedTools.HighlightDevice; + // Setup permanent menu & selection PinnedToolButtons + //deviceData.pinnedToolButtons = new Dictionary(); + pinnedToolsMenu.createPinnedToolButton(typeof(IMainMenu), evr.m_UnityIcon, deviceData.node); + //pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); + pinnedToolsMenu.createPinnedToolButton(typeof(SelectionTool), selectionToolData.icon, deviceData.node); + // Initialize PinnedToolButtons & set SelectionTool as the active tool type + //pinnedTools.SetupPinnedToolButtonsForDevice(deviceData.rayOrigin, typeof(SelectionTool), deviceData.node); } evr.GetModule().UpdatePlayerHandleMaps(); @@ -202,7 +211,6 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) var result = false; var deviceInputModule = evr.GetModule(); - var pinnedTools = evr.GetNestedModule(); Rays.ForEachProxyDevice(deviceData => { if (deviceData.rayOrigin == rayOrigin) @@ -211,6 +219,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) var spawnTool = true; var pinnedToolButtonAdded = false; var setSelectAsCurrentTool = toolType == typeof(SelectionTool);//deviceData.currentTool is ILocomotor; + var pinnedToolsMenu = deviceData.pinnedToolsMenu; // If this tool was on the current device already, then simply remove it var isSelectOrMainMenu = (deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool) || toolType == typeof(IMainMenu); @@ -256,12 +265,13 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) if (!setSelectAsCurrentTool) { pinnedToolButtonAdded = true; - pinnedTools.AddPinnedToolButton(deviceData, toolType, newTool.icon); + pinnedToolsMenu.createPinnedToolButton(toolType, newTool.icon, deviceData.node); } } } - pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, toolType); + // TODO remove after refactor + //pinnedToolsMenu.SetupPinnedToolButtonsForDevice(rayOrigin, toolType, deviceData.node); deviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; @@ -382,6 +392,15 @@ internal static void UpdatePlayerHandleMaps(List maps) maps.Add(alternateMenuInput); } + var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenuInput = deviceData.pinnedToolsMenuInput; + if (pinnedToolsMenu != null && pinnedToolsMenuInput != null) + { + // PinnedToolsMenu visibility is handled internally, not via hide flags + if (!maps.Contains(pinnedToolsMenuInput)) + maps.Add(pinnedToolsMenuInput); + } + maps.Add(deviceData.directSelectInput); maps.Add(deviceData.uiInput); } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index f1417d13f..e8d67d769 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -6,6 +6,7 @@ using System.Reflection; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; +using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -74,7 +75,9 @@ class DeviceData public ActionMapInput alternateMenuInput; public ITool currentTool; public IMenu customMenu; - public Dictionary pinnedToolButtons; + public IPinnedToolsMenu pinnedToolsMenu; + public ActionMapInput pinnedToolsMenuInput; + //public Dictionary pinnedToolButtons; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); } @@ -325,6 +328,11 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate if (!deviceData.proxy.active) continue; + var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; + if (pinnedToolsMenuInput != null) + pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); + var mainMenu = deviceData.mainMenu; var menuInput = mainMenu as IProcessInput; if (menuInput != null && mainMenu.visible) @@ -335,8 +343,15 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate if (altMenuInput != null && altMenu.visible) altMenuInput.ProcessInput(deviceData.alternateMenuInput, consumeControl); + ActionMapInput testBlinkActionMap = null; // HACK - implement proper fetching of action map input that minds the grip move/zoom + foreach (var toolData in deviceData.toolData) { + var blink = (toolData.tool as BlinkLocomotionTool); + if (blink) + { + testBlinkActionMap = toolData.input; + } var process = toolData.tool as IProcessInput; if (process != null && ((MonoBehaviour)toolData.tool).enabled && processedInputs.Add(process)) // Only process inputs for an instance of a tool once (e.g. two-handed tools) diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 251e193da..2881e82a7 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -8,17 +8,24 @@ namespace UnityEditor.Experimental.EditorVR /// /// Gives decorated class Pinned Tool Button functionality /// - public interface IPinnedToolButton : IUsesMenuOrigins + public interface IPinnedToolButton { + Type previewToolType { set; } + int order { get; set; } + Type toolType { get; set; } + bool highlighted { get; set; } + bool allButtonsVisible { get; set; } + int maxButtonCount { get; set; } + int visibileButtonCount { get; set; } + bool activeTool { get; set; } + Action selectTool { get; set; } + /* int menuButtonOrderPosition { get; } int activeToolOrderPosition { get; } - int order { get; set; } int activeButtonCount { set; } bool revealed { set; } bool moveToAlternatePosition { get; set; } Transform rayOrigin { get; set; } - Type toolType { get; set; } - Type previewToolType { set; } Vector3 toolButtonActivePosition { get; } // Shared active button offset from the alternate menu Sprite icon { set; } Node node { set; } @@ -30,7 +37,11 @@ public interface IPinnedToolButton : IUsesMenuOrigins Action selectTool { set; } Action deletePinnedToolButton { set; } - Action highlightAllToolButtons { set; } + Action revealAllToolButtons { set; } + Action dighlightSingleButton { set; } + Action selectHighlightedButton { set; } + Action deleteHighlightedButton { set; } + */ } public static class IPinnedToolButtonMethods diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 84dd4056f..e59a00424 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -7,6 +7,7 @@ using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using UnityEngine.InputNew; using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Menus @@ -17,7 +18,6 @@ public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, IToolt static Color s_SemiTransparentFrameColor; static bool s_Hovered; - const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation const float k_alternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu const string k_MaterialColorProperty = "_Color"; @@ -35,15 +35,16 @@ public Type toolType } set { + m_ToolType = value; + m_GradientButton.gameObject.SetActive(true); - m_ToolType = value; if (m_ToolType != null) { + Debug.LogError("Setting up button type : " + m_ToolType.ToString()); if (isSelectionTool || isMainMenu) { - //activeButtonCount = 1; - order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; + //order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair secondaryButtonCollidersEnabled = false; @@ -77,9 +78,15 @@ public int order get { return m_Order; } set { + if (m_Order == value) + return; + + + Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order); + m_Order = value; // Position of this button in relation to other pinned tool buttons //m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive - activeTool = activeTool; + //activeTool = activeTool; const float kSmoothingMax = 50f; const int kSmoothingIncreaseFactor = 10; //var smoothingFactor = Mathf.Clamp(kSmoothingMax- m_Order * kSmoothingIncreaseFactor, 0f, kSmoothingMax); @@ -101,7 +108,7 @@ public int order var mainMenuAndActiveButtonCount = 2; var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order, aboluteMenuButtonCount)); + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order)); /* if (aboluteMenuButtonCount > mainMenuAndActiveButtonCount) @@ -175,6 +182,7 @@ public Type previewToolType } } + /* public Transform alternateMenuOrigin { get { return m_AlternateMenuOrigin; } @@ -189,6 +197,7 @@ public Transform alternateMenuOrigin transform.localRotation = Quaternion.identity; } } +*/ [SerializeField] GradientButton m_GradientButton; @@ -263,11 +272,11 @@ public Transform alternateMenuOrigin string m_TooltipText; bool m_Revealed; bool m_MoveToAlternatePosition; - int m_Order; + int m_Order = -1; Type m_previewToolType; Type m_ToolType; GradientPair m_GradientPair; - Transform m_AlternateMenuOrigin; + //Transform m_AlternateMenuOrigin; Material m_FrameMaterial; Material m_InsetMaterial; //Vector3 m_InactivePosition; // Inactive button offset from the main menu activator @@ -276,6 +285,8 @@ public Transform alternateMenuOrigin Material m_IconMaterial; Sprite m_Icon; Sprite m_PreviewIcon; + bool m_Highlighted; + bool m_ActiveTool; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -289,27 +300,37 @@ public Transform alternateMenuOrigin public GradientPair customToolTipHighlightColor { get; set; } public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } - public Action deletePinnedToolButton { get; set; } public int activeButtonCount { get; set; } + public int maxButtonCount { get; set; } public Transform menuOrigin { get; set; } - public Action highlightAllToolButtons { get; set; } + //public Action revealAllToolButtons { get; set; } + //public Action revealAllToolButtons { get; set; } + //public Action hideAllToolButtons { get; set; } + public bool allButtonsVisible { get; set; } public Action OpenMenu { get; set; } - public Action selectTool { get; set; } - public int menuButtonOrderPosition { get { return k_MenuButtonOrderPosition; } } - public int activeToolOrderPosition { get { return k_ActiveToolOrderPosition; } } + public Action selectTool { get; set; } + public Action highlightSingleButton { get; set; } + public Action deleteHighlightedButton { get; set; } + public Action selectHighlightedButton { get; set; } public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu + public int visibileButtonCount { get; set; } public event Action hoverEnter; public event Action hoverExit; public event Action selected; - bool activeTool + public bool activeTool { - get { return m_Order == activeToolOrderPosition; } + get { return m_ActiveTool; } set { - m_GradientButton.normalGradientPair = activeTool ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.highlightGradientPair = activeTool ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; + if (m_ActiveTool == value) + return; + + m_ActiveTool = value; + + m_GradientButton.normalGradientPair = m_ActiveTool ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; + m_GradientButton.highlightGradientPair = m_ActiveTool ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; //if (activeTool) // TODO REMOVE IF NOT NEEDED //m_GradientButton.invertHighlightScale = value; @@ -319,6 +340,30 @@ bool activeTool } } + public bool highlighted + { + get { return m_Highlighted; } + set + { + if (m_Highlighted == value) + return; + + m_Highlighted = value; + m_GradientButton.highlighted = m_Highlighted; + + if (!m_Highlighted) + this.HideTooltip(this); + + if (!isMainMenu || !isSelectionTool) + { + if (m_Highlighted) + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); + else + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + } + } + } + bool primaryButtonCollidersEnabled { set @@ -385,7 +430,7 @@ public bool revealed this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); } - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newOrderPosition, buttonCount)); + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newOrderPosition)); //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value && order < 1)); } @@ -456,7 +501,7 @@ void Start() Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); - transform.parent = alternateMenuOrigin; + //transform.parent = alternateMenuOrigin; if (m_ToolType == null) { @@ -544,8 +589,9 @@ bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) void OnBackgroundHoverEnter () { - if (m_PositionCoroutine != null || m_SecondaryGradientButton.highlighted) - return; + //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); + //if (m_PositionCoroutine != null || m_SecondaryGradientButton.highlighted) + //return; s_Hovered = true; @@ -568,7 +614,8 @@ void OnBackgroundHoverEnter () //Debug.LogWarning("Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); - highlightAllToolButtons(rayOrigin, true); + //revealAllToolButtons(rayOrigin, true); + allButtonsVisible = true; //HoverButton(); //m_ButtonCollider.enabled = false; //} @@ -607,7 +654,7 @@ void HoverButton() //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; } - highlightAllToolButtons(rayOrigin, true); + revealAllToolButtons(rayOrigin, true); } */ @@ -622,7 +669,7 @@ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) return; } - this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); + //this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); if (!m_SecondaryGradientButton.highlighted) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); @@ -640,12 +687,13 @@ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) //m_RightPinnedToolActionButton.visible = false; //m_GradientButton.visible = true; m_GradientButton.highlighted = false; - highlightAllToolButtons(rayOrigin, false); + //revealAllToolButtons(rayOrigin, false); //} m_GradientButton.UpdateMaterialColors(); } + /* void ActionButtonClicked(PinnedToolActionButton button) { Debug.LogError("Action Button selectTool!"); @@ -674,6 +722,7 @@ void ActionButtonClicked(PinnedToolActionButton button) //m_RightPinnedToolActionButton.revealed = false; } } + */ void OnBackgroundButtonClick() { @@ -685,12 +734,12 @@ void OnBackgroundButtonClick() //{ //} - selectTool(rayOrigin, m_ToolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons + selectTool(this); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons if (!isMainMenu) { OnActionButtonHoverExit(false); - //highlightAllToolButtons(rayOrigin, true); + //revealAllToolButtons(rayOrigin, true); } m_GradientButton.UpdateMaterialColors(); @@ -699,7 +748,8 @@ void OnBackgroundButtonClick() void OnSecondaryButtonClicked() { this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndClose()); - deletePinnedToolButton(rayOrigin, this); + deleteHighlightedButton(rayOrigin); + //deletePinnedToolButton(rayOrigin, this); OnActionButtonHoverExit(false); } @@ -742,8 +792,10 @@ IEnumerator AnimateHideAndClose() ObjectUtils.Destroy(gameObject, 0.1f); } - IEnumerator AnimatePosition(int orderPosition, int buttonCount) + //IEnumerator AnimatePosition(int orderPosition, int buttonCount) + IEnumerator AnimatePosition(int orderPosition) { + Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition); primaryButtonCollidersEnabled = false; //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed //gameObject.SetActive(true); @@ -753,14 +805,14 @@ IEnumerator AnimatePosition(int orderPosition, int buttonCount) const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = kRotationSpacing * 0.5f - (buttonCount * 0.5f) * kRotationSpacing; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu - var targetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * orderPosition, Vector3.down); + var phaseOffset = orderPosition > -1 ? kRotationSpacing * 0.5f - (visibileButtonCount * 0.5f) * kRotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + var targetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down); var duration = 0f; //var currentPosition = transform.localPosition; //var targetPosition = activeTool ? activePosition : m_InactivePosition; var currentCanvasAlpha = m_IconContainerCanvasGroup.alpha; - var targetCanvasAlpha = orderPosition > k_ActiveToolOrderPosition - 1 || activeTool ? 1f : 0f; + var targetCanvasAlpha = orderPosition > -1 ? 1f : 0f; var currentRotation = transform.localRotation; var positionWait = 1f;// (order + 5) * 0.1f; while (duration < 1) @@ -892,7 +944,7 @@ IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) // Only proceed if no other button is being hovered m_GradientButton.highlighted = false; - highlightAllToolButtons(rayOrigin, false); + allButtonsVisible = false; m_GradientButton.UpdateMaterialColors(); m_HoverCheckCoroutine = null; } @@ -912,6 +964,7 @@ void CorrectIconRotation() IEnumerator ShowSecondaryButton() { + Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; const float kSecondaryButtonVisibleBlendShapeWeight = 46f; @@ -925,6 +978,9 @@ IEnumerator ShowSecondaryButton() yield return null; } + Debug.LogError("SHOWING SECONDARY BUTTON"); + this.ShowTooltip(this); + amount = 0f; while (amount < 1f) { From 8e34f00e71d8b41ee3ec82979fadb2827ccfea85 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 5 May 2017 14:55:29 -0700 Subject: [PATCH 235/870] Fix outstanding bugs related to new PinnedToolsMenu controller implementation --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 42 ++++-- .../Scripts/PinnedToolsMenuUI.cs | 125 ++++++++++++------ Scripts/Core/EditorVR.PinnedToolButtons.cs | 4 +- Scripts/UI/Interfaces/IPinnedToolButton.cs | 3 +- Scripts/UI/PinnedToolButton.cs | 56 +++++--- 5 files changed, 161 insertions(+), 69 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index d3116907b..d54669a40 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -118,8 +118,15 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) { Debug.LogWarning("SPAWNING pinned tool button for type of : " + toolType); //var pinnedToolButtons = deviceData.pinnedToolButtons; - if (pinnedToolButtons.ContainsKey(toolType) || pinnedToolButtons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button + if (pinnedToolButtons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button + { return; + } + else if (pinnedToolButtons.ContainsKey(toolType)) + { + m_PinnedToolsMenuUI.SelectExistingType(toolType); + return; + } // Before adding new button, offset each button to a position greater than the zeroth/active tool position //foreach (var pair in pinnedToolButtons) @@ -160,6 +167,7 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) m_PinnedToolsMenuUI.AddButton(button, buttonTransform); } + float? continuedInputConsumptionStartTime; Vector3 spatialScrollStartPosition; Vector3? spatialDirection = null; Vector3 previousWorldPosition; @@ -169,8 +177,15 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (buttonCount <= k_ActiveToolOrderPosition + 1) return; - //Debug.LogError("PinnedToolButton"); var pinnedToolInput = (PinnedToolslMenuInput) input; + if (continuedInputConsumptionStartTime != null) + { + // Continue consumption for period of time after releasing the button + consumeControl(pinnedToolInput.show); + consumeControl(pinnedToolInput.select); + if (Time.time > continuedInputConsumptionStartTime.Value) + continuedInputConsumptionStartTime = null; + } if (pinnedToolInput.show.wasJustPressed) Debug.LogError("SHOW pressed in PinnedToolButton"); @@ -182,6 +197,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { //Debug.LogError("Processing input in PinnedToolButton"); //consumeControl(directSelectInput.select); + consumeControl(pinnedToolInput.show); m_PinnedToolsMenuUI.allButtonsVisible = true; spatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; } @@ -193,22 +209,32 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //OnActionButtonHoverExit(false); deleteHighlightedButton(rayOrigin); m_PinnedToolsMenuUI.allButtonsVisible = false; - spatialDirection = null; + //spatialDirection = null; return; } // normalized input should loop after reaching the 0.15f length + buttonCount -= 1; // Decrement to disallow cycling through the main menu button var normalizedRepeatingPosition = processSpatialScrolling(spatialScrollStartPosition, m_PinnedToolsMenuUI.transform.position, 0.15f, true); - m_PinnedToolsMenuUI.HighlightSingleButton((int)(buttonCount * normalizedRepeatingPosition)); + m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition)); consumeControl(pinnedToolInput.show); consumeControl(pinnedToolInput.select); } else if (pinnedToolInput.show.wasJustReleased) { - m_PinnedToolsMenuUI.allButtonsVisible = false; - m_PinnedToolsMenuUI.SelectHighlightedButton(); - spatialDirection = null; - consumeControl(pinnedToolInput.select); + continuedInputConsumptionStartTime = Time.time + 2f; + + if (spatialDirection != null) + { + m_PinnedToolsMenuUI.SelectHighlightedButton(); + spatialDirection = null; + consumeControl(pinnedToolInput.select); + + } + else + { + m_PinnedToolsMenuUI.allButtonsVisible = false; + } } // cache current position for delta comparison on next frame for fine tuned scrolling with low velocity diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 644bb63ac..8aacaeb8c 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -6,6 +6,7 @@ using System.Security.Permissions; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -13,8 +14,9 @@ namespace UnityEditor.Experimental.EditorVR.Menus { sealed class PinnedToolsMenuUI : MonoBehaviour, IInstantiateUI { - const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation - const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation + const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation + const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation + const int k_InactiveButtonInitialOrderPosition = -1; [SerializeField] Transform m_ButtonContainer; @@ -42,27 +44,12 @@ public bool allButtonsVisible m_AllButtonsVisible = value; if (m_AllButtonsVisible) - ShowAllButtons(); - else - HideAllButtons(); - } - } - - private int visibleButtonCount - { - get - { - return m_VisibleButtonCount; - /* - int count = 0; - for (int i = 0; i < m_OrderedButtons.Count; ++i) { - if (m_OrderedButtons[i].order > -1) - ++count; + this.StopCoroutine(ref m_ShowHideAllButtonsCoroutine); + ShowAllExceptMenuButton(); } - - return count; - */ + else + ShowOnlyMenuAndActiveToolButtons(); } } @@ -77,30 +64,37 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) button.allButtonsVisible = allButtonsVisible; button.maxButtonCount = maxButtonCount; button.selectTool = SelectTool; - button.visibileButtonCount = visibleButtonCount; + button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount - var insertPosition = -1; - if (button.toolType == typeof(IMainMenu)) + var insertPosition = k_InactiveButtonInitialOrderPosition; + if (IsMainMenuButton(button)) + { insertPosition = k_MenuButtonOrderPosition; + //m_VisibleButtonCount = 2; // Show only the MainMenu and select buttons initiall + } else + { insertPosition = k_ActiveToolOrderPosition; + } m_OrderedButtons.Insert(insertPosition, button); - m_VisibleButtonCount = m_VisibleButtonCount = m_OrderedButtons.Count; + m_VisibleButtonCount = m_OrderedButtons.Count; button.activeTool = true; + button.order = insertPosition; buttonTransform.rotation = Quaternion.identity; buttonTransform.localPosition = Vector3.zero; buttonTransform.localScale = Vector3.zero; - button.order = insertPosition; - Debug.LogWarning("Setting up button : " + button.toolType + " - ORDER : " + button.order); - if (m_OrderedButtons.Count > k_ActiveToolOrderPosition) + if (m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1) this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons()); + else + SetupButtonOrder(); // Setup the MainMenu and active tool buttons only /* + foreach (var pair in pinnedToolButtons) { if (pair.Value.order != pair.Value.menuButtonOrderPosition) // don't move the main menu button @@ -158,8 +152,24 @@ IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolT return pinnedToolButton; } + void Reinsert(IPinnedToolButton button, int newOrderPosition, bool updateButtonOrder = false) + { + var removed = m_OrderedButtons.Remove(button); + if (!removed) + { + Debug.LogError("Could not remove button"); + return; + } + + m_OrderedButtons.Insert(newOrderPosition, button); + + if (updateButtonOrder) + button.order = newOrderPosition; + } + void SetupButtonOrder() { + Debug.LogError("SetupButtonOrder"); for (int i = 0; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i]; @@ -168,45 +178,61 @@ void SetupButtonOrder() } } - void ShowAllButtons() + void ShowAllExceptMenuButton() { - m_VisibleButtonCount = m_OrderedButtons.Count - 1; // subtract the menu button from the total + Debug.LogError("ShowAllExceptMenuButton"); + m_VisibleButtonCount = Mathf.Max(0, m_OrderedButtons.Count - 1); // The MainMenu button will be hidden, subtract 1 from the m_VisibleButtonCount for (int i = 0; i < m_OrderedButtons.Count; ++i) - m_OrderedButtons[i].order = i == 0 ? -1 : i; // hide the menu buttons when revealing all tools buttons + m_OrderedButtons[i].order = i == k_MenuButtonOrderPosition ? k_InactiveButtonInitialOrderPosition : i - 1; // Hide the menu buttons when revealing all tools buttons SetupButtonOrder(); } - void HideAllButtons() + void ShowOnlyMenuAndActiveToolButtons() { Debug.LogError("Hiding all buttons"); m_VisibleButtonCount = 2; // Show only the menu and active tool button - const int kInactiveButtonInitialOrderPosition = -1; for (int i = 0; i < m_OrderedButtons.Count; ++i) - m_OrderedButtons[i].order = i > k_ActiveToolOrderPosition ? kInactiveButtonInitialOrderPosition : i; // maintain menu and active tool positions + { + var button = m_OrderedButtons[i]; + button.toolTipVisible = false; + if (IsMainMenuButton(button)) + Reinsert(button, k_MenuButtonOrderPosition, true); // Return the main menu button to its original position after being hidden when showing tool buttons + else + m_OrderedButtons[i].order = i > k_ActiveToolOrderPosition ? k_InactiveButtonInitialOrderPosition : i; // Hide buttons beyond the active tool button threshold + } } void SelectTool(IPinnedToolButton pinnedToolButton) { + Debug.LogError("Selecting toolf of type : " + pinnedToolButton.toolType); for (int i = 0; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i];; if (button == pinnedToolButton && button.order > k_ActiveToolOrderPosition) - { - m_OrderedButtons.Remove(button); - m_OrderedButtons.Insert(k_ActiveToolOrderPosition, button); - } + Reinsert(button, k_ActiveToolOrderPosition); } - SetupButtonOrder(); // after setting the new order of the active tool button, reposition the buttons + this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons()); selectTool(rayOrigin, pinnedToolButton.toolType); } - public void HighlightSingleButton(int buttonOrderPosition) + public void SelectExistingType(Type type) + { + foreach (var button in m_OrderedButtons) + { + if (button.toolType == type) + SelectTool(button); + } + } + + public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) { Debug.LogError("Highlighting SINGLE BUTTON at position : "+ buttonOrderPosition); - for (int i = 0; i < m_OrderedButtons.Count; ++i) - m_OrderedButtons[i].highlighted = i == buttonOrderPosition; + for (int i = 0; i < m_OrderedButtons.Count - 1; ++i) + { + m_OrderedButtons[i + 1].highlighted = i == buttonOrderPosition; + } } public void SelectHighlightedButton() @@ -222,6 +248,21 @@ public void SelectHighlightedButton() } } } + + bool IsMainMenuButton(IPinnedToolButton button) + { + return button.toolType == typeof(IMainMenu); + } + + bool IsSelectionButton(IPinnedToolButton button) + { + return button.toolType == typeof(SelectionTool); + } + + int VisibleButtonCount() + { + return m_VisibleButtonCount; + } } } #endif diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index f9657cefe..0668729b4 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -74,7 +74,7 @@ internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolT button.deletePinnedToolButton = DeletePinnedToolButton; button.revealAllToolButtons = RevealAllToolButtons; button.selectTool = ToolButtonClicked; - //button.highli = HighlightSingleButton; + //button.highli = HighlightSingleButtonWithoutMenu; button.selectHighlightedButton = SelectHighlightedButton; button.deleteHighlightedButton = DeleteHighlightedButton; //button.selected += OnMainMenuActivatorSelected; @@ -234,7 +234,7 @@ internal void RevealAllToolButtons (Transform rayOrigin, bool reveal) /* // TODO: move into pinned tool button controller? - internal void HighlightSingleButton (Transform rayOrigin, int buttonOrderPosition, bool highlight = true) + internal void HighlightSingleButtonWithoutMenu (Transform rayOrigin, int buttonOrderPosition, bool highlight = true) { Rays.ForEachProxyDevice(deviceData => { diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 2881e82a7..f5b17db7d 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -16,9 +16,10 @@ public interface IPinnedToolButton bool highlighted { get; set; } bool allButtonsVisible { get; set; } int maxButtonCount { get; set; } - int visibileButtonCount { get; set; } + Func visibileButtonCount { get; set; } bool activeTool { get; set; } Action selectTool { get; set; } + bool toolTipVisible { set; } /* int menuButtonOrderPosition { get; } int activeToolOrderPosition { get; } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index e59a00424..c35520cf0 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -78,17 +78,17 @@ public int order get { return m_Order; } set { - if (m_Order == value) - return; + //if (m_Order == value) + //return; + m_Order = value; // Position of this button in relation to other pinned tool buttons - Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order); + Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order + " - current button count : " + visibileButtonCount); - m_Order = value; // Position of this button in relation to other pinned tool buttons //m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive //activeTool = activeTool; - const float kSmoothingMax = 50f; - const int kSmoothingIncreaseFactor = 10; + //const float kSmoothingMax = 50f; + //const int kSmoothingIncreaseFactor = 10; //var smoothingFactor = Mathf.Clamp(kSmoothingMax- m_Order * kSmoothingIncreaseFactor, 0f, kSmoothingMax); //m_SmoothMotion.SetPositionSmoothing(smoothingFactor); //m_SmoothMotion.SetRotationSmoothing(smoothingFactor); @@ -106,10 +106,13 @@ public int order m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); m_IconContainerCanvasGroup.alpha = 1f; - var mainMenuAndActiveButtonCount = 2; - var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton + //var mainMenuAndActiveButtonCount = 2; + //var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order)); + if(m_Order == -1) + this.HideTooltip(this); + /* if (aboluteMenuButtonCount > mainMenuAndActiveButtonCount) this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); @@ -287,6 +290,7 @@ public Transform alternateMenuOrigin Sprite m_PreviewIcon; bool m_Highlighted; bool m_ActiveTool; + bool m_Visible; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -313,7 +317,7 @@ public Transform alternateMenuOrigin public Action deleteHighlightedButton { get; set; } public Action selectHighlightedButton { get; set; } public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu - public int visibileButtonCount { get; set; } + public Func visibileButtonCount { get; set; } public event Action hoverEnter; public event Action hoverExit; @@ -324,8 +328,8 @@ public bool activeTool get { return m_ActiveTool; } set { - if (m_ActiveTool == value) - return; + //if (m_ActiveTool == value) + //return; m_ActiveTool = value; @@ -340,6 +344,18 @@ public bool activeTool } } + public bool visible + { + //get { return m_Highlighted; } + set + { + if (m_Visible == value) + return; + + gameObject.SetActive(value); + } + } + public bool highlighted { get { return m_Highlighted; } @@ -364,6 +380,15 @@ public bool highlighted } } + public bool toolTipVisible + { + set + { + if (!value) + this.HideTooltip(this); + } + } + bool primaryButtonCollidersEnabled { set @@ -795,7 +820,7 @@ IEnumerator AnimateHideAndClose() //IEnumerator AnimatePosition(int orderPosition, int buttonCount) IEnumerator AnimatePosition(int orderPosition) { - Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition); + Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition + " - BUTTON COUNT: " + visibileButtonCount); primaryButtonCollidersEnabled = false; //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed //gameObject.SetActive(true); @@ -803,10 +828,9 @@ IEnumerator AnimatePosition(int orderPosition) //if (order != activeToolOrderPosition) //m_RootCollider.enabled = false; - const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice - const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = orderPosition > -1 ? kRotationSpacing * 0.5f - (visibileButtonCount * 0.5f) * kRotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu - var targetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down); + var rotationSpacing = 360f / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time + var phaseOffset = orderPosition > -1 ? rotationSpacing * 0.5f - (visibileButtonCount() * 0.5f) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; var duration = 0f; //var currentPosition = transform.localPosition; From 0bf80b90ea0c02cb999e38e62e551eaf896a8ddc Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 5 May 2017 18:39:10 -0700 Subject: [PATCH 236/870] Add support for timed showing/hiding of buttons based on input context --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 3 +- .../Scripts/PinnedToolsMenuUI.cs | 12 +- Scripts/UI/PinnedToolButton.cs | 112 +++++++++++++++++- 3 files changed, 115 insertions(+), 12 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index d54669a40..567c41d47 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -216,7 +216,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button var normalizedRepeatingPosition = processSpatialScrolling(spatialScrollStartPosition, m_PinnedToolsMenuUI.transform.position, 0.15f, true); - m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition)); + m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); consumeControl(pinnedToolInput.show); consumeControl(pinnedToolInput.select); } @@ -229,7 +229,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PinnedToolsMenuUI.SelectHighlightedButton(); spatialDirection = null; consumeControl(pinnedToolInput.select); - } else { diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 8aacaeb8c..d686e250b 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -103,14 +103,14 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) */ } - IEnumerator ShowThenHideAllButtons(bool waitBeforeClosingAllButtons = true) + IEnumerator ShowThenHideAllButtons(float delayBeforeHiding = 1.25f) { SetupButtonOrder(); - if (waitBeforeClosingAllButtons) + if (delayBeforeHiding > 0) { var duration = Time.unscaledDeltaTime; - while (duration < 1.25f) + while (duration < delayBeforeHiding) { duration += Time.unscaledDeltaTime; yield return null; @@ -213,7 +213,7 @@ void SelectTool(IPinnedToolButton pinnedToolButton) Reinsert(button, k_ActiveToolOrderPosition); } - this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons()); + this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(0.5f)); selectTool(rayOrigin, pinnedToolButton.toolType); } @@ -229,9 +229,9 @@ public void SelectExistingType(Type type) public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) { Debug.LogError("Highlighting SINGLE BUTTON at position : "+ buttonOrderPosition); - for (int i = 0; i < m_OrderedButtons.Count - 1; ++i) + for (int i = 1; i < m_OrderedButtons.Count; ++i) { - m_OrderedButtons[i + 1].highlighted = i == buttonOrderPosition; + m_OrderedButtons[i].highlighted = i == buttonOrderPosition; } } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index c35520cf0..26838a8f5 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -85,6 +85,7 @@ public int order Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order + " - current button count : " + visibileButtonCount); + highlighted = false; //m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive //activeTool = activeTool; //const float kSmoothingMax = 50f; @@ -265,6 +266,9 @@ public Transform alternateMenuOrigin [SerializeField] Image m_ButtonIcon; + [SerializeField] + AudioClip m_HighlightedHapticClip; + Coroutine m_PositionCoroutine; Coroutine m_VisibilityCoroutine; Coroutine m_HighlightCoroutine; @@ -735,7 +739,7 @@ void ActionButtonClicked(PinnedToolActionButton button) else // Handle action buttons assigned Close-Tool functionality { //if (!isSelectionTool) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndClose()); + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); //else //Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); @@ -772,7 +776,7 @@ void OnBackgroundButtonClick() void OnSecondaryButtonClicked() { - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndClose()); + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); deleteHighlightedButton(rayOrigin); //deletePinnedToolButton(rayOrigin, this); OnActionButtonHoverExit(false); @@ -798,7 +802,7 @@ IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) m_VisibilityCoroutine = null; } - IEnumerator AnimateHideAndClose() + IEnumerator AnimateHideAndDestroy() { this.HideTooltip(this); var duration = 0f; @@ -817,6 +821,98 @@ IEnumerator AnimateHideAndClose() ObjectUtils.Destroy(gameObject, 0.1f); } + IEnumerator AnimateTempHide() + { + primaryButtonCollidersEnabled = false; + secondaryButtonCollidersEnabled = false; + + var currentFrameColor = m_FrameMaterial.color; + var targetFrameColor = Color.clear; + var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); + var targetInsetAlpha = 0f; + var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); + var targetIconColor = Color.clear; + //var currentInsetScale = m_Inset.localScale; + //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; + //var currentInsetMaskScale = m_InsetMask.localScale; + //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; + var currentIconScale = m_IconContainer.localScale; + var targetIconContainerScale = Vector3.zero; + var transitionAmount = 0f; + var currentScale = transform.localScale; + while (transitionAmount < 1) + { + transitionAmount += Time.unscaledDeltaTime * 8; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + /* + m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); + //m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); + //m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); + m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); + //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); + */ + //CorrectIconRotation(); + transform.localScale = Vector3.Lerp(currentScale, Vector3.zero, shapedAmount); + yield return null; + } + + m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); + //m_Inset.localScale = targetInsetScale; + //m_InsetMask.localScale = targetInsetMaskScale; + m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + m_IconContainer.localScale = targetIconContainerScale; + m_VisibilityCoroutine = null; + } + + IEnumerator AnimateTempShow() + { + primaryButtonCollidersEnabled = false; + secondaryButtonCollidersEnabled = false; + + var currentFrameColor = m_FrameMaterial.color; + var targetFrameColor = Color.clear; + var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); + var targetInsetAlpha = 0f; + var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); + var targetIconColor = Color.clear; + //var currentInsetScale = m_Inset.localScale; + //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; + //var currentInsetMaskScale = m_InsetMask.localScale; + //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; + var currentIconScale = m_IconContainer.localScale; + var targetIconContainerScale = Vector3.zero; + var transitionAmount = 0f; + var currentScale = transform.localScale; + while (transitionAmount < 1) + { + transitionAmount += Time.unscaledDeltaTime * 8; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + /* + m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); + //m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); + //m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); + m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); + //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); + */ + //CorrectIconRotation(); + transform.localScale = Vector3.Lerp(currentScale, m_OriginalLocalScale, shapedAmount); + yield return null; + } + + m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); + //m_Inset.localScale = targetInsetScale; + //m_InsetMask.localScale = targetInsetMaskScale; + m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + m_IconContainer.localScale = targetIconContainerScale; + m_VisibilityCoroutine = null; + } + //IEnumerator AnimatePosition(int orderPosition, int buttonCount) IEnumerator AnimatePosition(int orderPosition) { @@ -828,6 +924,14 @@ IEnumerator AnimatePosition(int orderPosition) //if (order != activeToolOrderPosition) //m_RootCollider.enabled = false; + if (orderPosition == -1) + { + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateTempHide()); + } + //else + //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateTempShow()); + var rotationSpacing = 360f / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time var phaseOffset = orderPosition > -1 ? rotationSpacing * 0.5f - (visibileButtonCount() * 0.5f) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; @@ -859,7 +963,7 @@ IEnumerator AnimatePosition(int orderPosition) primaryButtonCollidersEnabled = true; m_PositionCoroutine = null; - if (m_GradientButton.highlighted) + if (orderPosition > -1 && m_GradientButton.highlighted) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } From 64a83229ab304abf40a278b616665107ac6a8530 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 00:26:45 -0700 Subject: [PATCH 237/870] Make animated coroutine names relevant to new functionality in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 26838a8f5..1f44c025f 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -63,7 +63,7 @@ public Type toolType var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow(targetPosition, targetScale)); + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateInitialReveal(targetPosition, targetScale)); } else { @@ -782,7 +782,7 @@ void OnSecondaryButtonClicked() OnActionButtonHoverExit(false); } - IEnumerator AnimateShow(Vector3 targetPosition, Vector3 targetScale) + IEnumerator AnimateInitialReveal(Vector3 targetPosition, Vector3 targetScale) { m_IconContainerCanvasGroup.alpha = 1f; var duration = 0f; @@ -821,7 +821,7 @@ IEnumerator AnimateHideAndDestroy() ObjectUtils.Destroy(gameObject, 0.1f); } - IEnumerator AnimateTempHide() + IEnumerator AnimateHide() { primaryButtonCollidersEnabled = false; secondaryButtonCollidersEnabled = false; @@ -867,7 +867,7 @@ IEnumerator AnimateTempHide() m_VisibilityCoroutine = null; } - IEnumerator AnimateTempShow() + IEnumerator AnimateShow() { primaryButtonCollidersEnabled = false; secondaryButtonCollidersEnabled = false; @@ -927,10 +927,10 @@ IEnumerator AnimatePosition(int orderPosition) if (orderPosition == -1) { this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateTempHide()); + //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); } //else - //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateTempShow()); + //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); var rotationSpacing = 360f / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time var phaseOffset = orderPosition > -1 ? rotationSpacing * 0.5f - (visibileButtonCount() * 0.5f) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu From 9b4d1934117a4147341801b68c6d4e8ab67d4397 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 02:47:04 -0700 Subject: [PATCH 238/870] Remove SetupButtonOrder call in ShowAllExceptMenuButton function; assign active tool states in the same loop --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index d686e250b..0e121059d 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -183,9 +183,11 @@ void ShowAllExceptMenuButton() Debug.LogError("ShowAllExceptMenuButton"); m_VisibleButtonCount = Mathf.Max(0, m_OrderedButtons.Count - 1); // The MainMenu button will be hidden, subtract 1 from the m_VisibleButtonCount for (int i = 0; i < m_OrderedButtons.Count; ++i) - m_OrderedButtons[i].order = i == k_MenuButtonOrderPosition ? k_InactiveButtonInitialOrderPosition : i - 1; // Hide the menu buttons when revealing all tools buttons - - SetupButtonOrder(); + { + var button = m_OrderedButtons[i]; + button.activeTool = i == k_ActiveToolOrderPosition; + button.order = i == k_MenuButtonOrderPosition ? k_InactiveButtonInitialOrderPosition : i - 1; // Hide the menu buttons when revealing all tools buttons + } } void ShowOnlyMenuAndActiveToolButtons() From 815bb80b9e2e4be254593a6f14bd592271ef1211 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 02:48:31 -0700 Subject: [PATCH 239/870] Cleanup animated show/hide/position functions in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 65 +++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 1f44c025f..12f5d1936 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -61,9 +61,9 @@ public Type toolType m_GradientButton.visible = true; //m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); - var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateInitialReveal(targetPosition, targetScale)); + //var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + //var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; + //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateInitialReveal(targetPosition, targetScale)); } else { @@ -104,9 +104,6 @@ public int order //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); - m_IconContainerCanvasGroup.alpha = 1f; - //var mainMenuAndActiveButtonCount = 2; //var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order)); @@ -290,6 +287,7 @@ public Transform alternateMenuOrigin Vector3 m_OriginalLocalPosition; Vector3 m_OriginalLocalScale; Material m_IconMaterial; + Vector3 m_OriginalIconContainerLocalScale; Sprite m_Icon; Sprite m_PreviewIcon; bool m_Highlighted; @@ -337,8 +335,8 @@ public bool activeTool m_ActiveTool = value; - m_GradientButton.normalGradientPair = m_ActiveTool ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.highlightGradientPair = m_ActiveTool ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; + m_GradientButton.normalGradientPair = !m_ActiveTool ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; + m_GradientButton.highlightGradientPair = !m_ActiveTool ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; //if (activeTool) // TODO REMOVE IF NOT NEEDED //m_GradientButton.invertHighlightScale = value; @@ -514,13 +512,13 @@ void Awake() m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); var frameMaterialColor = m_FrameMaterial.color; - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); m_IconMaterial = MaterialUtils.GetMaterialClone(m_ButtonIcon); - m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); + m_OriginalIconContainerLocalScale = m_IconContainer.localScale; //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); } @@ -823,8 +821,11 @@ IEnumerator AnimateHideAndDestroy() IEnumerator AnimateHide() { - primaryButtonCollidersEnabled = false; - secondaryButtonCollidersEnabled = false; + //primaryButtonCollidersEnabled = false; + //secondaryButtonCollidersEnabled = false; + var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + var targetPosition = Vector3.zero; + var currentPosition = transform.localPosition; var currentFrameColor = m_FrameMaterial.color; var targetFrameColor = Color.clear; @@ -851,26 +852,33 @@ IEnumerator AnimateHide() m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); */ //CorrectIconRotation(); + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); transform.localScale = Vector3.Lerp(currentScale, Vector3.zero, shapedAmount); yield return null; } + /* m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); //m_Inset.localScale = targetInsetScale; //m_InsetMask.localScale = targetInsetMaskScale; m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + */ m_IconContainer.localScale = targetIconContainerScale; + transform.localPosition = targetPosition; m_VisibilityCoroutine = null; } IEnumerator AnimateShow() { - primaryButtonCollidersEnabled = false; - secondaryButtonCollidersEnabled = false; + //primaryButtonCollidersEnabled = false; + //secondaryButtonCollidersEnabled = false; + + var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; var currentFrameColor = m_FrameMaterial.color; var targetFrameColor = Color.clear; @@ -883,7 +891,7 @@ IEnumerator AnimateShow() //var currentInsetMaskScale = m_InsetMask.localScale; //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; var currentIconScale = m_IconContainer.localScale; - var targetIconContainerScale = Vector3.zero; + var targetIconContainerScale = m_OriginalIconContainerLocalScale; var transitionAmount = 0f; var currentScale = transform.localScale; while (transitionAmount < 1) @@ -897,18 +905,24 @@ IEnumerator AnimateShow() m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); + transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); */ //CorrectIconRotation(); - transform.localScale = Vector3.Lerp(currentScale, m_OriginalLocalScale, shapedAmount); + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); + transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, shapedAmount); + transform.localScale = Vector3.Lerp(currentScale, targetScale, shapedAmount); yield return null; } + /* m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); //m_Inset.localScale = targetInsetScale; //m_InsetMask.localScale = targetInsetMaskScale; m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + */ + transform.localPosition = targetPosition; + transform.localScale = targetScale; m_IconContainer.localScale = targetIconContainerScale; m_VisibilityCoroutine = null; } @@ -918,19 +932,19 @@ IEnumerator AnimatePosition(int orderPosition) { Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition + " - BUTTON COUNT: " + visibileButtonCount); primaryButtonCollidersEnabled = false; + secondaryButtonCollidersEnabled = false; //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed //gameObject.SetActive(true); //if (order != activeToolOrderPosition) //m_RootCollider.enabled = false; + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + if (orderPosition == -1) - { - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); - } - //else - //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); + else + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); var rotationSpacing = 360f / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time var phaseOffset = orderPosition > -1 ? rotationSpacing * 0.5f - (visibileButtonCount() * 0.5f) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu @@ -960,7 +974,8 @@ IEnumerator AnimatePosition(int orderPosition) //transform.localPosition = targetPosition; transform.localRotation = targetRotation; CorrectIconRotation(); - primaryButtonCollidersEnabled = true; + primaryButtonCollidersEnabled = orderPosition > -1 ? true : false; + secondaryButtonCollidersEnabled = orderPosition > -1 ? true : false; m_PositionCoroutine = null; if (orderPosition > -1 && m_GradientButton.highlighted) From 26da592718b1af6a12ae0bb7e39f3b5427469d04 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 02:50:48 -0700 Subject: [PATCH 240/870] Reduce IconContainer localScale; it's initially cached in PinnedToolButton for animation purposes --- Prefabs/UI/PinnedToolButton.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index 1f08e23c8..ca3376b19 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -664,7 +664,7 @@ Transform: m_GameObject: {fileID: 1000011490841208} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -2.0372681e-10, y: -0.0027, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 0.85, y: 0.85, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000010289694770} From 1c497e8ea122d1de91e0d320d38443a9af475f5d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 17:51:23 -0700 Subject: [PATCH 241/870] Prevent the main menu button from being shown in the revealed button layout after selecting a tool via spatial-scrolling --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 0e121059d..6746d07d4 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -103,9 +103,12 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) */ } - IEnumerator ShowThenHideAllButtons(float delayBeforeHiding = 1.25f) + IEnumerator ShowThenHideAllButtons(float delayBeforeHiding = 1.25f, bool showMenuButton = true) { - SetupButtonOrder(); + if (showMenuButton) + SetupButtonOrder(); + else + ShowAllExceptMenuButton(); if (delayBeforeHiding > 0) { @@ -215,7 +218,7 @@ void SelectTool(IPinnedToolButton pinnedToolButton) Reinsert(button, k_ActiveToolOrderPosition); } - this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(0.5f)); + this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(0.5f, false)); selectTool(rayOrigin, pinnedToolButton.toolType); } From 7072c43cb845dfae2438dfcb6327c377f06382aa Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 18:17:08 -0700 Subject: [PATCH 242/870] Add maximum tools reached warning to PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 567c41d47..4f5e35395 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -120,6 +120,8 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) //var pinnedToolButtons = deviceData.pinnedToolButtons; if (pinnedToolButtons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button { + // TODO: kick out the oldest tool, and allow the new tool to become the active tool + Debug.LogWarning("New pinned tool button cannot be added. The maximum number of pinned tool buttons are currently being displayed"); return; } else if (pinnedToolButtons.ContainsKey(toolType)) From af6f3c831f7eb9ff192ab41ba296609ad268572d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 18:20:25 -0700 Subject: [PATCH 243/870] Prevent button scale from increasing when setting new button order --- Scripts/UI/PinnedToolButton.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 12f5d1936..00c6e364a 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -894,6 +894,7 @@ IEnumerator AnimateShow() var targetIconContainerScale = m_OriginalIconContainerLocalScale; var transitionAmount = 0f; var currentScale = transform.localScale; + var currentPosition = transform.localPosition; while (transitionAmount < 1) { transitionAmount += Time.unscaledDeltaTime * 8; @@ -909,7 +910,7 @@ IEnumerator AnimateShow() */ //CorrectIconRotation(); m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); - transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, shapedAmount); + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); transform.localScale = Vector3.Lerp(currentScale, targetScale, shapedAmount); yield return null; } From 4f102d9a5b71ffa4647ab38b89978b6696caa79f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 18:21:35 -0700 Subject: [PATCH 244/870] Prevent menu button from being shown when creating new PinnedToolButtons and adding them to the UI --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 6746d07d4..18c842793 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -90,7 +90,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) Debug.LogWarning("Setting up button : " + button.toolType + " - ORDER : " + button.order); if (m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1) - this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons()); + this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1.25f, false)); else SetupButtonOrder(); // Setup the MainMenu and active tool buttons only /* @@ -188,7 +188,7 @@ void ShowAllExceptMenuButton() for (int i = 0; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i]; - button.activeTool = i == k_ActiveToolOrderPosition; + button.activeTool = i == k_ActiveToolOrderPosition; // Set the button gradients // TODO Consider handling insid button via k_ActiveToolOrder position comparison button.order = i == k_MenuButtonOrderPosition ? k_InactiveButtonInitialOrderPosition : i - 1; // Hide the menu buttons when revealing all tools buttons } } From 0ac0ba0913ca3d239a97dc4498a9b91c063e17d2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 8 May 2017 20:19:15 -0700 Subject: [PATCH 245/870] Prevent existing buttons and the main menu button from performing an additional SelectTool call --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 18c842793..7b94e0384 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -208,7 +208,7 @@ void ShowOnlyMenuAndActiveToolButtons() } } - void SelectTool(IPinnedToolButton pinnedToolButton) + void SelectTool(IPinnedToolButton pinnedToolButton, bool existingButton = false) { Debug.LogError("Selecting toolf of type : " + pinnedToolButton.toolType); for (int i = 0; i < m_OrderedButtons.Count; ++i) @@ -219,7 +219,9 @@ void SelectTool(IPinnedToolButton pinnedToolButton) } this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(0.5f, false)); - selectTool(rayOrigin, pinnedToolButton.toolType); + + if (!existingButton || IsMainMenuButton(pinnedToolButton)) + selectTool(rayOrigin, pinnedToolButton.toolType); } public void SelectExistingType(Type type) @@ -227,7 +229,7 @@ public void SelectExistingType(Type type) foreach (var button in m_OrderedButtons) { if (button.toolType == type) - SelectTool(button); + SelectTool(button, true); } } From 33c254b16bff37a0ca42f2b406ba30abf6e56aba Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 12:55:07 -0700 Subject: [PATCH 246/870] Remove connectInterfaces and SmoothMotion hookup in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 00c6e364a..44d07215f 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IConnectInterfaces + public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor { static Color s_FrameOpaqueColor; static Color s_SemiTransparentFrameColor; @@ -545,7 +545,6 @@ void Start() tooltipSource.localPosition = tooltipSourcePosition; tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); - this.ConnectInterfaces(m_SmoothMotion); m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions m_GradientButton.hoverExit += OnActionButtonHoverExit; From c7682d8d21bf8c0d438e9532b3dd9431cd91cd0b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 14:40:01 -0700 Subject: [PATCH 247/870] Cleanup PinnedToolsMenu setup order in EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index ef924ede4..7a8f06768 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -132,11 +132,12 @@ internal static void SpawnDefaultTools(IProxy proxy) // Setup PinnedToolsMenu var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); deviceData.pinnedToolsMenu = pinnedToolsMenu; - pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; pinnedToolsMenu.selectTool = pinnedTools.ToolButtonClicked; pinnedToolsMenu.onButtonHoverEnter = pinnedTools.OnButtonHoverEnter; pinnedToolsMenu.onButtonHoverExit = pinnedTools.OnButtonHoverExit; pinnedToolsMenu.highlightDevice = pinnedTools.HighlightDevice; + pinnedToolsMenu.mainMenuActivatorSelected = pinnedTools.OnMainMenuActivatorSelected; + pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; // Setup permanent menu & selection PinnedToolButtons //deviceData.pinnedToolButtons = new Dictionary(); pinnedToolsMenu.createPinnedToolButton(typeof(IMainMenu), evr.m_UnityIcon, deviceData.node); @@ -222,9 +223,9 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) var pinnedToolsMenu = deviceData.pinnedToolsMenu; // If this tool was on the current device already, then simply remove it - var isSelectOrMainMenu = (deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool) || toolType == typeof(IMainMenu); + var despawn = deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool || toolType == typeof(IMainMenu); var defaultTool = IsDefaultTool(toolType); // TODO initially set spawnTool to this default/permatool value - if (deviceData.currentTool != null && isSelectOrMainMenu) + if (deviceData.currentTool != null && despawn) { Debug.LogError("Despawing tool !!!! : toolType == typeof(SelectionTool) : " + (toolType == typeof(SelectionTool)).ToString()); DespawnTool(deviceData, deviceData.currentTool); From 9d710fcbb8231a875c2d6f2390fcc63d463bcd62 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 14:41:47 -0700 Subject: [PATCH 248/870] Add MainMenu activation action to IPinnedToolButton --- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index f17d81162..5bf72f9a5 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -35,6 +35,7 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap Action onButtonHoverEnter { get; set; } Action onButtonHoverExit { get; set; } Action highlightDevice { get; set; } + Action mainMenuActivatorSelected { set; } // CONVERT INTO METHODS Action createPinnedToolButton { get; set; } From 477e67203522beb20d596665a623adf9e6d3da3b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 14:42:28 -0700 Subject: [PATCH 249/870] Cleanup PinnedToolsMenuUI setup in PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 34 +++++++++++++++---------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 4f5e35395..ad3cf4843 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -52,13 +52,11 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Action onButtonHoverExit { get; set; } public Action highlightDevice { get; set; } public Action createPinnedToolButton { get; set; } + public Action mainMenuActivatorSelected { get; set; } Transform m_AlternateMenuOrigin; - public Action selectTool - { - set { m_PinnedToolsMenuUI.selectTool = value; } - } + public Action selectTool { get; set; } public Transform rayOrigin { @@ -66,7 +64,7 @@ public Transform rayOrigin set { m_RayOrigin = value; - m_PinnedToolsMenuUI.rayOrigin = value; + CreatePinnedToolsUI(); } } @@ -85,15 +83,7 @@ public Transform alternateMenuOrigin m_AlternateMenuOrigin = value; - if (m_PinnedToolsMenuUI == null) - m_PinnedToolsMenuUI = this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); - - m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; - var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; - pinnedToolsUITransform.SetParent(m_AlternateMenuOrigin); - pinnedToolsUITransform.localPosition = Vector3.zero; - pinnedToolsUITransform.localRotation = Quaternion.identity; } } @@ -114,6 +104,24 @@ void Awake() createPinnedToolButton = CreatePinnedToolButton; } + void CreatePinnedToolsUI() + { + Debug.LogWarning("Spawing pinned tools menu UI"); + if (m_PinnedToolsMenuUI == null) + m_PinnedToolsMenuUI = this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); + + this.ConnectInterfaces(m_PinnedToolsMenuUI); + m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; + m_PinnedToolsMenuUI.mainMenuActivatorSelected = mainMenuActivatorSelected; + m_PinnedToolsMenuUI.rayOrigin = rayOrigin; + + // Alternate menu origin isnt set when awake or start run + var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; + pinnedToolsUITransform.SetParent(m_AlternateMenuOrigin); + pinnedToolsUITransform.localPosition = Vector3.zero; + pinnedToolsUITransform.localRotation = Quaternion.identity; + } + public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) { Debug.LogWarning("SPAWNING pinned tool button for type of : " + toolType); From 35c77bf5ab720d12d9bb8f9e8f9eee8a9ed9a0f4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 15:07:18 -0700 Subject: [PATCH 250/870] Add menu-based alternating selection of the same tool in PinnedToolButtons; add ISelectTool to PinnedToolsMenuUI --- .../Scripts/PinnedToolsMenuUI.cs | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 7b94e0384..3c7a5700e 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, IInstantiateUI + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -30,8 +30,8 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, IInstantiateUI public Node node { get; set; } public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } - public Action selectTool { get; set; } public Transform rayOrigin { get; set; } + public Action mainMenuActivatorSelected { get; set; } public bool allButtonsVisible { @@ -63,7 +63,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) { button.allButtonsVisible = allButtonsVisible; button.maxButtonCount = maxButtonCount; - button.selectTool = SelectTool; + button.selectTool = SetupButtonOrderThenSelectTool; button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount var insertPosition = k_InactiveButtonInitialOrderPosition; @@ -208,8 +208,10 @@ void ShowOnlyMenuAndActiveToolButtons() } } - void SelectTool(IPinnedToolButton pinnedToolButton, bool existingButton = false) + void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) { + bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); + Debug.LogError("Selecting toolf of type : " + pinnedToolButton.toolType); for (int i = 0; i < m_OrderedButtons.Count; ++i) { @@ -220,16 +222,22 @@ void SelectTool(IPinnedToolButton pinnedToolButton, bool existingButton = false) this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(0.5f, false)); - if (!existingButton || IsMainMenuButton(pinnedToolButton)) - selectTool(rayOrigin, pinnedToolButton.toolType); + if (IsMainMenuButton(pinnedToolButton)) + mainMenuActivatorSelected(rayOrigin); + else if (!existingButton) + this.SelectTool(rayOrigin, pinnedToolButton.toolType); } + /// + /// Utilized by PinnedToolsMenu to select an existing button by type, without created a new button + /// + /// Button ToolType to compare against existing button types public void SelectExistingType(Type type) { foreach (var button in m_OrderedButtons) { if (button.toolType == type) - SelectTool(button, true); + SetupButtonOrderThenSelectTool(button); } } @@ -250,7 +258,7 @@ public void SelectHighlightedButton() var isHighlighted = button.highlighted; if (isHighlighted) { - SelectTool(button); + SetupButtonOrderThenSelectTool(button); return; } } From 62fa91f60acbcf5ca7a21f50ea2733c8120a62fa Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 15:41:47 -0700 Subject: [PATCH 251/870] Optimize setup of PinnedToolButton order when selecting an existing (button's) ToolType --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 3c7a5700e..2dfa3b6d0 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -210,18 +210,12 @@ void ShowOnlyMenuAndActiveToolButtons() void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) { - bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); - Debug.LogError("Selecting toolf of type : " + pinnedToolButton.toolType); - for (int i = 0; i < m_OrderedButtons.Count; ++i) - { - var button = m_OrderedButtons[i];; - if (button == pinnedToolButton && button.order > k_ActiveToolOrderPosition) - Reinsert(button, k_ActiveToolOrderPosition); - } + Reinsert(pinnedToolButton, k_ActiveToolOrderPosition); - this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(0.5f, false)); + this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1f, false)); + bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); if (IsMainMenuButton(pinnedToolButton)) mainMenuActivatorSelected(rayOrigin); else if (!existingButton) From 483755151bf24cefbf59b38699ca1641f9110ba1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 17:14:18 -0700 Subject: [PATCH 252/870] Mute logs in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 44d07215f..98651c469 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -83,7 +83,7 @@ public int order m_Order = value; // Position of this button in relation to other pinned tool buttons - Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order + " - current button count : " + visibileButtonCount); + //Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order + " - current button count : " + visibileButtonCount); highlighted = false; //m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive @@ -930,7 +930,7 @@ IEnumerator AnimateShow() //IEnumerator AnimatePosition(int orderPosition, int buttonCount) IEnumerator AnimatePosition(int orderPosition) { - Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition + " - BUTTON COUNT: " + visibileButtonCount); + //Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition + " - BUTTON COUNT: " + visibileButtonCount); primaryButtonCollidersEnabled = false; secondaryButtonCollidersEnabled = false; //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed @@ -1107,7 +1107,7 @@ void CorrectIconRotation() IEnumerator ShowSecondaryButton() { - Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); + //Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; const float kSecondaryButtonVisibleBlendShapeWeight = 46f; @@ -1121,7 +1121,7 @@ IEnumerator ShowSecondaryButton() yield return null; } - Debug.LogError("SHOWING SECONDARY BUTTON"); + //Debug.LogError("SHOWING SECONDARY BUTTON"); this.ShowTooltip(this); amount = 0f; From 2b232361140006fab30052862db82bdbdc2745c5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 18:43:52 -0700 Subject: [PATCH 253/870] Reduce recursion and simplify logic in PinnedToolMenuUI --- .../Scripts/PinnedToolsMenuUI.cs | 41 +++++++++++++++---- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 2dfa3b6d0..18dc0c86c 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -53,6 +53,8 @@ public bool allButtonsVisible } } + private bool aboveMinimumButtonCount { get { return m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1; } } + void Awake() { m_OrderedButtons = new List(); @@ -89,7 +91,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) Debug.LogWarning("Setting up button : " + button.toolType + " - ORDER : " + button.order); - if (m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1) + if (aboveMinimumButtonCount) this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1.25f, false)); else SetupButtonOrder(); // Setup the MainMenu and active tool buttons only @@ -195,7 +197,10 @@ void ShowAllExceptMenuButton() void ShowOnlyMenuAndActiveToolButtons() { - Debug.LogError("Hiding all buttons"); + Debug.LogError("Showing only the MainMenu and ACTIVE tool buttons"); + if (!aboveMinimumButtonCount) // If only the Selection and MainMenu buttons exist, don't proceed + return; + m_VisibleButtonCount = 2; // Show only the menu and active tool button for (int i = 0; i < m_OrderedButtons.Count; ++i) { @@ -210,15 +215,24 @@ void ShowOnlyMenuAndActiveToolButtons() void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) { - Debug.LogError("Selecting toolf of type : " + pinnedToolButton.toolType); + Debug.LogError(" SetupButtonOrderThenSelectTool - Selecting of type : " + pinnedToolButton.toolType); + var mainMenu = IsMainMenuButton(pinnedToolButton); + if (mainMenu) + { + mainMenuActivatorSelected(rayOrigin); + return; + } + else if (!aboveMinimumButtonCount) + { + return; + } + Reinsert(pinnedToolButton, k_ActiveToolOrderPosition); this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1f, false)); bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); - if (IsMainMenuButton(pinnedToolButton)) - mainMenuActivatorSelected(rayOrigin); - else if (!existingButton) + if (!existingButton) this.SelectTool(rayOrigin, pinnedToolButton.toolType); } @@ -231,13 +245,21 @@ public void SelectExistingType(Type type) foreach (var button in m_OrderedButtons) { if (button.toolType == type) + { SetupButtonOrderThenSelectTool(button); + return; + } } } + public void SelectNextExistingToolButton() + { + SetupButtonOrderThenSelectTool(m_OrderedButtons[k_ActiveToolOrderPosition + 1]); + } + public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) { - Debug.LogError("Highlighting SINGLE BUTTON at position : "+ buttonOrderPosition); + //Debug.LogError("Highlighting SINGLE BUTTON at position : "+ buttonOrderPosition); for (int i = 1; i < m_OrderedButtons.Count; ++i) { m_OrderedButtons[i].highlighted = i == buttonOrderPosition; @@ -252,7 +274,10 @@ public void SelectHighlightedButton() var isHighlighted = button.highlighted; if (isHighlighted) { - SetupButtonOrderThenSelectTool(button); + Debug.LogError("Selecting highlighted button : "+ button.toolType); + //SetupButtonOrderThenSelectTool(button); + // Force the selection of the button regardless of it previously existing via a call to EVR that triggers a call to SelectExistingType() + this.SelectTool(rayOrigin, button.toolType); return; } } From ea0e4d8d490c7c3855a23603d65c618d64448705 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 18:46:32 -0700 Subject: [PATCH 254/870] Select the SelectionTool's pinned tool button if current tool is despawned in SelecTool --- Scripts/Core/EditorVR.Tools.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 7a8f06768..2fcb76a1b 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -79,7 +79,6 @@ internal static void SpawnDefaultTools(IProxy proxy) var defaultTools = evr.m_DefaultTools; var directSelection = evr.GetNestedModule(); var pinnedTools = evr.GetNestedModule(); - Debug.LogWarning("get selection tool icon selectionToolData.icon for pinned tool buttons now that selection tool is a DefaultTool"); foreach (var deviceData in evr.m_DeviceData) { @@ -222,13 +221,14 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) var setSelectAsCurrentTool = toolType == typeof(SelectionTool);//deviceData.currentTool is ILocomotor; var pinnedToolsMenu = deviceData.pinnedToolsMenu; - // If this tool was on the current device already, then simply remove it + // If this tool was on the current device already, remove it, if it is selected while already being the current tool var despawn = deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool || toolType == typeof(IMainMenu); var defaultTool = IsDefaultTool(toolType); // TODO initially set spawnTool to this default/permatool value if (deviceData.currentTool != null && despawn) { Debug.LogError("Despawing tool !!!! : toolType == typeof(SelectionTool) : " + (toolType == typeof(SelectionTool)).ToString()); DespawnTool(deviceData, deviceData.currentTool); + pinnedToolsMenu.createPinnedToolButton(toolType, null, deviceData.node); // Don't spawn a new tool, since we are only removing the old tool spawnTool = false; From d44e32a142e1950a4b66694010763224ea2e9fa9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 19:44:49 -0700 Subject: [PATCH 255/870] Add next tool cycling on show button press; add support for hiding when performing a two-handed scale/rotation/move; fix continued consumption duration for PinnedToolsMenu ActionMapInput --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 50 +++++++++++++++++-------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index ad3cf4843..7870a4a36 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -124,7 +124,7 @@ void CreatePinnedToolsUI() public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) { - Debug.LogWarning("SPAWNING pinned tool button for type of : " + toolType); + Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); //var pinnedToolButtons = deviceData.pinnedToolButtons; if (pinnedToolButtons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button { @@ -181,19 +181,20 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) Vector3 spatialScrollStartPosition; Vector3? spatialDirection = null; Vector3 previousWorldPosition; + float? spatialScrollStartTime = null; // use to hide menu if input is consumed externally and no spatialDirection is define within a given duration public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var buttonCount = pinnedToolButtons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount if (buttonCount <= k_ActiveToolOrderPosition + 1) return; + const float kAutoHideDuration = 1f; var pinnedToolInput = (PinnedToolslMenuInput) input; if (continuedInputConsumptionStartTime != null) { - // Continue consumption for period of time after releasing the button + // Continue consumption of the "show" input for period of time after releasing the button consumeControl(pinnedToolInput.show); - consumeControl(pinnedToolInput.select); - if (Time.time > continuedInputConsumptionStartTime.Value) + if (Time.realtimeSinceStartup > continuedInputConsumptionStartTime.Value) continuedInputConsumptionStartTime = null; } @@ -203,37 +204,54 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (pinnedToolInput.select.wasJustPressed) Debug.LogError("SELECT pressed in PinnedToolButton"); + if (spatialScrollStartTime != null && spatialDirection == null && Time.realtimeSinceStartup > spatialScrollStartTime.Value) + { + // Hide if no direction as been defined after a given duration + m_PinnedToolsMenuUI.allButtonsVisible = false; + spatialScrollStartTime = null; + return; + } + if (pinnedToolInput.show.wasJustPressed) { - //Debug.LogError("Processing input in PinnedToolButton"); - //consumeControl(directSelectInput.select); - consumeControl(pinnedToolInput.show); + //consumeControl(pinnedToolInput.show); m_PinnedToolsMenuUI.allButtonsVisible = true; spatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; + spatialScrollStartTime = Time.realtimeSinceStartup + kAutoHideDuration; } else if (pinnedToolInput.show.isHeld && !pinnedToolInput.select.isHeld && !pinnedToolInput.select.wasJustPressed) { if (pinnedToolInput.select.wasJustReleased) { + Debug.LogError("DELETING PinnedToolButton"); //selectHighlightedButton(rayOrigin); //OnActionButtonHoverExit(false); deleteHighlightedButton(rayOrigin); m_PinnedToolsMenuUI.allButtonsVisible = false; - //spatialDirection = null; + spatialScrollStartTime = null; + spatialDirection = null; return; } // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button var normalizedRepeatingPosition = processSpatialScrolling(spatialScrollStartPosition, m_PinnedToolsMenuUI.transform.position, 0.15f, true); - m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); - consumeControl(pinnedToolInput.show); - consumeControl(pinnedToolInput.select); + if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) + { + m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int) (buttonCount * normalizedRepeatingPosition) + 1); + consumeControl(pinnedToolInput.show); + consumeControl(pinnedToolInput.select); + } + } else if (pinnedToolInput.show.wasJustReleased) { - continuedInputConsumptionStartTime = Time.time + 2f; + if (spatialScrollStartTime == null) + return; + const float kAdditionalConsumptionDuration = 0.25f; + continuedInputConsumptionStartTime = Time.realtimeSinceStartup + kAdditionalConsumptionDuration; + spatialScrollStartTime = null; if (spatialDirection != null) { m_PinnedToolsMenuUI.SelectHighlightedButton(); @@ -242,7 +260,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else { - m_PinnedToolsMenuUI.allButtonsVisible = false; + // Allow for single press+release to cycle through tools + m_PinnedToolsMenuUI.SelectNextExistingToolButton(); } } @@ -260,10 +279,9 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, //const float kMinFineTuneVelocity = 0.000001f; if (spatialDirection == null) { - const float newDirectionVectorThreshold = - 0.025f; // Initial magnitude beyond which spatial scrolling will be evaluated + const float kNewDirectionVectorThreshold = 0.0175f; // Initial magnitude beyond which spatial scrolling will be evaluated directionVector = currentPosition - startingPosition; - if (Vector3.Magnitude(directionVector) > newDirectionVectorThreshold) + if (Vector3.Magnitude(directionVector) > kNewDirectionVectorThreshold) spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton } else From f8e63d280a520839aea2c0ad34a9f5ec814748a7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 22:42:56 -0700 Subject: [PATCH 256/870] Prevent PinnedToolsMenu from being shown when pressing button, and not dragging beyond the direction definition threshold --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 7870a4a36..496e215ae 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -215,12 +215,15 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (pinnedToolInput.show.wasJustPressed) { //consumeControl(pinnedToolInput.show); - m_PinnedToolsMenuUI.allButtonsVisible = true; + //m_PinnedToolsMenuUI.allButtonsVisible = true; spatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; spatialScrollStartTime = Time.realtimeSinceStartup + kAutoHideDuration; + + //Dont show if the user hasnt passed the threshold in the given duration } else if (pinnedToolInput.show.isHeld && !pinnedToolInput.select.isHeld && !pinnedToolInput.select.wasJustPressed) { + // Don't scroll if the trigger is held, allowing the user to setting on a single button to select with release if (pinnedToolInput.select.wasJustReleased) { Debug.LogError("DELETING PinnedToolButton"); @@ -238,6 +241,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var normalizedRepeatingPosition = processSpatialScrolling(spatialScrollStartPosition, m_PinnedToolsMenuUI.transform.position, 0.15f, true); if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { + if (!m_PinnedToolsMenuUI.allButtonsVisible) + m_PinnedToolsMenuUI.allButtonsVisible = true; + m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int) (buttonCount * normalizedRepeatingPosition) + 1); consumeControl(pinnedToolInput.show); consumeControl(pinnedToolInput.select); From 6d796f030808ea2f3e26745b01ab9065cb8bb745 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 22:43:49 -0700 Subject: [PATCH 257/870] Add support for quick-toogle selecting previous tool --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 18dc0c86c..26e6bbfb7 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -254,7 +254,9 @@ public void SelectExistingType(Type type) public void SelectNextExistingToolButton() { - SetupButtonOrderThenSelectTool(m_OrderedButtons[k_ActiveToolOrderPosition + 1]); + var button = m_OrderedButtons[k_ActiveToolOrderPosition + 1]; + SetupButtonOrderThenSelectTool(button); + this.SelectTool(rayOrigin, button.toolType); } public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) @@ -275,7 +277,6 @@ public void SelectHighlightedButton() if (isHighlighted) { Debug.LogError("Selecting highlighted button : "+ button.toolType); - //SetupButtonOrderThenSelectTool(button); // Force the selection of the button regardless of it previously existing via a call to EVR that triggers a call to SelectExistingType() this.SelectTool(rayOrigin, button.toolType); return; From baf5eb91d4ed21a6eef538af36a97c6894d189e0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 22:44:38 -0700 Subject: [PATCH 258/870] Change initial naming of members in ISpatialScrolling --- Scripts/Interfaces/ISpatialScrolling.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Interfaces/ISpatialScrolling.cs b/Scripts/Interfaces/ISpatialScrolling.cs index 24e2bc537..3b5cbbd5b 100644 --- a/Scripts/Interfaces/ISpatialScrolling.cs +++ b/Scripts/Interfaces/ISpatialScrolling.cs @@ -34,7 +34,7 @@ public interface ISpatialScrolling : IUsesMenuOrigins Action revealAllToolButtons { set; } */ - Vector3 startingPosition { set; } + Vector3 initialPosition { set; } // Position of the input device when spatial-scrolling is initiated Vector3 currentPosition { set; } // start pos, current pos, world length before repeat, returns normalized repeating projection position From 89eb3caed64a128a4ed9f90608da8ee27e14f67d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 10 May 2017 22:53:38 -0700 Subject: [PATCH 259/870] Limit allowed duration for triggering a recent tool toogle --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 496e215ae..75111539c 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -181,7 +181,8 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) Vector3 spatialScrollStartPosition; Vector3? spatialDirection = null; Vector3 previousWorldPosition; - float? spatialScrollStartTime = null; // use to hide menu if input is consumed externally and no spatialDirection is define within a given duration + float? allowSpatialScrollBeforeThisTime = null; // use to hide menu if input is consumed externally and no spatialDirection is define within a given duration + float allowToolToggleBeforeThisTime; public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var buttonCount = pinnedToolButtons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount @@ -189,6 +190,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; const float kAutoHideDuration = 1f; + const float kAllowToggleDuration = 0.25f; var pinnedToolInput = (PinnedToolslMenuInput) input; if (continuedInputConsumptionStartTime != null) { @@ -204,11 +206,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (pinnedToolInput.select.wasJustPressed) Debug.LogError("SELECT pressed in PinnedToolButton"); - if (spatialScrollStartTime != null && spatialDirection == null && Time.realtimeSinceStartup > spatialScrollStartTime.Value) + if (allowSpatialScrollBeforeThisTime != null && spatialDirection == null && Time.realtimeSinceStartup > allowSpatialScrollBeforeThisTime.Value) { // Hide if no direction as been defined after a given duration m_PinnedToolsMenuUI.allButtonsVisible = false; - spatialScrollStartTime = null; + allowSpatialScrollBeforeThisTime = null; return; } @@ -217,8 +219,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //consumeControl(pinnedToolInput.show); //m_PinnedToolsMenuUI.allButtonsVisible = true; spatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; - spatialScrollStartTime = Time.realtimeSinceStartup + kAutoHideDuration; - + allowSpatialScrollBeforeThisTime = Time.realtimeSinceStartup + kAutoHideDuration; + allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; //Dont show if the user hasnt passed the threshold in the given duration } else if (pinnedToolInput.show.isHeld && !pinnedToolInput.select.isHeld && !pinnedToolInput.select.wasJustPressed) @@ -231,7 +233,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //OnActionButtonHoverExit(false); deleteHighlightedButton(rayOrigin); m_PinnedToolsMenuUI.allButtonsVisible = false; - spatialScrollStartTime = null; + allowSpatialScrollBeforeThisTime = null; spatialDirection = null; return; } @@ -252,19 +254,19 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else if (pinnedToolInput.show.wasJustReleased) { - if (spatialScrollStartTime == null) + if (allowSpatialScrollBeforeThisTime == null) return; const float kAdditionalConsumptionDuration = 0.25f; continuedInputConsumptionStartTime = Time.realtimeSinceStartup + kAdditionalConsumptionDuration; - spatialScrollStartTime = null; + allowSpatialScrollBeforeThisTime = null; if (spatialDirection != null) { m_PinnedToolsMenuUI.SelectHighlightedButton(); spatialDirection = null; consumeControl(pinnedToolInput.select); } - else + else if (Time.realtimeSinceStartup < allowToolToggleBeforeThisTime) { // Allow for single press+release to cycle through tools m_PinnedToolsMenuUI.SelectNextExistingToolButton(); From cfbd57b343729088386b3f7096ba0348b21581a0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 12:04:42 -0700 Subject: [PATCH 260/870] Add support for moving (& scaling) the PinnedToolsMenu to alternate location; disable continued input consumption temporarily --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 4 +++- .../Scripts/PinnedToolsMenuUI.cs | 23 +++++++++++++++++++ Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 75111539c..787954ace 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -41,7 +41,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Dictionary icons { get; set; } public int activeToolOrderPosition { get; private set; } public bool revealed { get; set; } - public bool moveToAlternatePosition { get; set; } + public bool moveToAlternatePosition { set { m_PinnedToolsMenuUI.moveToAlternatePosition = value; } } public Type previewToolType { get; set; } public Vector3 alternateMenuItem { get; private set; } public Node node { set { m_PinnedToolsMenuUI.node = value; } } @@ -192,6 +192,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon const float kAutoHideDuration = 1f; const float kAllowToggleDuration = 0.25f; var pinnedToolInput = (PinnedToolslMenuInput) input; + /* if (continuedInputConsumptionStartTime != null) { // Continue consumption of the "show" input for period of time after releasing the button @@ -199,6 +200,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (Time.realtimeSinceStartup > continuedInputConsumptionStartTime.Value) continuedInputConsumptionStartTime = null; } + */ if (pinnedToolInput.show.wasJustPressed) Debug.LogError("SHOW pressed in PinnedToolButton"); diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 26e6bbfb7..4aa9b0303 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -21,10 +21,19 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool [SerializeField] Transform m_ButtonContainer; + [Header("Used when displaying Alternate Menu")] + [SerializeField] + Vector3 m_AlternatePosition; + + [SerializeField] + Vector3 m_AlternateLocalScale; + bool m_AllButtonsVisible; List m_OrderedButtons; Coroutine m_ShowHideAllButtonsCoroutine; int m_VisibleButtonCount; + bool m_MoveToAlternatePosition; + Vector3 m_OriginalLocalScale; public Dictionary pinnedToolButtons { get; set; } public Node node { get; set; } @@ -53,10 +62,24 @@ public bool allButtonsVisible } } + public bool moveToAlternatePosition + { + set + { + if (m_MoveToAlternatePosition == value) + return; + + m_MoveToAlternatePosition = value; + transform.localScale = m_MoveToAlternatePosition ? m_AlternateLocalScale : m_OriginalLocalScale; + transform.localPosition = m_MoveToAlternatePosition ? m_AlternatePosition : Vector3.zero; + } + } + private bool aboveMinimumButtonCount { get { return m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1; } } void Awake() { + m_OriginalLocalScale = transform.localScale; m_OrderedButtons = new List(); Debug.LogError("PinnedToolsMenuUI initialized"); } diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 5bf72f9a5..dd447a02a 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -16,7 +16,7 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap int activeToolOrderPosition { get; } //int activeButtonCount { set; } bool revealed { set; } - bool moveToAlternatePosition { get; set; } + bool moveToAlternatePosition { set; } Transform rayOrigin { get; set; } Type previewToolType { set; } Vector3 alternateMenuItem { get; } // Shared active button offset from the alternate menu From 926785b2947406d5ba08b8f3550bb7a0673deb4b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 12:05:45 -0700 Subject: [PATCH 261/870] Process PinnedToolsMenu input after device tools --- Scripts/Core/EditorVR.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index e8d67d769..628f92343 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -328,11 +328,6 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate if (!deviceData.proxy.active) continue; - var pinnedToolsMenu = deviceData.pinnedToolsMenu; - var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; - if (pinnedToolsMenuInput != null) - pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); - var mainMenu = deviceData.mainMenu; var menuInput = mainMenu as IProcessInput; if (menuInput != null && mainMenu.visible) @@ -357,6 +352,11 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate && processedInputs.Add(process)) // Only process inputs for an instance of a tool once (e.g. two-handed tools) process.ProcessInput(toolData.input, consumeControl); } + + var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; + if (pinnedToolsMenuInput != null) + pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); } } From 8dd12b0284316b70a25ebc4a400d1000e60f0581 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 12:36:25 -0700 Subject: [PATCH 262/870] Add animated movement of PinnedToolsMenu when showing/hiding the alternate (Radial) menu --- .../Scripts/PinnedToolsMenuUI.cs | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 4aa9b0303..befb8d469 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -31,6 +31,7 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool bool m_AllButtonsVisible; List m_OrderedButtons; Coroutine m_ShowHideAllButtonsCoroutine; + Coroutine m_MoveCoroutine; int m_VisibleButtonCount; bool m_MoveToAlternatePosition; Vector3 m_OriginalLocalScale; @@ -70,8 +71,9 @@ public bool moveToAlternatePosition return; m_MoveToAlternatePosition = value; - transform.localScale = m_MoveToAlternatePosition ? m_AlternateLocalScale : m_OriginalLocalScale; - transform.localPosition = m_MoveToAlternatePosition ? m_AlternatePosition : Vector3.zero; + var newPosition = m_MoveToAlternatePosition ? m_AlternatePosition : Vector3.zero; + var newScale = m_MoveToAlternatePosition ? m_AlternateLocalScale : m_OriginalLocalScale; + this.RestartCoroutine(ref m_MoveCoroutine, MoveToLocation(newPosition, newScale)); } } @@ -321,6 +323,25 @@ int VisibleButtonCount() { return m_VisibleButtonCount; } + + IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) + { + var currentPosition = transform.localPosition; + var currentScale = transform.localScale; + var duration = 0f; + while (duration < 1) + { + duration += Time.unscaledDeltaTime * 6f; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); + transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); + yield return null; + } + + transform.localScale = targetScale; + transform.localPosition = targetPosition; + m_MoveCoroutine = null; + } } } #endif From ef2d3ca234f691ea966d5b938618461bde3d25fb Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 16:56:21 -0700 Subject: [PATCH 263/870] Implement button delete functionality compatible with spatial-scrolling --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 6 +++-- .../Scripts/PinnedToolsMenuUI.cs | 26 +++++++++++++++++-- Scripts/UI/Interfaces/IPinnedToolButton.cs | 3 +++ Scripts/UI/PinnedToolButton.cs | 26 ++++++++++++++++--- 4 files changed, 54 insertions(+), 7 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 787954ace..03a8f68da 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -233,8 +233,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon Debug.LogError("DELETING PinnedToolButton"); //selectHighlightedButton(rayOrigin); //OnActionButtonHoverExit(false); - deleteHighlightedButton(rayOrigin); - m_PinnedToolsMenuUI.allButtonsVisible = false; + + + //KEEP deleteHighlightedButton(rayOrigin); // convert to method in IPinnedToolsMenu interface + m_PinnedToolsMenuUI.DeleteHighlightedButton(); allowSpatialScrollBeforeThisTime = null; spatialDirection = null; return; diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index befb8d469..1ae009cb0 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -93,20 +93,22 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) button.selectTool = SetupButtonOrderThenSelectTool; button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount + bool allowSecondaryButton = false; // Secondary button is the close button var insertPosition = k_InactiveButtonInitialOrderPosition; if (IsMainMenuButton(button)) { insertPosition = k_MenuButtonOrderPosition; - //m_VisibleButtonCount = 2; // Show only the MainMenu and select buttons initiall } else { insertPosition = k_ActiveToolOrderPosition; + allowSecondaryButton = !IsSelectionToolButton(button); } m_OrderedButtons.Insert(insertPosition, button); m_VisibleButtonCount = m_OrderedButtons.Count; + button.implementsSecondaryButton = allowSecondaryButton; button.activeTool = true; button.order = insertPosition; @@ -309,12 +311,32 @@ public void SelectHighlightedButton() } } + public void DeleteHighlightedButton() + { + IPinnedToolButton button = null; + for (int i = 0; i < m_OrderedButtons.Count; ++i) + { + button = m_OrderedButtons[i]; + var isHighlighted = button.highlighted; + if (isHighlighted) + { + Debug.LogError("DeleteHighlightedButton : "+ button.toolType); + break; + } + } + + m_OrderedButtons.Remove(button); + button.destroy(); + button = m_OrderedButtons[k_ActiveToolOrderPosition]; + this.SelectTool(rayOrigin, button.toolType); + } + bool IsMainMenuButton(IPinnedToolButton button) { return button.toolType == typeof(IMainMenu); } - bool IsSelectionButton(IPinnedToolButton button) + bool IsSelectionToolButton(IPinnedToolButton button) { return button.toolType == typeof(SelectionTool); } diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index f5b17db7d..f754038b5 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -20,6 +20,9 @@ public interface IPinnedToolButton bool activeTool { get; set; } Action selectTool { get; set; } bool toolTipVisible { set; } + Action destroy { get; } + bool implementsSecondaryButton { get; set; } + /* int menuButtonOrderPosition { get; } int activeToolOrderPosition { get; } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 98651c469..fe1fc8fbd 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -320,6 +320,8 @@ public Transform alternateMenuOrigin public Action selectHighlightedButton { get; set; } public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu public Func visibileButtonCount { get; set; } + public bool implementsSecondaryButton { get; set; } + public Action destroy { get { return DestroyButton; } } public event Action hoverEnter; public event Action hoverExit; @@ -372,7 +374,7 @@ public bool highlighted if (!m_Highlighted) this.HideTooltip(this); - if (!isMainMenu || !isSelectionTool) + if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) { if (m_Highlighted) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); @@ -590,6 +592,18 @@ void OnDestroy() ObjectUtils.Destroy(m_InsetMaterial); ObjectUtils.Destroy(m_IconMaterial); ObjectUtils.Destroy(m_FrameMaterial); + + this.StopCoroutine(ref m_PositionCoroutine); + this.StopCoroutine(ref m_VisibilityCoroutine); + this.StopCoroutine(ref m_HighlightCoroutine); + this.StopCoroutine(ref m_ActivatorMoveCoroutine); + this.StopCoroutine(ref m_HoverCheckCoroutine); + this.StopCoroutine(ref m_SecondaryButtonVisibilityCoroutine); + } + + void DestroyButton() + { + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); } // Create periodic table-style names for types @@ -626,7 +640,7 @@ void OnBackgroundHoverEnter () m_GradientButton.highlighted = true; return; } - else if (!isSelectionTool) + else if (implementsSecondaryButton) { this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } @@ -801,6 +815,12 @@ IEnumerator AnimateInitialReveal(Vector3 targetPosition, Vector3 targetScale) IEnumerator AnimateHideAndDestroy() { + this.StopCoroutine(ref m_PositionCoroutine); + this.StopCoroutine(ref m_HighlightCoroutine); + this.StopCoroutine(ref m_ActivatorMoveCoroutine); + this.StopCoroutine(ref m_HoverCheckCoroutine); + this.StopCoroutine(ref m_SecondaryButtonVisibilityCoroutine); + this.HideTooltip(this); var duration = 0f; var currentScale = transform.localScale; @@ -978,7 +998,7 @@ IEnumerator AnimatePosition(int orderPosition) secondaryButtonCollidersEnabled = orderPosition > -1 ? true : false; m_PositionCoroutine = null; - if (orderPosition > -1 && m_GradientButton.highlighted) + if (implementsSecondaryButton && orderPosition > -1 && m_GradientButton.highlighted) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } From a475b95d32888acd50b4292e66695e0c0633765f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 17:34:43 -0700 Subject: [PATCH 264/870] Add sequential button-delete support to PinnedToolsMenu, when deleting button via spatial-scrolling --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 21 +++++++++++++---- .../Scripts/PinnedToolsMenuUI.cs | 23 ++++++++++++------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 03a8f68da..613cf9ea0 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -236,10 +236,23 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //KEEP deleteHighlightedButton(rayOrigin); // convert to method in IPinnedToolsMenu interface - m_PinnedToolsMenuUI.DeleteHighlightedButton(); - allowSpatialScrollBeforeThisTime = null; - spatialDirection = null; - return; + var deletedType = m_PinnedToolsMenuUI.DeleteHighlightedButton(); + if (deletedType != null) + { + buttonCount = pinnedToolButtons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + //if (buttonCount <= k_ActiveToolOrderPosition + 1) + //return; + + //allowSpatialScrollBeforeThisTime = null; + //spatialDirection = null; + } + + if (buttonCount <= k_ActiveToolOrderPosition + 1) + { + allowSpatialScrollBeforeThisTime = null; + spatialDirection = null; + return; + } } // normalized input should loop after reaching the 0.15f length diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 1ae009cb0..f1ff74ed5 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -281,7 +281,7 @@ public void SelectExistingType(Type type) public void SelectNextExistingToolButton() { - var button = m_OrderedButtons[k_ActiveToolOrderPosition + 1]; + var button = m_OrderedButtons[aboveMinimumButtonCount ? k_ActiveToolOrderPosition + 1 : k_ActiveToolOrderPosition]; SetupButtonOrderThenSelectTool(button); this.SelectTool(rayOrigin, button.toolType); } @@ -311,24 +311,31 @@ public void SelectHighlightedButton() } } - public void DeleteHighlightedButton() + public Type DeleteHighlightedButton() { IPinnedToolButton button = null; for (int i = 0; i < m_OrderedButtons.Count; ++i) { button = m_OrderedButtons[i]; var isHighlighted = button.highlighted; - if (isHighlighted) + if (isHighlighted && !IsSelectionToolButton(button)) { - Debug.LogError("DeleteHighlightedButton : "+ button.toolType); + Debug.LogError("DeleteHighlightedButton : " + button.toolType); break; } + + button = null; } - m_OrderedButtons.Remove(button); - button.destroy(); - button = m_OrderedButtons[k_ActiveToolOrderPosition]; - this.SelectTool(rayOrigin, button.toolType); + if (button != null) + { + m_OrderedButtons.Remove(button); + button.destroy(); + button = m_OrderedButtons[k_ActiveToolOrderPosition]; + this.SelectTool(rayOrigin, button.toolType); + } + + return button != null ? button.toolType : null; } bool IsMainMenuButton(IPinnedToolButton button) From 738a8d9936894d72a07f8c41588a7c3db93ffc01 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 17:48:12 -0700 Subject: [PATCH 265/870] Reduce redandant button collection logic in PinnedToolsMenu; utilize the pinnedToolButtons dictionary in PinnedToolsMenuUI --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 9 ++++----- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 6 ++++-- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 613cf9ea0..a44dad445 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -37,7 +37,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac Transform m_RayOrigin; public Transform menuOrigin { get; set; } - public Dictionary pinnedToolButtons { get; set; } + public Dictionary pinnedToolButtons { get { return m_PinnedToolsMenuUI.pinnedToolButtons; } } public Dictionary icons { get; set; } public int activeToolOrderPosition { get; private set; } public bool revealed { get; set; } @@ -100,7 +100,6 @@ public Transform alternateMenuOrigin void Awake() { - pinnedToolButtons = new Dictionary(); createPinnedToolButton = CreatePinnedToolButton; } @@ -132,7 +131,8 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) Debug.LogWarning("New pinned tool button cannot be added. The maximum number of pinned tool buttons are currently being displayed"); return; } - else if (pinnedToolButtons.ContainsKey(toolType)) + + if (pinnedToolButtons.ContainsKey(toolType)) { m_PinnedToolsMenuUI.SelectExistingType(toolType); return; @@ -236,8 +236,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //KEEP deleteHighlightedButton(rayOrigin); // convert to method in IPinnedToolsMenu interface - var deletedType = m_PinnedToolsMenuUI.DeleteHighlightedButton(); - if (deletedType != null) + if (m_PinnedToolsMenuUI.DeleteHighlightedButton()) { buttonCount = pinnedToolButtons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount //if (buttonCount <= k_ActiveToolOrderPosition + 1) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index f1ff74ed5..757d20edf 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -81,6 +81,7 @@ public bool moveToAlternatePosition void Awake() { + pinnedToolButtons = new Dictionary(); m_OriginalLocalScale = transform.localScale; m_OrderedButtons = new List(); Debug.LogError("PinnedToolsMenuUI initialized"); @@ -311,7 +312,7 @@ public void SelectHighlightedButton() } } - public Type DeleteHighlightedButton() + public bool DeleteHighlightedButton() { IPinnedToolButton button = null; for (int i = 0; i < m_OrderedButtons.Count; ++i) @@ -330,12 +331,13 @@ public Type DeleteHighlightedButton() if (button != null) { m_OrderedButtons.Remove(button); + pinnedToolButtons.Remove(button.toolType); button.destroy(); button = m_OrderedButtons[k_ActiveToolOrderPosition]; this.SelectTool(rayOrigin, button.toolType); } - return button != null ? button.toolType : null; + return button != null; } bool IsMainMenuButton(IPinnedToolButton button) diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index dd447a02a..4a650c950 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR /// public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap { - Dictionary pinnedToolButtons { set; } + Dictionary pinnedToolButtons { get; } Dictionary icons { set; } int activeToolOrderPosition { get; } //int activeButtonCount { set; } From 108326d71cb5fd6c89fc9ddb392d7071bd3dfd3a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 18:46:26 -0700 Subject: [PATCH 266/870] Remove last remaining redundant PinnedTool buttons collection; only one collection, residing in PinnedToolsMenuUI, is used for all button collection operations --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 19 +++++++++---------- .../Scripts/PinnedToolsMenuUI.cs | 4 +--- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 1 - 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index a44dad445..f9c1282ff 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Text; using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Extensions; @@ -37,7 +38,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac Transform m_RayOrigin; public Transform menuOrigin { get; set; } - public Dictionary pinnedToolButtons { get { return m_PinnedToolsMenuUI.pinnedToolButtons; } } + List buttons { get { return m_PinnedToolsMenuUI.buttons; } } public Dictionary icons { get; set; } public int activeToolOrderPosition { get; private set; } public bool revealed { get; set; } @@ -124,22 +125,22 @@ void CreatePinnedToolsUI() public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) { Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); - //var pinnedToolButtons = deviceData.pinnedToolButtons; - if (pinnedToolButtons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button + //var buttons = deviceData.buttons; + if (buttons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button { // TODO: kick out the oldest tool, and allow the new tool to become the active tool Debug.LogWarning("New pinned tool button cannot be added. The maximum number of pinned tool buttons are currently being displayed"); return; } - if (pinnedToolButtons.ContainsKey(toolType)) + if (buttons.Any( (x) => x.toolType == toolType)) { m_PinnedToolsMenuUI.SelectExistingType(toolType); return; } // Before adding new button, offset each button to a position greater than the zeroth/active tool position - //foreach (var pair in pinnedToolButtons) + //foreach (var pair in buttons) //{ // if (pair.Value.order != pair.Value.menuButtonOrderPosition) // don't move the main menu button // pair.Value.order++; @@ -150,7 +151,6 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) var buttonTransform = ObjectUtils.Instantiate(m_PinnedToolButtonTemplate.gameObject, m_PinnedToolsMenuUI.buttonContainer, false).transform; var button = buttonTransform.GetComponent(); this.ConnectInterfaces(button); - pinnedToolButtons.Add(toolType, button); // Initialize button in alternate position if the alternate menu is hidden /* @@ -158,7 +158,7 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) if (toolType == typeof(IMainMenu)) mainMenu = button; else - pinnedToolButtons.TryGetValue(typeof(IMainMenu), out mainMenu); + buttons.TryGetValue(typeof(IMainMenu), out mainMenu); */ //button.moveToAlternatePosition = mainMenu != null && mainMenu.moveToAlternatePosition; @@ -185,7 +185,7 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) float allowToolToggleBeforeThisTime; public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var buttonCount = pinnedToolButtons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + var buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount if (buttonCount <= k_ActiveToolOrderPosition + 1) return; @@ -234,11 +234,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //selectHighlightedButton(rayOrigin); //OnActionButtonHoverExit(false); - //KEEP deleteHighlightedButton(rayOrigin); // convert to method in IPinnedToolsMenu interface if (m_PinnedToolsMenuUI.DeleteHighlightedButton()) { - buttonCount = pinnedToolButtons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount //if (buttonCount <= k_ActiveToolOrderPosition + 1) //return; diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 757d20edf..ad3991092 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -36,12 +36,12 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool bool m_MoveToAlternatePosition; Vector3 m_OriginalLocalScale; - public Dictionary pinnedToolButtons { get; set; } public Node node { get; set; } public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } public Transform rayOrigin { get; set; } public Action mainMenuActivatorSelected { get; set; } + public List buttons { get { return m_OrderedButtons; } } public bool allButtonsVisible { @@ -81,7 +81,6 @@ public bool moveToAlternatePosition void Awake() { - pinnedToolButtons = new Dictionary(); m_OriginalLocalScale = transform.localScale; m_OrderedButtons = new List(); Debug.LogError("PinnedToolsMenuUI initialized"); @@ -331,7 +330,6 @@ public bool DeleteHighlightedButton() if (button != null) { m_OrderedButtons.Remove(button); - pinnedToolButtons.Remove(button.toolType); button.destroy(); button = m_OrderedButtons[k_ActiveToolOrderPosition]; this.SelectTool(rayOrigin, button.toolType); diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 4a650c950..55ac01611 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -11,7 +11,6 @@ namespace UnityEditor.Experimental.EditorVR /// public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap { - Dictionary pinnedToolButtons { get; } Dictionary icons { set; } int activeToolOrderPosition { get; } //int activeButtonCount { set; } From a23d0fcc98caf2d455847f4bbf24fe44b0c1185f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 19:48:20 -0700 Subject: [PATCH 267/870] Add support for selecting the SelectionTool button, and displaying the MainMenu button, after closing all other tool buttons via spatial-scrolling --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index ad3991092..1f710c6d6 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -244,6 +244,7 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) { Debug.LogError(" SetupButtonOrderThenSelectTool - Selecting of type : " + pinnedToolButton.toolType); var mainMenu = IsMainMenuButton(pinnedToolButton); + var showMenuButton = false; if (mainMenu) { mainMenuActivatorSelected(rayOrigin); @@ -251,12 +252,12 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) } else if (!aboveMinimumButtonCount) { - return; + showMenuButton = true; } Reinsert(pinnedToolButton, k_ActiveToolOrderPosition); - this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1f, false)); + this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1f, showMenuButton)); bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); if (!existingButton) From 8b2bb33feebbcf4fdee3303120582f2ecf2bb6d6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 21:38:07 -0700 Subject: [PATCH 268/870] Set PinnedToolButton prefab scale to uniform value of 1f --- Prefabs/UI/PinnedToolButton.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Prefabs/UI/PinnedToolButton.prefab index ca3376b19..44140fae3 100644 --- a/Prefabs/UI/PinnedToolButton.prefab +++ b/Prefabs/UI/PinnedToolButton.prefab @@ -720,7 +720,7 @@ Transform: m_GameObject: {fileID: 1000010204453368} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0.025} - m_LocalScale: {x: 0.465, y: 0.615, z: 0.465} + m_LocalScale: {x: 1, y: 1, z: 1} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000012648346800} From 1901838211ba9a14e87465f12fa29feb19e04492 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 21:39:00 -0700 Subject: [PATCH 269/870] Remove underlying member check in allButtonsVisible property; caller/setter has responsibility to check if necessary --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 1f710c6d6..4b35fea5c 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -48,9 +48,6 @@ public bool allButtonsVisible get { return m_AllButtonsVisible; } set { - //if (m_AllButtonsVisible == value) - //return; - m_AllButtonsVisible = value; if (m_AllButtonsVisible) @@ -59,7 +56,9 @@ public bool allButtonsVisible ShowAllExceptMenuButton(); } else + { ShowOnlyMenuAndActiveToolButtons(); + } } } From 32fa34dd48b7a3c1190541abeefa2e5d7e58933d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 21:40:45 -0700 Subject: [PATCH 270/870] Set new alternate position/scale values, and localscale, in PinnedToolsMenu prefab --- Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 4230f5d3a..d3b4f3f1f 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -51,7 +51,7 @@ Transform: m_GameObject: {fileID: 1000014083153210} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000012301197336} @@ -83,6 +83,8 @@ MonoBehaviour: m_EditorClassIdentifier: m_RunInEditMode: 0 m_ButtonContainer: {fileID: 4000012301197336} + m_AlternatePosition: {x: 0, y: 0, z: -0.0136} + m_AlternateLocalScale: {x: 0.54, y: 0.54, z: 0.54} --- !u!114 &114000011597863712 MonoBehaviour: m_ObjectHideFlags: 1 From f99a344ce2b56c17e76da57ca4e2c7575ab6dc32 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 11 May 2017 23:33:44 -0700 Subject: [PATCH 271/870] Add showing of PinnedToolsMenu via opposite-hand hover on active-tool-button --- .../PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 17 ++++++++++++++++- Scripts/UI/Interfaces/IPinnedToolButton.cs | 3 ++- Scripts/UI/PinnedToolButton.cs | 7 ++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 4b35fea5c..b56a8564b 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -87,7 +87,8 @@ void Awake() public void AddButton(IPinnedToolButton button, Transform buttonTransform) { - button.allButtonsVisible = allButtonsVisible; + button.showAllButtons = ShowAllButtons; + button.hideAllButtons = HideAllButtons; button.maxButtonCount = maxButtonCount; button.selectTool = SetupButtonOrderThenSelectTool; button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount @@ -371,6 +372,20 @@ IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) transform.localPosition = targetPosition; m_MoveCoroutine = null; } + + void ShowAllButtons(IPinnedToolButton button) + { + Debug.LogError("ShowAllButtons : " + button.toolType); + if (!allButtonsVisible && aboveMinimumButtonCount && !IsMainMenuButton(button)) + allButtonsVisible = true; + } + + void HideAllButtons(IPinnedToolButton button) + { + Debug.LogError("HideAllButtons : " + button.toolType); + if (allButtonsVisible && !IsMainMenuButton(button)) + allButtonsVisible = false; + } } } #endif diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index f754038b5..832fba18c 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -14,7 +14,6 @@ public interface IPinnedToolButton int order { get; set; } Type toolType { get; set; } bool highlighted { get; set; } - bool allButtonsVisible { get; set; } int maxButtonCount { get; set; } Func visibileButtonCount { get; set; } bool activeTool { get; set; } @@ -22,6 +21,8 @@ public interface IPinnedToolButton bool toolTipVisible { set; } Action destroy { get; } bool implementsSecondaryButton { get; set; } + Action showAllButtons { get; set; } + Action hideAllButtons { get; set; } /* int menuButtonOrderPosition { get; } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index fe1fc8fbd..a5509d204 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -312,7 +312,6 @@ public Transform alternateMenuOrigin //public Action revealAllToolButtons { get; set; } //public Action revealAllToolButtons { get; set; } //public Action hideAllToolButtons { get; set; } - public bool allButtonsVisible { get; set; } public Action OpenMenu { get; set; } public Action selectTool { get; set; } public Action highlightSingleButton { get; set; } @@ -322,6 +321,8 @@ public Transform alternateMenuOrigin public Func visibileButtonCount { get; set; } public bool implementsSecondaryButton { get; set; } public Action destroy { get { return DestroyButton; } } + public Action showAllButtons { get; set; } + public Action hideAllButtons { get; set; } public event Action hoverEnter; public event Action hoverExit; @@ -655,7 +656,7 @@ void OnBackgroundHoverEnter () //Debug.LogWarning("Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); //revealAllToolButtons(rayOrigin, true); - allButtonsVisible = true; + showAllButtons(this); //HoverButton(); //m_ButtonCollider.enabled = false; //} @@ -1107,7 +1108,7 @@ IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) // Only proceed if no other button is being hovered m_GradientButton.highlighted = false; - allButtonsVisible = false; + hideAllButtons(this); m_GradientButton.UpdateMaterialColors(); m_HoverCheckCoroutine = null; } From c28eade36145555afba31679518c8807530fe438 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 12 May 2017 00:50:26 -0700 Subject: [PATCH 272/870] Comment out HoverEnter & HoverExit functions in EditorVR.PinnedToolButtons; functionality is now handled inside of PinnedToolsMenuUI --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 0668729b4..aa29bd967 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -298,6 +298,7 @@ internal void SelectHighlightedButton (Transform rayOrigin) */ } + /* internal void OnButtonHoverEnter(Transform rayOrigin) { var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); @@ -323,6 +324,7 @@ internal void OnButtonHoverExit(Transform rayOrigin) } } } + */ internal void OnMainMenuActivatorSelected(Transform rayOrigin) { From 40f4a5e6bba1ac16db233eb6c545e186a779dda4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 12 May 2017 00:52:11 -0700 Subject: [PATCH 273/870] Add time-based HoverEnter/HoverExit functionality to PinnedToolButton in the menu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 5 +-- .../Scripts/PinnedToolsMenuUI.cs | 37 ++++++++++++++++--- Scripts/Core/EditorVR.Tools.cs | 4 +- Scripts/UI/Interfaces/IPinnedToolButton.cs | 6 ++- Scripts/UI/PinnedToolButton.cs | 23 ++++++++---- 5 files changed, 55 insertions(+), 20 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index f9c1282ff..7096038b3 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -166,12 +166,11 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) button.rayOrigin = rayOrigin; button.toolType = toolType; // Assign Tool Type before assigning order button.icon = buttonIcon; - button.deleteHighlightedButton = deleteHighlightedButton; button.highlightSingleButton = HighlightSingleButton; button.selectHighlightedButton = SelectHighlightedButton; //button.selected += OnMainMenuActivatorSelected; - button.hoverEnter += onButtonHoverExit; - button.hoverExit += onButtonHoverExit; + //button.hoverEnter += onButtonHoverExit; + //button.hoverExit += onButtonHoverExit; button.rayOrigin = rayOrigin; m_PinnedToolsMenuUI.AddButton(button, buttonTransform); diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index b56a8564b..5a13f98a3 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -32,9 +32,11 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool List m_OrderedButtons; Coroutine m_ShowHideAllButtonsCoroutine; Coroutine m_MoveCoroutine; + Coroutine m_ButtonHoverExitDelayCoroutine; int m_VisibleButtonCount; bool m_MoveToAlternatePosition; Vector3 m_OriginalLocalScale; + bool m_RayHovered; public Node node { get; set; } public int maxButtonCount { get; set; } @@ -88,9 +90,10 @@ void Awake() public void AddButton(IPinnedToolButton button, Transform buttonTransform) { button.showAllButtons = ShowAllButtons; - button.hideAllButtons = HideAllButtons; + button.hoverExit = ButtonHoverExitPerformed; button.maxButtonCount = maxButtonCount; - button.selectTool = SetupButtonOrderThenSelectTool; + button.selectTool = SelectExistingType; + button.closeButton = DeleteHighlightedButton; button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount bool allowSecondaryButton = false; // Secondary button is the close button @@ -318,8 +321,7 @@ public bool DeleteHighlightedButton() for (int i = 0; i < m_OrderedButtons.Count; ++i) { button = m_OrderedButtons[i]; - var isHighlighted = button.highlighted; - if (isHighlighted && !IsSelectionToolButton(button)) + if ((button.highlighted || button.secondaryButtonHighlighted) && !IsSelectionToolButton(button)) { Debug.LogError("DeleteHighlightedButton : " + button.toolType); break; @@ -376,7 +378,8 @@ IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) void ShowAllButtons(IPinnedToolButton button) { Debug.LogError("ShowAllButtons : " + button.toolType); - if (!allButtonsVisible && aboveMinimumButtonCount && !IsMainMenuButton(button)) + m_RayHovered = true; + if (!allButtonsVisible && aboveMinimumButtonCount && !IsMainMenuButton(button) && m_ButtonHoverExitDelayCoroutine == null) allButtonsVisible = true; } @@ -386,6 +389,30 @@ void HideAllButtons(IPinnedToolButton button) if (allButtonsVisible && !IsMainMenuButton(button)) allButtonsVisible = false; } + + void ButtonHoverExitPerformed() + { + this.RestartCoroutine(ref m_ButtonHoverExitDelayCoroutine, DelayedHoverExitCheck()); + } + + IEnumerator DelayedHoverExitCheck() + { + m_RayHovered = false; + + var duration = Time.unscaledDeltaTime; + while (duration < 0.25f) + { + duration += Time.unscaledDeltaTime; + yield return null; + + if (m_RayHovered) + yield break; + } + + // Only proceed if no other button is being hovered + allButtonsVisible = false; + m_ButtonHoverExitDelayCoroutine = null; + } } } #endif diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 2fcb76a1b..61303d696 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -132,8 +132,8 @@ internal static void SpawnDefaultTools(IProxy proxy) var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); deviceData.pinnedToolsMenu = pinnedToolsMenu; pinnedToolsMenu.selectTool = pinnedTools.ToolButtonClicked; - pinnedToolsMenu.onButtonHoverEnter = pinnedTools.OnButtonHoverEnter; - pinnedToolsMenu.onButtonHoverExit = pinnedTools.OnButtonHoverExit; + //pinnedToolsMenu.onButtonHoverEnter = pinnedTools.OnButtonHoverEnter; + //pinnedToolsMenu.onButtonHoverExit = pinnedTools.OnButtonHoverExit; pinnedToolsMenu.highlightDevice = pinnedTools.HighlightDevice; pinnedToolsMenu.mainMenuActivatorSelected = pinnedTools.OnMainMenuActivatorSelected; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 832fba18c..f55abb6c9 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -14,15 +14,17 @@ public interface IPinnedToolButton int order { get; set; } Type toolType { get; set; } bool highlighted { get; set; } + bool secondaryButtonHighlighted { get; } int maxButtonCount { get; set; } Func visibileButtonCount { get; set; } bool activeTool { get; set; } - Action selectTool { get; set; } + Action selectTool { get; set; } + Func closeButton { get; set; } bool toolTipVisible { set; } Action destroy { get; } bool implementsSecondaryButton { get; set; } Action showAllButtons { get; set; } - Action hideAllButtons { get; set; } + Action hoverExit { get; set; } /* int menuButtonOrderPosition { get; } diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index a5509d204..958e86dc9 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -33,6 +33,7 @@ public Type toolType { return m_ToolType; } + set { m_ToolType = value; @@ -313,19 +314,20 @@ public Transform alternateMenuOrigin //public Action revealAllToolButtons { get; set; } //public Action hideAllToolButtons { get; set; } public Action OpenMenu { get; set; } - public Action selectTool { get; set; } + public Action selectTool { get; set; } + public Func closeButton { get; set; } public Action highlightSingleButton { get; set; } - public Action deleteHighlightedButton { get; set; } + //public Action deleteHighlightedButton { get; set; } public Action selectHighlightedButton { get; set; } public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu public Func visibileButtonCount { get; set; } public bool implementsSecondaryButton { get; set; } public Action destroy { get { return DestroyButton; } } public Action showAllButtons { get; set; } - public Action hideAllButtons { get; set; } + public Action hoverExit { get; set; } - public event Action hoverEnter; - public event Action hoverExit; + //public event Action hoverEnter; + //public event Action hoverExit; public event Action selected; public bool activeTool @@ -385,6 +387,8 @@ public bool highlighted } } + public bool secondaryButtonHighlighted { get { return m_SecondaryGradientButton.highlighted; } } + public bool toolTipVisible { set @@ -715,6 +719,8 @@ void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) if (!m_SecondaryGradientButton.highlighted) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + hoverExit(); + return; Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons @@ -775,7 +781,7 @@ void OnBackgroundButtonClick() //{ //} - selectTool(this); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons + selectTool(toolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons if (!isMainMenu) { @@ -789,7 +795,8 @@ void OnBackgroundButtonClick() void OnSecondaryButtonClicked() { this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); - deleteHighlightedButton(rayOrigin); + closeButton(); + //deleteHighlightedButton(rayOrigin); //deletePinnedToolButton(rayOrigin, this); OnActionButtonHoverExit(false); } @@ -1108,7 +1115,7 @@ IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) // Only proceed if no other button is being hovered m_GradientButton.highlighted = false; - hideAllButtons(this); + hoverExit(); m_GradientButton.UpdateMaterialColors(); m_HoverCheckCoroutine = null; } From 97003f71155c3667f884c352b233c128d144364e Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Mon, 15 May 2017 01:00:11 -0700 Subject: [PATCH 274/870] Use correct controller models when using Rift/Touch through OpenVR --- Prefabs/Proxies/ViveLeftTouch.prefab | 1793 ++++++++++++++++++++ Prefabs/Proxies/ViveLeftTouch.prefab.meta | 8 + Prefabs/Proxies/ViveRightTouch.prefab | 1793 ++++++++++++++++++++ Prefabs/Proxies/ViveRightTouch.prefab.meta | 8 + Scripts/Input/ViveInputToEvents.cs | 10 + Scripts/Proxies/ViveProxy.cs | 18 +- Scripts/Proxies/ViveProxy.cs.meta | 6 +- libs/input-prototype | 2 +- 8 files changed, 3635 insertions(+), 3 deletions(-) create mode 100644 Prefabs/Proxies/ViveLeftTouch.prefab create mode 100644 Prefabs/Proxies/ViveLeftTouch.prefab.meta create mode 100644 Prefabs/Proxies/ViveRightTouch.prefab create mode 100644 Prefabs/Proxies/ViveRightTouch.prefab.meta diff --git a/Prefabs/Proxies/ViveLeftTouch.prefab b/Prefabs/Proxies/ViveLeftTouch.prefab new file mode 100644 index 000000000..e67b94494 --- /dev/null +++ b/Prefabs/Proxies/ViveLeftTouch.prefab @@ -0,0 +1,1793 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &118082 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 436998} + - component: {fileID: 114000013861093962} + m_Layer: 0 + m_Name: ViveLeftTouch + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &436998 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 118082} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4560682712705560} + - {fileID: 4794322518342860} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 0} + propertyPath: m_animator + value: + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_controllerMask + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 118082} + m_IsPrefabParent: 1 +--- !u!1 &1000011111799672 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000010810114962} + m_Layer: 0 + m_Name: FieldDragOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011958545574 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000012123783760} + m_Layer: 0 + m_Name: PreviewOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012440443120 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000012197213606} + m_Layer: 0 + m_Name: MenuOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013074843682 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000011559331518} + m_Layer: 0 + m_Name: AltMenuOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013561259994 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000011600309478} + m_Layer: 0 + m_Name: RayOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1007789260927380 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4050334673459560} + m_Layer: 0 + m_Name: tip + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1035596773115294 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4530606897415404} + m_Layer: 0 + m_Name: sys_button + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1049163276494280 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4483743749631420} + m_Layer: 0 + m_Name: base + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1060698883967346 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4285027184705220} + - component: {fileID: 33469603830917590} + - component: {fileID: 23011143559282002} + m_Layer: 0 + m_Name: grip + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1104926084809440 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4337199902515864} + - component: {fileID: 33956794758310866} + - component: {fileID: 23051715092450864} + m_Layer: 0 + m_Name: x_button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1110475007587292 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4587665996471028} + m_Layer: 0 + m_Name: rgrip + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1156465154805694 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4560682712705560} + - component: {fileID: 114937401967916400} + m_Layer: 0 + m_Name: ViveController + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1174060473669720 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4150248458252998} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1258117880674016 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4738112902644160} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1266831003489266 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4890536220949060} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1300265623868800 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4426836777321650} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1336837414518560 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4827942793568330} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1361187521139138 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4988814349371388} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1391981533677216 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4870480252557800} + - component: {fileID: 33178554236838322} + - component: {fileID: 23092173763119808} + m_Layer: 0 + m_Name: y_button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1393640855049194 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4367960988115872} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1399362814821872 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4633347229691846} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1420128299563268 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4539072541428752} + m_Layer: 0 + m_Name: gdc2015 + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1437228542812490 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4695993798676282} + m_Layer: 0 + m_Name: trackpad_scroll_cut + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1437418336100850 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4062986250107026} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1439211211668616 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4642943849942306} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1440919061280958 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4716886561057732} + m_Layer: 0 + m_Name: status + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1442609195633634 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4296230171978536} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1492068379737228 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4791681828321116} + m_Layer: 0 + m_Name: handgrip + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1504505394622770 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4610012774413914} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1509876955685344 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4769650049049550} + - component: {fileID: 33112371956597706} + - component: {fileID: 23995618592158306} + m_Layer: 0 + m_Name: enter_button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1515052315250130 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4710379363873502} + m_Layer: 0 + m_Name: lgrip + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1521131054530934 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4883595441978386} + - component: {fileID: 33916300125348632} + - component: {fileID: 23853239758501888} + m_Layer: 0 + m_Name: thumbstick + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1522899860247498 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4390317408276986} + - component: {fileID: 33785835701983434} + - component: {fileID: 23279684870724754} + m_Layer: 0 + m_Name: body + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1536059129537142 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4751982353548818} + - component: {fileID: 33249309609687366} + - component: {fileID: 23204078342171062} + m_Layer: 0 + m_Name: trigger + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1542893286125322 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4347810169859968} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1591938757829128 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4774128065012916} + m_Layer: 0 + m_Name: scroll_wheel + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1596603730712686 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4333997724612544} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1663480401225244 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4794322518342860} + m_Layer: 0 + m_Name: Pivot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1703325721247870 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4317776395953736} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1749022349492836 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4581809795155478} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1766619086927632 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4213492642316678} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1770412470437466 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4774972711166902} + m_Layer: 0 + m_Name: trackpad + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1816339016628520 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4503428551396470} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1840772862127990 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4333883292380042} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1876384562517976 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4805665119888262} + m_Layer: 0 + m_Name: led + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1925894250920826 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4230762009131586} + m_Layer: 0 + m_Name: button + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1962360390267190 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4363050274432786} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1981557860433196 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4577270798619972} + m_Layer: 0 + m_Name: trackpad_touch + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1986466803964708 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4368742210636480} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010810114962 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011111799672} + m_LocalRotation: {x: -0.258819, y: -0, z: -0, w: 0.9659259} + m_LocalPosition: {x: 0, y: 0.025, z: 0.0746} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4794322518342860} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: -30, y: 0, z: 0} +--- !u!4 &4000011559331518 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013074843682} + m_LocalRotation: {x: -0, y: 0.06975647, z: -0, w: 0.9975641} + m_LocalPosition: {x: 0, y: 0.0208, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4794322518342860} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 8, z: 0} +--- !u!4 &4000011600309478 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013561259994} + m_LocalRotation: {x: -0, y: 0.06975647, z: -0, w: 0.9975641} + m_LocalPosition: {x: 0, y: -0.003, z: 0.03} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4794322518342860} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 8, z: 0} +--- !u!4 &4000012123783760 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011958545574} + m_LocalRotation: {x: -0.258819, y: -0, z: -0, w: 0.9659259} + m_LocalPosition: {x: 0, y: 0.074, z: 0.0746} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4794322518342860} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: -30, y: 0, z: 0} +--- !u!4 &4000012197213606 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012440443120} + m_LocalRotation: {x: 0.7053843, y: 0.049325276, z: -0.049325276, w: 0.7053843} + m_LocalPosition: {x: 0, y: -0.02, z: 0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4794322518342860} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 8, z: 0} +--- !u!4 &4050334673459560 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1007789260927380} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4642943849942306} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4062986250107026 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1437418336100850} + m_LocalRotation: {x: -0.73805505, y: -0, z: -0, w: 0.6747405} + m_LocalPosition: {x: 0, y: 0.003, z: -0.096} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4805665119888262} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4150248458252998 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1174060473669720} + m_LocalRotation: {x: -0.7368645, y: -0, z: -0, w: 0.6760405} + m_LocalPosition: {x: 0, y: 0.004, z: -0.088} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4530606897415404} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4213492642316678 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1766619086927632} + m_LocalRotation: {x: -0.52774763, y: -0.52774763, z: -0.47061923, w: 0.4706192} + m_LocalPosition: {x: 0, y: 0.002, z: -0.049} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4774128065012916} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4230762009131586 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1925894250920826} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4367960988115872} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4285027184705220 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1060698883967346} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4426836777321650} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4296230171978536 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1442609195633634} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4539072541428752} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4317776395953736 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1703325721247870} + m_LocalRotation: {x: -0.043941922, y: -0, z: -0, w: 0.9990341} + m_LocalPosition: {x: 0, y: 0.003, z: -0.097} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4390317408276986} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4333883292380042 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1840772862127990} + m_LocalRotation: {x: -0.42735785, y: -0, z: -0, w: 0.9040826} + m_LocalPosition: {x: 0.01107, y: 0.0001, z: -0.05813} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4337199902515864} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4333997724612544 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1596603730712686} + m_LocalRotation: {x: -0, y: -0.7327449, z: -0, w: 0.68050355} + m_LocalPosition: {x: -0.02, y: -0.015, z: -0.088} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4710379363873502} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4337199902515864 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1104926084809440} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4333883292380042} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 19 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4347810169859968 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542893286125322} + m_LocalRotation: {x: -0.42735785, y: -0, z: -0, w: 0.9040826} + m_LocalPosition: {x: 0.01732, y: -0.00897, z: -0.04806} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4870480252557800} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4363050274432786 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1962360390267190} + m_LocalRotation: {x: -0.043941922, y: -0, z: -0, w: 0.9990341} + m_LocalPosition: {x: 0, y: 0.003, z: -0.097} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4791681828321116} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4367960988115872 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1393640855049194} + m_LocalRotation: {x: -0.68217707, y: -0, z: -0, w: 0.73118705} + m_LocalPosition: {x: 0, y: 0.008, z: -0.019} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4230762009131586} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4368742210636480 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1986466803964708} + m_LocalRotation: {x: -0.52774763, y: -0.52774763, z: -0.47061923, w: 0.4706192} + m_LocalPosition: {x: 0, y: 0.002, z: -0.049} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4774972711166902} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4390317408276986 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1522899860247498} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4317776395953736} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4426836777321650 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1300265623868800} + m_LocalRotation: {x: -0, y: -0.7313537, z: -0, w: 0.6819984} + m_LocalPosition: {x: 0.012, y: -0.00938, z: -0.09077} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4285027184705220} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4483743749631420 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1049163276494280} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4610012774413914} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4503428551396470 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1816339016628520} + m_LocalRotation: {x: -0, y: 0.7327449, z: -0, w: 0.68050355} + m_LocalPosition: {x: 0.02, y: -0.015, z: -0.088} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4587665996471028} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4530606897415404 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1035596773115294} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4150248458252998} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4539072541428752 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1420128299563268} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4296230171978536} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4560682712705560 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1156465154805694} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4483743749631420} + - {fileID: 4390317408276986} + - {fileID: 4230762009131586} + - {fileID: 4539072541428752} + - {fileID: 4791681828321116} + - {fileID: 4805665119888262} + - {fileID: 4710379363873502} + - {fileID: 4587665996471028} + - {fileID: 4774128065012916} + - {fileID: 4716886561057732} + - {fileID: 4530606897415404} + - {fileID: 4050334673459560} + - {fileID: 4774972711166902} + - {fileID: 4695993798676282} + - {fileID: 4577270798619972} + - {fileID: 4751982353548818} + - {fileID: 4769650049049550} + - {fileID: 4285027184705220} + - {fileID: 4883595441978386} + - {fileID: 4337199902515864} + - {fileID: 4870480252557800} + m_Father: {fileID: 436998} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4577270798619972 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1981557860433196} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -6.9849193e-10, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4633347229691846} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4581809795155478 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1749022349492836} + m_LocalRotation: {x: 0.33709526, y: -0, z: -0, w: 0.94147056} + m_LocalPosition: {x: 0.00391, y: -0.04554, z: -0.05172} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4751982353548818} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4587665996471028 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1110475007587292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4503428551396470} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4610012774413914 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1504505394622770} + m_LocalRotation: {x: -0, y: -0.9999939, z: 0.0034912962, w: 0} + m_LocalPosition: {x: -0.00554, y: -0.00735, z: -0.139} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4483743749631420} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4633347229691846 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1399362814821872} + m_LocalRotation: {x: -0.52774763, y: -0.52774763, z: -0.47061923, w: 0.4706192} + m_LocalPosition: {x: 0, y: 0.002, z: -0.049} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4577270798619972} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4642943849942306 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1439211211668616} + m_LocalRotation: {x: 0.33709526, y: -0, z: -0, w: 0.94147056} + m_LocalPosition: {x: 0.00629, y: -0.02522, z: -0.03469} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4050334673459560} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4695993798676282 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1437228542812490} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4988814349371388} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4710379363873502 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1515052315250130} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4333997724612544} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4716886561057732 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1440919061280958} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4738112902644160} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4738112902644160 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1258117880674016} + m_LocalRotation: {x: -0.74271846, y: -0, z: -0, w: 0.6696039} + m_LocalPosition: {x: 0, y: -0.002, z: -0.146} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4716886561057732} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4751982353548818 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1536059129537142} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4581809795155478} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4769650049049550 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1509876955685344} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4827942793568330} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4774128065012916 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1591938757829128} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4213492642316678} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4774972711166902 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1770412470437466} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -6.9849193e-10, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4368742210636480} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4791681828321116 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1492068379737228} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4363050274432786} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4794322518342860 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1663480401225244} + m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} + m_LocalPosition: {x: -0.007, y: -0.005, z: -0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000011600309478} + - {fileID: 4000012197213606} + - {fileID: 4000011559331518} + - {fileID: 4000012123783760} + - {fileID: 4000010810114962} + m_Father: {fileID: 436998} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0} +--- !u!4 &4805665119888262 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1876384562517976} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4062986250107026} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4827942793568330 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1336837414518560} + m_LocalRotation: {x: -0.42735785, y: -0, z: -0, w: 0.9040826} + m_LocalPosition: {x: -0.00371, y: 0.00408, z: -0.06298} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4769650049049550} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4870480252557800 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1391981533677216} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4347810169859968} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 20 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4883595441978386 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1521131054530934} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4890536220949060} + m_Father: {fileID: 4560682712705560} + m_RootOrder: 18 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4890536220949060 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1266831003489266} + m_LocalRotation: {x: -0.42735785, y: -0, z: -0, w: 0.9040826} + m_LocalPosition: {x: -0.00149, y: -0.0012, z: -0.042} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4883595441978386} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4988814349371388 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1361187521139138} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4695993798676282} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23011143559282002 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1060698883967346} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23051715092450864 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1104926084809440} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23092173763119808 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1391981533677216} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23204078342171062 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1536059129537142} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23279684870724754 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1522899860247498} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23853239758501888 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1521131054530934} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23995618592158306 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1509876955685344} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33112371956597706 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1509876955685344} + m_Mesh: {fileID: 0} +--- !u!33 &33178554236838322 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1391981533677216} + m_Mesh: {fileID: 0} +--- !u!33 &33249309609687366 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1536059129537142} + m_Mesh: {fileID: 0} +--- !u!33 &33469603830917590 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1060698883967346} + m_Mesh: {fileID: 0} +--- !u!33 &33785835701983434 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1522899860247498} + m_Mesh: {fileID: 0} +--- !u!33 &33916300125348632 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1521131054530934} + m_Mesh: {fileID: 0} +--- !u!33 &33956794758310866 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1104926084809440} + m_Mesh: {fileID: 0} +--- !u!114 &114000013861093962 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 118082} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88cb44c52683f6648b7d436e9aa51bcc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RayOrigin: {fileID: 4000011600309478} + m_MenuOrigin: {fileID: 4000012197213606} + m_AlternateMenuOrigin: {fileID: 4000011559331518} + m_PreviewOrigin: {fileID: 4000012123783760} + m_FieldGrabOrigin: {fileID: 4000010810114962} + m_MeshRoot: {fileID: 4560682712705560} +--- !u!114 &114937401967916400 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1156465154805694} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5890e3cad70bea64d91aef9145ba3454, type: 3} + m_Name: + m_EditorClassIdentifier: + index: -1 + modelOverride: oculus_cv1_controller_left + shader: {fileID: 0} + verbose: 0 + createComponents: 1 + updateDynamically: 1 diff --git a/Prefabs/Proxies/ViveLeftTouch.prefab.meta b/Prefabs/Proxies/ViveLeftTouch.prefab.meta new file mode 100644 index 000000000..c3d0eec89 --- /dev/null +++ b/Prefabs/Proxies/ViveLeftTouch.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: daaa590e782c45c4880977eb4d91d4ee +timeCreated: 1466800271 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/Proxies/ViveRightTouch.prefab b/Prefabs/Proxies/ViveRightTouch.prefab new file mode 100644 index 000000000..be21f637e --- /dev/null +++ b/Prefabs/Proxies/ViveRightTouch.prefab @@ -0,0 +1,1793 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &141214 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 401760} + - component: {fileID: 114000011379258124} + m_Layer: 0 + m_Name: ViveRightTouch + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &401760 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 141214} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4114123614112124} + - {fileID: 4955629398068996} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 0} + propertyPath: m_animator + value: + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_controllerMask + value: 2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 141214} + m_IsPrefabParent: 1 +--- !u!1 &1000010902826424 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000013824268610} + m_Layer: 0 + m_Name: PreviewOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011728326988 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000014173169826} + m_Layer: 0 + m_Name: AltMenuOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013093051286 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000013278877548} + m_Layer: 0 + m_Name: MenuOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013401176380 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000010594257346} + m_Layer: 0 + m_Name: RayOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013806026548 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000013218449236} + m_Layer: 0 + m_Name: FieldGrabOrigin + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1015025080107114 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4338863275766746} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1017848103554036 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4122877284945652} + m_Layer: 0 + m_Name: trackpad + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1078006834343386 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4153476044374478} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1084918560607064 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4394165137411150} + m_Layer: 0 + m_Name: lgrip + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1096205118238398 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4985208446964720} + m_Layer: 0 + m_Name: gdc2015 + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1167263510738910 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4561186901587738} + m_Layer: 0 + m_Name: led + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1175562550023768 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4064421876161292} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1204407478510882 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4169102245282828} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1216001569780214 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4311070753493540} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1222108692673876 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4875182527443278} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1226461832118804 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4965564546862400} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1256313153753432 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4430884566944392} + m_Layer: 0 + m_Name: button + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1277699755885064 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4955629398068996} + m_Layer: 0 + m_Name: Pivot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1291234185117738 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4492256861506862} + m_Layer: 0 + m_Name: sys_button + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1292403980323252 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4285528196412450} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1319750618082326 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4056063937132584} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1333329582297900 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4284541016125380} + m_Layer: 0 + m_Name: trackpad_scroll_cut + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1353490116601374 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4599338099271058} + - component: {fileID: 33213006784566536} + - component: {fileID: 23685513969778260} + m_Layer: 0 + m_Name: grip + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1365288689439810 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4729463227102552} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1370040456003826 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4035414622491038} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1383174753814500 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4446355355938954} + - component: {fileID: 33759447688285446} + - component: {fileID: 23450107420406520} + m_Layer: 0 + m_Name: home_button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1397216264146802 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4209818961789830} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1403337088170430 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4407470732880478} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1419037120550808 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4227554333722452} + m_Layer: 0 + m_Name: scroll_wheel + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1445857430169780 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4172279170361694} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1502414433327842 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4960372018300962} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1506756903305690 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4789122475774794} + m_Layer: 0 + m_Name: rgrip + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1513740458129314 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4981603906608778} + - component: {fileID: 33967930094284210} + - component: {fileID: 23568579826718600} + m_Layer: 0 + m_Name: trigger + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1513766918687040 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4387113911672788} + - component: {fileID: 33819656159155084} + - component: {fileID: 23815770440904726} + m_Layer: 0 + m_Name: a_button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1519858117726124 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4736825928440594} + m_Layer: 0 + m_Name: trackpad_touch + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1538132534700554 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4317735520733896} + m_Layer: 0 + m_Name: tip + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1538927158357284 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4954436683111630} + - component: {fileID: 33333166757609738} + - component: {fileID: 23861366152661854} + m_Layer: 0 + m_Name: thumbstick + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1547058690299732 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4957691913824072} + m_Layer: 0 + m_Name: attach + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1565124413751224 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4425350603751650} + m_Layer: 0 + m_Name: base + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1568059572411962 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4114123614112124} + - component: {fileID: 114864599699760286} + m_Layer: 0 + m_Name: ViveController + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1578026775671302 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4928237335952316} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1628430348274358 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4868308064664076} + - component: {fileID: 33313187326441368} + - component: {fileID: 23657970368481130} + m_Layer: 0 + m_Name: b_button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1782201578535092 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4051923300086686} + m_Layer: 0 + m_Name: status + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1789018909152748 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4238326113030232} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1847735767803450 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4948460115251384} + - component: {fileID: 33826026786099534} + - component: {fileID: 23412163262348934} + m_Layer: 0 + m_Name: body + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1849442996289906 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4563531661905232} + m_Layer: 0 + m_Name: handgrip + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1850472157921530 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4157320317652094} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1865910509741364 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4215450861154768} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1898858430087610 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4115262718920228} + m_Layer: 0 + m_Name: attach + m_TagString: ShowInMiniWorld + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010594257346 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013401176380} + m_LocalRotation: {x: -0, y: -0.06975647, z: -0, w: 0.9975641} + m_LocalPosition: {x: 0, y: -0.003, z: 0.03} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4955629398068996} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: -8, z: 0} +--- !u!4 &4000013218449236 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013806026548} + m_LocalRotation: {x: -0.258819, y: -0, z: -0, w: 0.9659259} + m_LocalPosition: {x: 0, y: 0.025, z: 0.0746} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4955629398068996} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: -30, y: 0, z: 0} +--- !u!4 &4000013278877548 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013093051286} + m_LocalRotation: {x: 0.7053843, y: -0.049325276, z: 0.049325276, w: 0.7053843} + m_LocalPosition: {x: 0, y: -0.02, z: 0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4955629398068996} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: -8, z: 0} +--- !u!4 &4000013824268610 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010902826424} + m_LocalRotation: {x: -0.258819, y: -0, z: -0, w: 0.9659259} + m_LocalPosition: {x: 0, y: 0.074, z: 0.0746} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4955629398068996} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: -30, y: 0, z: 0} +--- !u!4 &4000014173169826 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011728326988} + m_LocalRotation: {x: -0, y: -0.06975647, z: -0, w: 0.9975641} + m_LocalPosition: {x: 0, y: 0.0208, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4955629398068996} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: -8, z: 0} +--- !u!4 &4035414622491038 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1370040456003826} + m_LocalRotation: {x: 0.33709526, y: -0, z: -0, w: 0.94147056} + m_LocalPosition: {x: -0.00629, y: -0.02522, z: -0.03469} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4317735520733896} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4051923300086686 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1782201578535092} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4209818961789830} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4056063937132584 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1319750618082326} + m_LocalRotation: {x: -0.043941922, y: -0, z: -0, w: 0.9990341} + m_LocalPosition: {x: 0, y: 0.003, z: -0.097} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4563531661905232} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4064421876161292 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1175562550023768} + m_LocalRotation: {x: -0.42735785, y: -0, z: -0, w: 0.9040826} + m_LocalPosition: {x: 0.00371, y: 0.00408, z: -0.06298} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4446355355938954} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4114123614112124 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1568059572411962} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4425350603751650} + - {fileID: 4948460115251384} + - {fileID: 4430884566944392} + - {fileID: 4985208446964720} + - {fileID: 4563531661905232} + - {fileID: 4561186901587738} + - {fileID: 4394165137411150} + - {fileID: 4789122475774794} + - {fileID: 4227554333722452} + - {fileID: 4051923300086686} + - {fileID: 4492256861506862} + - {fileID: 4317735520733896} + - {fileID: 4122877284945652} + - {fileID: 4284541016125380} + - {fileID: 4736825928440594} + - {fileID: 4981603906608778} + - {fileID: 4387113911672788} + - {fileID: 4868308064664076} + - {fileID: 4599338099271058} + - {fileID: 4446355355938954} + - {fileID: 4954436683111630} + m_Father: {fileID: 401760} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4115262718920228 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1898858430087610} + m_LocalRotation: {x: -0, y: -0.9999939, z: 0.0034912962, w: 0} + m_LocalPosition: {x: 0.00554, y: -0.00735, z: -0.139} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4425350603751650} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4122877284945652 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1017848103554036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -6.9849193e-10, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4965564546862400} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4153476044374478 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1078006834343386} + m_LocalRotation: {x: -0.68217707, y: -0, z: -0, w: 0.73118705} + m_LocalPosition: {x: 0, y: 0.008, z: -0.019} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4430884566944392} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4157320317652094 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1850472157921530} + m_LocalRotation: {x: -0.7368645, y: -0, z: -0, w: 0.6760405} + m_LocalPosition: {x: 0, y: 0.004, z: -0.088} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4492256861506862} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4169102245282828 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1204407478510882} + m_LocalRotation: {x: -0, y: -0.7313537, z: -0, w: 0.6819984} + m_LocalPosition: {x: -0.012, y: -0.00938, z: -0.09077} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4599338099271058} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4172279170361694 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1445857430169780} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4985208446964720} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4209818961789830 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1397216264146802} + m_LocalRotation: {x: -0.74271846, y: -0, z: -0, w: 0.6696039} + m_LocalPosition: {x: 0, y: -0.002, z: -0.146} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4051923300086686} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4215450861154768 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1865910509741364} + m_LocalRotation: {x: 0.33709526, y: -0, z: -0, w: 0.94147056} + m_LocalPosition: {x: -0.00391, y: -0.04554, z: -0.05172} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4981603906608778} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4227554333722452 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1419037120550808} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4729463227102552} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4238326113030232 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1789018909152748} + m_LocalRotation: {x: -0.73805505, y: -0, z: -0, w: 0.6747405} + m_LocalPosition: {x: 0, y: 0.003, z: -0.096} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4561186901587738} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4284541016125380 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1333329582297900} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4960372018300962} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4285528196412450 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1292403980323252} + m_LocalRotation: {x: -0.42735785, y: -0, z: -0, w: 0.9040826} + m_LocalPosition: {x: -0.01732, y: -0.00897, z: -0.04806} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4868308064664076} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4311070753493540 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1216001569780214} + m_LocalRotation: {x: -0.043941922, y: -0, z: -0, w: 0.9990341} + m_LocalPosition: {x: 0, y: 0.003, z: -0.097} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4948460115251384} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4317735520733896 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1538132534700554} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4035414622491038} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4338863275766746 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1015025080107114} + m_LocalRotation: {x: -0, y: 0.7327449, z: -0, w: 0.68050355} + m_LocalPosition: {x: 0.02, y: -0.015, z: -0.088} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4789122475774794} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4387113911672788 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1513766918687040} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4957691913824072} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4394165137411150 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1084918560607064} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4875182527443278} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4407470732880478 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1403337088170430} + m_LocalRotation: {x: -0.42735785, y: -0, z: -0, w: 0.9040826} + m_LocalPosition: {x: 0.00149, y: -0.0012, z: -0.042} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4954436683111630} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4425350603751650 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1565124413751224} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4115262718920228} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4430884566944392 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1256313153753432} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4153476044374478} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4446355355938954 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1383174753814500} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4064421876161292} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 19 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4492256861506862 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1291234185117738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4157320317652094} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4561186901587738 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1167263510738910} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4238326113030232} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4563531661905232 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1849442996289906} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4056063937132584} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4599338099271058 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1353490116601374} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4169102245282828} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 18 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4729463227102552 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1365288689439810} + m_LocalRotation: {x: -0.52774763, y: -0.52774763, z: -0.47061923, w: 0.4706192} + m_LocalPosition: {x: 0, y: 0.002, z: -0.049} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4227554333722452} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4736825928440594 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519858117726124} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -6.9849193e-10, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4928237335952316} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4789122475774794 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1506756903305690} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4338863275766746} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4868308064664076 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1628430348274358} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4285528196412450} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4875182527443278 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1222108692673876} + m_LocalRotation: {x: -0, y: -0.7327449, z: -0, w: 0.68050355} + m_LocalPosition: {x: -0.02, y: -0.015, z: -0.088} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4394165137411150} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4928237335952316 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1578026775671302} + m_LocalRotation: {x: -0.52774763, y: -0.52774763, z: -0.47061923, w: 0.4706192} + m_LocalPosition: {x: 0, y: 0.002, z: -0.049} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4736825928440594} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4948460115251384 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1847735767803450} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4311070753493540} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4954436683111630 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1538927158357284} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4407470732880478} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 20 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4955629398068996 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1277699755885064} + m_LocalRotation: {x: 0.3420201, y: 0, z: 0, w: 0.9396927} + m_LocalPosition: {x: -0.007, y: -0.005, z: -0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000010594257346} + - {fileID: 4000013278877548} + - {fileID: 4000014173169826} + - {fileID: 4000013824268610} + - {fileID: 4000013218449236} + m_Father: {fileID: 401760} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 40, y: 0, z: 0} +--- !u!4 &4957691913824072 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1547058690299732} + m_LocalRotation: {x: -0.42735785, y: -0, z: -0, w: 0.9040826} + m_LocalPosition: {x: -0.01107, y: 0.0001, z: -0.05813} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4387113911672788} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4960372018300962 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1502414433327842} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4284541016125380} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4965564546862400 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1226461832118804} + m_LocalRotation: {x: -0.52774763, y: -0.52774763, z: -0.47061923, w: 0.4706192} + m_LocalPosition: {x: 0, y: 0.002, z: -0.049} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4122877284945652} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4981603906608778 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1513740458129314} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4215450861154768} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4985208446964720 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1096205118238398} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4172279170361694} + m_Father: {fileID: 4114123614112124} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23412163262348934 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1847735767803450} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23450107420406520 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1383174753814500} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23568579826718600 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1513740458129314} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23657970368481130 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1628430348274358} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23685513969778260 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1353490116601374} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23815770440904726 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1513766918687040} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23861366152661854 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1538927158357284} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33213006784566536 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1353490116601374} + m_Mesh: {fileID: 0} +--- !u!33 &33313187326441368 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1628430348274358} + m_Mesh: {fileID: 0} +--- !u!33 &33333166757609738 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1538927158357284} + m_Mesh: {fileID: 0} +--- !u!33 &33759447688285446 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1383174753814500} + m_Mesh: {fileID: 0} +--- !u!33 &33819656159155084 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1513766918687040} + m_Mesh: {fileID: 0} +--- !u!33 &33826026786099534 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1847735767803450} + m_Mesh: {fileID: 0} +--- !u!33 &33967930094284210 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1513740458129314} + m_Mesh: {fileID: 0} +--- !u!114 &114000011379258124 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 141214} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 88cb44c52683f6648b7d436e9aa51bcc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RayOrigin: {fileID: 4000010594257346} + m_MenuOrigin: {fileID: 4000013278877548} + m_AlternateMenuOrigin: {fileID: 4000014173169826} + m_PreviewOrigin: {fileID: 4000013824268610} + m_FieldGrabOrigin: {fileID: 4000013218449236} + m_MeshRoot: {fileID: 4114123614112124} +--- !u!114 &114864599699760286 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1568059572411962} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5890e3cad70bea64d91aef9145ba3454, type: 3} + m_Name: + m_EditorClassIdentifier: + index: -1 + modelOverride: oculus_cv1_controller_right + shader: {fileID: 0} + verbose: 0 + createComponents: 1 + updateDynamically: 1 diff --git a/Prefabs/Proxies/ViveRightTouch.prefab.meta b/Prefabs/Proxies/ViveRightTouch.prefab.meta new file mode 100644 index 000000000..28ccc1308 --- /dev/null +++ b/Prefabs/Proxies/ViveRightTouch.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 687f54c4214cdf541b6809be57b26544 +timeCreated: 1466800271 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Input/ViveInputToEvents.cs b/Scripts/Input/ViveInputToEvents.cs index 18746f38e..c3a222e34 100644 --- a/Scripts/Input/ViveInputToEvents.cs +++ b/Scripts/Input/ViveInputToEvents.cs @@ -2,6 +2,7 @@ using UnityEditor.Experimental.EditorVR; using UnityEngine; using UnityEngine.InputNew; +using UnityEngine.VR; #if ENABLE_STEAMVR_INPUT using System; using Valve.VR; @@ -63,6 +64,15 @@ public void Update() if (leftSteamDeviceIndex == -1 || rightSteamDeviceIndex == -1 || leftSteamDeviceIndex == rightSteamDeviceIndex) return; + // Oculus Touch on OpenVR should have fixed left/right hand device indices + if (VRDevice.model.IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0 + && leftSteamDeviceIndex > rightSteamDeviceIndex) + { + var swap = rightSteamDeviceIndex; + rightSteamDeviceIndex = leftSteamDeviceIndex; + leftSteamDeviceIndex = swap; + } + for (VRInputDevice.Handedness hand = VRInputDevice.Handedness.Left; (int)hand <= (int)VRInputDevice.Handedness.Right; hand++) { var steamDeviceIndex = steamDeviceIndices[(int)hand]; diff --git a/Scripts/Proxies/ViveProxy.cs b/Scripts/Proxies/ViveProxy.cs index a67f22539..9580b2cb1 100644 --- a/Scripts/Proxies/ViveProxy.cs +++ b/Scripts/Proxies/ViveProxy.cs @@ -1,21 +1,37 @@ #if UNITY_EDITOR +using System; using System.Collections; using UnityEditor.Experimental.EditorVR.Input; using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; +using UnityEngine.VR; namespace UnityEditor.Experimental.EditorVR.Proxies { sealed class ViveProxy : TwoHandedProxyBase { + [SerializeField] + GameObject m_LeftHandTouchProxyPrefab; + + [SerializeField] + GameObject m_RightHandTouchProxyPrefab; + #if ENABLE_STEAMVR_INPUT - SteamVR_RenderModel m_RightModel; SteamVR_RenderModel m_LeftModel; + SteamVR_RenderModel m_RightModel; #endif public override void Awake() { + if (VRDevice.model.IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0) + { + m_LeftHandProxyPrefab = m_LeftHandTouchProxyPrefab; + m_RightHandProxyPrefab = m_RightHandTouchProxyPrefab; + } + base.Awake(); m_InputToEvents = ObjectUtils.AddComponent(gameObject); + #if !ENABLE_STEAMVR_INPUT enabled = false; #endif diff --git a/Scripts/Proxies/ViveProxy.cs.meta b/Scripts/Proxies/ViveProxy.cs.meta index f9bc2766b..7d7db58ad 100644 --- a/Scripts/Proxies/ViveProxy.cs.meta +++ b/Scripts/Proxies/ViveProxy.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 1dd05fa08947fc34392a98bded9b0ae0 -timeCreated: 1467068989 +timeCreated: 1494831546 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -10,6 +10,10 @@ MonoImporter: - m_RightHandProxyPrefab: {fileID: 1000010426338840, guid: fbcfdb50f5e2d7a45bebae9a3a90b3fa, type: 2} - m_PlayerInput: {instanceID: 0} + - m_LeftHandTouchProxyPrefab: {fileID: 118082, guid: daaa590e782c45c4880977eb4d91d4ee, + type: 2} + - m_RightHandTouchProxyPrefab: {fileID: 141214, guid: 687f54c4214cdf541b6809be57b26544, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/libs/input-prototype b/libs/input-prototype index 968971051..b2316ef33 160000 --- a/libs/input-prototype +++ b/libs/input-prototype @@ -1 +1 @@ -Subproject commit 9689710511d6156fafd8a7e96628111649fd7113 +Subproject commit b2316ef3354d9b548064faeb38f95f99f11a63e2 From 0c26584f4f31df257e741e88b4e1847e919f7397 Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Mon, 15 May 2017 14:34:41 -0700 Subject: [PATCH 275/870] Don't require button press for Oculus Touch when using OpenVR --- Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs index 8a7fd373a..6f5eeff3f 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs @@ -6,6 +6,7 @@ using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; +using UnityEngine.VR; namespace UnityEditor.Experimental.EditorVR.Tools { @@ -58,6 +59,7 @@ enum State Vector3 m_StartMidPoint; Vector3 m_StartDirection; float m_StartYaw; + bool m_IsVive; // Allow shared updater to consume these controls for another linked instance InputControl m_Grip; @@ -90,6 +92,9 @@ private void Start() m_BlinkVisualsGO.transform.localPosition = Vector3.zero; m_BlinkVisualsGO.transform.localRotation = Quaternion.identity; + m_IsVive = proxyType == typeof(ViveProxy) + && VRDevice.model.IndexOf("oculus", StringComparison.OrdinalIgnoreCase) < 0; + Shader.SetGlobalFloat(k_WorldScaleProperty, 1); } @@ -231,9 +236,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - bool isVive = proxyType == typeof(ViveProxy); - - if (m_EnableJoystick && (!isVive || m_Thumb != null)) + if (m_EnableJoystick && (!m_IsVive || m_Thumb != null)) { var viewerCamera = CameraUtils.GetMainCamera(); @@ -247,12 +250,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon direction.y = 0; direction.Normalize(); - Translate(yawValue, isVive, direction); + Translate(yawValue, m_IsVive, direction); } else { var speed = yawValue * k_SlowRotationSpeed; - var threshold = isVive ? k_RotationThresholdVive : k_RotationThreshold; + var threshold = m_IsVive ? k_RotationThresholdVive : k_RotationThreshold; if (Mathf.Abs(yawValue) > threshold) speed = k_FastRotationSpeed * Mathf.Sign(yawValue); @@ -275,7 +278,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon direction.Normalize(); } - Translate(forwardValue, isVive, direction); + Translate(forwardValue, m_IsVive, direction); consumeControl(blinkInput.forward); } } From 24932e486bbb0754c20803a18e6108562be2e02e Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Mon, 15 May 2017 15:08:14 -0700 Subject: [PATCH 276/870] Fix Clone/Paste spawning behind you or at your head --- Actions/Paste.cs | 5 +++-- Scripts/Utilities/ObjectUtils.cs | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Actions/Paste.cs b/Actions/Paste.cs index 016ccd380..7f26a219c 100644 --- a/Actions/Paste.cs +++ b/Actions/Paste.cs @@ -22,7 +22,8 @@ public static Transform[] buffer { var bounds = ObjectUtils.GetBounds(value); - s_BufferDistance = bounds.size == Vector3.zero ? (bounds.center - CameraUtils.GetMainCamera().transform.position).magnitude : 0f; + s_BufferDistance = bounds.size != Vector3.zero ? + (bounds.center - CameraUtils.GetMainCamera().transform.position).magnitude : 1f; } } } @@ -39,7 +40,7 @@ public override void ExecuteAction() var bounds = ObjectUtils.GetBounds(buffer); foreach (var transform in buffer) { - var pasted = Instantiate(transform.gameObject); + var pasted = ObjectUtils.Instantiate(transform.gameObject); var pastedTransform = pasted.transform; pasted.hideFlags = HideFlags.None; var cameraTransform = CameraUtils.GetMainCamera().transform; diff --git a/Scripts/Utilities/ObjectUtils.cs b/Scripts/Utilities/ObjectUtils.cs index 27cf9608f..9ca57182b 100644 --- a/Scripts/Utilities/ObjectUtils.cs +++ b/Scripts/Utilities/ObjectUtils.cs @@ -24,8 +24,13 @@ public static HideFlags hideFlags public static GameObject Instantiate(GameObject prefab, Transform parent = null, bool worldPositionStays = true, bool runInEditMode = true, bool active = true) { - var go = UnityObject.Instantiate(prefab); - go.transform.SetParent(parent, worldPositionStays); + var go = UnityObject.Instantiate(prefab, parent, worldPositionStays); + if (worldPositionStays) + { + go.transform.position = prefab.transform.position; + go.transform.rotation = prefab.transform.rotation; + } + go.SetActive(active); if (!Application.isPlaying && runInEditMode) { From b6c6c9268694b8db84c8e200d90bc355abab3e82 Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Mon, 15 May 2017 15:35:18 -0700 Subject: [PATCH 277/870] Don't show outline for objects that are cut --- Scripts/Modules/SelectionModule.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/Modules/SelectionModule.cs b/Scripts/Modules/SelectionModule.cs index 6dce6b507..8920953dc 100644 --- a/Scripts/Modules/SelectionModule.cs +++ b/Scripts/Modules/SelectionModule.cs @@ -41,6 +41,9 @@ bool CanSelectObject(GameObject hoveredObject, bool useGrouping) if (hoveredObject != null) { + if (!hoveredObject.activeInHierarchy) + return false; + if (useGrouping) return CanSelectObject(GetSelectionCandidate(hoveredObject, true), false); } From c252b0c746181af47066787bb1eee7311cb958c9 Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Mon, 15 May 2017 16:06:58 -0700 Subject: [PATCH 278/870] Cache transforms --- Scripts/Utilities/ObjectUtils.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Scripts/Utilities/ObjectUtils.cs b/Scripts/Utilities/ObjectUtils.cs index 9ca57182b..edf76bbec 100644 --- a/Scripts/Utilities/ObjectUtils.cs +++ b/Scripts/Utilities/ObjectUtils.cs @@ -27,8 +27,10 @@ public static GameObject Instantiate(GameObject prefab, Transform parent = null, var go = UnityObject.Instantiate(prefab, parent, worldPositionStays); if (worldPositionStays) { - go.transform.position = prefab.transform.position; - go.transform.rotation = prefab.transform.rotation; + var goTransform = go.transform; + var prefabTransform = prefab.transform; + goTransform.position = prefabTransform.position; + goTransform.rotation = prefabTransform.rotation; } go.SetActive(active); From 4256348b8c77f4a91ab0d98cbeeb1262fa1bfe03 Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Thu, 18 May 2017 17:52:10 +0200 Subject: [PATCH 279/870] Fix switching in and out of play mode --- .../Core/Contexts/EditingContextManager.cs | 37 ++++++++++++++++++- Scripts/Core/VRView.cs | 37 +------------------ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Scripts/Core/Contexts/EditingContextManager.cs b/Scripts/Core/Contexts/EditingContextManager.cs index ed6aeecc2..d24047457 100644 --- a/Scripts/Core/Contexts/EditingContextManager.cs +++ b/Scripts/Core/Contexts/EditingContextManager.cs @@ -11,7 +11,8 @@ namespace UnityEditor.Experimental.EditorVR.Core { - class EditingContextManager : MonoBehaviour + [InitializeOnLoad] + sealed class EditingContextManager : MonoBehaviour { [SerializeField] UnityObject m_DefaultContext; @@ -19,6 +20,8 @@ class EditingContextManager : MonoBehaviour const string k_SettingsPath = "ProjectSettings/EditingContextManagerSettings.asset"; const string k_UserSettingsPath = "Library/EditingContextManagerSettings.asset"; + const string k_LaunchOnExitPlaymode = "EditingContextManager.LaunchOnExitPlaymode"; + static EditingContextManager s_Instance; static InputManager s_InputManager; @@ -54,6 +57,8 @@ static EditingContextManager() { VRView.viewEnabled += OnVRViewEnabled; VRView.viewDisabled += OnVRViewDisabled; + + EditorApplication.update += ReopenOnExitPlaymode; } static void OnVRViewEnabled() @@ -89,6 +94,32 @@ static void EditProjectSettings() Selection.activeObject = settings; } + // Life cycle management across playmode switches is an odd beast indeed, and there is a need to reliably relaunch + // EditorVR after we switch back out of playmode (assuming the view was visible before a playmode switch). So, + // we watch until playmode is done and then relaunch. + static void ReopenOnExitPlaymode() + { + bool launch = EditorPrefs.GetBool(k_LaunchOnExitPlaymode, false); + if (!launch || !EditorApplication.isPlaying) + { + EditorPrefs.DeleteKey(k_LaunchOnExitPlaymode); + EditorApplication.update -= ReopenOnExitPlaymode; + if (launch) + EditorApplication.delayCall += ShowEditorVR; + } + } + + private void OnPlaymodeStateChanged() + { + if (EditorApplication.isPlayingOrWillChangePlaymode) + { + EditorPrefs.SetBool(k_LaunchOnExitPlaymode, true); + VRView view = VRView.activeView; + if (view) + view.Close(); + } + } + void OnEnable() { m_Settings = LoadUserSettings(); @@ -105,10 +136,14 @@ void OnEnable() if (m_AvailableContexts.Count > 1) VRView.afterOnGUI += OnVRViewGUI; + + EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged; } void OnDisable() { + EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged; + VRView.afterOnGUI -= OnVRViewGUI; defaultContext = m_CurrentContext; diff --git a/Scripts/Core/VRView.cs b/Scripts/Core/VRView.cs index 8e0c7adf0..8a9c9a03f 100644 --- a/Scripts/Core/VRView.cs +++ b/Scripts/Core/VRView.cs @@ -13,12 +13,10 @@ namespace UnityEditor.Experimental.EditorVR.Core { - [InitializeOnLoad] sealed class VRView : EditorWindow { const string k_ShowDeviceView = "VRView.ShowDeviceView"; const string k_UseCustomPreviewCamera = "VRView.UseCustomPreviewCamera"; - const string k_LaunchOnExitPlaymode = "VRView.LaunchOnExitPlaymode"; DrawCameraMode m_RenderMode = DrawCameraMode.Textured; @@ -103,11 +101,6 @@ public static LayerMask cullingMask public Rect guiRect { get; private set; } - static VRView GetWindow() - { - return GetWindow(true); - } - public static Coroutine StartCoroutine(IEnumerator routine) { if (s_ActiveView && s_ActiveView.m_CameraRig) @@ -119,25 +112,8 @@ public static Coroutine StartCoroutine(IEnumerator routine) return null; } - // Life cycle management across playmode switches is an odd beast indeed, and there is a need to reliably relaunch - // EditorVR after we switch back out of playmode (assuming the view was visible before a playmode switch). So, - // we watch until playmode is done and then relaunch. - static void ReopenOnExitPlaymode() - { - bool launch = EditorPrefs.GetBool(k_LaunchOnExitPlaymode, false); - if (!launch || !EditorApplication.isPlaying) - { - EditorPrefs.DeleteKey(k_LaunchOnExitPlaymode); - EditorApplication.update -= ReopenOnExitPlaymode; - if (launch) - GetWindow(); - } - } - public void OnEnable() { - EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged; - Assert.IsNull(s_ActiveView, "Only one EditorVR should be active"); autoRepaintOnSceneChange = true; @@ -184,8 +160,6 @@ public void OnDisable() if (viewDisabled != null) viewDisabled(); - EditorApplication.playmodeStateChanged -= OnPlaymodeStateChanged; - VRSettings.enabled = false; EditorPrefs.SetBool(k_ShowDeviceView, m_ShowDeviceView); @@ -323,19 +297,10 @@ void DoDrawCamera(Rect rect) } } - private void OnPlaymodeStateChanged() - { - if (EditorApplication.isPlayingOrWillChangePlaymode) - { - EditorPrefs.SetBool(k_LaunchOnExitPlaymode, true); - Close(); - } - } - private void Update() { // If code is compiling, then we need to clean up the window resources before classes get re-initialized - if (EditorApplication.isCompiling) + if (EditorApplication.isCompiling || EditorApplication.isPlayingOrWillChangePlaymode) { Close(); return; From 256721805a0c6cd6f49e3652217f4ecc6d04d27b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 24 May 2017 11:41:19 +0200 Subject: [PATCH 280/870] Fix a copy paste error in ILinkedObject XML documentation --- Scripts/Interfaces/ILinkedObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Interfaces/ILinkedObject.cs b/Scripts/Interfaces/ILinkedObject.cs index 96ee4e8c8..04d3e1cf8 100644 --- a/Scripts/Interfaces/ILinkedObject.cs +++ b/Scripts/Interfaces/ILinkedObject.cs @@ -20,7 +20,7 @@ public static class ILinkedObjectMethods internal static Func isSharedUpdater { get; set; } /// - /// Returns whether the specified ray origin is hovering over a UI element + /// Returns whether the specified object is designated to perform the duties of all linked objects of this type /// /// Object among the linked objects to check if it is the central one public static bool IsSharedUpdater(this ILinkedObject obj, ILinkedObject linkedObject) From f40ab6a846c990ed85994867b52034232440e926 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 31 May 2017 16:27:32 -0700 Subject: [PATCH 281/870] Perform development merge cleanups --- Menus/MainMenu/Scripts/MainMenuButton.cs | 1 + Scripts/Proxies/ViveProxy.cs.meta | 1 + Scripts/UI/PinnedToolButton.cs | 11 ++++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 6c4d4d946..7a6c11768 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -17,6 +17,7 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip [SerializeField] private Text m_ButtonTitle; + Transform m_HoveringRayOrigin; Color m_OriginalColor; IPinnedToolButton m_HighlightedPinnedToolbutton; diff --git a/Scripts/Proxies/ViveProxy.cs.meta b/Scripts/Proxies/ViveProxy.cs.meta index e5f037ae8..8a3a3aca9 100644 --- a/Scripts/Proxies/ViveProxy.cs.meta +++ b/Scripts/Proxies/ViveProxy.cs.meta @@ -11,6 +11,7 @@ MonoImporter: type: 2} - m_PlayerInput: {instanceID: 0} - m_HighlightMaterial: {fileID: 2100000, guid: 40ce8f85e3653a84abffb13adb986781, + type: 2} - m_LeftHandTouchProxyPrefab: {fileID: 118082, guid: daaa590e782c45c4880977eb4d91d4ee, type: 2} - m_RightHandTouchProxyPrefab: {fileID: 141214, guid: 687f54c4214cdf541b6809be57b26544, diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 958e86dc9..6ebe6cf30 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -703,7 +703,12 @@ void HoverButton() } */ - void OnActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) + void OnActionButtonHoverExit() + { + ActionButtonHoverExit(); + } + + void ActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) { if (m_PositionCoroutine != null) return; @@ -785,7 +790,7 @@ void OnBackgroundButtonClick() if (!isMainMenu) { - OnActionButtonHoverExit(false); + ActionButtonHoverExit(false); //revealAllToolButtons(rayOrigin, true); } @@ -798,7 +803,7 @@ void OnSecondaryButtonClicked() closeButton(); //deleteHighlightedButton(rayOrigin); //deletePinnedToolButton(rayOrigin, this); - OnActionButtonHoverExit(false); + ActionButtonHoverExit(false); } IEnumerator AnimateInitialReveal(Vector3 targetPosition, Vector3 targetScale) From 2edd9a189361e5d41d7bdabc329ce26111602bc0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 31 May 2017 19:17:16 -0700 Subject: [PATCH 282/870] Add LateUpdate processing of OVRHaptics to EditorVR --- Scripts/Core/EditorVR.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 773b0590d..a1516a8fb 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -300,6 +300,11 @@ void OnDestroy() nested.OnDestroy(); } } + + void LateUpdate() + { + OVRHaptics.Process(); + } void Update() { From 7847cc890f7b377c08d842826bf6e3466b2b101e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 31 May 2017 19:30:20 -0700 Subject: [PATCH 283/870] Add initial haptic support to PinnedToolButtons; Oculus only for now --- Scripts/UI/PinnedToolButton.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 6ebe6cf30..b31d9fc55 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -294,6 +294,9 @@ public Transform alternateMenuOrigin bool m_Highlighted; bool m_ActiveTool; bool m_Visible; + OVRHaptics.OVRHapticsChannel m_LHapticsChannel; + OVRHaptics.OVRHapticsChannel m_RHapticsChannel; + OVRHapticsClip m_GeneratedHapticClip; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -376,6 +379,8 @@ public bool highlighted if (!m_Highlighted) this.HideTooltip(this); + else + PerformHoverHaptics(); if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) { @@ -531,6 +536,10 @@ void Awake() void Start() { + m_LHapticsChannel = OVRHaptics.LeftChannel; + m_RHapticsChannel = OVRHaptics.RightChannel; + m_GeneratedHapticClip = new OVRHapticsClip(); + //m_GradientButton.onClick += ButtonClicked; // TODO remove after action button refactor Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); @@ -632,6 +641,20 @@ bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) return buttonType == PinnedToolActionButton.ButtonType.SelectTool; } + void PerformHoverHaptics() + { + m_GeneratedHapticClip.Reset(); + var intensity = 25; + intensity = Mathf.Clamp(intensity, 0, 255); + byte holder = Convert.ToByte(intensity); + var clipLength = 25; + for (int i = 0; i < clipLength; ++i) + m_GeneratedHapticClip.WriteSample(holder); + + m_RHapticsChannel.Mix(m_GeneratedHapticClip); + m_LHapticsChannel.Mix(m_GeneratedHapticClip); + } + void OnBackgroundHoverEnter () { //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); From 0fe6d9a7137c0ff6da1ced41571336660dc00df6 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 1 Jun 2017 12:05:12 -0700 Subject: [PATCH 284/870] Consume inputs to resolve conflicts with LocomotionTool; Increase size of BrushSizeUI activator collider; Apply auto-updates from update to 5.6 --- Tools/AnnotationTool/AnnotationTool.cs | 24 ++- .../Input/AnnotationInput.asset | 36 +++- Tools/AnnotationTool/Input/AnnotationInput.cs | 1 + .../Materials/AnnotationShader.shader | 4 +- .../Materials/BrushConeShader.shader | 4 +- .../AnnotationTool/Prefabs/BrushSizeUI.prefab | 127 ++++++------- .../Prefabs/ColorPickerActivator.prefab | 173 +++++++++--------- 7 files changed, 199 insertions(+), 170 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 7306f5950..1cb515be5 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -408,11 +408,11 @@ private void GeneratePointerCapsTriangles(List triangles) triangles.Add(kSides * 2 + 1); } - private void SetupAnnotation() + bool SetupAnnotation() { m_IsValidStroke = m_CustomPointerObject.activeSelf; if (!m_IsValidStroke) - return; + return false; SetupHolder(); @@ -439,6 +439,8 @@ private void SetupAnnotation() m_CurrentMesh = new Mesh(); m_CurrentMesh.name = "Annotation"; + + return true; } private void SetupHolder() @@ -651,7 +653,6 @@ private void FinalizeMesh() m_CurrentMesh.RecalculateBounds(); m_CurrentMesh.RecalculateNormals(); - m_CurrentMesh.Optimize(); m_CurrentMesh.UploadMeshData(true); @@ -732,21 +733,32 @@ private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, in public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var annotationInput = input as AnnotationInput; - + if (annotationInput.draw.wasJustPressed) - SetupAnnotation(); + { + if (SetupAnnotation()) + consumeControl(annotationInput.draw); + } else if (m_IsValidStroke) { + consumeControl(annotationInput.draw); if (annotationInput.draw.isHeld) UpdateAnnotation(); else if (annotationInput.draw.wasJustReleased) FinalizeMesh(); } else if (annotationInput.undo.wasJustPressed) + { + consumeControl(annotationInput.undo); UndoLast(); + } - if (annotationInput.changeBrushSize.value != 0) + if (!Mathf.Approximately(annotationInput.changeBrushSize.value, 0)) + { HandleBrushSize(annotationInput.changeBrushSize.value); + consumeControl(annotationInput.changeBrushSize); + consumeControl(annotationInput.vertical); + } } } diff --git a/Tools/AnnotationTool/Input/AnnotationInput.asset b/Tools/AnnotationTool/Input/AnnotationInput.asset index e6025df19..09f6abe08 100644 --- a/Tools/AnnotationTool/Input/AnnotationInput.asset +++ b/Tools/AnnotationTool/Input/AnnotationInput.asset @@ -11,11 +11,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} m_Name: AnnotationInput m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Actions: - {fileID: 114000013162093460} - {fileID: 114000010589948208} - {fileID: 114000012503875562} + - {fileID: 114574627476091900} m_ControlSchemes: - m_Name: AnnotationInput m_DeviceSlots: @@ -45,7 +45,16 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 3 + - controlIndex: 18 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 1 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -67,7 +76,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} m_Name: ChangeBrushSize m_EditorClassIdentifier: - m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} m_ActionIndex: 1 m_ControlData: @@ -88,7 +96,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} m_Name: Undo m_EditorClassIdentifier: - m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} m_ActionIndex: 2 m_ControlData: @@ -109,7 +116,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} m_Name: Draw m_EditorClassIdentifier: - m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} m_ActionIndex: 0 m_ControlData: @@ -119,3 +125,23 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Draw defaultValue: 0 +--- !u!114 &114574627476091900 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Vertical + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 3 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Vertical + defaultValue: 0 diff --git a/Tools/AnnotationTool/Input/AnnotationInput.cs b/Tools/AnnotationTool/Input/AnnotationInput.cs index 30c34db45..785f77ab6 100644 --- a/Tools/AnnotationTool/Input/AnnotationInput.cs +++ b/Tools/AnnotationTool/Input/AnnotationInput.cs @@ -10,5 +10,6 @@ public AnnotationInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @draw { get { return (ButtonInputControl)this[0]; } } public AxisInputControl @changeBrushSize { get { return (AxisInputControl)this[1]; } } public ButtonInputControl @undo { get { return (ButtonInputControl)this[2]; } } + public AxisInputControl @vertical { get { return (AxisInputControl)this[3]; } } } } diff --git a/Tools/AnnotationTool/Materials/AnnotationShader.shader b/Tools/AnnotationTool/Materials/AnnotationShader.shader index d66cbe36d..a37dac156 100644 --- a/Tools/AnnotationTool/Materials/AnnotationShader.shader +++ b/Tools/AnnotationTool/Materials/AnnotationShader.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "EditorVR/Annotation/Line" { @@ -55,7 +57,7 @@ Shader "EditorVR/Annotation/Line" { VertexOutput o = (VertexOutput)0; o.uv0 = i.texcoord0; - o.pos = mul(UNITY_MATRIX_MVP, i.vertex); + o.pos = UnityObjectToClipPos(i.vertex); return o; } diff --git a/Tools/AnnotationTool/Materials/BrushConeShader.shader b/Tools/AnnotationTool/Materials/BrushConeShader.shader index 5ae5d986c..9dacf2ae6 100644 --- a/Tools/AnnotationTool/Materials/BrushConeShader.shader +++ b/Tools/AnnotationTool/Materials/BrushConeShader.shader @@ -1,3 +1,5 @@ +// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' + Shader "EditorVR/Annotation/Brush" { @@ -52,7 +54,7 @@ Shader "EditorVR/Annotation/Brush" { VertexOutput o = (VertexOutput)0; o.uv0 = i.texcoord0; - o.pos = mul(UNITY_MATRIX_MVP, i.vertex); + o.pos = UnityObjectToClipPos(i.vertex); return o; } diff --git a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab index a7f13677d..62b83e662 100644 --- a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab +++ b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab @@ -16,11 +16,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012429854860} - - 222: {fileID: 222000011738690670} - - 114: {fileID: 114000011659273912} + - component: {fileID: 224000012429854860} + - component: {fileID: 222000011738690670} + - component: {fileID: 114000011659273912} m_Layer: 5 m_Name: SmallSizeImage m_TagString: Untagged @@ -33,11 +33,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013958544464} - - 222: {fileID: 222000010512651690} - - 114: {fileID: 114000013227729880} + - component: {fileID: 224000013958544464} + - component: {fileID: 222000010512651690} + - component: {fileID: 114000013227729880} m_Layer: 5 m_Name: Background m_TagString: Untagged @@ -50,13 +50,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010313966380} - - 223: {fileID: 223000013517572560} - - 114: {fileID: 114000012280541332} - - 114: {fileID: 114000011439948932} - - 114: {fileID: 114000010188600316} + - component: {fileID: 224000010313966380} + - component: {fileID: 223000013517572560} + - component: {fileID: 114000012280541332} + - component: {fileID: 114000011439948932} + - component: {fileID: 114000010188600316} m_Layer: 5 m_Name: BrushSizeUI m_TagString: Untagged @@ -69,10 +69,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010302154246} - - 114: {fileID: 114000012898989976} + - component: {fileID: 224000010302154246} + - component: {fileID: 114000012898989976} m_Layer: 5 m_Name: Slider m_TagString: Untagged @@ -85,11 +85,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012952319812} - - 222: {fileID: 222000012566840462} - - 114: {fileID: 114000012817225156} + - component: {fileID: 224000012952319812} + - component: {fileID: 222000012566840462} + - component: {fileID: 114000012817225156} m_Layer: 5 m_Name: Slider m_TagString: Untagged @@ -102,11 +102,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012965305110} - - 222: {fileID: 222000011049661008} - - 114: {fileID: 114000010590218436} + - component: {fileID: 224000012965305110} + - component: {fileID: 222000011049661008} + - component: {fileID: 114000010590218436} m_Layer: 5 m_Name: Handle m_TagString: Untagged @@ -119,11 +119,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012602292052} - - 222: {fileID: 222000011346353818} - - 114: {fileID: 114000012234307126} + - component: {fileID: 224000012602292052} + - component: {fileID: 222000011346353818} + - component: {fileID: 114000012234307126} m_Layer: 5 m_Name: LargeSizeImage m_TagString: Untagged @@ -136,12 +136,12 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010282135770} - - 222: {fileID: 222000013985520966} - - 114: {fileID: 114000011610748400} - - 114: {fileID: 114000010580475510} + - component: {fileID: 224000010282135770} + - component: {fileID: 222000013985520966} + - component: {fileID: 114000011610748400} + - component: {fileID: 114000010580475510} m_Layer: 5 m_Name: SliderMask m_TagString: Untagged @@ -154,9 +154,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013752871822} + - component: {fileID: 224000013752871822} m_Layer: 5 m_Name: Handle Slide Area m_TagString: Untagged @@ -169,10 +169,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011445143916} - - 222: {fileID: 222000010361401928} + - component: {fileID: 224000011445143916} + - component: {fileID: 222000010361401928} m_Layer: 5 m_Name: EndPoints m_TagString: Untagged @@ -185,11 +185,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013742708240} - - 222: {fileID: 222000012902449500} - - 114: {fileID: 114000011019955918} + - component: {fileID: 224000013742708240} + - component: {fileID: 222000012902449500} + - component: {fileID: 114000011019955918} m_Layer: 5 m_Name: Background m_TagString: Untagged @@ -208,7 +208,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e7f7403e35cc7f54489fcfaaebc3aa83, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_SliderHandle: {fileID: 224000012965305110} m_Slider: {fileID: 114000012898989976} --- !u!114 &114000010580475510 @@ -222,7 +221,6 @@ MonoBehaviour: m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_ShowMaskGraphic: 0 --- !u!114 &114000010590218436 MonoBehaviour: @@ -235,7 +233,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 @@ -263,7 +260,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 0} m_RaycastTarget: 1 @@ -291,7 +287,6 @@ MonoBehaviour: m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_IgnoreReversedGraphics: 0 m_BlockingObjects: 0 m_BlockingMask: @@ -308,7 +303,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -336,7 +330,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 1} m_RaycastTarget: 0 @@ -364,7 +357,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 0.2509804, g: 0.2509804, b: 0.2509804, a: 1} m_RaycastTarget: 0 @@ -392,7 +384,6 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_UiScaleMode: 0 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 @@ -414,7 +405,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 1} m_RaycastTarget: 0 @@ -442,7 +432,6 @@ MonoBehaviour: m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Navigation: m_Mode: 3 m_SelectOnUp: {fileID: 0} @@ -502,7 +491,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 1 @@ -574,7 +562,7 @@ Canvas: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012251850158} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 2 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -583,8 +571,9 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 - m_SortingOrder: 0 + m_SortingOrder: 1 m_TargetDisplay: 0 --- !u!224 &224000010282135770 RectTransform: @@ -595,11 +584,11 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -1.2434494e-14, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000012952319812} m_Father: {fileID: 224000010313966380} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -55.800014, y: 0.9999981} @@ -614,12 +603,12 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013742708240} - {fileID: 224000013752871822} m_Father: {fileID: 224000010313966380} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} m_AnchoredPosition: {x: 2.25, y: 0} @@ -634,7 +623,6 @@ RectTransform: m_LocalRotation: {x: 0.7071012, y: -0.000000029802322, z: -0.000000702632, w: 0.70711243} m_LocalPosition: {x: 0, y: 0, z: -0.03} m_LocalScale: {x: 0.0001, y: 0.0001, z: 0.0001} - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: - {fileID: 224000013958544464} - {fileID: 224000010282135770} @@ -642,6 +630,7 @@ RectTransform: - {fileID: 224000010302154246} m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0.02} @@ -656,12 +645,12 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000012429854860} - {fileID: 224000012602292052} m_Father: {fileID: 224000010313966380} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -676,10 +665,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.125, y: 0.125, z: 0.125} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011445143916} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} m_AnchoredPosition: {x: 5, y: 0} @@ -694,10 +683,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 2.5, y: 2.5, z: 2.5} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011445143916} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} m_AnchoredPosition: {x: -5, y: 0} @@ -712,10 +701,10 @@ RectTransform: m_LocalRotation: {x: -1.852897e-22, y: 0.000000014901266, z: -0.70710665, w: 0.7071069} m_LocalPosition: {x: 0, y: 0, z: -0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} m_Children: [] m_Father: {fileID: 224000010282135770} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: -90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 43.80002, y: -1.0000011} @@ -729,11 +718,11 @@ RectTransform: m_GameObject: {fileID: 1000013640950356} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.25, y: 0.25, z: 0.25} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.625, y: 0.625, z: 0.625} m_Children: [] m_Father: {fileID: 224000013752871822} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: -0, y: 0} @@ -748,10 +737,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000010302154246} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -766,11 +755,11 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000012965305110} m_Father: {fileID: 224000010302154246} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: -61.25, y: 0} @@ -785,10 +774,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000010313966380} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab index 2e4f320f6..22fae8791 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab @@ -16,13 +16,13 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011933393472} - - 223: {fileID: 223000010278076522} - - 114: {fileID: 114000013959281966} - - 114: {fileID: 114000011474110792} - - 114: {fileID: 114000010240686482} + - component: {fileID: 224000011933393472} + - component: {fileID: 223000010278076522} + - component: {fileID: 114000013959281966} + - component: {fileID: 114000011474110792} + - component: {fileID: 114000010240686482} m_Layer: 5 m_Name: ColorPickerUI m_TagString: Untagged @@ -35,11 +35,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012841704540} - - 114: {fileID: 114000013627361928} - - 114: {fileID: 114000014269249202} + - component: {fileID: 4000012841704540} + - component: {fileID: 114000013627361928} + - component: {fileID: 114000014269249202} m_Layer: 5 m_Name: ColorPickerActivator m_TagString: Untagged @@ -52,12 +52,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013792078156} - - 222: {fileID: 222000013607042274} - - 114: {fileID: 114000010862220058} - - 114: {fileID: 114000012642262872} + - component: {fileID: 224000013792078156} + - component: {fileID: 222000013607042274} + - component: {fileID: 114000010862220058} + - component: {fileID: 114000012642262872} m_Layer: 5 m_Name: Viewport m_TagString: Untagged @@ -70,12 +70,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000010665089078} - - 33: {fileID: 33000012657744172} - - 23: {fileID: 23000013942706604} - - 64: {fileID: 64000011116907714} + - component: {fileID: 4000010665089078} + - component: {fileID: 33000012657744172} + - component: {fileID: 23000013942706604} + - component: {fileID: 64000011116907714} m_Layer: 5 m_Name: Base m_TagString: Untagged @@ -88,10 +88,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013901019326} - - 65: {fileID: 65000012153002324} + - component: {fileID: 224000013901019326} + - component: {fileID: 65000012153002324} m_Layer: 5 m_Name: Collider m_TagString: Untagged @@ -104,11 +104,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011891419810} - - 114: {fileID: 114000012907839542} - - 225: {fileID: 225000012229749264} + - component: {fileID: 224000011891419810} + - component: {fileID: 114000012907839542} + - component: {fileID: 225000012229749264} m_Layer: 5 m_Name: BrightnessSlider m_TagString: Untagged @@ -121,11 +121,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000010924652800} - - 33: {fileID: 33000010952925324} - - 23: {fileID: 23000011095290868} + - component: {fileID: 4000010924652800} + - component: {fileID: 33000010952925324} + - component: {fileID: 23000011095290868} m_Layer: 5 m_Name: ColorWheel m_TagString: Untagged @@ -138,11 +138,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011129790424} - - 222: {fileID: 222000010186370168} - - 114: {fileID: 114000013248295880} + - component: {fileID: 224000011129790424} + - component: {fileID: 222000010186370168} + - component: {fileID: 114000013248295880} m_Layer: 5 m_Name: Background m_TagString: Untagged @@ -155,9 +155,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013465431762} + - component: {fileID: 224000013465431762} m_Layer: 5 m_Name: Handle Slide Area m_TagString: Untagged @@ -170,9 +170,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000013117727556} + - component: {fileID: 4000013117727556} m_Layer: 5 m_Name: TargetScale m_TagString: Untagged @@ -185,11 +185,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012639415320} - - 222: {fileID: 222000013457728422} - - 114: {fileID: 114000010927911954} + - component: {fileID: 224000012639415320} + - component: {fileID: 222000013457728422} + - component: {fileID: 114000010927911954} m_Layer: 5 m_Name: ColorPicker m_TagString: Untagged @@ -202,9 +202,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012336507532} + - component: {fileID: 4000012336507532} m_Layer: 5 m_Name: GrowHolder m_TagString: Untagged @@ -217,11 +217,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013288384236} - - 222: {fileID: 222000011629875738} - - 114: {fileID: 114000012792763378} + - component: {fileID: 224000013288384236} + - component: {fileID: 222000011629875738} + - component: {fileID: 114000012792763378} m_Layer: 5 m_Name: Picker m_TagString: Untagged @@ -234,11 +234,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012070844378} - - 222: {fileID: 222000013866580918} - - 114: {fileID: 114000011559721380} + - component: {fileID: 224000012070844378} + - component: {fileID: 222000013866580918} + - component: {fileID: 114000011559721380} m_Layer: 5 m_Name: Handle m_TagString: Untagged @@ -251,9 +251,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000010343588658} + - component: {fileID: 4000010343588658} m_Layer: 5 m_Name: WheelHolder m_TagString: Untagged @@ -270,12 +270,12 @@ Transform: m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} m_LocalPosition: {x: 0.015, y: 0.0008, z: 0} m_LocalScale: {x: 0.029, y: 0.029, z: 0.029} - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: - {fileID: 4000010924652800} - {fileID: 224000011933393472} m_Father: {fileID: 4000012336507532} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!4 &4000010665089078 Transform: m_ObjectHideFlags: 1 @@ -285,10 +285,10 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.015, y: 0.0004, z: 0} m_LocalScale: {x: 0.5, y: 0.25, z: 0.5} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012336507532} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000010924652800 Transform: m_ObjectHideFlags: 1 @@ -298,10 +298,10 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000010343588658} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!4 &4000012336507532 Transform: m_ObjectHideFlags: 1 @@ -311,12 +311,12 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -0.015, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000010665089078} - {fileID: 4000010343588658} m_Father: {fileID: 4000012841704540} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012841704540 Transform: m_ObjectHideFlags: 1 @@ -326,12 +326,12 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000013117727556} - {fileID: 4000012336507532} m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013117727556 Transform: m_ObjectHideFlags: 1 @@ -341,10 +341,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0} m_LocalScale: {x: 4, y: 1, z: 4} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012841704540} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &23000011095290868 MeshRenderer: m_ObjectHideFlags: 1 @@ -359,7 +359,9 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_Materials: - {fileID: 2100000, guid: ed6062fbd167bed46b70b3ae75c81624, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -367,12 +369,13 @@ MeshRenderer: m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!23 &23000013942706604 MeshRenderer: @@ -388,7 +391,9 @@ MeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: f250eb9aab0312446bf01122291cf55e, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -396,12 +401,13 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!33 &33000010952925324 MeshFilter: @@ -428,6 +434,8 @@ MeshCollider: m_Enabled: 0 serializedVersion: 2 m_Convex: 0 + m_InflateMesh: 0 + m_SkinWidth: 0.01 m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} --- !u!65 &65000012153002324 BoxCollider: @@ -439,7 +447,7 @@ BoxCollider: m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 675.84, y: 844.8, z: 10} + m_Size: {x: 945.4, y: 1268, z: 10} m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114000010240686482 MonoBehaviour: @@ -452,7 +460,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ab372430e8c50ee47b774cdb4ac79e18, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_FadeTime: 0.25 m_ColorPicker: {fileID: 114000010862220058} m_BrightnessSlider: {fileID: 114000012907839542} @@ -470,7 +477,6 @@ MonoBehaviour: m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 @@ -497,7 +503,6 @@ MonoBehaviour: m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Content: {fileID: 224000013288384236} m_Horizontal: 1 m_Vertical: 1 @@ -529,7 +534,6 @@ MonoBehaviour: m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_IgnoreReversedGraphics: 0 m_BlockingObjects: 0 m_BlockingMask: @@ -546,7 +550,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 @@ -574,7 +577,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d26287cff9f94b448a1b36ffa9eccd4e, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Navigation: m_Mode: 3 m_SelectOnUp: {fileID: 0} @@ -611,7 +613,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 0 @@ -639,7 +640,6 @@ MonoBehaviour: m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Navigation: m_Mode: 3 m_SelectOnUp: {fileID: 0} @@ -699,7 +699,6 @@ MonoBehaviour: m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 @@ -726,7 +725,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_SelectionFlags: 3 --- !u!114 &114000013959281966 MonoBehaviour: @@ -739,7 +737,6 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_UiScaleMode: 0 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 @@ -761,7 +758,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 39742408926c5694d89876057a60578a, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_TargetScale: {fileID: 4000013117727556} m_Icon: {fileID: 4000012336507532} --- !u!222 &222000010186370168 @@ -801,7 +797,7 @@ Canvas: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010117119988} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 2 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -810,6 +806,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -822,10 +819,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011891419810} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.25} m_AnchorMax: {x: 1, y: 0.75} m_AnchoredPosition: {x: 0, y: 0} @@ -840,12 +837,12 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000011129790424} - {fileID: 224000013465431762} m_Father: {fileID: 224000011933393472} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -860,13 +857,13 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.001} m_LocalScale: {x: 0.00195, y: 0.00195, z: 0.00195} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000012639415320} - {fileID: 224000011891419810} - {fileID: 224000013901019326} m_Father: {fileID: 4000010343588658} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: -0.125} @@ -881,10 +878,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000013465431762} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 4.1, y: 0} @@ -899,11 +896,11 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013792078156} m_Father: {fileID: 224000011933393472} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -918,10 +915,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000013792078156} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: -256} @@ -936,11 +933,11 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000012070844378} m_Father: {fileID: 224000011891419810} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -955,11 +952,11 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013288384236} m_Father: {fileID: 224000012639415320} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -974,10 +971,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011933393472} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} From 9317fa20894a3966ca91cbbf77fbcc533f19dd78 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 1 Jun 2017 12:38:31 -0700 Subject: [PATCH 285/870] Follow code conventions; Remove unused code --- Tools/AnnotationTool/AnnotationTool.cs | 354 ++++++++---------- .../UserInterface/BrushSizeUI.cs | 19 +- .../UserInterface/ColorPickerActivator.cs | 12 +- .../UserInterface/ColorPickerSquareUI.cs | 9 +- .../UserInterface/ColorPickerUI.cs | 74 ++-- 5 files changed, 215 insertions(+), 253 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 1cb515be5..a344b1907 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR; -using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -12,49 +11,37 @@ [MainMenuItem("Annotation", "Create", "Draw in 3D")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesRayLocking { - public Transform rayOrigin { private get; set; } - public List otherRayOrigins { private get; set; } + [SerializeField] + ActionMap m_ActionMap; - public Transform menuOrigin { set; private get; } - public Transform alternateMenuOrigin { set; private get; } + [SerializeField] + Material m_AnnotationMaterial; - public Func customMenuOrigin { private get; set; } - public Func customAlternateMenuOrigin { private get; set; } + [SerializeField] + Material m_ConeMaterial; - public ActionMap actionMap - { - get { return m_ActionMap; } - } [SerializeField] - ActionMap m_ActionMap; + GameObject m_BrushSizePrefab; + + [SerializeField] + GameObject m_ColorPickerActivatorPrefab; Action onBrushSizeChanged { set; get; } - const int kInitialListSize = 32767; + const int k_InitialListSize = 32767; - List m_Points = new List(kInitialListSize); - List m_Forwards = new List(kInitialListSize); - List m_Widths = new List(kInitialListSize); - List m_Rights = new List(kInitialListSize); + List m_Points = new List(k_InitialListSize); + List m_Forwards = new List(k_InitialListSize); + List m_Widths = new List(k_InitialListSize); + List m_Rights = new List(k_InitialListSize); MeshFilter m_CurrentMeshFilter; Color m_ColorToUse = Color.white; Mesh m_CurrentMesh; Matrix4x4 m_WorldToLocalMesh; - [SerializeField] - Material m_AnnotationMaterial; - - [SerializeField] - Material m_ConeMaterial; Material m_ConeMaterialInstance; - - [SerializeField] - GameObject m_ColorPickerPrefab; ColorPickerUI m_ColorPicker; - - [SerializeField] - GameObject m_BrushSizePrefab; BrushSizeUI m_BrushSizeUi; Transform m_AnnotationHolder; @@ -65,20 +52,32 @@ public ActionMap actionMap Mesh m_CustomPointerMesh; GameObject m_CustomPointerObject; - [SerializeField] - GameObject m_ColorPickerActivatorPrefab; GameObject m_ColorPickerActivator; - const float kTopMinRadius = 0.0025f; - const float kTopMaxRadius = 0.05f; - const float kBottomRadius = 0.01f; - const float kTipDistance = 0.05f; - const int kSides = 16; + const float k_TopMinRadius = 0.0025f; + const float k_TopMaxRadius = 0.05f; + const float k_BottomRadius = 0.01f; + const float k_TipDistance = 0.05f; + const int k_Sides = 16; - float m_CurrentRadius = kTopMinRadius; + float m_CurrentRadius = k_TopMinRadius; List m_UndoList = new List(); + public Transform rayOrigin { private get; set; } + public List otherRayOrigins { private get; set; } + + public Transform menuOrigin { set; private get; } + public Transform alternateMenuOrigin { set; private get; } + + public Func customMenuOrigin { private get; set; } + public Func customAlternateMenuOrigin { private get; set; } + + public ActionMap actionMap + { + get { return m_ActionMap; } + } + void OnDestroy() { if (m_IsRayHidden) @@ -104,7 +103,7 @@ void Update() HandleRayOrigins(); } - private void HideRay() + void HideRay() { if (!m_IsRayHidden) { @@ -114,7 +113,7 @@ private void HideRay() } } - private void HandleRayOrigins() + void HandleRayOrigins() { if (rayOrigin != null) { @@ -144,7 +143,7 @@ private void HandleRayOrigins() } } - private void UndoLast() + void UndoLast() { if (m_UndoList.Count > 0) { @@ -156,7 +155,7 @@ private void UndoLast() if (m_AnnotationHolder.childCount == 0) { var root = m_AnnotationHolder.parent; - int index = m_AnnotationHolder.GetSiblingIndex(); + var index = m_AnnotationHolder.GetSiblingIndex(); DestroyImmediate(m_AnnotationHolder.gameObject); if (root.childCount == 0) @@ -172,7 +171,7 @@ private void UndoLast() } } - private void CheckBrushSizeUi() + void CheckBrushSizeUi() { if (m_BrushSizeUi == null) { @@ -186,14 +185,14 @@ private void CheckBrushSizeUi() m_BrushSizeUi.onValueChanged = (val) => { - m_CurrentRadius = Mathf.Lerp(kTopMinRadius, kTopMaxRadius, val); + m_CurrentRadius = Mathf.Lerp(k_TopMinRadius, k_TopMaxRadius, val); ResizePointer(); }; onBrushSizeChanged = m_BrushSizeUi.ChangeSliderValue; } } - private void ShowColorPicker(Transform otherRayOrigin) + void ShowColorPicker(Transform otherRayOrigin) { if (m_IsValidStroke) return; @@ -206,7 +205,7 @@ private void ShowColorPicker(Transform otherRayOrigin) m_CustomPointerObject.SetActive(false); } - private void HideColorPicker() + void HideColorPicker() { if (m_ColorPicker && m_ColorPicker.enabled) { @@ -217,36 +216,7 @@ private void HideColorPicker() } } - private void CreateColorPicker(Transform otherRayOrigin) - { - var colorPickerObj = this.InstantiateUI(m_ColorPickerPrefab); - m_ColorPicker = colorPickerObj.GetComponent(); - m_ColorPicker.onHideCalled = HideColorPicker; - m_ColorPicker.toolRayOrigin = rayOrigin; - m_ColorPicker.onColorPicked = OnColorPickerValueChanged; - - PositionColorPicker(otherRayOrigin); - - this.UnlockRay(rayOrigin, this); - this.ShowDefaultRay(rayOrigin); - m_CustomPointerObject.SetActive(false); - } - - private void PositionColorPicker(Transform otherRayOrigin) - { - var rayPos = rayOrigin.position; - var otherRayPos = otherRayOrigin.position; - var halfPos = (rayPos + otherRayPos) / 2f; - var upVector = Vector3.up * 0.1f; - var forwardVector = VRView.viewerCamera.transform.forward * 0.025f; - var targetPosition = halfPos + upVector + forwardVector; - - var pickerTrans = m_ColorPicker.transform; - pickerTrans.position = targetPosition; - pickerTrans.rotation = Quaternion.LookRotation(pickerTrans.position - VRView.viewerCamera.transform.position); - } - - private void OnColorPickerValueChanged(Color newColor) + void OnColorPickerValueChanged(Color newColor) { m_ColorToUse = newColor; @@ -256,23 +226,23 @@ private void OnColorPickerValueChanged(Color newColor) m_BrushSizeUi.OnBrushColorChanged(newColor); } - private void HandleBrushSize(float value) + void HandleBrushSize(float value) { if (m_CustomPointerMesh != null) { - // For vive controllers, use 1:1 touchpad setting. - if (VRSettings.loadedDeviceName == "OpenVR") - m_CurrentRadius = Mathf.Lerp(kTopMinRadius, kTopMaxRadius, (value + 1) / 2f); - // For touch and hydra, let the thumbstick gradually modifiy the width. - else + if (VRSettings.loadedDeviceName == "OpenVR") // For vive controllers, use 1:1 touchpad setting. + { + m_CurrentRadius = Mathf.Lerp(k_TopMinRadius, k_TopMaxRadius, (value + 1) / 2f); + } + else // For touch and hydra, let the thumbstick gradually modifiy the width. { m_CurrentRadius += value * Time.unscaledDeltaTime * .1f; - m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, kTopMinRadius, kTopMaxRadius); + m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, k_TopMinRadius, k_TopMaxRadius); } if (m_BrushSizeUi && onBrushSizeChanged != null) { - var ratio = Mathf.InverseLerp(kTopMinRadius, kTopMaxRadius, m_CurrentRadius); + var ratio = Mathf.InverseLerp(k_TopMinRadius, k_TopMaxRadius, m_CurrentRadius); onBrushSizeChanged(ratio); } @@ -280,22 +250,22 @@ private void HandleBrushSize(float value) } } - private void ResizePointer() + void ResizePointer() { var vertices = m_CustomPointerMesh.vertices; - for (int i = kSides; i < kSides * 2; i++) + for (var i = k_Sides; i < k_Sides * 2; i++) { - float angle = (i / (float)kSides) * Mathf.PI * 2f; - float xPos = Mathf.Cos(angle) * m_CurrentRadius; - float yPos = Mathf.Sin(angle) * m_CurrentRadius; + var angle = (i / (float)k_Sides) * Mathf.PI * 2f; + var xPos = Mathf.Cos(angle) * m_CurrentRadius; + var yPos = Mathf.Sin(angle) * m_CurrentRadius; - Vector3 point = new Vector3(xPos, yPos, kTipDistance); + var point = new Vector3(xPos, yPos, k_TipDistance); vertices[i] = point; } m_CustomPointerMesh.vertices = vertices; } - private void GenerateCustomPointer() + void GenerateCustomPointer() { if (m_CustomPointerMesh != null) return; @@ -319,33 +289,33 @@ private void GenerateCustomPointer() pointerTrans.localRotation = Quaternion.identity; } - private Vector3[] GeneratePointerVertices() + static Vector3[] GeneratePointerVertices() { - List points = new List(); + var points = new List(); - for (int capIndex = 0; capIndex < 2; capIndex++) + for (var capIndex = 0; capIndex < 2; capIndex++) { - float radius = capIndex == 0 ? kBottomRadius : Mathf.Lerp(kTopMaxRadius, kTopMinRadius, capIndex); + float radius = capIndex == 0 ? k_BottomRadius : Mathf.Lerp(k_TopMaxRadius, k_TopMinRadius, capIndex); - for (int i = 0; i < kSides; i++) + for (var i = 0; i < k_Sides; i++) { - float angle = (i / (float)kSides) * Mathf.PI * 2f; - float xPos = Mathf.Cos(angle) * radius; - float yPos = Mathf.Sin(angle) * radius; + var angle = (i / (float)k_Sides) * Mathf.PI * 2f; + var xPos = Mathf.Cos(angle) * radius; + var yPos = Mathf.Sin(angle) * radius; - Vector3 point = new Vector3(xPos, yPos, capIndex * kTipDistance); + var point = new Vector3(xPos, yPos, capIndex * k_TipDistance); points.Add(point); } } points.Add(new Vector3(0, 0, 0)); - points.Add(new Vector3(0, 0, kTipDistance)); + points.Add(new Vector3(0, 0, k_TipDistance)); return points.ToArray(); } - private int[] GeneratePointerTriangles() + static int[] GeneratePointerTriangles() { - List triangles = new List(); + var triangles = new List(); GeneratePointerSideTriangles(triangles); GeneratePointerCapsTriangles(triangles); @@ -353,32 +323,32 @@ private int[] GeneratePointerTriangles() return triangles.ToArray(); } - private void GeneratePointerSideTriangles(List triangles) + static void GeneratePointerSideTriangles(List triangles) { - for (int i = 1; i < kSides; i++) + for (var i = 1; i < k_Sides; i++) { - int lowerLeft = i - 1; - int lowerRight = i; - int upperLeft = i + kSides - 1; - int upperRight = i + kSides; + var lowerLeft = i - 1; + var lowerRight = i; + var upperLeft = i + k_Sides - 1; + var upperRight = i + k_Sides; - int[] sideTriangles = VerticesToPolygon(upperRight, upperLeft, lowerRight, lowerLeft); + var sideTriangles = VerticesToPolygon(upperRight, upperLeft, lowerRight, lowerLeft); triangles.AddRange(sideTriangles); } // Finish the side with a polygon that loops around from the end to the start vertices. - int[] finishTriangles = VerticesToPolygon(kSides, kSides * 2 - 1, 0, kSides - 1); + int[] finishTriangles = VerticesToPolygon(k_Sides, k_Sides * 2 - 1, 0, k_Sides - 1); triangles.AddRange(finishTriangles); } - private void GeneratePointerCapsTriangles(List triangles) + static void GeneratePointerCapsTriangles(List triangles) { // Generate the bottom circle cap. - for (int i = 1; i < kSides; i++) + for (var i = 1; i < k_Sides; i++) { - int lowerLeft = i - 1; - int lowerRight = i; - int upperLeft = kSides * 2; + var lowerLeft = i - 1; + var lowerRight = i; + const int upperLeft = k_Sides * 2; triangles.Add(upperLeft); triangles.Add(lowerRight); @@ -386,16 +356,16 @@ private void GeneratePointerCapsTriangles(List triangles) } // Close the bottom circle cap with a start-end loop triangle. - triangles.Add(kSides * 2); + triangles.Add(k_Sides * 2); triangles.Add(0); - triangles.Add(kSides - 1); + triangles.Add(k_Sides - 1); // Generate the top circle cap. - for (int i = kSides + 1; i < kSides * 2; i++) + for (var i = k_Sides + 1; i < k_Sides * 2; i++) { - int lowerLeft = i - 1; - int lowerRight = i; - int upperLeft = kSides * 2 + 1; + var lowerLeft = i - 1; + var lowerRight = i; + const int upperLeft = k_Sides * 2 + 1; triangles.Add(lowerLeft); triangles.Add(lowerRight); @@ -403,9 +373,9 @@ private void GeneratePointerCapsTriangles(List triangles) } // Close the top circle cap with a start-end loop triangle. - triangles.Add(kSides * 2 - 1); - triangles.Add(kSides); - triangles.Add(kSides * 2 + 1); + triangles.Add(k_Sides * 2 - 1); + triangles.Add(k_Sides); + triangles.Add(k_Sides * 2 + 1); } bool SetupAnnotation() @@ -421,15 +391,15 @@ bool SetupAnnotation() m_Widths.Clear(); m_Rights.Clear(); - GameObject go = new GameObject("Annotation " + m_AnnotationHolder.childCount); + var go = new GameObject("Annotation " + m_AnnotationHolder.childCount); m_UndoList.Add(go); - Transform goTrans = go.transform; + var goTrans = go.transform; goTrans.SetParent(m_AnnotationHolder); goTrans.position = rayOrigin.position; m_CurrentMeshFilter = go.AddComponent(); - MeshRenderer mRenderer = go.AddComponent(); + var mRenderer = go.AddComponent(); var matToUse = Instantiate(m_AnnotationMaterial); matToUse.SetColor("_EmissionColor", m_ColorToUse); @@ -443,12 +413,12 @@ bool SetupAnnotation() return true; } - private void SetupHolder() + void SetupHolder() { var mainHolder = GameObject.Find("Annotations") ?? new GameObject("Annotations"); var mainHolderTrans = mainHolder.transform; - GameObject newSession = GetNewSessionHolder(mainHolderTrans); + var newSession = GetNewSessionHolder(mainHolderTrans); if (!newSession) newSession = new GameObject("Group " + mainHolderTrans.childCount); @@ -456,23 +426,23 @@ private void SetupHolder() m_AnnotationHolder.SetParent(mainHolder.transform); } - private GameObject GetNewSessionHolder(Transform mainHolderTrans) + GameObject GetNewSessionHolder(Transform mainHolderTrans) { const float kGroupingDistance = .3f; GameObject newSession = null; - for (int i = 0; i < mainHolderTrans.childCount; i++) + for (var i = 0; i < mainHolderTrans.childCount; i++) { var child = mainHolderTrans.GetChild(i); child.name = "Group " + i; - if (!newSession) + if (newSession == null) { var renderers = child.GetComponentsInChildren(); if (renderers.Length > 0) { - Bounds bound = renderers[0].bounds; - for (int r = 1; r < renderers.Length; r++) + var bound = renderers[0].bounds; + for (var r = 1; r < renderers.Length; r++) bound.Encapsulate(renderers[r].bounds); if (bound.Contains(rayOrigin.position)) @@ -489,12 +459,12 @@ private GameObject GetNewSessionHolder(Transform mainHolderTrans) return newSession; } - private void UpdateAnnotation() + void UpdateAnnotation() { - Vector3 rayForward = rayOrigin.forward; - Vector3 rayRight = rayOrigin.right; - Vector3 worldPoint = rayOrigin.position + rayForward * kTipDistance; - Vector3 localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); + var rayForward = rayOrigin.forward; + var rayRight = rayOrigin.right; + var worldPoint = rayOrigin.position + rayForward * k_TipDistance; + var localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); if (m_Points.Count > 0) { @@ -514,7 +484,7 @@ private void UpdateAnnotation() PointsToMesh(); } - private void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, Vector3 rayRight) + void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, Vector3 rayRight) { if (m_Points.Count > 1) { @@ -538,7 +508,7 @@ private void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, V } } - private void PointsToMesh() + void PointsToMesh() { if (m_Points.Count < 4) return; @@ -546,9 +516,9 @@ private void PointsToMesh() if (m_CurrentMesh == null) m_CurrentMesh = new Mesh(); - List newVertices = new List(); - List newTriangles = new List(); - List newUvs = new List(); + var newVertices = new List(); + var newTriangles = new List(); + var newUvs = new List(); LineToPlane(newVertices); SmoothPlane(newVertices); @@ -571,15 +541,15 @@ private void PointsToMesh() m_CurrentMeshFilter.sharedMesh = m_CurrentMesh; } - private void LineToPlane(List newVertices) + void LineToPlane(List newVertices) { - Vector3 prevDirection = (m_Points[1] - m_Points[0]).normalized; + var prevDirection = (m_Points[1] - m_Points[0]).normalized; - for (int i = 1; i < m_Points.Count; i++) + for (var i = 1; i < m_Points.Count; i++) { - Vector3 nextPoint = m_Points[i]; - Vector3 thisPoint = m_Points[i - 1]; - Vector3 direction = (nextPoint - thisPoint).normalized; + var nextPoint = m_Points[i]; + var thisPoint = m_Points[i - 1]; + var direction = (nextPoint - thisPoint).normalized; // For optimization, ignore inner points of an almost straight line. // The last point is an exception, it is required for a smooth drawing experience. @@ -591,13 +561,13 @@ private void LineToPlane(List newVertices) var cross2 = Vector3.Cross(direction, m_Forwards[i - 1]).normalized; var cross = Vector3.Lerp(cross1, cross2, 1 - ratio).normalized; - float lowWidth = Mathf.Min((newVertices.Count / 2) * 0.1f, 1); - float highWidth = Mathf.Min((m_Points.Count - (i + 3)) * 0.25f, 1); - float unclampedWidth = m_Widths[i - 1] * Mathf.Clamp01(i < m_Points.Count / 2f ? lowWidth : highWidth); - float width = Mathf.Clamp(unclampedWidth, kTopMinRadius, kTopMaxRadius); + var lowWidth = Mathf.Min((newVertices.Count / 2) * 0.1f, 1); + var highWidth = Mathf.Min((m_Points.Count - (i + 3)) * 0.25f, 1); + var unclampedWidth = m_Widths[i - 1] * Mathf.Clamp01(i < m_Points.Count / 2f ? lowWidth : highWidth); + var width = Mathf.Clamp(unclampedWidth, k_TopMinRadius, k_TopMaxRadius); - Vector3 left = thisPoint - cross * width; - Vector3 right = thisPoint + cross * width; + var left = thisPoint - cross * width; + var right = thisPoint + cross * width; newVertices.Add(left); newVertices.Add(right); @@ -606,46 +576,44 @@ private void LineToPlane(List newVertices) } } - private void SmoothPlane(List newVertices) + static void SmoothPlane(List newVertices) { const float kSmoothRatio = 0.75f; - for (int side = 0; side < 2; side++) + for (var side = 0; side < 2; side++) { - for (int i = 4; i < newVertices.Count - 4 - side; i++) + for (var i = 4; i < newVertices.Count - 4 - side; i++) { - Vector3 average = (newVertices[i - 4 + side] + newVertices[i - 2 + side] + newVertices[i + 2 + side] + newVertices[i + 4 + side]) / 4f; - float dynamicSmooth = 1 / Vector3.Distance(newVertices[i + side], average); + var average = (newVertices[i - 4 + side] + newVertices[i - 2 + side] + newVertices[i + 2 + side] + newVertices[i + 4 + side]) / 4f; + var dynamicSmooth = 1 / Vector3.Distance(newVertices[i + side], average); newVertices[i + side] = Vector3.Lerp(newVertices[i + side], average, kSmoothRatio * dynamicSmooth); } } } - private void TriangulatePlane(List newTriangles, int vertexCount) + static void TriangulatePlane(List newTriangles, int vertexCount) { - for (int i = 3; i < vertexCount; i += 2) + for (var i = 3; i < vertexCount; i += 2) { - int upperLeft = i - 1; - int upperRight = i; - int lowerLeft = i - 3; - int lowerRight = i - 2; + var upperLeft = i - 1; + var upperRight = i; + var lowerLeft = i - 3; + var lowerRight = i - 2; - int[] triangles = VerticesToPolygon(upperLeft, upperRight, lowerLeft, lowerRight); + var triangles = VerticesToPolygon(upperLeft, upperRight, lowerLeft, lowerRight); newTriangles.AddRange(triangles); } } - private void CalculateUvs(List newUvs, List newVertices) + static void CalculateUvs(List newUvs, List newVertices) { - for (int i = 0; i < newVertices.Count; i += 2) + for (var i = 0; i < newVertices.Count; i += 2) { - for (int side = 0; side < 2; side++) - { - newUvs.Add(new Vector2(side, i / 2)); - } + newUvs.Add(new Vector2(0, i * 0.5f)); + newUvs.Add(new Vector2(1, i * 0.5f)); } } - private void FinalizeMesh() + void FinalizeMesh() { m_IsValidStroke = false; @@ -659,36 +627,40 @@ private void FinalizeMesh() CenterHolder(); } - private void CenterMesh() + void CenterMesh() { if (m_CurrentMesh == null || m_CurrentMesh.vertexCount == 0) return; - Vector3 center = Vector3.zero; + var center = Vector3.zero; var vertices = m_CurrentMesh.vertices; - for (int i = 0; i < m_CurrentMesh.vertexCount; i++) + for (var i = 0; i < m_CurrentMesh.vertexCount; i++) + { center += vertices[i]; + } center /= m_CurrentMesh.vertexCount; - for (int i = 0; i < m_CurrentMesh.vertexCount; i++) + for (var i = 0; i < m_CurrentMesh.vertexCount; i++) + { vertices[i] -= center; + } m_CurrentMesh.vertices = vertices; m_CurrentMeshFilter.transform.localPosition += center; } - private void CenterHolder() + void CenterHolder() { if (m_AnnotationHolder == null || m_AnnotationHolder.childCount == 0) return; - List childWorldPositions = new List(); - Vector3 center = Vector3.zero; + var childWorldPositions = new List(); + var center = Vector3.zero; - for (int i = 0; i < m_AnnotationHolder.childCount; i++) + for (var i = 0; i < m_AnnotationHolder.childCount; i++) { var worldPos = m_AnnotationHolder.GetChild(i).position; childWorldPositions.Add(worldPos); @@ -698,15 +670,17 @@ private void CenterHolder() center /= m_AnnotationHolder.childCount; m_AnnotationHolder.localPosition += center; - for (int i = 0; i < m_AnnotationHolder.childCount; i++) + for (var i = 0; i < m_AnnotationHolder.childCount; i++) + { m_AnnotationHolder.GetChild(i).position = childWorldPositions[i]; + } } - private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) + static int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) { - int triangleCount = doubleSided ? 12 : 6; - int[] triangles = new int[triangleCount]; - int index = 0; + var triangleCount = doubleSided ? 12 : 6; + var triangles = new int[triangleCount]; + var index = 0; triangles[index++] = upperLeft; triangles[index++] = lowerRight; @@ -724,7 +698,7 @@ private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, in triangles[index++] = upperRight; triangles[index++] = upperLeft; - triangles[index++] = lowerRight; + triangles[index] = lowerRight; } return triangles; @@ -732,7 +706,7 @@ private int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, in public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var annotationInput = input as AnnotationInput; + var annotationInput = (AnnotationInput)input; if (annotationInput.draw.wasJustPressed) { @@ -742,6 +716,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon else if (m_IsValidStroke) { consumeControl(annotationInput.draw); + if (annotationInput.draw.isHeld) UpdateAnnotation(); else if (annotationInput.draw.wasJustReleased) @@ -760,5 +735,4 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon consumeControl(annotationInput.vertical); } } - } diff --git a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs index 5da298c40..d29a4bba7 100644 --- a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs +++ b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs @@ -1,23 +1,21 @@ +using System; using UnityEngine; -using System.Collections; using UnityEngine.UI; -using System; public class BrushSizeUI : MonoBehaviour { - - public Action onValueChanged { private get; set; } + const float k_MinSize = 0.625f; + const float k_MaxSize = 12.5f; [SerializeField] - private RectTransform m_SliderHandle; + RectTransform m_SliderHandle; [SerializeField] - private Slider m_Slider; + Slider m_Slider; - private Image m_SliderHandleImage; + Image m_SliderHandleImage; - private const float kMinSize = 0.625f; - private const float kMaxSize = 12.5f; + public Action onValueChanged { private get; set; } void Start() { @@ -26,7 +24,7 @@ void Start() public void OnSliderValueChanged(float value) { - m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(kMinSize, kMaxSize, value); + m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(k_MinSize, k_MaxSize, value); if (onValueChanged != null) onValueChanged(value); @@ -41,5 +39,4 @@ public void OnBrushColorChanged(Color newColor) { m_SliderHandleImage.color = newColor; } - } diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index 719a3cc62..b08080421 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -5,18 +5,17 @@ public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler { + [SerializeField] + Transform m_TargetScale; [SerializeField] - private Transform m_TargetScale; + Transform m_Icon; + + Coroutine m_HighlightCoroutine; public Transform rayOrigin { private get; set; } public Action showColorPicker { private get; set; } public Action hideColorPicker { private get; set; } - - [SerializeField] - private Transform m_Icon; - - private Coroutine m_HighlightCoroutine; public void OnPointerClick(PointerEventData eventData) { @@ -59,5 +58,4 @@ IEnumerator Highlight(bool transitionIn = true) m_Icon.localScale = targetScale; } - } diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs index 01c534b46..75246623d 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs @@ -1,13 +1,11 @@ -using UnityEngine; -using System.Collections; -using UnityEngine.UI; -using UnityEngine.EventSystems; using System; +using UnityEngine.EventSystems; +using UnityEngine.UI; public class ColorPickerSquareUI : Selectable, IDragHandler, IBeginDragHandler, IEndDragHandler { + bool m_AllowDragEvents; - private bool m_AllowDragEvents; public Action onDrag { private get; set; } public void OnBeginDrag(PointerEventData eventData) @@ -25,5 +23,4 @@ public void OnEndDrag(PointerEventData eventData) { m_AllowDragEvents = false; } - } diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index b1cd1f9be..8b3202131 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -6,37 +6,33 @@ public class ColorPickerUI : MonoBehaviour, IPointerExitHandler { - - public Transform toolRayOrigin { private get; set; } - - public Action onColorPicked { private get; set; } - - public Action onHideCalled { private get; set; } - [SerializeField] - private float m_FadeTime; + float m_FadeTime; [SerializeField] - private RawImage m_ColorPicker; + RawImage m_ColorPicker; [SerializeField] - private Slider m_BrightnessSlider; + RawImage m_SliderBackground; [SerializeField] - private RawImage m_SliderBackground; + RectTransform m_Picker; + + Vector3 m_PickerTargetPosition; [SerializeField] - private RectTransform m_Picker; + ColorPickerSquareUI m_ColorPickerSquare; - private Vector3 m_PickerTargetPosition; + Texture2D m_BrightnessBarTexture; + Texture2D m_ColorPickerTexture; - [SerializeField] - private ColorPickerSquareUI m_ColorPickerSquare; + Coroutine m_FadeCoroutine; + + public Transform toolRayOrigin { private get; set; } - private Texture2D m_BrightnessBarTexture; - private Texture2D m_ColorPickerTexture; + public Action onColorPicked { private get; set; } - private Coroutine m_FadeCoroutine; + public Action onHideCalled { private get; set; } void Start() { @@ -78,15 +74,15 @@ public void OnSliderChanged(float val) PositionToColor(); } - private IEnumerator FadeCanvas(bool fadeOut) + IEnumerator FadeCanvas(bool fadeOut) { enabled = !fadeOut; m_Picker.localPosition = m_PickerTargetPosition; var canvasGroup = GetComponentInChildren(); - float current = canvasGroup.alpha; - float start = fadeOut ? 1 : 0; - float target = 1 - start; + var current = canvasGroup.alpha; + var start = fadeOut ? 1 : 0; + var target = 1 - start; if (current == target) { @@ -94,7 +90,7 @@ private IEnumerator FadeCanvas(bool fadeOut) yield break; } - float ratio = fadeOut ? 1 - current : current; + var ratio = fadeOut ? 1 - current : current; while (ratio < 1) { canvasGroup.alpha = Mathf.Lerp(start, target, ratio); @@ -120,12 +116,12 @@ void OnDrag() var localRayPos = worldToLocal.MultiplyPoint3x4(toolRayOrigin.position); var localRayForward = worldToLocal.MultiplyVector(toolRayOrigin.forward).normalized; - float height = localRayPos.z; - float angle = Vector3.Angle(new Vector3(0, 0, height), localRayForward); - float sine = Mathf.Sin((90 - angle) * Mathf.Deg2Rad); + var height = localRayPos.z; + var angle = Vector3.Angle(new Vector3(0, 0, height), localRayForward); + var sine = Mathf.Sin((90 - angle) * Mathf.Deg2Rad); - float distance = Mathf.Abs(height / sine); - Vector2 point = localRayPos + localRayForward * distance; + var distance = Mathf.Abs(height / sine); + var point = localRayPos + localRayForward * distance; point = point.normalized * Mathf.Min(point.magnitude, rect.width / 2f); m_PickerTargetPosition = point; @@ -134,19 +130,19 @@ void OnDrag() } } - private void GenerateBrightnessBar() + void GenerateBrightnessBar() { var rect = m_SliderBackground.rectTransform.rect; if (!m_BrightnessBarTexture) m_BrightnessBarTexture = new Texture2D((int)rect.width, 1); - Color col = GetColorForCurrentPosition(); + var col = GetColorForCurrentPosition(); - for (int y = 0; y < m_BrightnessBarTexture.height; y++) + for (var y = 0; y < m_BrightnessBarTexture.height; y++) { - for (int x = 0; x < m_BrightnessBarTexture.width; x++) + for (var x = 0; x < m_BrightnessBarTexture.width; x++) { - float brightness = x / rect.width; + var brightness = x / rect.width; var tempCol = col * brightness; tempCol.a = 1; m_BrightnessBarTexture.SetPixel(x, y, tempCol); @@ -157,7 +153,7 @@ private void GenerateBrightnessBar() m_SliderBackground.texture = m_BrightnessBarTexture; } - private void PositionToColor() + void PositionToColor() { if (onColorPicked != null) { @@ -166,16 +162,16 @@ private void PositionToColor() } } - private Color GetColorForCurrentPosition() + Color GetColorForCurrentPosition() { var rect = m_ColorPicker.rectTransform.rect; - Vector3 dir = m_PickerTargetPosition; + var dir = m_PickerTargetPosition; var x = (dir.x + rect.width / 2f) / rect.width; var y = (dir.y + rect.height / 2f) / rect.height; - int textureX = (int)(x * m_ColorPickerTexture.width); - int textureY = (int)(y * m_ColorPickerTexture.height); - Color col = m_ColorPickerTexture.GetPixel(textureX, textureY); + var textureX = (int)(x * m_ColorPickerTexture.width); + var textureY = (int)(y * m_ColorPickerTexture.height); + var col = m_ColorPickerTexture.GetPixel(textureX, textureY); return col; } From 8097e4c91ce58001db4cdd153d5e4a3c42a42658 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 1 Jun 2017 13:21:13 -0700 Subject: [PATCH 286/870] Split AnnotationPointer into a separate MonoBehaviour --- Tools/AnnotationTool/AnnotationTool.cs | 319 +++++------------- .../UserInterface/AnnotationPointer.cs | 136 ++++++++ .../UserInterface/AnnotationPointer.cs.meta | 13 + 3 files changed, 228 insertions(+), 240 deletions(-) create mode 100644 Tools/AnnotationTool/UserInterface/AnnotationPointer.cs create mode 100644 Tools/AnnotationTool/UserInterface/AnnotationPointer.cs.meta diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index a344b1907..a77bbfcfe 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -11,15 +11,16 @@ [MainMenuItem("Annotation", "Create", "Draw in 3D")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesRayLocking { + public const float TipDistance = 0.05f; + public const float MinBrushSize = 0.0025f; + public const float MaxBrushSize = 0.05f; + [SerializeField] ActionMap m_ActionMap; [SerializeField] Material m_AnnotationMaterial; - [SerializeField] - Material m_ConeMaterial; - [SerializeField] GameObject m_BrushSizePrefab; @@ -28,7 +29,7 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr Action onBrushSizeChanged { set; get; } - const int k_InitialListSize = 32767; + const int k_InitialListSize = 1024; // Pre-allocate lists to avoid GC List m_Points = new List(k_InitialListSize); List m_Forwards = new List(k_InitialListSize); @@ -40,27 +41,16 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr Mesh m_CurrentMesh; Matrix4x4 m_WorldToLocalMesh; - Material m_ConeMaterialInstance; ColorPickerUI m_ColorPicker; BrushSizeUI m_BrushSizeUi; Transform m_AnnotationHolder; - bool m_IsRayHidden; - bool m_IsValidStroke; - - Mesh m_CustomPointerMesh; - GameObject m_CustomPointerObject; + AnnotationPointer m_AnnotationPointer; GameObject m_ColorPickerActivator; - const float k_TopMinRadius = 0.0025f; - const float k_TopMaxRadius = 0.05f; - const float k_BottomRadius = 0.01f; - const float k_TipDistance = 0.05f; - const int k_Sides = 16; - - float m_CurrentRadius = k_TopMinRadius; + float m_BrushSize = MinBrushSize; List m_UndoList = new List(); @@ -80,11 +70,8 @@ public ActionMap actionMap void OnDestroy() { - if (m_IsRayHidden) - { - this.UnlockRay(rayOrigin, this); - this.ShowDefaultRay(rayOrigin); - } + this.UnlockRay(rayOrigin, this); + this.ShowDefaultRay(rayOrigin); if (m_ColorPicker) ObjectUtils.Destroy(m_ColorPicker.gameObject); @@ -93,53 +80,37 @@ void OnDestroy() if (m_ColorPickerActivator) ObjectUtils.Destroy(m_ColorPickerActivator); - if (m_CustomPointerObject) - DestroyImmediate(m_CustomPointerObject); - } - - void Update() - { - HideRay(); - HandleRayOrigins(); + if (m_AnnotationPointer) + ObjectUtils.Destroy(m_AnnotationPointer.gameObject); } - void HideRay() + void Start() { - if (!m_IsRayHidden) - { - this.HideDefaultRay(rayOrigin); - this.LockRay(rayOrigin, this); - m_IsRayHidden = true; - } - } + this.HideDefaultRay(rayOrigin); + this.LockRay(rayOrigin, this); - void HandleRayOrigins() - { - if (rayOrigin != null) + m_AnnotationPointer = ObjectUtils.CreateGameObjectWithComponent(rayOrigin, false); + CheckBrushSizeUi(); + + if (m_ColorPickerActivator == null) { - GenerateCustomPointer(); - CheckBrushSizeUi(); + m_ColorPickerActivator = this.InstantiateUI(m_ColorPickerActivatorPrefab); + var otherAltMenu = customAlternateMenuOrigin(otherRayOrigins[0]); - if (m_ColorPickerActivator == null) - { - m_ColorPickerActivator = this.InstantiateUI(m_ColorPickerActivatorPrefab); - var otherAltMenu = customAlternateMenuOrigin(otherRayOrigins[0]); - - m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); - m_ColorPickerActivator.transform.localRotation = Quaternion.identity; - m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; - - var activator = m_ColorPickerActivator.GetComponent(); - - m_ColorPicker = activator.GetComponentInChildren(true); - m_ColorPicker.onHideCalled = HideColorPicker; - m_ColorPicker.toolRayOrigin = rayOrigin; - m_ColorPicker.onColorPicked = OnColorPickerValueChanged; - - activator.rayOrigin = otherRayOrigins.First(); - activator.showColorPicker = ShowColorPicker; - activator.hideColorPicker = HideColorPicker; - } + m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); + m_ColorPickerActivator.transform.localRotation = Quaternion.identity; + m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; + + var activator = m_ColorPickerActivator.GetComponent(); + + m_ColorPicker = activator.GetComponentInChildren(true); + m_ColorPicker.onHideCalled = HideColorPicker; + m_ColorPicker.toolRayOrigin = rayOrigin; + m_ColorPicker.onColorPicked = OnColorPickerValueChanged; + + activator.rayOrigin = otherRayOrigins.First(); + activator.showColorPicker = ShowColorPicker; + activator.hideColorPicker = HideColorPicker; } } @@ -185,8 +156,8 @@ void CheckBrushSizeUi() m_BrushSizeUi.onValueChanged = (val) => { - m_CurrentRadius = Mathf.Lerp(k_TopMinRadius, k_TopMaxRadius, val); - ResizePointer(); + m_BrushSize = Mathf.Lerp(MinBrushSize, MaxBrushSize, val); + m_AnnotationPointer.Resize(m_BrushSize); }; onBrushSizeChanged = m_BrushSizeUi.ChangeSliderValue; } @@ -194,15 +165,12 @@ void CheckBrushSizeUi() void ShowColorPicker(Transform otherRayOrigin) { - if (m_IsValidStroke) - return; - if (!m_ColorPicker.enabled) m_ColorPicker.Show(); this.UnlockRay(rayOrigin, this); this.ShowDefaultRay(rayOrigin); - m_CustomPointerObject.SetActive(false); + m_AnnotationPointer.gameObject.SetActive(false); } void HideColorPicker() @@ -212,178 +180,46 @@ void HideColorPicker() m_ColorPicker.Hide(); this.HideDefaultRay(rayOrigin); this.LockRay(rayOrigin, this); - m_CustomPointerObject.SetActive(true); + m_AnnotationPointer.gameObject.SetActive(true); } } - void OnColorPickerValueChanged(Color newColor) + void OnColorPickerValueChanged(Color color) { - m_ColorToUse = newColor; + m_ColorToUse = color; - newColor.a = .75f; - m_ConeMaterialInstance.SetColor("_EmissionColor", newColor); + color.a = .75f; + m_AnnotationPointer.SetColor(color); - m_BrushSizeUi.OnBrushColorChanged(newColor); + m_BrushSizeUi.OnBrushColorChanged(color); } void HandleBrushSize(float value) { - if (m_CustomPointerMesh != null) + if (m_AnnotationPointer != null) { if (VRSettings.loadedDeviceName == "OpenVR") // For vive controllers, use 1:1 touchpad setting. { - m_CurrentRadius = Mathf.Lerp(k_TopMinRadius, k_TopMaxRadius, (value + 1) / 2f); + m_BrushSize = Mathf.Lerp(MinBrushSize, MaxBrushSize, (value + 1) / 2f); } else // For touch and hydra, let the thumbstick gradually modifiy the width. { - m_CurrentRadius += value * Time.unscaledDeltaTime * .1f; - m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, k_TopMinRadius, k_TopMaxRadius); + m_BrushSize += value * Time.unscaledDeltaTime * .1f; + m_BrushSize = Mathf.Clamp(m_BrushSize, MinBrushSize, MaxBrushSize); } if (m_BrushSizeUi && onBrushSizeChanged != null) { - var ratio = Mathf.InverseLerp(k_TopMinRadius, k_TopMaxRadius, m_CurrentRadius); + var ratio = Mathf.InverseLerp(MinBrushSize, MaxBrushSize, m_BrushSize); onBrushSizeChanged(ratio); } - ResizePointer(); - } - } - - void ResizePointer() - { - var vertices = m_CustomPointerMesh.vertices; - for (var i = k_Sides; i < k_Sides * 2; i++) - { - var angle = (i / (float)k_Sides) * Mathf.PI * 2f; - var xPos = Mathf.Cos(angle) * m_CurrentRadius; - var yPos = Mathf.Sin(angle) * m_CurrentRadius; - - var point = new Vector3(xPos, yPos, k_TipDistance); - vertices[i] = point; - } - m_CustomPointerMesh.vertices = vertices; - } - - void GenerateCustomPointer() - { - if (m_CustomPointerMesh != null) - return; - - m_CustomPointerMesh = new Mesh(); - m_CustomPointerMesh.vertices = GeneratePointerVertices(); - m_CustomPointerMesh.triangles = GeneratePointerTriangles(); - - m_CustomPointerObject = new GameObject("CustomPointer"); - - m_CustomPointerObject.AddComponent().sharedMesh = m_CustomPointerMesh; - - m_ConeMaterialInstance = Instantiate(m_ConeMaterial); - m_CustomPointerObject.AddComponent().sharedMaterial = m_ConeMaterialInstance; - - var pointerTrans = m_CustomPointerObject.transform; - pointerTrans.SetParent(rayOrigin); - - pointerTrans.localPosition = Vector3.zero; - pointerTrans.localScale = Vector3.one; - pointerTrans.localRotation = Quaternion.identity; - } - - static Vector3[] GeneratePointerVertices() - { - var points = new List(); - - for (var capIndex = 0; capIndex < 2; capIndex++) - { - float radius = capIndex == 0 ? k_BottomRadius : Mathf.Lerp(k_TopMaxRadius, k_TopMinRadius, capIndex); - - for (var i = 0; i < k_Sides; i++) - { - var angle = (i / (float)k_Sides) * Mathf.PI * 2f; - var xPos = Mathf.Cos(angle) * radius; - var yPos = Mathf.Sin(angle) * radius; - - var point = new Vector3(xPos, yPos, capIndex * k_TipDistance); - points.Add(point); - } - } - points.Add(new Vector3(0, 0, 0)); - points.Add(new Vector3(0, 0, k_TipDistance)); - - return points.ToArray(); - } - - static int[] GeneratePointerTriangles() - { - var triangles = new List(); - - GeneratePointerSideTriangles(triangles); - GeneratePointerCapsTriangles(triangles); - - return triangles.ToArray(); - } - - static void GeneratePointerSideTriangles(List triangles) - { - for (var i = 1; i < k_Sides; i++) - { - var lowerLeft = i - 1; - var lowerRight = i; - var upperLeft = i + k_Sides - 1; - var upperRight = i + k_Sides; - - var sideTriangles = VerticesToPolygon(upperRight, upperLeft, lowerRight, lowerLeft); - triangles.AddRange(sideTriangles); + m_AnnotationPointer.Resize(m_BrushSize); } - - // Finish the side with a polygon that loops around from the end to the start vertices. - int[] finishTriangles = VerticesToPolygon(k_Sides, k_Sides * 2 - 1, 0, k_Sides - 1); - triangles.AddRange(finishTriangles); } - static void GeneratePointerCapsTriangles(List triangles) + void SetupAnnotation() { - // Generate the bottom circle cap. - for (var i = 1; i < k_Sides; i++) - { - var lowerLeft = i - 1; - var lowerRight = i; - const int upperLeft = k_Sides * 2; - - triangles.Add(upperLeft); - triangles.Add(lowerRight); - triangles.Add(lowerLeft); - } - - // Close the bottom circle cap with a start-end loop triangle. - triangles.Add(k_Sides * 2); - triangles.Add(0); - triangles.Add(k_Sides - 1); - - // Generate the top circle cap. - for (var i = k_Sides + 1; i < k_Sides * 2; i++) - { - var lowerLeft = i - 1; - var lowerRight = i; - const int upperLeft = k_Sides * 2 + 1; - - triangles.Add(lowerLeft); - triangles.Add(lowerRight); - triangles.Add(upperLeft); - } - - // Close the top circle cap with a start-end loop triangle. - triangles.Add(k_Sides * 2 - 1); - triangles.Add(k_Sides); - triangles.Add(k_Sides * 2 + 1); - } - - bool SetupAnnotation() - { - m_IsValidStroke = m_CustomPointerObject.activeSelf; - if (!m_IsValidStroke) - return false; - SetupHolder(); m_Points.Clear(); @@ -409,8 +245,6 @@ bool SetupAnnotation() m_CurrentMesh = new Mesh(); m_CurrentMesh.name = "Annotation"; - - return true; } void SetupHolder() @@ -463,14 +297,14 @@ void UpdateAnnotation() { var rayForward = rayOrigin.forward; var rayRight = rayOrigin.right; - var worldPoint = rayOrigin.position + rayForward * k_TipDistance; + var worldPoint = rayOrigin.position + rayForward * TipDistance; var localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); if (m_Points.Count > 0) { var lastPoint = m_Points.Last(); var velocity = (localPoint - lastPoint) / Time.unscaledDeltaTime; - if (velocity.magnitude < m_CurrentRadius) + if (velocity.magnitude < m_BrushSize) return; } @@ -478,7 +312,7 @@ void UpdateAnnotation() m_Points.Add(localPoint); m_Forwards.Add(rayForward); - m_Widths.Add(m_CurrentRadius); + m_Widths.Add(m_BrushSize); m_Rights.Add(rayRight); PointsToMesh(); @@ -491,7 +325,7 @@ void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, Vector3 r var lastPoint = m_Points.Last(); var distance = Vector3.Distance(lastPoint, localPoint); - if (distance > m_CurrentRadius * .5f) + if (distance > m_BrushSize * .5f) { var halfPoint = (lastPoint + localPoint) / 2f; m_Points.Add(halfPoint); @@ -499,7 +333,7 @@ void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, Vector3 r var halfForward = (m_Forwards.Last() + rayForward) / 2f; m_Forwards.Add(halfForward); - var halfRadius = (m_Widths.Last() + m_CurrentRadius) / 2f; + var halfRadius = (m_Widths.Last() + m_BrushSize) / 2f; m_Widths.Add(halfRadius); var halfRight = (m_Rights.Last() + rayRight) / 2f; @@ -564,7 +398,7 @@ void LineToPlane(List newVertices) var lowWidth = Mathf.Min((newVertices.Count / 2) * 0.1f, 1); var highWidth = Mathf.Min((m_Points.Count - (i + 3)) * 0.25f, 1); var unclampedWidth = m_Widths[i - 1] * Mathf.Clamp01(i < m_Points.Count / 2f ? lowWidth : highWidth); - var width = Mathf.Clamp(unclampedWidth, k_TopMinRadius, k_TopMaxRadius); + var width = Mathf.Clamp(unclampedWidth, MinBrushSize, MaxBrushSize); var left = thisPoint - cross * width; var right = thisPoint + cross * width; @@ -615,8 +449,6 @@ static void CalculateUvs(List newUvs, List newVertices) void FinalizeMesh() { - m_IsValidStroke = false; - CenterMesh(); m_CurrentMesh.RecalculateBounds(); @@ -676,7 +508,7 @@ void CenterHolder() } } - static int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) + public static int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) { var triangleCount = doubleSided ? 12 : 6; var triangles = new int[triangleCount]; @@ -708,31 +540,38 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { var annotationInput = (AnnotationInput)input; - if (annotationInput.draw.wasJustPressed) + if (!Mathf.Approximately(annotationInput.changeBrushSize.value, 0)) { - if (SetupAnnotation()) - consumeControl(annotationInput.draw); + HandleBrushSize(annotationInput.changeBrushSize.value); + consumeControl(annotationInput.changeBrushSize); + consumeControl(annotationInput.vertical); } - else if (m_IsValidStroke) + + if (annotationInput.draw.wasJustPressed) { + SetupAnnotation(); consumeControl(annotationInput.draw); + return; + } - if (annotationInput.draw.isHeld) - UpdateAnnotation(); - else if (annotationInput.draw.wasJustReleased) - FinalizeMesh(); + if (annotationInput.draw.isHeld) + { + UpdateAnnotation(); + consumeControl(annotationInput.draw); + return; } - else if (annotationInput.undo.wasJustPressed) + + if (annotationInput.draw.wasJustReleased) { - consumeControl(annotationInput.undo); - UndoLast(); + FinalizeMesh(); + consumeControl(annotationInput.draw); + return; } - if (!Mathf.Approximately(annotationInput.changeBrushSize.value, 0)) + if (annotationInput.undo.wasJustPressed) { - HandleBrushSize(annotationInput.changeBrushSize.value); - consumeControl(annotationInput.changeBrushSize); - consumeControl(annotationInput.vertical); + consumeControl(annotationInput.undo); + UndoLast(); } } } diff --git a/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs b/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs new file mode 100644 index 000000000..43aab5d2a --- /dev/null +++ b/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs @@ -0,0 +1,136 @@ +using System.Collections.Generic; +using UnityEngine; + +public class AnnotationPointer : MonoBehaviour +{ + const int k_Sides = 16; + const float k_BottomRadius = 0.01f; + + [SerializeField] + Material m_ConeMaterial; + + Material m_ConeMaterialInstance; + + Mesh m_CustomPointerMesh; + + public void Resize(float size) + { + var vertices = m_CustomPointerMesh.vertices; + for (var i = k_Sides; i < k_Sides * 2; i++) + { + var angle = (i / (float)k_Sides) * Mathf.PI * 2f; + var xPos = Mathf.Cos(angle) * size; + var yPos = Mathf.Sin(angle) * size; + + var point = new Vector3(xPos, yPos, AnnotationTool.TipDistance); + vertices[i] = point; + } + m_CustomPointerMesh.vertices = vertices; + } + + void Awake() + { + m_CustomPointerMesh = new Mesh(); + m_CustomPointerMesh.vertices = GeneratePointerVertices(); + m_CustomPointerMesh.triangles = GeneratePointerTriangles(); + + gameObject.AddComponent().sharedMesh = m_CustomPointerMesh; + + m_ConeMaterialInstance = Instantiate(m_ConeMaterial); + gameObject.AddComponent().sharedMaterial = m_ConeMaterialInstance; + } + + static Vector3[] GeneratePointerVertices() + { + var points = new List(); + + for (var capIndex = 0; capIndex < 2; capIndex++) + { + var radius = capIndex == 0 ? k_BottomRadius : Mathf.Lerp(AnnotationTool.MaxBrushSize, AnnotationTool.MinBrushSize, capIndex); + + for (var i = 0; i < k_Sides; i++) + { + var angle = (i / (float)k_Sides) * Mathf.PI * 2f; + var xPos = Mathf.Cos(angle) * radius; + var yPos = Mathf.Sin(angle) * radius; + + var point = new Vector3(xPos, yPos, capIndex * AnnotationTool.TipDistance); + points.Add(point); + } + } + points.Add(new Vector3(0, 0, 0)); + points.Add(new Vector3(0, 0, AnnotationTool.TipDistance)); + + return points.ToArray(); + } + + static int[] GeneratePointerTriangles() + { + var triangles = new List(); + + GeneratePointerSideTriangles(triangles); + GeneratePointerCapsTriangles(triangles); + + return triangles.ToArray(); + } + + static void GeneratePointerSideTriangles(List triangles) + { + for (var i = 1; i < k_Sides; i++) + { + var lowerLeft = i - 1; + var lowerRight = i; + var upperLeft = i + k_Sides - 1; + var upperRight = i + k_Sides; + + var sideTriangles = AnnotationTool.VerticesToPolygon(upperRight, upperLeft, lowerRight, lowerLeft); + triangles.AddRange(sideTriangles); + } + + // Finish the side with a polygon that loops around from the end to the start vertices. + var finishTriangles = AnnotationTool.VerticesToPolygon(k_Sides, k_Sides * 2 - 1, 0, k_Sides - 1); + triangles.AddRange(finishTriangles); + } + + static void GeneratePointerCapsTriangles(List triangles) + { + // Generate the bottom circle cap. + for (var i = 1; i < k_Sides; i++) + { + var lowerLeft = i - 1; + var lowerRight = i; + const int upperLeft = k_Sides * 2; + + triangles.Add(upperLeft); + triangles.Add(lowerRight); + triangles.Add(lowerLeft); + } + + // Close the bottom circle cap with a start-end loop triangle. + triangles.Add(k_Sides * 2); + triangles.Add(0); + triangles.Add(k_Sides - 1); + + // Generate the top circle cap. + for (var i = k_Sides + 1; i < k_Sides * 2; i++) + { + var lowerLeft = i - 1; + var lowerRight = i; + const int upperLeft = k_Sides * 2 + 1; + + triangles.Add(lowerLeft); + triangles.Add(lowerRight); + triangles.Add(upperLeft); + } + + // Close the top circle cap with a start-end loop triangle. + triangles.Add(k_Sides * 2 - 1); + triangles.Add(k_Sides); + triangles.Add(k_Sides * 2 + 1); + } + + public void SetColor(Color color) + { + m_ConeMaterialInstance.SetColor("_EmissionColor", color); + } +} \ No newline at end of file diff --git a/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs.meta b/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs.meta new file mode 100644 index 000000000..4e855a42c --- /dev/null +++ b/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 3252fb4903b3a0d4aa39d17c0ce7557f +timeCreated: 1496347474 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_ConeMaterial: {fileID: 2100000, guid: facc16e9d19b3b84e9110a7805dfa457, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 883b42316138694f457e2303b8b94cf9cd0839d2 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 1 Jun 2017 13:46:29 -0700 Subject: [PATCH 287/870] Fix brightness picker --- Tools/AnnotationTool/UserInterface/ColorPickerUI.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index 8b3202131..745970f0f 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -158,6 +158,7 @@ void PositionToColor() if (onColorPicked != null) { var col = GetColorForCurrentPosition(); + col *= m_ColorPicker.color; onColorPicked(col); } } From 31d6c3f83508044c7009a5b44749410c4903b4c1 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 1 Jun 2017 15:33:30 -0700 Subject: [PATCH 288/870] Simplify meshing logic --- Tools/AnnotationTool/AnnotationTool.cs | 49 +++++++++----------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index a77bbfcfe..75966f5cf 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -9,11 +9,12 @@ using UnityEngine.VR; [MainMenuItem("Annotation", "Create", "Draw in 3D")] -public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesRayLocking +public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale { public const float TipDistance = 0.05f; public const float MinBrushSize = 0.0025f; public const float MaxBrushSize = 0.05f; + const float k_MinDistance = 0.001f; [SerializeField] ActionMap m_ActionMap; @@ -34,7 +35,6 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr List m_Points = new List(k_InitialListSize); List m_Forwards = new List(k_InitialListSize); List m_Widths = new List(k_InitialListSize); - List m_Rights = new List(k_InitialListSize); MeshFilter m_CurrentMeshFilter; Color m_ColorToUse = Color.white; @@ -225,7 +225,6 @@ void SetupAnnotation() m_Points.Clear(); m_Forwards.Clear(); m_Widths.Clear(); - m_Rights.Clear(); var go = new GameObject("Annotation " + m_AnnotationHolder.childCount); m_UndoList.Add(go); @@ -296,29 +295,28 @@ GameObject GetNewSessionHolder(Transform mainHolderTrans) void UpdateAnnotation() { var rayForward = rayOrigin.forward; - var rayRight = rayOrigin.right; - var worldPoint = rayOrigin.position + rayForward * TipDistance; + var viewerScale = this.GetViewerScale(); + var worldPoint = rayOrigin.position + rayForward * TipDistance * viewerScale; var localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); if (m_Points.Count > 0) { var lastPoint = m_Points.Last(); - var velocity = (localPoint - lastPoint) / Time.unscaledDeltaTime; - if (velocity.magnitude < m_BrushSize) + var velocity = localPoint - lastPoint; + if (velocity.magnitude < k_MinDistance * viewerScale) return; } - InterpolatePointsIfNeeded(localPoint, rayForward, rayRight); + InterpolatePointsIfNeeded(localPoint, rayForward); m_Points.Add(localPoint); m_Forwards.Add(rayForward); - m_Widths.Add(m_BrushSize); - m_Rights.Add(rayRight); + m_Widths.Add(m_BrushSize * viewerScale); PointsToMesh(); } - void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, Vector3 rayRight) + void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward) { if (m_Points.Count > 1) { @@ -335,9 +333,6 @@ void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, Vector3 r var halfRadius = (m_Widths.Last() + m_BrushSize) / 2f; m_Widths.Add(halfRadius); - - var halfRight = (m_Rights.Last() + rayRight) / 2f; - m_Rights.Add(halfRight); } } } @@ -377,36 +372,23 @@ void PointsToMesh() void LineToPlane(List newVertices) { - var prevDirection = (m_Points[1] - m_Points[0]).normalized; - for (var i = 1; i < m_Points.Count; i++) { var nextPoint = m_Points[i]; var thisPoint = m_Points[i - 1]; var direction = (nextPoint - thisPoint).normalized; - // For optimization, ignore inner points of an almost straight line. - // The last point is an exception, it is required for a smooth drawing experience. - if (Vector3.Angle(prevDirection, direction) < 1f && i < m_Points.Count - 1 && i > 1) - continue; - - var ratio = Mathf.Abs(Vector3.Dot(direction, m_Forwards[i - 1])); - var cross1 = m_Rights[i - 1].normalized; - var cross2 = Vector3.Cross(direction, m_Forwards[i - 1]).normalized; - var cross = Vector3.Lerp(cross1, cross2, 1 - ratio).normalized; + var forward = m_Forwards[i]; + Vector3.OrthoNormalize(ref direction, ref forward); + var binormal = Vector3.Cross(forward, direction).normalized; - var lowWidth = Mathf.Min((newVertices.Count / 2) * 0.1f, 1); - var highWidth = Mathf.Min((m_Points.Count - (i + 3)) * 0.25f, 1); - var unclampedWidth = m_Widths[i - 1] * Mathf.Clamp01(i < m_Points.Count / 2f ? lowWidth : highWidth); - var width = Mathf.Clamp(unclampedWidth, MinBrushSize, MaxBrushSize); + var width = m_Widths[i]; - var left = thisPoint - cross * width; - var right = thisPoint + cross * width; + var left = thisPoint - binormal * width; + var right = thisPoint + binormal * width; newVertices.Add(left); newVertices.Add(right); - - prevDirection = direction; } } @@ -550,6 +532,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (annotationInput.draw.wasJustPressed) { SetupAnnotation(); + UpdateAnnotation(); consumeControl(annotationInput.draw); return; } From 1613b4a680dfbbdaf89913f6defc54bd688f4cb0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 17:47:11 -0700 Subject: [PATCH 289/870] Add HapticsModule; a basic, Rift-only, initial implementation --- Scripts/Modules/HapticsModule.cs | 64 +++++++++++++++++++++++++++ Scripts/Modules/HapticsModule.cs.meta | 18 ++++++++ 2 files changed, 82 insertions(+) create mode 100644 Scripts/Modules/HapticsModule.cs create mode 100644 Scripts/Modules/HapticsModule.cs.meta diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs new file mode 100644 index 000000000..893fefdc0 --- /dev/null +++ b/Scripts/Modules/HapticsModule.cs @@ -0,0 +1,64 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Modules +{ + sealed class HapticsModule : MonoBehaviour, IUsesGameObjectLocking + { + [SerializeField] + private float m_MasterIntensity = 1f; + + [SerializeField] + private float m_ShortPulseDuration = 0.125f; + + [SerializeField] + private float m_MediumPulseDuration = 0.25f; + + [SerializeField] + private float m_LongPulseDuration = 0.5f; + + /// + /// Overall intensity of haptics. + /// A value to 0 will mute haptics. + /// A value of 1 will allow haptics to be performed at normal intensity + /// + public float masterIntensity { set { m_MasterIntensity = Mathf.Clamp01(value); } } + + OVRHaptics.OVRHapticsChannel m_LHapticsChannel; + OVRHaptics.OVRHapticsChannel m_RHapticsChannel; + OVRHapticsClip m_GeneratedHapticClip; + + void Start() + { + m_LHapticsChannel = OVRHaptics.LeftChannel; + m_RHapticsChannel = OVRHaptics.RightChannel; + m_GeneratedHapticClip = new OVRHapticsClip(); + } + + void LateUpdate() + { + // Perform a manual update of OVR haptics + OVRHaptics.Process(); + } + + public void PerformHaptics(float duration, float intensity = 1f) + { + if (Mathf.Approximately(m_MasterIntensity, 0)) + return; + + m_GeneratedHapticClip.Reset(); // TODO: Support multiple generated clips + + const int kIntensityIncreaseMultiplier = 25; + intensity = Mathf.Clamp(intensity * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, 255); + byte hapticClipSample = Convert.ToByte(intensity); + var clipLength = 25; + for (int i = 0; i < clipLength; ++i) + m_GeneratedHapticClip.WriteSample(hapticClipSample); + + m_RHapticsChannel.Mix(m_GeneratedHapticClip); + m_LHapticsChannel.Mix(m_GeneratedHapticClip); + } + } +} +#endif diff --git a/Scripts/Modules/HapticsModule.cs.meta b/Scripts/Modules/HapticsModule.cs.meta new file mode 100644 index 000000000..b6d03be0a --- /dev/null +++ b/Scripts/Modules/HapticsModule.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: d3359d35460d63a469d686098ebbcb79 +timeCreated: 1490053335 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_DefaultHighlightMaterial: {fileID: 2100000, guid: debb0327296a96e42886209b1b1cfd4f, + type: 2} + - m_LeftHighlightMaterial: {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, + type: 2} + - m_RightHighlightMaterial: {fileID: 2100000, guid: 455d777fd601af149ab2da220d5bd435, + type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 2bdb4f13e7370855b53c7e0d775fd60c3144a951 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 17:47:41 -0700 Subject: [PATCH 290/870] Add HapticsModuleConnector --- .../HapticsModuleConnector.cs | 17 +++++++++++++++++ .../HapticsModuleConnector.cs.meta | 12 ++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs create mode 100644 Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs.meta diff --git a/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs new file mode 100644 index 000000000..226fe0bd6 --- /dev/null +++ b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs @@ -0,0 +1,17 @@ +#if UNITY_EDITOR && UNITY_EDITORVR +using UnityEditor.Experimental.EditorVR.Modules; + +namespace UnityEditor.Experimental.EditorVR.Core +{ + partial class EditorVR + { + class HapticsModuleConnector : Nested, ILateBindInterfaceMethods + { + public void LateBindInterfaceMethods(HapticsModule provider) + { + IPerformHapticsMethods.performHaptics = provider.PerformHaptics; + } + } + } +} +#endif diff --git a/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs.meta b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs.meta new file mode 100644 index 000000000..1c8b80936 --- /dev/null +++ b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9fd9027b505d0c244b1bb5c586615e8d +timeCreated: 1489520545 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From cb4072cef2ade870d9917e2247dee64886de9e22 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 17:49:01 -0700 Subject: [PATCH 291/870] Add IPerformHaptics interface; a basic/initial implementation --- Scripts/Interfaces/IPerformHaptics.cs | 29 ++++++++++++++++++++++ Scripts/Interfaces/IPerformHaptics.cs.meta | 12 +++++++++ 2 files changed, 41 insertions(+) create mode 100644 Scripts/Interfaces/IPerformHaptics.cs create mode 100644 Scripts/Interfaces/IPerformHaptics.cs.meta diff --git a/Scripts/Interfaces/IPerformHaptics.cs b/Scripts/Interfaces/IPerformHaptics.cs new file mode 100644 index 000000000..7036f7c39 --- /dev/null +++ b/Scripts/Interfaces/IPerformHaptics.cs @@ -0,0 +1,29 @@ +#if UNITY_EDITOR + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Gives decorated class ability to perform haptic feedback + /// + public interface IPerformHaptics + { + } + + public static class IPerformHapticsMethods + { + internal delegate void PerformHapticsDelegate(float duration, float intensity = 1f); + + internal static PerformHapticsDelegate performHaptics { get; set; } + + /// + /// Method for performing haptic feedback + /// + /// Duration of haptic feedback + /// Intensity of haptic feedback (optional) + public static void PerformHaptics(this IPerformHaptics obj, float duration, float intensity = 1f) + { + performHaptics(duration, intensity); + } + } +} +#endif diff --git a/Scripts/Interfaces/IPerformHaptics.cs.meta b/Scripts/Interfaces/IPerformHaptics.cs.meta new file mode 100644 index 000000000..f862990f4 --- /dev/null +++ b/Scripts/Interfaces/IPerformHaptics.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0f9df5dc698ee6b4a9d44ecd7f4ce7c7 +timeCreated: 1468885156 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 76ac093b95326154bb0f2b5a3bd046fc0b569edd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 17:50:27 -0700 Subject: [PATCH 292/870] Add haptics module in EditorVR Awake function --- Scripts/Core/EditorVR.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 1e6675bca..7bcabb676 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -142,6 +142,7 @@ void Awake() AddModule(); AddModule(); + AddModule(); var lockModule = AddModule(); lockModule.updateAlternateMenu = (rayOrigin, o) => Menus.SetAlternateMenuVisibility(rayOrigin, o != null); From ee8472f4e98c70564299ffe55b6795a09ef66b54 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 17:51:07 -0700 Subject: [PATCH 293/870] Add haptic feedback to hovering of WorkspaceButtons --- Workspaces/Common/Scripts/WorkspaceButton.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index ed046d523..3d96a1074 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, IUsesStencilRef + sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, IUsesStencilRef, IPerformHaptics { const float k_IconHighlightedLocalZOffset = -0.0015f; const string k_MaterialAlphaProperty = "_Alpha"; @@ -318,6 +318,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { + this.PerformHaptics(1f, 1f); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); From bff434a59c4570b18198c482db7403cf38ac93e5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 19:32:06 -0700 Subject: [PATCH 294/870] Add haptics to list view scrolling --- Scripts/ListView/ListViewControllerBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index 4846a9c8a..a3fb706e6 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -1,12 +1,12 @@ #if UNITY_EDITOR using System; -using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR; using UnityEngine; using UnityEngine.EventSystems; namespace ListView { - public abstract class ListViewControllerBase : MonoBehaviour, IScrollHandler + public abstract class ListViewControllerBase : MonoBehaviour, IScrollHandler, IPerformHaptics { public float scrollOffset { get { return m_ScrollOffset; } set { m_ScrollOffset = value; } } @@ -233,6 +233,8 @@ public void OnScroll(PointerEventData eventData) return; scrollOffset += eventData.scrollDelta.y * scrollSpeed * Time.deltaTime; + + this.PerformHaptics(0.0001f, 0.125f); } protected virtual void StartSettling(Action onComplete = null) From 63de1b6b055cab2cffd61a846384875233bc1184 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 19:33:56 -0700 Subject: [PATCH 295/870] Add haptics to fram/resize hover state in WorkspaceUI --- Workspaces/Base/WorkspaceUI.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index ebff87477..4d6813da2 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength + sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IPerformHaptics { const int k_AngledFaceBlendShapeIndex = 2; const int k_ThinFrameBlendShapeIndex = 3; @@ -813,6 +813,10 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount) yield return null; } + // If hovering the frame, and not dragging, perform haptic feedback + if (m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) + this.PerformHaptics(0.25f, 0.05f); + m_FrameThicknessCoroutine = null; } From 0317df1f9b7a59e26f9f0413fa70498ac26070ff Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 19:35:37 -0700 Subject: [PATCH 296/870] Refine WorkspaceButton hover haptics --- Workspaces/Common/Scripts/WorkspaceButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 3d96a1074..dc7edcfff 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -318,7 +318,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.PerformHaptics(1f, 1f); + this.PerformHaptics(0.005f, 0.125f); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); From 23a414c0bd4efafc2954b1b950d91ae66fdacdb7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 19:37:48 -0700 Subject: [PATCH 297/870] Refine haptics intensity logic in HapticsModule --- Scripts/Modules/HapticsModule.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index 893fefdc0..6e01f9b76 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -49,11 +49,11 @@ public void PerformHaptics(float duration, float intensity = 1f) m_GeneratedHapticClip.Reset(); // TODO: Support multiple generated clips - const int kIntensityIncreaseMultiplier = 25; - intensity = Mathf.Clamp(intensity * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, 255); + const int kIntensityIncreaseMultiplier = 255; // Maximum value of 255 for intensity + intensity = Mathf.Clamp(Mathf.Clamp01(intensity) * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, 255); byte hapticClipSample = Convert.ToByte(intensity); - var clipLength = 25; - for (int i = 0; i < clipLength; ++i) + duration *= 490; // Samplerate conversion : 44100/90fps + for (int i = 0; i < duration; ++i) m_GeneratedHapticClip.WriteSample(hapticClipSample); m_RHapticsChannel.Mix(m_GeneratedHapticClip); From 58467c77248102928ef07f3635b4c89eeb4d885f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 19:49:12 -0700 Subject: [PATCH 298/870] Add Rift-specific clipSample comments ot HapticModule --- Scripts/Modules/HapticsModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index 6e01f9b76..4fcbc6c35 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -44,6 +44,8 @@ void LateUpdate() public void PerformHaptics(float duration, float intensity = 1f) { + // Clip buffer can hold up to 800 milliseconds of samples + // At 320Hz, each sample is 3.125f milliseconds if (Mathf.Approximately(m_MasterIntensity, 0)) return; From 1811e2de5688b7aec38743edd50bd23d79111cbb Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 19:54:41 -0700 Subject: [PATCH 299/870] Add click haptic feedback to WorkspaceButton; further refine hover haptic intensity --- Workspaces/Common/Scripts/WorkspaceButton.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index dc7edcfff..8e20c6b46 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -207,6 +207,8 @@ void Awake() // Hookup button OnClick event if there is an alternate icon sprite set if (m_SwapIconsOnClick && m_AlternateIconSprite) m_Button.onClick.AddListener(SwapIconSprite); + + m_Button.onClick.AddListener(OnButtonClicked); } void Start() @@ -229,6 +231,8 @@ void OnDestroy() { ObjectUtils.Destroy(m_ButtonMaterial); ObjectUtils.Destroy(m_ButtonMaskMaterial); + + m_Button.onClick.RemoveAllListeners(); } void OnDisable() @@ -318,7 +322,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.PerformHaptics(0.005f, 0.125f); + this.PerformHaptics(0.005f, 0.075f); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); @@ -465,6 +469,11 @@ void SwapIconSprite() // Alternate between the main icon and the alternate icon when the button is clicked alternateIconVisible = !alternateIconVisible; } + + void OnButtonClicked() + { + this.PerformHaptics(0.175f, 0.05f); + } } } #endif From e93f71806187b896aeb155758b7b8b5255d8df81 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 1 Jun 2017 20:04:30 -0700 Subject: [PATCH 300/870] Use actual undo/redo for annotation strips; Add tapering at ends of strips; Add smoothing to points; Add (inactive) code to bring up radial menu; Draw double-sided strips and add to spatial hash --- Tools/AnnotationTool/AnnotationTool.cs | 131 ++++++++---------- .../Input/AnnotationInput.asset | 32 +---- Tools/AnnotationTool/Input/AnnotationInput.cs | 3 +- .../Textures/AnnotationTexture.png | 3 - .../Textures/AnnotationTexture.png.meta | 59 -------- .../UserInterface/ColorPickerUI.cs | 2 +- 6 files changed, 60 insertions(+), 170 deletions(-) delete mode 100644 Tools/AnnotationTool/Textures/AnnotationTexture.png delete mode 100644 Tools/AnnotationTool/Textures/AnnotationTexture.png.meta diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 75966f5cf..5a9b7db4e 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Actions; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -9,12 +10,13 @@ using UnityEngine.VR; [MainMenuItem("Annotation", "Create", "Draw in 3D")] -public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale +public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ICustomRay, IUsesRayOrigins, + IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale, IUsesSpatialHash { public const float TipDistance = 0.05f; public const float MinBrushSize = 0.0025f; public const float MaxBrushSize = 0.05f; - const float k_MinDistance = 0.001f; + const float k_MinDistance = 0.003f; [SerializeField] ActionMap m_ActionMap; @@ -35,6 +37,7 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr List m_Points = new List(k_InitialListSize); List m_Forwards = new List(k_InitialListSize); List m_Widths = new List(k_InitialListSize); + float m_Length; MeshFilter m_CurrentMeshFilter; Color m_ColorToUse = Color.white; @@ -52,7 +55,7 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr float m_BrushSize = MinBrushSize; - List m_UndoList = new List(); + List m_PreviousActions; public Transform rayOrigin { private get; set; } public List otherRayOrigins { private get; set; } @@ -82,6 +85,11 @@ void OnDestroy() if (m_AnnotationPointer) ObjectUtils.Destroy(m_AnnotationPointer.gameObject); + + //HACK: Get RadialMenuUI directly until we create an interface to set custom actions + var radialUI = alternateMenuOrigin.GetComponentInChildren(true); + radialUI.actions = m_PreviousActions; + radialUI.visible = false; } void Start() @@ -112,34 +120,12 @@ void Start() activator.showColorPicker = ShowColorPicker; activator.hideColorPicker = HideColorPicker; } - } - - void UndoLast() - { - if (m_UndoList.Count > 0) - { - var first = m_UndoList.Last(); - DestroyImmediate(first); - m_UndoList.RemoveAt(m_UndoList.Count - 1); - - // Clean up after the removed annotations if necessary. - if (m_AnnotationHolder.childCount == 0) - { - var root = m_AnnotationHolder.parent; - var index = m_AnnotationHolder.GetSiblingIndex(); - DestroyImmediate(m_AnnotationHolder.gameObject); - if (root.childCount == 0) - DestroyImmediate(root.gameObject); - else - { - if (index > 0) - m_AnnotationHolder = root.GetChild(index - 1); - else if (index < root.childCount) - m_AnnotationHolder = root.GetChild(index); - } - } - } + //HACK: Get RadialMenuUI directly until we create an interface to set custom actions + var radialUI = alternateMenuOrigin.GetComponentInChildren(true); + m_PreviousActions = radialUI.actions; + radialUI.actions = m_PreviousActions.Where(action => action.action is Undo || action.action is Redo).ToList(); + //radialUI.visible = true; } void CheckBrushSizeUi() @@ -225,9 +211,9 @@ void SetupAnnotation() m_Points.Clear(); m_Forwards.Clear(); m_Widths.Clear(); + m_Length = 0; var go = new GameObject("Annotation " + m_AnnotationHolder.childCount); - m_UndoList.Add(go); var goTrans = go.transform; goTrans.SetParent(m_AnnotationHolder); @@ -302,28 +288,32 @@ void UpdateAnnotation() if (m_Points.Count > 0) { var lastPoint = m_Points.Last(); - var velocity = localPoint - lastPoint; - if (velocity.magnitude < k_MinDistance * viewerScale) + localPoint = Vector3.Lerp(lastPoint, localPoint, 0.5f); + var distance = (localPoint - lastPoint).magnitude; + if (distance < k_MinDistance * viewerScale) return; + + m_Length += distance; } - InterpolatePointsIfNeeded(localPoint, rayForward); + var brushSize = m_BrushSize * viewerScale; + InterpolatePointsIfNeeded(localPoint, rayForward, brushSize); m_Points.Add(localPoint); m_Forwards.Add(rayForward); - m_Widths.Add(m_BrushSize * viewerScale); + m_Widths.Add(brushSize); PointsToMesh(); } - void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward) + void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, float brushSize) { if (m_Points.Count > 1) { var lastPoint = m_Points.Last(); var distance = Vector3.Distance(lastPoint, localPoint); - if (distance > m_BrushSize * .5f) + if (distance > brushSize * .5f) { var halfPoint = (lastPoint + localPoint) / 2f; m_Points.Add(halfPoint); @@ -331,7 +321,7 @@ void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward) var halfForward = (m_Forwards.Last() + rayForward) / 2f; m_Forwards.Add(halfForward); - var halfRadius = (m_Widths.Last() + m_BrushSize) / 2f; + var halfRadius = (m_Widths.Last() + brushSize) / 2f; m_Widths.Add(halfRadius); } } @@ -350,11 +340,6 @@ void PointsToMesh() var newUvs = new List(); LineToPlane(newVertices); - SmoothPlane(newVertices); - - newVertices.RemoveRange(0, Mathf.Min(newVertices.Count, 4)); - if (newVertices.Count > 4) - newVertices.RemoveRange(newVertices.Count - 4, 4); TriangulatePlane(newTriangles, newVertices.Count); CalculateUvs(newUvs, newVertices); @@ -372,37 +357,38 @@ void PointsToMesh() void LineToPlane(List newVertices) { + var distance = 0f; + var lastPoint = m_Points[0]; + var direction = (m_Points[1] - m_Points[0]).normalized; + var forward = -m_Forwards[0]; + Vector3.OrthoNormalize(ref direction, ref forward); + var lastBinormal = Vector3.Cross(forward, direction).normalized; for (var i = 1; i < m_Points.Count; i++) { - var nextPoint = m_Points[i]; - var thisPoint = m_Points[i - 1]; - var direction = (nextPoint - thisPoint).normalized; + var point = m_Points[i]; + var segment = point - lastPoint; + direction = segment.normalized; - var forward = m_Forwards[i]; + forward = -m_Forwards[i]; Vector3.OrthoNormalize(ref direction, ref forward); var binormal = Vector3.Cross(forward, direction).normalized; + binormal = Vector3.Lerp(lastBinormal, binormal, 0.1f).normalized; + lastBinormal = binormal; var width = m_Widths[i]; - var left = thisPoint - binormal * width; - var right = thisPoint + binormal * width; + width *= Math.Min(Mathf.Sqrt(distance / width), 1); + var endDistance = m_Length - distance; + width *= Math.Min(Mathf.Sqrt(endDistance / width), 1); + + var left = point - binormal * width; + var right = point + binormal * width; newVertices.Add(left); newVertices.Add(right); - } - } - - static void SmoothPlane(List newVertices) - { - const float kSmoothRatio = 0.75f; - for (var side = 0; side < 2; side++) - { - for (var i = 4; i < newVertices.Count - 4 - side; i++) - { - var average = (newVertices[i - 4 + side] + newVertices[i - 2 + side] + newVertices[i + 2 + side] + newVertices[i + 4 + side]) / 4f; - var dynamicSmooth = 1 / Vector3.Distance(newVertices[i + side], average); - newVertices[i + side] = Vector3.Lerp(newVertices[i + side], average, kSmoothRatio * dynamicSmooth); - } + + distance += segment.magnitude; + lastPoint = point; } } @@ -439,6 +425,13 @@ void FinalizeMesh() m_CurrentMesh.UploadMeshData(true); CenterHolder(); + + var go = m_CurrentMeshFilter.gameObject; + + this.AddToSpatialHash(go); + + UnityEditor.Undo.IncrementCurrentGroup(); + UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create Annotation"); } void CenterMesh() @@ -490,7 +483,7 @@ void CenterHolder() } } - public static int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = false) + public static int[] VerticesToPolygon(int upperLeft, int upperRight, int lowerLeft, int lowerRight, bool doubleSided = true) { var triangleCount = doubleSided ? 12 : 6; var triangles = new int[triangleCount]; @@ -532,29 +525,19 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (annotationInput.draw.wasJustPressed) { SetupAnnotation(); - UpdateAnnotation(); consumeControl(annotationInput.draw); - return; } if (annotationInput.draw.isHeld) { UpdateAnnotation(); consumeControl(annotationInput.draw); - return; } if (annotationInput.draw.wasJustReleased) { FinalizeMesh(); consumeControl(annotationInput.draw); - return; - } - - if (annotationInput.undo.wasJustPressed) - { - consumeControl(annotationInput.undo); - UndoLast(); } } } diff --git a/Tools/AnnotationTool/Input/AnnotationInput.asset b/Tools/AnnotationTool/Input/AnnotationInput.asset index 09f6abe08..cbf95d5fa 100644 --- a/Tools/AnnotationTool/Input/AnnotationInput.asset +++ b/Tools/AnnotationTool/Input/AnnotationInput.asset @@ -14,7 +14,6 @@ MonoBehaviour: m_Actions: - {fileID: 114000013162093460} - {fileID: 114000010589948208} - - {fileID: 114000012503875562} - {fileID: 114574627476091900} m_ControlSchemes: - m_Name: AnnotationInput @@ -44,15 +43,6 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 - - sources: - - controlIndex: 18 - deviceKey: 1 - deadZone: 0.3 - buttonAxisSources: [] - gravity: 1000 - sensitivity: 1000 - snap: 1 - primaryIsButtonAxis: 0 - sources: - controlIndex: 1 deviceKey: 1 @@ -85,26 +75,6 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: ChangeBrushSize defaultValue: 0 ---- !u!114 &114000012503875562 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Undo - m_EditorClassIdentifier: - m_ActionMap: {fileID: 11400000} - m_ActionIndex: 2 - m_ControlData: - componentControlIndices: - controlType: - m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - name: Undo - defaultValue: 0 --- !u!114 &114000013162093460 MonoBehaviour: m_ObjectHideFlags: 0 @@ -137,7 +107,7 @@ MonoBehaviour: m_Name: Vertical m_EditorClassIdentifier: m_ActionMap: {fileID: 11400000} - m_ActionIndex: 3 + m_ActionIndex: 2 m_ControlData: componentControlIndices: controlType: diff --git a/Tools/AnnotationTool/Input/AnnotationInput.cs b/Tools/AnnotationTool/Input/AnnotationInput.cs index 785f77ab6..b0473e2c0 100644 --- a/Tools/AnnotationTool/Input/AnnotationInput.cs +++ b/Tools/AnnotationTool/Input/AnnotationInput.cs @@ -9,7 +9,6 @@ public AnnotationInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @draw { get { return (ButtonInputControl)this[0]; } } public AxisInputControl @changeBrushSize { get { return (AxisInputControl)this[1]; } } - public ButtonInputControl @undo { get { return (ButtonInputControl)this[2]; } } - public AxisInputControl @vertical { get { return (AxisInputControl)this[3]; } } + public AxisInputControl @vertical { get { return (AxisInputControl)this[2]; } } } } diff --git a/Tools/AnnotationTool/Textures/AnnotationTexture.png b/Tools/AnnotationTool/Textures/AnnotationTexture.png deleted file mode 100644 index 2ccd8b07f..000000000 --- a/Tools/AnnotationTool/Textures/AnnotationTexture.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:68d936a33e71b0ea49261d6f2ad8ef5b979e6aa4155a96bce6be2ba32d265c8a -size 233254 diff --git a/Tools/AnnotationTool/Textures/AnnotationTexture.png.meta b/Tools/AnnotationTool/Textures/AnnotationTexture.png.meta deleted file mode 100644 index 41083d8d7..000000000 --- a/Tools/AnnotationTool/Textures/AnnotationTexture.png.meta +++ /dev/null @@ -1,59 +0,0 @@ -fileFormatVersion: 2 -guid: 831efcd782cc31c4493674a90523630a -timeCreated: 1478614738 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - cubemapConvolution: 0 - cubemapConvolutionSteps: 7 - cubemapConvolutionExponent: 1.5 - seamlessCubemap: 0 - textureFormat: -3 - maxTextureSize: 2048 - textureSettings: - filterMode: 2 - aniso: 16 - mipBias: -1 - wrapMode: 1 - nPOTScale: 1 - lightmap: 0 - rGBM: 0 - compressionQuality: 50 - allowsAlphaSplitting: 0 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: -1 - buildTargetSettings: [] - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index 745970f0f..4db29ee95 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -158,7 +158,7 @@ void PositionToColor() if (onColorPicked != null) { var col = GetColorForCurrentPosition(); - col *= m_ColorPicker.color; + col *= m_ColorPicker.color; // Apply brightness slider onColorPicked(col); } } From d002934cc357045e89e283cf18297afa7feb235c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 1 Jun 2017 20:15:47 -0700 Subject: [PATCH 301/870] Protect against exception on closing EditorVR --- Tools/AnnotationTool/AnnotationTool.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 5a9b7db4e..9155bafc9 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -73,8 +73,16 @@ public ActionMap actionMap void OnDestroy() { - this.UnlockRay(rayOrigin, this); - this.ShowDefaultRay(rayOrigin); + if (rayOrigin) + { + this.UnlockRay(rayOrigin, this); + this.ShowDefaultRay(rayOrigin); + + //HACK: Get RadialMenuUI directly until we create an interface to set custom actions + var radialUI = alternateMenuOrigin.GetComponentInChildren(true); + radialUI.actions = m_PreviousActions; + radialUI.visible = false; + } if (m_ColorPicker) ObjectUtils.Destroy(m_ColorPicker.gameObject); @@ -85,11 +93,6 @@ void OnDestroy() if (m_AnnotationPointer) ObjectUtils.Destroy(m_AnnotationPointer.gameObject); - - //HACK: Get RadialMenuUI directly until we create an interface to set custom actions - var radialUI = alternateMenuOrigin.GetComponentInChildren(true); - radialUI.actions = m_PreviousActions; - radialUI.visible = false; } void Start() From aaa5e8272f6430c08c9f6a6358556fbb306c84e1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 23:49:24 -0700 Subject: [PATCH 302/870] Handle byte conversion for haptics --- Scripts/Modules/HapticsModule.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index 4fcbc6c35..c68e7ef7b 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -42,7 +42,7 @@ void LateUpdate() OVRHaptics.Process(); } - public void PerformHaptics(float duration, float intensity = 1f) + public void PerformHaptics(float duration, float intensity = 1f, bool fadeIn = false) { // Clip buffer can hold up to 800 milliseconds of samples // At 320Hz, each sample is 3.125f milliseconds @@ -51,12 +51,22 @@ public void PerformHaptics(float duration, float intensity = 1f) m_GeneratedHapticClip.Reset(); // TODO: Support multiple generated clips + const float kFadeInSampleCount = 200f; const int kIntensityIncreaseMultiplier = 255; // Maximum value of 255 for intensity intensity = Mathf.Clamp(Mathf.Clamp01(intensity) * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, 255); byte hapticClipSample = Convert.ToByte(intensity); duration *= 490; // Samplerate conversion : 44100/90fps - for (int i = 0; i < duration; ++i) - m_GeneratedHapticClip.WriteSample(hapticClipSample); + for (int i = 1; i < duration; ++i) + { + float sampleShaped = hapticClipSample; + if (fadeIn && i < kFadeInSampleCount) + { + sampleShaped = Mathf.Lerp(0, intensity, i / kFadeInSampleCount); + } + + Debug.LogWarning(Convert.ToByte(sampleShaped)); + m_GeneratedHapticClip.WriteSample(Convert.ToByte(sampleShaped)); + } m_RHapticsChannel.Mix(m_GeneratedHapticClip); m_LHapticsChannel.Mix(m_GeneratedHapticClip); From 0cd7e7323b1facd060cb8e11144cf51e4079ebb1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 23:49:50 -0700 Subject: [PATCH 303/870] Add FadeIn logic to IPerformHaptics --- Scripts/Interfaces/IPerformHaptics.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Interfaces/IPerformHaptics.cs b/Scripts/Interfaces/IPerformHaptics.cs index 7036f7c39..c62c2c599 100644 --- a/Scripts/Interfaces/IPerformHaptics.cs +++ b/Scripts/Interfaces/IPerformHaptics.cs @@ -11,7 +11,7 @@ public interface IPerformHaptics public static class IPerformHapticsMethods { - internal delegate void PerformHapticsDelegate(float duration, float intensity = 1f); + internal delegate void PerformHapticsDelegate(float duration, float intensity = 1f, bool fadeIn = false); internal static PerformHapticsDelegate performHaptics { get; set; } @@ -20,9 +20,9 @@ public static class IPerformHapticsMethods /// /// Duration of haptic feedback /// Intensity of haptic feedback (optional) - public static void PerformHaptics(this IPerformHaptics obj, float duration, float intensity = 1f) + public static void PerformHaptics(this IPerformHaptics obj, float duration, float intensity = 1f, bool fadeIn = false) { - performHaptics(duration, intensity); + performHaptics(duration, intensity, fadeIn); } } } From a391933ba2ccc5b6c700cc408107c6cbbf4f9f18 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 1 Jun 2017 23:50:43 -0700 Subject: [PATCH 304/870] Add haptics fadeIn support in WorkspaceUI frame hover --- Workspaces/Base/WorkspaceUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 4d6813da2..c4894108b 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -815,7 +815,7 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount) // If hovering the frame, and not dragging, perform haptic feedback if (m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.PerformHaptics(0.25f, 0.05f); + this.PerformHaptics(1.25f, 0.05f, true); m_FrameThicknessCoroutine = null; } From fbce000ae5b07eb0b883f1279ba3ac509b2ecc1b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 2 Jun 2017 11:35:02 -0700 Subject: [PATCH 305/870] Fix color picker scale --- Tools/AnnotationTool/AnnotationTool.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 9155bafc9..fc41835ab 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -111,6 +111,7 @@ void Start() m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); m_ColorPickerActivator.transform.localRotation = Quaternion.identity; m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; + m_ColorPickerActivator.transform.localScale = Vector3.one; var activator = m_ColorPickerActivator.GetComponent(); From 78657c1b084e8aebb2fd03d2db4ea0996759d96b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 2 Jun 2017 15:22:54 -0700 Subject: [PATCH 306/870] Remove previous haptics implementation in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index b31d9fc55..1ad702a19 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -294,9 +294,6 @@ public Transform alternateMenuOrigin bool m_Highlighted; bool m_ActiveTool; bool m_Visible; - OVRHaptics.OVRHapticsChannel m_LHapticsChannel; - OVRHaptics.OVRHapticsChannel m_RHapticsChannel; - OVRHapticsClip m_GeneratedHapticClip; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -379,8 +376,8 @@ public bool highlighted if (!m_Highlighted) this.HideTooltip(this); - else - PerformHoverHaptics(); + //else + // perform haptics here for spatial scrolling if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) { @@ -536,10 +533,6 @@ void Awake() void Start() { - m_LHapticsChannel = OVRHaptics.LeftChannel; - m_RHapticsChannel = OVRHaptics.RightChannel; - m_GeneratedHapticClip = new OVRHapticsClip(); - //m_GradientButton.onClick += ButtonClicked; // TODO remove after action button refactor Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); @@ -641,20 +634,6 @@ bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) return buttonType == PinnedToolActionButton.ButtonType.SelectTool; } - void PerformHoverHaptics() - { - m_GeneratedHapticClip.Reset(); - var intensity = 25; - intensity = Mathf.Clamp(intensity, 0, 255); - byte holder = Convert.ToByte(intensity); - var clipLength = 25; - for (int i = 0; i < clipLength; ++i) - m_GeneratedHapticClip.WriteSample(holder); - - m_RHapticsChannel.Mix(m_GeneratedHapticClip); - m_LHapticsChannel.Mix(m_GeneratedHapticClip); - } - void OnBackgroundHoverEnter () { //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); From a09cebc907b3b16dc10482fafad9309de7c7544c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 2 Jun 2017 16:00:03 -0700 Subject: [PATCH 307/870] Add undo/redo buttons --- Tools/AnnotationTool/AnnotationTool.cs | 13 +- .../Prefabs/AnnotationUI.prefab | 2159 +++++++++++++++++ ...r.prefab.meta => AnnotationUI.prefab.meta} | 0 .../Prefabs/ColorPickerActivator.prefab | 993 -------- .../UserInterface/ColorPickerActivator.cs | 35 +- .../UserInterface/ColorPickerUI.cs | 4 +- 6 files changed, 2205 insertions(+), 999 deletions(-) create mode 100644 Tools/AnnotationTool/Prefabs/AnnotationUI.prefab rename Tools/AnnotationTool/Prefabs/{ColorPickerActivator.prefab.meta => AnnotationUI.prefab.meta} (100%) delete mode 100644 Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index fc41835ab..44158b3e6 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -113,7 +113,7 @@ void Start() m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; m_ColorPickerActivator.transform.localScale = Vector3.one; - var activator = m_ColorPickerActivator.GetComponent(); + var activator = m_ColorPickerActivator.GetComponentInChildren(); m_ColorPicker = activator.GetComponentInChildren(true); m_ColorPicker.onHideCalled = HideColorPicker; @@ -123,13 +123,18 @@ void Start() activator.rayOrigin = otherRayOrigins.First(); activator.showColorPicker = ShowColorPicker; activator.hideColorPicker = HideColorPicker; + +#if UNITY_EDITOR + activator.undoButtonClick += UnityEditor.Undo.PerformUndo; + activator.redoButtonClick += UnityEditor.Undo.PerformRedo; +#endif } //HACK: Get RadialMenuUI directly until we create an interface to set custom actions var radialUI = alternateMenuOrigin.GetComponentInChildren(true); m_PreviousActions = radialUI.actions; radialUI.actions = m_PreviousActions.Where(action => action.action is Undo || action.action is Redo).ToList(); - //radialUI.visible = true; + radialUI.visible = true; } void CheckBrushSizeUi() @@ -140,9 +145,11 @@ void CheckBrushSizeUi() m_BrushSizeUi = brushSizeUi.GetComponent(); var trans = brushSizeUi.transform; - trans.SetParent(alternateMenuOrigin); + var scale = brushSizeUi.transform.localScale; + trans.SetParent(alternateMenuOrigin, false); trans.localPosition = Vector3.zero; trans.localRotation = Quaternion.Euler(-90, 0, 0); + trans.localScale = scale; m_BrushSizeUi.onValueChanged = (val) => { diff --git a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab new file mode 100644 index 000000000..74b94d05a --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab @@ -0,0 +1,2159 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000010255295176} + m_IsPrefabParent: 1 +--- !u!1 &1000010117119988 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011933393472} + - component: {fileID: 223000010278076522} + - component: {fileID: 114000013959281966} + - component: {fileID: 114000011474110792} + - component: {fileID: 114000010240686482} + m_Layer: 5 + m_Name: ColorPickerUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010255295176 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000012841704540} + m_Layer: 0 + m_Name: AnnotationUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010613848074 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013792078156} + - component: {fileID: 222000013607042274} + - component: {fileID: 114000010862220058} + - component: {fileID: 114000012642262872} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010898514098 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013901019326} + - component: {fileID: 65000012153002324} + m_Layer: 5 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000010981163860 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011891419810} + - component: {fileID: 114000012907839542} + - component: {fileID: 225000012229749264} + m_Layer: 5 + m_Name: BrightnessSlider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011463743810 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000010924652800} + - component: {fileID: 33000010952925324} + - component: {fileID: 23000011095290868} + m_Layer: 5 + m_Name: ColorWheel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000011582997490 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011129790424} + - component: {fileID: 222000010186370168} + - component: {fileID: 114000013248295880} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012033952848 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013465431762} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012208465784 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000013117727556} + m_Layer: 5 + m_Name: TargetScale + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012763078460 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012639415320} + - component: {fileID: 222000013457728422} + - component: {fileID: 114000010927911954} + m_Layer: 5 + m_Name: ColorPicker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013722987470 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000012336507532} + m_Layer: 5 + m_Name: GrowHolder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013793807480 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013288384236} + - component: {fileID: 222000011629875738} + - component: {fileID: 114000012792763378} + m_Layer: 5 + m_Name: Picker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1000014088439944 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012070844378} + - component: {fileID: 222000013866580918} + - component: {fileID: 114000011559721380} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014121892912 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4000010343588658} + m_Layer: 5 + m_Name: WheelHolder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1036881825388254 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224393326463988594} + - component: {fileID: 222928571895566388} + - component: {fileID: 114121773849455374} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1099690223586730 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4940108482629240} + - component: {fileID: 33257561653289390} + - component: {fileID: 23652728190552066} + m_Layer: 0 + m_Name: ButtonMesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1136647751248060 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4663617041298854} + - component: {fileID: 33923684612379296} + - component: {fileID: 23825123643262260} + - component: {fileID: 64638945432625296} + m_Layer: 5 + m_Name: Base + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1141551173516660 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224963898299502848} + - component: {fileID: 222582790420601646} + - component: {fileID: 114469476190543946} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1167948277449984 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224333717671022096} + - component: {fileID: 33699724321051718} + - component: {fileID: 23309274037775718} + - component: {fileID: 114168715074745758} + - component: {fileID: 135185009107635084} + m_Layer: 5 + m_Name: Base + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1187994386522324 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4066649049098668} + m_Layer: 5 + m_Name: TooltipSource + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1279537530764624 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4230552379396688} + - component: {fileID: 114543901646842364} + m_Layer: 5 + m_Name: Undo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1329748470766914 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4670339961100958} + m_Layer: 5 + m_Name: RotationPivot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1346101208067254 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4626871607531114} + - component: {fileID: 114955240123553084} + - component: {fileID: 114360875105238964} + m_Layer: 5 + m_Name: ColorPickerActivator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1347799845701476 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4702350181192430} + m_Layer: 5 + m_Name: TooltipSource + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1361017080451862 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4572708185800628} + - component: {fileID: 33824803535794784} + - component: {fileID: 23437852442812966} + m_Layer: 0 + m_Name: ButtonMesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1365241548943880 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224107373598291132} + - component: {fileID: 33095966663817246} + - component: {fileID: 23375274514904506} + - component: {fileID: 114257755424135964} + - component: {fileID: 135877582041375586} + m_Layer: 5 + m_Name: Base + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1382527450794256 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4843657865520138} + - component: {fileID: 114824239518982862} + m_Layer: 5 + m_Name: Redo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1411372913666494 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224860733548256162} + - component: {fileID: 225914373114193260} + - component: {fileID: 223499351256631318} + m_Layer: 5 + m_Name: ButtonContentContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1430967031119936 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224638576672757326} + - component: {fileID: 222975643046639372} + - component: {fileID: 114967506099497140} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1482568457756204 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224939432255965946} + m_Layer: 5 + m_Name: IconContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1490901763651664 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4796074920551568} + m_Layer: 5 + m_Name: RotationPivot + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1603094234734992 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224124519857189990} + - component: {fileID: 225328779711015670} + - component: {fileID: 223502477285382174} + m_Layer: 5 + m_Name: ButtonContentContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1619517534170012 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224388597326433990} + - component: {fileID: 222227951865979474} + - component: {fileID: 114481225842932662} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1863793980498380 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4166573009768210} + m_Layer: 5 + m_Name: TooltipTarget + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1887300028592862 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224878234700512394} + m_Layer: 5 + m_Name: IconContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1913076707455610 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4602986436310456} + m_Layer: 5 + m_Name: TooltipTarget + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010343588658 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014121892912} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0.015, y: 0.0008, z: 0} + m_LocalScale: {x: 0.029, y: 0.029, z: 0.029} + m_Children: + - {fileID: 4000010924652800} + - {fileID: 224000011933393472} + m_Father: {fileID: 4000012336507532} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!4 &4000010924652800 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011463743810} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000010343588658} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!4 &4000012336507532 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013722987470} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.015, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4663617041298854} + - {fileID: 4000010343588658} + m_Father: {fileID: 4626871607531114} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000012841704540 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010255295176} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4626871607531114} + - {fileID: 4230552379396688} + - {fileID: 4843657865520138} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000013117727556 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012208465784} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0} + m_LocalScale: {x: 4, y: 1, z: 4} + m_Children: [] + m_Father: {fileID: 4626871607531114} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4066649049098668 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1187994386522324} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0.01267001, y: 0.00078000035, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4230552379396688} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!4 &4166573009768210 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1863793980498380} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0.025, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4843657865520138} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!4 &4230552379396688 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1279537530764624} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.006864082, y: 0.0018081665, z: 0.00087684765} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4602986436310456} + - {fileID: 4066649049098668} + - {fileID: 4670339961100958} + m_Father: {fileID: 4000012841704540} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4572708185800628 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1361017080451862} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0, z: 0.00009} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224939432255965946} + m_Father: {fileID: 224860733548256162} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4602986436310456 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1913076707455610} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0.025, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4230552379396688} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!4 &4626871607531114 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1346101208067254} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.006864082, y: 0.0018081665, z: -0.032373153} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4000013117727556} + - {fileID: 4000012336507532} + m_Father: {fileID: 4000012841704540} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4663617041298854 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1136647751248060} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.015, y: 0.0004, z: 0} + m_LocalScale: {x: 0.5, y: 0.25, z: 0.5} + m_Children: [] + m_Father: {fileID: 4000012336507532} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4670339961100958 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1329748470766914} + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224107373598291132} + - {fileID: 224124519857189990} + m_Father: {fileID: 4230552379396688} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!4 &4702350181192430 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1347799845701476} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0.01267001, y: 0.00078000035, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4843657865520138} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!4 &4796074920551568 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1490901763651664} + m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224333717671022096} + - {fileID: 224860733548256162} + m_Father: {fileID: 4843657865520138} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!4 &4843657865520138 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1382527450794256} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.006864082, y: 0.0018081665, z: 0.029026847} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4166573009768210} + - {fileID: 4702350181192430} + - {fileID: 4796074920551568} + m_Father: {fileID: 4000012841704540} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4940108482629240 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1099690223586730} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0, z: 0.00009} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224878234700512394} + m_Father: {fileID: 224124519857189990} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23000011095290868 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011463743810} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: ed6062fbd167bed46b70b3ae75c81624, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23309274037775718 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1167948277449984} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 6adae681ad457e140ac31a9ac83c3a11, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23375274514904506 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1365241548943880} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 6adae681ad457e140ac31a9ac83c3a11, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23437852442812966 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1361017080451862} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} + - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23652728190552066 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1099690223586730} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} + - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23825123643262260 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1136647751248060} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: f250eb9aab0312446bf01122291cf55e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33000010952925324 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011463743810} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33095966663817246 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1365241548943880} + m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!33 &33257561653289390 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1099690223586730} + m_Mesh: {fileID: 4300000, guid: 7f7c3987753e1bf41bee70661b3eff03, type: 3} +--- !u!33 &33699724321051718 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1167948277449984} + m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!33 &33824803535794784 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1361017080451862} + m_Mesh: {fileID: 4300000, guid: 7f7c3987753e1bf41bee70661b3eff03, type: 3} +--- !u!33 &33923684612379296 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1136647751248060} + m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!64 &64638945432625296 +MeshCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1136647751248060} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Convex: 0 + m_InflateMesh: 0 + m_SkinWidth: 0.01 + m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!65 &65000012153002324 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010898514098} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 945.4, y: 1268, z: 10} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &114000010240686482 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ab372430e8c50ee47b774cdb4ac79e18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FadeTime: 0.25 + m_ColorPicker: {fileID: 114000010862220058} + m_SliderBackground: {fileID: 114000013248295880} + m_Picker: {fileID: 224000013288384236} + m_ColorPickerSquare: {fileID: 114000012642262872} +--- !u!114 &114000010862220058 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010613848074} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 2800000, guid: 213a1424a537fb84d8128ab7db0cf05b, type: 3} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &114000010927911954 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012763078460} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 224000013288384236} + m_Horizontal: 1 + m_Vertical: 1 + m_MovementType: 2 + m_Elasticity: 0.1 + m_Inertia: 0 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 224000013792078156} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 0 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000011474110792 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 0 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &114000011559721380 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014088439944} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 0 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012642262872 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010613848074} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d26287cff9f94b448a1b36ffa9eccd4e, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000010862220058} +--- !u!114 &114000012792763378 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013793807480} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 054f8016e5e85e745a11230d51f0ca2b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000012907839542 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010981163860} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000011559721380} + m_FillRect: {fileID: 0} + m_HandleRect: {fileID: 224000012070844378} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 1 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 114000010240686482} + m_MethodName: OnSliderChanged + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 + m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &114000013248295880 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011582997490} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &114000013959281966 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &114121773849455374 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1036881825388254} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 007346dc664d64847a830c562c9659f9, type: 3} + m_FontSize: 250 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 0 + m_MaxSize: 250 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: A +--- !u!114 &114168715074745758 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1167948277449984} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NormalGradientPair: + a: {r: 0, g: 0, b: 0, a: 0} + b: {r: 0, g: 0, b: 0, a: 0} + m_HighlightGradientPair: + a: {r: 0, g: 0, b: 0, a: 0} + b: {r: 0, g: 0, b: 0, a: 0} + m_ButtonMeshRenderer: {fileID: 23437852442812966} + m_IconContainer: {fileID: 224939432255965946} + m_ContentContainer: {fileID: 224860733548256162} + m_CanvasGroup: {fileID: 225914373114193260} + m_Text: {fileID: 114121773849455374} + m_Icon: {fileID: 114967506099497140} + m_AlternateIconSprite: {fileID: 0} + m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightItems: + - {fileID: 114967506099497140} + - {fileID: 114121773849455374} + m_DelayBeforeReveal: 0 + m_highlightZScaleMultiplier: 10 +--- !u!114 &114257755424135964 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1365241548943880} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_NormalGradientPair: + a: {r: 0, g: 0, b: 0, a: 0} + b: {r: 0, g: 0, b: 0, a: 0} + m_HighlightGradientPair: + a: {r: 0, g: 0, b: 0, a: 0} + b: {r: 0, g: 0, b: 0, a: 0} + m_ButtonMeshRenderer: {fileID: 23652728190552066} + m_IconContainer: {fileID: 224878234700512394} + m_ContentContainer: {fileID: 224124519857189990} + m_CanvasGroup: {fileID: 225328779711015670} + m_Text: {fileID: 114469476190543946} + m_Icon: {fileID: 114481225842932662} + m_AlternateIconSprite: {fileID: 0} + m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightItems: + - {fileID: 114481225842932662} + - {fileID: 114469476190543946} + m_DelayBeforeReveal: 0 + m_highlightZScaleMultiplier: 10 +--- !u!114 &114360875105238964 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1346101208067254} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39742408926c5694d89876057a60578a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TargetScale: {fileID: 4000013117727556} + m_Icon: {fileID: 4000012336507532} + m_Undo: {fileID: 1279537530764624} + m_Redo: {fileID: 1382527450794256} +--- !u!114 &114469476190543946 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1141551173516660} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 007346dc664d64847a830c562c9659f9, type: 3} + m_FontSize: 250 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 0 + m_MaxSize: 250 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: A +--- !u!114 &114481225842932662 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1619517534170012} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: f7acf93d805e2dd42b4f32bed5d45ce8, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114543901646842364 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1279537530764624} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 121a9b94e41e9e444af3e8069a887154, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TooltipText: Undo + m_TooltipTarget: {fileID: 4602986436310456} + m_TooltipSource: {fileID: 4066649049098668} + m_TooltipAlignment: 0 +--- !u!114 &114824239518982862 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1382527450794256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 121a9b94e41e9e444af3e8069a887154, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TooltipText: Redo + m_TooltipTarget: {fileID: 4166573009768210} + m_TooltipSource: {fileID: 4702350181192430} + m_TooltipAlignment: 0 +--- !u!114 &114955240123553084 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1346101208067254} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SelectionFlags: 3 +--- !u!114 &114967506099497140 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1430967031119936} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 6c24010c054434e468a95292a7af0f67, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!135 &135185009107635084 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1167948277449984} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.03 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135877582041375586 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1365241548943880} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.03 + m_Center: {x: 0, y: 0, z: 0} +--- !u!222 &222000010186370168 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011582997490} +--- !u!222 &222000011629875738 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013793807480} +--- !u!222 &222000013457728422 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012763078460} +--- !u!222 &222000013607042274 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010613848074} +--- !u!222 &222000013866580918 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014088439944} +--- !u!222 &222227951865979474 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1619517534170012} +--- !u!222 &222582790420601646 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1141551173516660} +--- !u!222 &222928571895566388 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1036881825388254} +--- !u!222 &222975643046639372 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1430967031119936} +--- !u!223 &223000010278076522 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!223 &223499351256631318 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1411372913666494} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!223 &223502477285382174 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1603094234734992} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &224000011129790424 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011582997490} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011891419810} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011891419810 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010981163860} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000011129790424} + - {fileID: 224000013465431762} + m_Father: {fileID: 224000011933393472} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 128} + m_Pivot: {x: 0.5, y: 0} +--- !u!224 &224000011933393472 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010117119988} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.001} + m_LocalScale: {x: 0.00195, y: 0.00195, z: 0.00195} + m_Children: + - {fileID: 224000012639415320} + - {fileID: 224000011891419810} + - {fileID: 224000013901019326} + m_Father: {fileID: 4000010343588658} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: -0.125} + m_SizeDelta: {x: 512, y: 640} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012070844378 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014088439944} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000013465431762} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 4.100006, y: 0} + m_SizeDelta: {x: 28.3, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012639415320 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012763078460} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000013792078156} + m_Father: {fileID: 224000011933393472} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 512} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &224000013288384236 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013793807480} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000013792078156} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -256} + m_SizeDelta: {x: 50, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013465431762 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012033952848} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000012070844378} + m_Father: {fileID: 224000011891419810} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -48} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013792078156 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010613848074} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000013288384236} + m_Father: {fileID: 224000012639415320} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013901019326 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010898514098} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011933393472} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224107373598291132 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1365241548943880} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.425, y: 0.5000001, z: 0.42500013} + m_Children: [] + m_Father: {fileID: 4670339961100958} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224124519857189990 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1603094234734992} + m_LocalRotation: {x: 1, y: -0, z: -0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.00093460095} + m_LocalScale: {x: 0.85, y: 0.85000026, z: 0.13000003} + m_Children: + - {fileID: 4940108482629240} + m_Father: {fileID: 4670339961100958} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -0.0000012314413} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224333717671022096 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1167948277449984} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.425, y: 0.5000001, z: 0.42500013} + m_Children: [] + m_Father: {fileID: 4796074920551568} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224388597326433990 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1619517534170012} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00000013453973} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224878234700512394} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: -24.5, y: -24.5} + m_AnchorMax: {x: 25.5, y: 25.5} + m_AnchoredPosition: {x: -0.00000032782555, y: 0.00000014901161} + m_SizeDelta: {x: -1.13105, y: -1.13086} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224393326463988594 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1036881825388254} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00000013408862} + m_LocalScale: {x: 0.00008, y: 0.00008, z: 1} + m_Children: [] + m_Father: {fileID: 224939432255965946} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.00008, y: 0.0005000001} + m_SizeDelta: {x: 268.38452, y: 268.38452} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224638576672757326 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1430967031119936} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00000013453973} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224939432255965946} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: -24.5, y: -24.5} + m_AnchorMax: {x: 25.5, y: 25.5} + m_AnchoredPosition: {x: -0.00000032782555, y: 0.00000014901161} + m_SizeDelta: {x: -1.13105, y: -1.13086} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224860733548256162 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1411372913666494} + m_LocalRotation: {x: 1, y: -0, z: -0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.00093460095} + m_LocalScale: {x: 0.85, y: 0.85000026, z: 0.13000003} + m_Children: + - {fileID: 4572708185800628} + m_Father: {fileID: 4796074920551568} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 180, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -0.0000012314413} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224878234700512394 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1887300028592862} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224388597326433990} + - {fileID: 224963898299502848} + m_Father: {fileID: 4940108482629240} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -8.731149e-10, y: -2.3283064e-10} + m_SizeDelta: {x: 0.02307, y: 0.02307} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224939432255965946 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1482568457756204} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224638576672757326} + - {fileID: 224393326463988594} + m_Father: {fileID: 4572708185800628} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -8.731149e-10, y: -2.3283064e-10} + m_SizeDelta: {x: 0.02307, y: 0.02307} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224963898299502848 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1141551173516660} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00000013408862} + m_LocalScale: {x: 0.00008, y: 0.00008, z: 1} + m_Children: [] + m_Father: {fileID: 224878234700512394} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.00008, y: 0.0005000001} + m_SizeDelta: {x: 268.38452, y: 268.38452} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &225000012229749264 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010981163860} + m_Enabled: 1 + m_Alpha: 0 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 +--- !u!225 &225328779711015670 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1603094234734992} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 +--- !u!225 &225914373114193260 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1411372913666494} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab.meta b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab.meta similarity index 100% rename from Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab.meta rename to Tools/AnnotationTool/Prefabs/AnnotationUI.prefab.meta diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab deleted file mode 100644 index 22fae8791..000000000 --- a/Tools/AnnotationTool/Prefabs/ColorPickerActivator.prefab +++ /dev/null @@ -1,993 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1000010255295176} - m_IsPrefabParent: 1 ---- !u!1 &1000010117119988 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000011933393472} - - component: {fileID: 223000010278076522} - - component: {fileID: 114000013959281966} - - component: {fileID: 114000011474110792} - - component: {fileID: 114000010240686482} - m_Layer: 5 - m_Name: ColorPickerUI - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000010255295176 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000012841704540} - - component: {fileID: 114000013627361928} - - component: {fileID: 114000014269249202} - m_Layer: 5 - m_Name: ColorPickerActivator - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000010613848074 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000013792078156} - - component: {fileID: 222000013607042274} - - component: {fileID: 114000010862220058} - - component: {fileID: 114000012642262872} - m_Layer: 5 - m_Name: Viewport - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000010848960288 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000010665089078} - - component: {fileID: 33000012657744172} - - component: {fileID: 23000013942706604} - - component: {fileID: 64000011116907714} - m_Layer: 5 - m_Name: Base - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000010898514098 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000013901019326} - - component: {fileID: 65000012153002324} - m_Layer: 5 - m_Name: Collider - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000010981163860 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000011891419810} - - component: {fileID: 114000012907839542} - - component: {fileID: 225000012229749264} - m_Layer: 5 - m_Name: BrightnessSlider - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000011463743810 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000010924652800} - - component: {fileID: 33000010952925324} - - component: {fileID: 23000011095290868} - m_Layer: 5 - m_Name: ColorWheel - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1000011582997490 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000011129790424} - - component: {fileID: 222000010186370168} - - component: {fileID: 114000013248295880} - m_Layer: 5 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000012033952848 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000013465431762} - m_Layer: 5 - m_Name: Handle Slide Area - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000012208465784 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000013117727556} - m_Layer: 5 - m_Name: TargetScale - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000012763078460 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000012639415320} - - component: {fileID: 222000013457728422} - - component: {fileID: 114000010927911954} - m_Layer: 5 - m_Name: ColorPicker - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000013722987470 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000012336507532} - m_Layer: 5 - m_Name: GrowHolder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000013793807480 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000013288384236} - - component: {fileID: 222000011629875738} - - component: {fileID: 114000012792763378} - m_Layer: 5 - m_Name: Picker - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1000014088439944 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000012070844378} - - component: {fileID: 222000013866580918} - - component: {fileID: 114000011559721380} - m_Layer: 5 - m_Name: Handle - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000014121892912 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000010343588658} - m_Layer: 5 - m_Name: WheelHolder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &4000010343588658 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014121892912} - m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0.015, y: 0.0008, z: 0} - m_LocalScale: {x: 0.029, y: 0.029, z: 0.029} - m_Children: - - {fileID: 4000010924652800} - - {fileID: 224000011933393472} - m_Father: {fileID: 4000012336507532} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} ---- !u!4 &4000010665089078 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010848960288} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.015, y: 0.0004, z: 0} - m_LocalScale: {x: 0.5, y: 0.25, z: 0.5} - m_Children: [] - m_Father: {fileID: 4000012336507532} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000010924652800 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011463743810} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4000010343588658} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} ---- !u!4 &4000012336507532 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013722987470} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.015, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4000010665089078} - - {fileID: 4000010343588658} - m_Father: {fileID: 4000012841704540} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012841704540 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010255295176} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4000013117727556} - - {fileID: 4000012336507532} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000013117727556 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012208465784} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0} - m_LocalScale: {x: 4, y: 1, z: 4} - m_Children: [] - m_Father: {fileID: 4000012841704540} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23000011095290868 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011463743810} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: ed6062fbd167bed46b70b3ae75c81624, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23000013942706604 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010848960288} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: f250eb9aab0312446bf01122291cf55e, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &33000010952925324 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011463743810} - m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33000012657744172 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010848960288} - m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} ---- !u!64 &64000011116907714 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010848960288} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} ---- !u!65 &65000012153002324 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010898514098} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 945.4, y: 1268, z: 10} - m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &114000010240686482 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010117119988} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ab372430e8c50ee47b774cdb4ac79e18, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FadeTime: 0.25 - m_ColorPicker: {fileID: 114000010862220058} - m_BrightnessSlider: {fileID: 114000012907839542} - m_SliderBackground: {fileID: 114000013248295880} - m_Picker: {fileID: 224000013288384236} - m_ColorPickerSquare: {fileID: 114000012642262872} ---- !u!114 &114000010862220058 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010613848074} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Texture: {fileID: 2800000, guid: 213a1424a537fb84d8128ab7db0cf05b, type: 3} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 ---- !u!114 &114000010927911954 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012763078460} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Content: {fileID: 224000013288384236} - m_Horizontal: 1 - m_Vertical: 1 - m_MovementType: 2 - m_Elasticity: 0.1 - m_Inertia: 0 - m_DecelerationRate: 0.135 - m_ScrollSensitivity: 1 - m_Viewport: {fileID: 224000013792078156} - m_HorizontalScrollbar: {fileID: 0} - m_VerticalScrollbar: {fileID: 0} - m_HorizontalScrollbarVisibility: 0 - m_VerticalScrollbarVisibility: 0 - m_HorizontalScrollbarSpacing: 0 - m_VerticalScrollbarSpacing: 0 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &114000011474110792 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010117119988} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 0 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &114000011559721380 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014088439944} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 0 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114000012642262872 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010613848074} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d26287cff9f94b448a1b36ffa9eccd4e, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 0 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 114000010862220058} ---- !u!114 &114000012792763378 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013793807480} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 054f8016e5e85e745a11230d51f0ca2b, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114000012907839542 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010981163860} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 114000011559721380} - m_FillRect: {fileID: 0} - m_HandleRect: {fileID: 224000012070844378} - m_Direction: 0 - m_MinValue: 0 - m_MaxValue: 1 - m_WholeNumbers: 0 - m_Value: 1 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 114000010240686482} - m_MethodName: OnSliderChanged - m_Mode: 0 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 1 - m_TypeName: UnityEngine.UI.Slider+SliderEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &114000013248295880 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011582997490} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Texture: {fileID: 0} - m_UVRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 ---- !u!114 &114000013627361928 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010255295176} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_SelectionFlags: 3 ---- !u!114 &114000013959281966 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010117119988} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 ---- !u!114 &114000014269249202 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010255295176} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 39742408926c5694d89876057a60578a, type: 3} - m_Name: - m_EditorClassIdentifier: - m_TargetScale: {fileID: 4000013117727556} - m_Icon: {fileID: 4000012336507532} ---- !u!222 &222000010186370168 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011582997490} ---- !u!222 &222000011629875738 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013793807480} ---- !u!222 &222000013457728422 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012763078460} ---- !u!222 &222000013607042274 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010613848074} ---- !u!222 &222000013866580918 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014088439944} ---- !u!223 &223000010278076522 -Canvas: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010117119988} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 25 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!224 &224000011129790424 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011582997490} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000011891419810} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0.25} - m_AnchorMax: {x: 1, y: 0.75} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000011891419810 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010981163860} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000011129790424} - - {fileID: 224000013465431762} - m_Father: {fileID: 224000011933393472} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 128} - m_Pivot: {x: 0.5, y: 0} ---- !u!224 &224000011933393472 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010117119988} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.001} - m_LocalScale: {x: 0.00195, y: 0.00195, z: 0.00195} - m_Children: - - {fileID: 224000012639415320} - - {fileID: 224000011891419810} - - {fileID: 224000013901019326} - m_Father: {fileID: 4000010343588658} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: -0.125} - m_SizeDelta: {x: 512, y: 640} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000012070844378 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014088439944} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000013465431762} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 4.1, y: 0} - m_SizeDelta: {x: 28.3, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000012639415320 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012763078460} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000013792078156} - m_Father: {fileID: 224000011933393472} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 512} - m_Pivot: {x: 0.5, y: 1} ---- !u!224 &224000013288384236 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013793807480} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000013792078156} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: -256} - m_SizeDelta: {x: 50, y: 50} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000013465431762 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012033952848} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000012070844378} - m_Father: {fileID: 224000011891419810} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -20, y: -48} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000013792078156 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010613848074} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000013288384236} - m_Father: {fileID: 224000012639415320} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000013901019326 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010898514098} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000011933393472} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!225 &225000012229749264 -CanvasGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010981163860} - m_Enabled: 1 - m_Alpha: 0 - m_Interactable: 0 - m_BlocksRaycasts: 0 - m_IgnoreParentGroups: 0 diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index b08080421..e38af4f19 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using UnityEditor.Experimental.EditorVR.UI; using UnityEngine; using UnityEngine.EventSystems; @@ -11,12 +12,38 @@ public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointe [SerializeField] Transform m_Icon; + [SerializeField] + GameObject m_Undo; + + [SerializeField] + GameObject m_Redo; + Coroutine m_HighlightCoroutine; + GradientButton m_UndoButton; + GradientButton m_RedoButton; public Transform rayOrigin { private get; set; } public Action showColorPicker { private get; set; } public Action hideColorPicker { private get; set; } - + + public event Action undoButtonClick + { + add { m_UndoButton.click += value; } + remove { m_UndoButton.click -= value; } + } + + public event Action redoButtonClick + { + add { m_RedoButton.click += value; } + remove { m_RedoButton.click -= value; } + } + + void Awake() + { + m_UndoButton = m_Undo.GetComponentInChildren(); + m_RedoButton = m_Redo.GetComponentInChildren(); + } + public void OnPointerClick(PointerEventData eventData) { eventData.Use(); @@ -29,6 +56,9 @@ public void OnPointerEnter(PointerEventData eventData) showColorPicker(rayOrigin); m_HighlightCoroutine = StartCoroutine(Highlight()); + + m_Undo.SetActive(false); + m_Redo.SetActive(false); eventData.Use(); } @@ -40,6 +70,9 @@ public void OnPointerExit(PointerEventData eventData) hideColorPicker(); m_HighlightCoroutine = StartCoroutine(Highlight(false)); + + m_Undo.SetActive(true); + m_Redo.SetActive(true); } IEnumerator Highlight(bool transitionIn = true) diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index 4db29ee95..8ac3ea7e1 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -18,11 +18,11 @@ public class ColorPickerUI : MonoBehaviour, IPointerExitHandler [SerializeField] RectTransform m_Picker; - Vector3 m_PickerTargetPosition; - [SerializeField] ColorPickerSquareUI m_ColorPickerSquare; + Vector3 m_PickerTargetPosition; + Texture2D m_BrightnessBarTexture; Texture2D m_ColorPickerTexture; From 0843acd3439cb5e3980352c77a507eb05a4d34ed Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 2 Jun 2017 16:00:13 -0700 Subject: [PATCH 308/870] Change pointer shape --- Tools/AnnotationTool/UserInterface/AnnotationPointer.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs b/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs index 43aab5d2a..ed8f91d72 100644 --- a/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs +++ b/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs @@ -3,8 +3,9 @@ public class AnnotationPointer : MonoBehaviour { - const int k_Sides = 16; + const int k_Sides = 8; const float k_BottomRadius = 0.01f; + const float k_YScale = 2.5f; [SerializeField] Material m_ConeMaterial; @@ -15,11 +16,12 @@ public class AnnotationPointer : MonoBehaviour public void Resize(float size) { + size /= k_YScale; var vertices = m_CustomPointerMesh.vertices; for (var i = k_Sides; i < k_Sides * 2; i++) { var angle = (i / (float)k_Sides) * Mathf.PI * 2f; - var xPos = Mathf.Cos(angle) * size; + var xPos = Mathf.Sin(angle) * 0.001f; var yPos = Mathf.Sin(angle) * size; var point = new Vector3(xPos, yPos, AnnotationTool.TipDistance); @@ -38,6 +40,8 @@ void Awake() m_ConeMaterialInstance = Instantiate(m_ConeMaterial); gameObject.AddComponent().sharedMaterial = m_ConeMaterialInstance; + + transform.localScale = new Vector3(1, k_YScale, 1); } static Vector3[] GeneratePointerVertices() From 12ebb664e36014c77025087595f0e17cbcf90a1b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 2 Jun 2017 16:01:04 -0700 Subject: [PATCH 309/870] Remove radial UI for undo/redo --- Tools/AnnotationTool/AnnotationTool.cs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 44158b3e6..e2290ba99 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -55,8 +55,6 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr float m_BrushSize = MinBrushSize; - List m_PreviousActions; - public Transform rayOrigin { private get; set; } public List otherRayOrigins { private get; set; } @@ -77,11 +75,6 @@ void OnDestroy() { this.UnlockRay(rayOrigin, this); this.ShowDefaultRay(rayOrigin); - - //HACK: Get RadialMenuUI directly until we create an interface to set custom actions - var radialUI = alternateMenuOrigin.GetComponentInChildren(true); - radialUI.actions = m_PreviousActions; - radialUI.visible = false; } if (m_ColorPicker) @@ -129,12 +122,6 @@ void Start() activator.redoButtonClick += UnityEditor.Undo.PerformRedo; #endif } - - //HACK: Get RadialMenuUI directly until we create an interface to set custom actions - var radialUI = alternateMenuOrigin.GetComponentInChildren(true); - m_PreviousActions = radialUI.actions; - radialUI.actions = m_PreviousActions.Where(action => action.action is Undo || action.action is Redo).ToList(); - radialUI.visible = true; } void CheckBrushSizeUi() From 4107a450377b0bcbaeda8ebe46d6f461c57611c4 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 2 Jun 2017 16:46:59 -0700 Subject: [PATCH 310/870] Fix undo/redo button highlight states --- Tools/AnnotationTool/AnnotationTool.cs | 1 - .../Materials/UndoRedoButtonMaterial.mat | 85 +++++++++++++++++++ .../Materials/UndoRedoButtonMaterial.mat.meta | 8 ++ .../Prefabs/AnnotationUI.prefab | 28 +++--- .../UserInterface/ColorPickerActivator.cs | 11 +++ 5 files changed, 118 insertions(+), 15 deletions(-) create mode 100644 Tools/AnnotationTool/Materials/UndoRedoButtonMaterial.mat create mode 100644 Tools/AnnotationTool/Materials/UndoRedoButtonMaterial.mat.meta diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index e2290ba99..5404be8db 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR; -using UnityEditor.Experimental.EditorVR.Actions; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; diff --git a/Tools/AnnotationTool/Materials/UndoRedoButtonMaterial.mat b/Tools/AnnotationTool/Materials/UndoRedoButtonMaterial.mat new file mode 100644 index 000000000..f0ba3b358 --- /dev/null +++ b/Tools/AnnotationTool/Materials/UndoRedoButtonMaterial.mat @@ -0,0 +1,85 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: UndoRedoButtonMaterial + m_Shader: {fileID: 10760, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHABLEND_ON _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: 9503 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _BumpScale: 1 + - _ColorMask: 15 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _InvFade: 1 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UVSec: 0 + - _UseUIAlphaClip: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _TintColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tools/AnnotationTool/Materials/UndoRedoButtonMaterial.mat.meta b/Tools/AnnotationTool/Materials/UndoRedoButtonMaterial.mat.meta new file mode 100644 index 000000000..c31df6906 --- /dev/null +++ b/Tools/AnnotationTool/Materials/UndoRedoButtonMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f51c2d173513e574f91a3666d94906b2 +timeCreated: 1475037493 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab index 74b94d05a..b761c8c3b 100644 --- a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab +++ b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab @@ -1436,11 +1436,11 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_NormalGradientPair: - a: {r: 0, g: 0, b: 0, a: 0} - b: {r: 0, g: 0, b: 0, a: 0} + a: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + b: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} m_HighlightGradientPair: - a: {r: 0, g: 0, b: 0, a: 0} - b: {r: 0, g: 0, b: 0, a: 0} + a: {r: 0.19607843, g: 0.2, b: 0.2, a: 1} + b: {r: 0.19607843, g: 0.2, b: 0.2, a: 1} m_ButtonMeshRenderer: {fileID: 23437852442812966} m_IconContainer: {fileID: 224939432255965946} m_ContentContainer: {fileID: 224860733548256162} @@ -1449,7 +1449,7 @@ MonoBehaviour: m_Icon: {fileID: 114967506099497140} m_AlternateIconSprite: {fileID: 0} m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightItemColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_HighlightItems: - {fileID: 114967506099497140} - {fileID: 114121773849455374} @@ -1467,11 +1467,11 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_NormalGradientPair: - a: {r: 0, g: 0, b: 0, a: 0} - b: {r: 0, g: 0, b: 0, a: 0} + a: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + b: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} m_HighlightGradientPair: - a: {r: 0, g: 0, b: 0, a: 0} - b: {r: 0, g: 0, b: 0, a: 0} + a: {r: 0.19607843, g: 0.2, b: 0.2, a: 1} + b: {r: 0.19607843, g: 0.2, b: 0.2, a: 1} m_ButtonMeshRenderer: {fileID: 23652728190552066} m_IconContainer: {fileID: 224878234700512394} m_ContentContainer: {fileID: 224124519857189990} @@ -1480,7 +1480,7 @@ MonoBehaviour: m_Icon: {fileID: 114481225842932662} m_AlternateIconSprite: {fileID: 0} m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightItemColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_HighlightItems: - {fileID: 114481225842932662} - {fileID: 114469476190543946} @@ -1545,8 +1545,8 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_Material: {fileID: 2100000, guid: f51c2d173513e574f91a3666d94906b2, type: 2} + m_Color: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: @@ -1614,8 +1614,8 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} + m_Material: {fileID: 2100000, guid: f51c2d173513e574f91a3666d94906b2, type: 2} + m_Color: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index e38af4f19..26ab86356 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using UnityEditor.Experimental.EditorVR.UI; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.EventSystems; @@ -41,7 +42,17 @@ public event Action redoButtonClick void Awake() { m_UndoButton = m_Undo.GetComponentInChildren(); + m_UndoButton.normalGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; + m_UndoButton.highlightGradientPair = UnityBrandColorScheme.sessionGradient; m_RedoButton = m_Redo.GetComponentInChildren(); + m_RedoButton.normalGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; + m_RedoButton.highlightGradientPair = UnityBrandColorScheme.sessionGradient; + } + + void Start() + { + m_UndoButton.UpdateMaterialColors(); + m_RedoButton.UpdateMaterialColors(); } public void OnPointerClick(PointerEventData eventData) From 56b25c7a046076fe44fff644cf7bab37fd160bbb Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 2 Jun 2017 17:01:24 -0700 Subject: [PATCH 311/870] Start working on constrained snapping mode --- Manipulators/BaseManipulator.cs | 2 +- Manipulators/DirectManipulator.cs | 4 ++-- Manipulators/StandardManipulator.cs | 11 ++++++++++- Scripts/Handles/LinearHandle.cs | 5 +++++ Scripts/Handles/PlaneHandle.cs | 5 +++++ Scripts/Interfaces/IManipulator.cs | 11 ++++++++++- Scripts/Interfaces/IUsesSnapping.cs | 17 +++++++++++++++++ Scripts/UI/KeyboardUI.cs | 2 +- Tools/TransformTool/TransformTool.cs | 15 ++++++++++----- 9 files changed, 61 insertions(+), 11 deletions(-) diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index 2a13f7794..86667082f 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -10,7 +10,7 @@ class BaseManipulator : MonoBehaviour, IManipulator public bool adjustScaleForCamera { get; set; } - public Action translate { protected get; set; } + public Action translate { protected get; set; } public Action rotate { protected get; set; } public Action scale { protected get; set; } diff --git a/Manipulators/DirectManipulator.cs b/Manipulators/DirectManipulator.cs index 13c18670e..5ed4f837e 100644 --- a/Manipulators/DirectManipulator.cs +++ b/Manipulators/DirectManipulator.cs @@ -22,7 +22,7 @@ public Transform target Vector3 m_PositionOffset; Quaternion m_RotationOffset; - public Action translate { private get; set; } + public Action translate { private get; set; } public Action rotate { private get; set; } public Action scale { private get; set; } @@ -74,7 +74,7 @@ void OnHandleDragging(BaseHandle handle, HandleEventData eventData) var target = m_Target == null ? transform : m_Target; var rayOrigin = eventData.rayOrigin; - translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, false); + translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, ConstrainedAxis.None); rotate(Quaternion.Inverse(target.rotation) * rayOrigin.rotation * m_RotationOffset); } diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index 08cdee817..d7fb2557d 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -67,7 +67,16 @@ void Update() void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) { - translate(eventData.deltaPosition, eventData.rayOrigin, !(handle is SphereHandle)); + var constraints = ConstrainedAxis.None; + var linear = handle as LinearHandle; + if (linear) + constraints = linear.constraints; + + var plane = handle as PlaneHandle; + if (plane) + constraints = plane.constraints; + + translate(eventData.deltaPosition, eventData.rayOrigin, constraints); } void OnRotateDragging(BaseHandle handle, HandleEventData eventData) diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index e1b5fb94a..e332c2cdf 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -20,11 +20,16 @@ public LinearHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, [SerializeField] bool m_OrientDragPlaneToRay = true; + [SerializeField] + ConstrainedAxis m_Constraints; + private const float k_MaxDragDistance = 1000f; private Plane m_Plane; private Vector3 m_LastPosition; + public ConstrainedAxis constraints { get { return m_Constraints; } } + private void OnDisable() { if (m_HandleTip != null) diff --git a/Scripts/Handles/PlaneHandle.cs b/Scripts/Handles/PlaneHandle.cs index ad30a6e39..2f7da4857 100644 --- a/Scripts/Handles/PlaneHandle.cs +++ b/Scripts/Handles/PlaneHandle.cs @@ -17,11 +17,16 @@ public PlaneHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, [SerializeField] private Material m_PlaneMaterial; + [SerializeField] + ConstrainedAxis m_Constraints; + private const float k_MaxDragDistance = 1000f; private Plane m_Plane; private Vector3 m_LastPosition; + public ConstrainedAxis constraints { get { return m_Constraints; } } + protected override HandleEventData GetHandleEventData(RayEventData eventData) { return new PlaneHandleEventData(eventData.rayOrigin, UIUtils.IsDirectEvent(eventData)) { raycastHitWorldPosition = eventData.pointerCurrentRaycast.worldPosition }; diff --git a/Scripts/Interfaces/IManipulator.cs b/Scripts/Interfaces/IManipulator.cs index f2365e87c..e46554767 100644 --- a/Scripts/Interfaces/IManipulator.cs +++ b/Scripts/Interfaces/IManipulator.cs @@ -4,6 +4,15 @@ namespace UnityEditor.Experimental.EditorVR { + [Flags] + public enum ConstrainedAxis + { + None = 0, + X = 1, + Y = 2, + Z = 4 + } + /// /// Gives decorated class access to the GameObject over which a particular ray is hovering /// @@ -13,7 +22,7 @@ public interface IManipulator /// Delegate that processes the translation, using the vector3 passed in /// Caller also provides the ray origin that is doing the action, and whether or not this translation is axis-constrained /// - Action translate { set; } + Action translate { set; } /// /// Delegate that processes the rotation, using the quaternion passed in diff --git a/Scripts/Interfaces/IUsesSnapping.cs b/Scripts/Interfaces/IUsesSnapping.cs index a5fc99135..32f77baa5 100644 --- a/Scripts/Interfaces/IUsesSnapping.cs +++ b/Scripts/Interfaces/IUsesSnapping.cs @@ -15,9 +15,11 @@ public static class IUsesSnappingMethods { internal delegate bool ManipulatorSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta); internal delegate bool DirectSnapDelegate(Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation); + internal delegate bool ConstrainedSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints); internal static ManipulatorSnapDelegate manipulatorSnap { get; set; } internal static DirectSnapDelegate directSnap { get; set; } + internal static ConstrainedSnapDelegate constrainedSnap { get; set; } internal static Action clearSnappingState { get; set; } /// @@ -57,6 +59,21 @@ public static void ClearSnappingState(this IUsesSnapping usesSnaping, Transform { clearSnappingState(rayOrigin); } + + /// + /// Perform constrained snapping: Translate a position vector using deltas while also respecting constraints and snapping + /// + /// The ray doing the translating + /// The transforms being translated (used to determine bounds; Transforms do not get modified) + /// The position being modified by delta. This will be set with a snapped position if possible + /// The rotation to be modified if rotation snapping is enabled + /// The position delta to apply + /// The axis constraints + /// Whether the position was set to a snapped position + public static bool ConstrainedSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints) + { + return constrainedSnap(rayOrigin, transforms, ref position, ref rotation, delta, constraints); + } } } #endif diff --git a/Scripts/UI/KeyboardUI.cs b/Scripts/UI/KeyboardUI.cs index c08d1b295..734eb6da2 100644 --- a/Scripts/UI/KeyboardUI.cs +++ b/Scripts/UI/KeyboardUI.cs @@ -341,7 +341,7 @@ bool InTransition() return collapsing || m_EligibleForDrag; } - void Translate(Vector3 deltaPosition, Transform rayOrigin, bool constrained) + void Translate(Vector3 deltaPosition, Transform rayOrigin, ConstrainedAxis constraints) { if (m_EligibleForDrag) transform.position += deltaPosition; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 144a9961f..8474752e4 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -537,12 +537,17 @@ public void DropHeldObjects(Node node) this.ClearSnappingState(rayOrigin); } - void Translate(Vector3 delta, Transform rayOrigin, bool constrained) + void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraint) { - if (constrained) - m_TargetPosition += delta; - else - this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta); + switch (constraint) + { + case ConstrainedAxis.None: + this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta); + break; + default: + m_TargetPosition += delta; + break; + } } void Rotate(Quaternion delta) From 3cbb76372fcc3f3ca0b81e5fdee0781ec1a12d2a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 2 Jun 2017 19:36:04 -0700 Subject: [PATCH 312/870] Add fading in/out to the PerformHaptics function --- Scripts/Interfaces/IPerformHaptics.cs | 6 +++--- Scripts/Modules/HapticsModule.cs | 17 +++++++++++------ Workspaces/Base/WorkspaceUI.cs | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Scripts/Interfaces/IPerformHaptics.cs b/Scripts/Interfaces/IPerformHaptics.cs index c62c2c599..58c3fc7b7 100644 --- a/Scripts/Interfaces/IPerformHaptics.cs +++ b/Scripts/Interfaces/IPerformHaptics.cs @@ -11,7 +11,7 @@ public interface IPerformHaptics public static class IPerformHapticsMethods { - internal delegate void PerformHapticsDelegate(float duration, float intensity = 1f, bool fadeIn = false); + internal delegate void PerformHapticsDelegate(float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false); internal static PerformHapticsDelegate performHaptics { get; set; } @@ -20,9 +20,9 @@ public static class IPerformHapticsMethods /// /// Duration of haptic feedback /// Intensity of haptic feedback (optional) - public static void PerformHaptics(this IPerformHaptics obj, float duration, float intensity = 1f, bool fadeIn = false) + public static void PerformHaptics(this IPerformHaptics obj, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { - performHaptics(duration, intensity, fadeIn); + performHaptics(duration, intensity, fadeIn, fadeOut); } } } diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index c68e7ef7b..e78e70b7c 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -42,7 +42,7 @@ void LateUpdate() OVRHaptics.Process(); } - public void PerformHaptics(float duration, float intensity = 1f, bool fadeIn = false) + public void PerformHaptics(float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { // Clip buffer can hold up to 800 milliseconds of samples // At 320Hz, each sample is 3.125f milliseconds @@ -51,20 +51,25 @@ public void PerformHaptics(float duration, float intensity = 1f, bool fadeIn = f m_GeneratedHapticClip.Reset(); // TODO: Support multiple generated clips - const float kFadeInSampleCount = 200f; + const float kSampleRateConversion = 490; // Samplerate conversion : 44100/90fps = 490 + var fadeInSampleCount = duration * kSampleRateConversion * 0.25f; const int kIntensityIncreaseMultiplier = 255; // Maximum value of 255 for intensity intensity = Mathf.Clamp(Mathf.Clamp01(intensity) * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, 255); byte hapticClipSample = Convert.ToByte(intensity); - duration *= 490; // Samplerate conversion : 44100/90fps + duration *= kSampleRateConversion; for (int i = 1; i < duration; ++i) { float sampleShaped = hapticClipSample; - if (fadeIn && i < kFadeInSampleCount) + if (fadeIn && i < fadeInSampleCount) { - sampleShaped = Mathf.Lerp(0, intensity, i / kFadeInSampleCount); + sampleShaped = Mathf.Lerp(0, intensity, i / fadeInSampleCount); + } + else if (fadeOut && i > duration - fadeInSampleCount) + { + sampleShaped = Mathf.Lerp(0, intensity, duration - i / fadeInSampleCount); + Debug.LogWarning(Convert.ToByte(sampleShaped) + " - i: " + i + " - duration: " + duration + " - fadeInSampleCount: " + fadeInSampleCount); } - Debug.LogWarning(Convert.ToByte(sampleShaped)); m_GeneratedHapticClip.WriteSample(Convert.ToByte(sampleShaped)); } diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index c4894108b..3554f480e 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -815,7 +815,7 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount) // If hovering the frame, and not dragging, perform haptic feedback if (m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.PerformHaptics(1.25f, 0.05f, true); + this.PerformHaptics(1.25f, 0.15f, true, true); m_FrameThicknessCoroutine = null; } From fa52f0004a99709ec71d0796f209331addb6dcae Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 14:22:01 -0700 Subject: [PATCH 313/870] Add FadeIn & FadeOut logic to PerformHaptics function in HapticsModule --- Scripts/Modules/HapticsModule.cs | 33 ++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index e78e70b7c..f6f184e4c 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -52,29 +52,38 @@ public void PerformHaptics(float duration, float intensity = 1f, bool fadeIn = f m_GeneratedHapticClip.Reset(); // TODO: Support multiple generated clips const float kSampleRateConversion = 490; // Samplerate conversion : 44100/90fps = 490 - var fadeInSampleCount = duration * kSampleRateConversion * 0.25f; const int kIntensityIncreaseMultiplier = 255; // Maximum value of 255 for intensity - intensity = Mathf.Clamp(Mathf.Clamp01(intensity) * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, 255); - byte hapticClipSample = Convert.ToByte(intensity); + duration = Mathf.Clamp(duration, 0f, 0.8f); // Clamp at maxiumum 800ms for sample buffer + var fadeInSampleCount = duration * kSampleRateConversion * 0.25f; + var fadeOutSampleCount = fadeInSampleCount * 2; // FadeOut is less apparent than FadeIn unless FadeOut duration is increased duration *= kSampleRateConversion; + var durationFadeOutPosition = duration - fadeOutSampleCount; + intensity = Mathf.Clamp(Mathf.Clamp01(intensity) * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, 255); + var hapticClipSample = Convert.ToByte(intensity); for (int i = 1; i < duration; ++i) { float sampleShaped = hapticClipSample; if (fadeIn && i < fadeInSampleCount) - { sampleShaped = Mathf.Lerp(0, intensity, i / fadeInSampleCount); - } - else if (fadeOut && i > duration - fadeInSampleCount) - { - sampleShaped = Mathf.Lerp(0, intensity, duration - i / fadeInSampleCount); - Debug.LogWarning(Convert.ToByte(sampleShaped) + " - i: " + i + " - duration: " + duration + " - fadeInSampleCount: " + fadeInSampleCount); - } + else if (fadeOut && i > durationFadeOutPosition) + sampleShaped = Mathf.Lerp(0, intensity, (duration - i) / fadeOutSampleCount); m_GeneratedHapticClip.WriteSample(Convert.ToByte(sampleShaped)); } - m_RHapticsChannel.Mix(m_GeneratedHapticClip); - m_LHapticsChannel.Mix(m_GeneratedHapticClip); + if (duration > 0.125f) + { + // Prevent multiple long clips from playing back simultaneously + // If the new clip has a long duration, stop playback of any existing clips + m_RHapticsChannel.Preempt(m_GeneratedHapticClip); + m_LHapticsChannel.Preempt(m_GeneratedHapticClip); + } + else + { + // Allow multiple short clips to play simultaneously + m_RHapticsChannel.Mix(m_GeneratedHapticClip); + m_LHapticsChannel.Mix(m_GeneratedHapticClip); + } } } } From 88b5b239fd7d7e73f10933e8cdccb4f2ed16e788 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 14:22:38 -0700 Subject: [PATCH 314/870] Reduce duration of workspace frame highlight haptics --- Workspaces/Base/WorkspaceUI.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 3554f480e..c9a41c435 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -771,7 +771,7 @@ void OnDestroy() { ObjectUtils.Destroy(m_TopFaceMaterial); ObjectUtils.Destroy(m_FrontFaceMaterial); - } + } public void CloseClick() { @@ -815,7 +815,7 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount) // If hovering the frame, and not dragging, perform haptic feedback if (m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.PerformHaptics(1.25f, 0.15f, true, true); + this.PerformHaptics(0.8f, 0.15f, true, true); m_FrameThicknessCoroutine = null; } From db61a37bdad9b75dc876e9864bbe133d25c95772 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 14:29:34 -0700 Subject: [PATCH 315/870] Rename "PerformHaptics" function to "Pulse" --- Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs | 2 +- Scripts/Interfaces/IPerformHaptics.cs | 2 +- Scripts/ListView/ListViewControllerBase.cs | 2 +- Scripts/Modules/HapticsModule.cs | 2 +- Workspaces/Base/WorkspaceUI.cs | 2 +- Workspaces/Common/Scripts/WorkspaceButton.cs | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs index 226fe0bd6..79eb25d94 100644 --- a/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs +++ b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs @@ -9,7 +9,7 @@ class HapticsModuleConnector : Nested, ILateBindInterfaceMethods { public void LateBindInterfaceMethods(HapticsModule provider) { - IPerformHapticsMethods.performHaptics = provider.PerformHaptics; + IPerformHapticsMethods.performHaptics = provider.Pulse; } } } diff --git a/Scripts/Interfaces/IPerformHaptics.cs b/Scripts/Interfaces/IPerformHaptics.cs index 58c3fc7b7..1bd9e3d1c 100644 --- a/Scripts/Interfaces/IPerformHaptics.cs +++ b/Scripts/Interfaces/IPerformHaptics.cs @@ -20,7 +20,7 @@ public static class IPerformHapticsMethods /// /// Duration of haptic feedback /// Intensity of haptic feedback (optional) - public static void PerformHaptics(this IPerformHaptics obj, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) + public static void Pulse(this IPerformHaptics obj, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { performHaptics(duration, intensity, fadeIn, fadeOut); } diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index a3fb706e6..fb69dfa94 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -234,7 +234,7 @@ public void OnScroll(PointerEventData eventData) scrollOffset += eventData.scrollDelta.y * scrollSpeed * Time.deltaTime; - this.PerformHaptics(0.0001f, 0.125f); + this.Pulse(0.0001f, 0.125f); } protected virtual void StartSettling(Action onComplete = null) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index f6f184e4c..b4fff332b 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -42,7 +42,7 @@ void LateUpdate() OVRHaptics.Process(); } - public void PerformHaptics(float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) + public void Pulse(float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { // Clip buffer can hold up to 800 milliseconds of samples // At 320Hz, each sample is 3.125f milliseconds diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index c9a41c435..353e123e0 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -815,7 +815,7 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount) // If hovering the frame, and not dragging, perform haptic feedback if (m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.PerformHaptics(0.8f, 0.15f, true, true); + this.Pulse(0.8f, 0.15f, true, true); m_FrameThicknessCoroutine = null; } diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 8e20c6b46..cb3837b9d 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -322,7 +322,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.PerformHaptics(0.005f, 0.075f); + this.Pulse(0.005f, 0.075f); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); @@ -472,7 +472,7 @@ void SwapIconSprite() void OnButtonClicked() { - this.PerformHaptics(0.175f, 0.05f); + this.Pulse(0.175f, 0.05f); } } } From 549682ca107e7a28b63386bce00ba6a76a944fdd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 14:31:18 -0700 Subject: [PATCH 316/870] Remove short/medium/long pulse duration members in HapticsModule; no longer needed --- Scripts/Modules/HapticsModule.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index b4fff332b..a08aada4c 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -9,15 +9,6 @@ sealed class HapticsModule : MonoBehaviour, IUsesGameObjectLocking [SerializeField] private float m_MasterIntensity = 1f; - [SerializeField] - private float m_ShortPulseDuration = 0.125f; - - [SerializeField] - private float m_MediumPulseDuration = 0.25f; - - [SerializeField] - private float m_LongPulseDuration = 0.5f; - /// /// Overall intensity of haptics. /// A value to 0 will mute haptics. From 6a88dcfa5b7d2b4d44831ea32177aa120c8faad6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 14:57:46 -0700 Subject: [PATCH 317/870] Add sample length warning (when greater than 0.8f) support to HapticsModule --- Scripts/Modules/HapticsModule.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index a08aada4c..ae7e24086 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules sealed class HapticsModule : MonoBehaviour, IUsesGameObjectLocking { [SerializeField] - private float m_MasterIntensity = 1f; + float m_MasterIntensity = 1f; /// /// Overall intensity of haptics. @@ -20,6 +20,8 @@ sealed class HapticsModule : MonoBehaviour, IUsesGameObjectLocking OVRHaptics.OVRHapticsChannel m_RHapticsChannel; OVRHapticsClip m_GeneratedHapticClip; + bool m_SampleLengthWarningShown; + void Start() { m_LHapticsChannel = OVRHaptics.LeftChannel; @@ -42,9 +44,20 @@ public void Pulse(float duration, float intensity = 1f, bool fadeIn = false, boo m_GeneratedHapticClip.Reset(); // TODO: Support multiple generated clips - const float kSampleRateConversion = 490; // Samplerate conversion : 44100/90fps = 490 + const float kMaxDuration = 0.8f; + if (duration > kMaxDuration) + { + duration = Mathf.Clamp(duration, 0f, kMaxDuration); // Clamp at maxiumum 800ms for sample buffer + + if (!m_SampleLengthWarningShown) + Debug.LogWarning("Pulse durations greater than 0.8f are not currently supported"); + + m_SampleLengthWarningShown = true; + } + + + const int kSampleRateConversion = 490; // Samplerate conversion : 44100/90fps = 490 const int kIntensityIncreaseMultiplier = 255; // Maximum value of 255 for intensity - duration = Mathf.Clamp(duration, 0f, 0.8f); // Clamp at maxiumum 800ms for sample buffer var fadeInSampleCount = duration * kSampleRateConversion * 0.25f; var fadeOutSampleCount = fadeInSampleCount * 2; // FadeOut is less apparent than FadeIn unless FadeOut duration is increased duration *= kSampleRateConversion; From d3db70f371fa49aaf7bb72669e6efe78e72c4e0c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 15:04:40 -0700 Subject: [PATCH 318/870] Define additional constants in HapticsModule --- Scripts/Modules/HapticsModule.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index ae7e24086..7ad6a3d48 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -55,14 +55,14 @@ public void Pulse(float duration, float intensity = 1f, bool fadeIn = false, boo m_SampleLengthWarningShown = true; } - const int kSampleRateConversion = 490; // Samplerate conversion : 44100/90fps = 490 const int kIntensityIncreaseMultiplier = 255; // Maximum value of 255 for intensity - var fadeInSampleCount = duration * kSampleRateConversion * 0.25f; + const float kFadeInProportion = 0.25f; + var fadeInSampleCount = duration * kSampleRateConversion * kFadeInProportion; var fadeOutSampleCount = fadeInSampleCount * 2; // FadeOut is less apparent than FadeIn unless FadeOut duration is increased duration *= kSampleRateConversion; var durationFadeOutPosition = duration - fadeOutSampleCount; - intensity = Mathf.Clamp(Mathf.Clamp01(intensity) * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, 255); + intensity = Mathf.Clamp(Mathf.Clamp01(intensity) * kIntensityIncreaseMultiplier * m_MasterIntensity, 0, kIntensityIncreaseMultiplier); var hapticClipSample = Convert.ToByte(intensity); for (int i = 1; i < duration; ++i) { @@ -75,7 +75,8 @@ public void Pulse(float duration, float intensity = 1f, bool fadeIn = false, boo m_GeneratedHapticClip.WriteSample(Convert.ToByte(sampleShaped)); } - if (duration > 0.125f) + const float kMaxSimultaneousClipDuration = 0.125f; + if (duration > kMaxSimultaneousClipDuration) { // Prevent multiple long clips from playing back simultaneously // If the new clip has a long duration, stop playback of any existing clips From f1c12e9bd74d5562107e492ef6ddc6989ddf8741 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 16:30:58 -0700 Subject: [PATCH 319/870] Add GetNodeFromRayOrigin function to EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index c2c1d019b..f403a950b 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -366,6 +366,18 @@ internal static void UpdatePlayerHandleMaps(List maps) } } } + + internal static Node? GetNodeFromRayOrigin(Transform rayOrigin) + { + Node? node = null; + Rays.ForEachProxyDevice(deviceData => + { + if (deviceData.rayOrigin == rayOrigin) + node = deviceData.node; + }); + + return node; + } } } } From b3c35ba218c5d043ec39fa5f1b170aef8e3d6a04 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 16:49:03 -0700 Subject: [PATCH 320/870] Add device/hand-specific targeting of haptic feedback --- Scripts/Core/EditorVR.cs | 4 +- Scripts/Interfaces/IPerformHaptics.cs | 12 ++-- Scripts/ListView/ListViewControllerBase.cs | 2 +- Scripts/Modules/HapticsModule.cs | 61 +++++++++++++++++--- Workspaces/Base/WorkspaceUI.cs | 17 +++--- Workspaces/Common/Scripts/WorkspaceButton.cs | 11 +++- 6 files changed, 83 insertions(+), 24 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 7bcabb676..350c1179e 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -142,7 +142,6 @@ void Awake() AddModule(); AddModule(); - AddModule(); var lockModule = AddModule(); lockModule.updateAlternateMenu = (rayOrigin, o) => Menus.SetAlternateMenuVisibility(rayOrigin, o != null); @@ -198,6 +197,9 @@ void Awake() return false; }; + var hapticsModule = AddModule(); + hapticsModule.getNodeFromRayOrigin = Tools.GetNodeFromRayOrigin; + viewer.AddPlayerModel(); GetNestedModule().CreateAllProxies(); diff --git a/Scripts/Interfaces/IPerformHaptics.cs b/Scripts/Interfaces/IPerformHaptics.cs index 1bd9e3d1c..ea2706dab 100644 --- a/Scripts/Interfaces/IPerformHaptics.cs +++ b/Scripts/Interfaces/IPerformHaptics.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using UnityEngine; namespace UnityEditor.Experimental.EditorVR { @@ -11,18 +12,21 @@ public interface IPerformHaptics public static class IPerformHapticsMethods { - internal delegate void PerformHapticsDelegate(float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false); + internal delegate void PerformHapticsDelegate(Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false); internal static PerformHapticsDelegate performHaptics { get; set; } /// - /// Method for performing haptic feedback + /// Perform haptic feedback /// + /// Device RayOrigin Transform on which to perform the pulse. A NULL value will pulse on all devices /// Duration of haptic feedback /// Intensity of haptic feedback (optional) - public static void Pulse(this IPerformHaptics obj, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) + /// Fade the pulse in + /// Fade the pulse out + public static void Pulse(this IPerformHaptics obj, Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { - performHaptics(duration, intensity, fadeIn, fadeOut); + performHaptics(rayOrigin, duration, intensity, fadeIn, fadeOut); } } } diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index fb69dfa94..25acc8e18 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -234,7 +234,7 @@ public void OnScroll(PointerEventData eventData) scrollOffset += eventData.scrollDelta.y * scrollSpeed * Time.deltaTime; - this.Pulse(0.0001f, 0.125f); + this.Pulse(null, 0.001f, 0.125f); } protected virtual void StartSettling(Action onComplete = null) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index 7ad6a3d48..7e7d76ffe 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -16,6 +16,12 @@ sealed class HapticsModule : MonoBehaviour, IUsesGameObjectLocking /// public float masterIntensity { set { m_MasterIntensity = Mathf.Clamp01(value); } } + /// + /// Fetch a corresponding node for a given transform. + /// Used to get the device node on which to perform the haptic feedback. + /// + public Func getNodeFromRayOrigin { private get; set; } + OVRHaptics.OVRHapticsChannel m_LHapticsChannel; OVRHaptics.OVRHapticsChannel m_RHapticsChannel; OVRHapticsClip m_GeneratedHapticClip; @@ -35,7 +41,15 @@ void LateUpdate() OVRHaptics.Process(); } - public void Pulse(float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) + /// + /// Pulse haptic feedback + /// + /// Device RayOrigin Transform on which to perform the pulse. A NULL value will pulse on all devices + /// Duration of pulse. Currently a maximum duration of 0.8f is supported. + /// Strength of pulse. + /// Fade the pulse in + /// Fade the pulse out + public void Pulse(Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { // Clip buffer can hold up to 800 milliseconds of samples // At 320Hz, each sample is 3.125f milliseconds @@ -75,21 +89,54 @@ public void Pulse(float duration, float intensity = 1f, bool fadeIn = false, boo m_GeneratedHapticClip.WriteSample(Convert.ToByte(sampleShaped)); } - const float kMaxSimultaneousClipDuration = 0.125f; + const float kMaxSimultaneousClipDuration = 0.25f; + var channel = GetTargetChannel(rayOrigin); if (duration > kMaxSimultaneousClipDuration) { // Prevent multiple long clips from playing back simultaneously - // If the new clip has a long duration, stop playback of any existing clips - m_RHapticsChannel.Preempt(m_GeneratedHapticClip); - m_LHapticsChannel.Preempt(m_GeneratedHapticClip); + // If the new clip has a long duration, stop playback of any existing clips in order to prevent haptic feedback noise + if (channel != null) + { + channel.Preempt(m_GeneratedHapticClip); + } + else + { + m_RHapticsChannel.Preempt(m_GeneratedHapticClip); + m_LHapticsChannel.Preempt(m_GeneratedHapticClip); + } + } else { // Allow multiple short clips to play simultaneously - m_RHapticsChannel.Mix(m_GeneratedHapticClip); - m_LHapticsChannel.Mix(m_GeneratedHapticClip); + if (channel != null) + { + channel.Mix(m_GeneratedHapticClip); + } + else + { + m_RHapticsChannel.Mix(m_GeneratedHapticClip); + m_LHapticsChannel.Mix(m_GeneratedHapticClip); + } } } + + OVRHaptics.OVRHapticsChannel GetTargetChannel(Transform rayOrigin) + { + OVRHaptics.OVRHapticsChannel channel = null; + var node = getNodeFromRayOrigin (rayOrigin); + switch (node) + { + case Node.LeftHand: + channel = m_LHapticsChannel; + break; + case Node.RightHand: + channel = m_RHapticsChannel; + break; + } + + return channel; + } } } #endif diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 353e123e0..922fd1256 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -506,10 +506,11 @@ void AdjustHandlesAndIcons() void OnHandleHoverStarted(BaseHandle handle, HandleEventData eventData) { + var rayOrigin = eventData.rayOrigin; if (m_HovereringRayOrigins.Count == 0 && m_DragState == null) - IncreaseFrameThickness(); + IncreaseFrameThickness(rayOrigin); - m_HovereringRayOrigins.Add(eventData.rayOrigin); + m_HovereringRayOrigins.Add(rayOrigin); } ResizeDirection GetResizeDirectionForLocalPosition(Vector3 localPosition) @@ -785,21 +786,21 @@ public void ResetSizeClick() resetSizeClicked(); } - void IncreaseFrameThickness() + void IncreaseFrameThickness(Transform rayOrigin = null) { this.StopCoroutine(ref m_FrameThicknessCoroutine); const float kTargetBlendAmount = 0f; - m_FrameThicknessCoroutine = StartCoroutine(ChangeFrameThickness(kTargetBlendAmount)); + m_FrameThicknessCoroutine = StartCoroutine(ChangeFrameThickness(kTargetBlendAmount, rayOrigin)); } void ResetFrameThickness() { this.StopCoroutine(ref m_FrameThicknessCoroutine); const float kTargetBlendAmount = 50f; - m_FrameThicknessCoroutine = StartCoroutine(ChangeFrameThickness(kTargetBlendAmount)); + m_FrameThicknessCoroutine = StartCoroutine(ChangeFrameThickness(kTargetBlendAmount, null)); } - IEnumerator ChangeFrameThickness(float targetBlendAmount) + IEnumerator ChangeFrameThickness(float targetBlendAmount, Transform rayOrigin) { const float kTargetDuration = 0.25f; var currentDuration = 0f; @@ -814,8 +815,8 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount) } // If hovering the frame, and not dragging, perform haptic feedback - if (m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.Pulse(0.8f, 0.15f, true, true); + if (m_HovereringRayOrigins.Count > 0 && m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) + this.Pulse(rayOrigin, 0.8f, 0.1f, true, true); m_FrameThicknessCoroutine = null; } diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index cb3837b9d..5ec54d201 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -138,7 +138,7 @@ public bool alternateIconVisible GradientPair m_OriginalGradientPair; GradientPair m_HighlightGradientPair; - Transform m_parentTransform; + Transform m_RayOrigin; Vector3 m_IconDirection; Material m_ButtonMaterial; Material m_ButtonMaskMaterial; @@ -172,6 +172,7 @@ public void InstantClearState() this.StopCoroutine(ref m_HighlightCoroutine); ResetColors(); + m_RayOrigin = null; } public void SetMaterialColors(GradientPair gradientPair) @@ -322,7 +323,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.Pulse(0.005f, 0.075f); + this.Pulse(m_RayOrigin, 0.005f, 0.075f); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); @@ -454,12 +455,16 @@ IEnumerator IconContainerContentsEndHighlight() public void OnRayEnter(RayEventData eventData) { + m_RayOrigin = eventData.rayOrigin; + if (autoHighlight) highlighted = true; } public void OnRayExit(RayEventData eventData) { + m_RayOrigin = null; + if (autoHighlight) highlighted = false; } @@ -472,7 +477,7 @@ void SwapIconSprite() void OnButtonClicked() { - this.Pulse(0.175f, 0.05f); + this.Pulse(m_RayOrigin, 0.25f, 0.065f, false, true); } } } From 6be341367481ede9a4cf1c4254965f67ca6279ba Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 5 Jun 2017 17:15:25 -0700 Subject: [PATCH 321/870] Refactor to use ManipulatorSnapping method --- Manipulators/StandardManipulator.prefab | 6 ++ Scripts/Core/EditorVR.cs | 2 + Scripts/Handles/LinearHandle.cs | 24 ++--- Scripts/Handles/PlaneHandle.cs | 18 ++-- Scripts/Interfaces/IUsesSnapping.cs | 25 ++---- .../Modules/SnappingModule/SnappingModule.cs | 87 ++++++++++++------- Tools/TransformTool/TransformTool.cs | 12 +-- 7 files changed, 95 insertions(+), 79 deletions(-) diff --git a/Manipulators/StandardManipulator.prefab b/Manipulators/StandardManipulator.prefab index 2209655dd..e9d5044ed 100644 --- a/Manipulators/StandardManipulator.prefab +++ b/Manipulators/StandardManipulator.prefab @@ -1306,6 +1306,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} + m_Constraints: 10 --- !u!114 &114000011169532704 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1319,6 +1320,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} + m_Constraints: 12 --- !u!114 &114000011250465190 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1333,6 +1335,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000014115655252} m_OrientDragPlaneToRay: 1 + m_Constraints: 2 --- !u!114 &114000011261594914 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1347,6 +1350,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000013116023314} m_OrientDragPlaneToRay: 1 + m_Constraints: 8 --- !u!114 &114000011660595710 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1361,6 +1365,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000012695962256} m_OrientDragPlaneToRay: 1 + m_Constraints: 4 --- !u!114 &114000012004783302 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1402,6 +1407,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} + m_Constraints: 6 --- !u!114 &114000012657926048 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 1e6675bca..0e1e777d7 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -176,6 +176,8 @@ void Awake() UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedLightGradient(); + AddModule(); + var sceneObjectModule = AddModule(); sceneObjectModule.tryPlaceObject = (obj, targetScale) => { diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index e332c2cdf..6616e7921 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR using UnityEditor.Experimental.EditorVR.Modules; +using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -7,6 +8,8 @@ namespace UnityEditor.Experimental.EditorVR.Handles { sealed class LinearHandle : BaseHandle { + const float k_MaxDragDistance = 1000f; + class LinearHandleEventData : HandleEventData { public Vector3 raycastHitWorldPosition; @@ -15,22 +18,21 @@ public LinearHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, } [SerializeField] - private Transform m_HandleTip; + Transform m_HandleTip; [SerializeField] bool m_OrientDragPlaneToRay = true; + [FlagsProperty] [SerializeField] ConstrainedAxis m_Constraints; - private const float k_MaxDragDistance = 1000f; - - private Plane m_Plane; - private Vector3 m_LastPosition; + Plane m_Plane; + Vector3 m_LastPosition; public ConstrainedAxis constraints { get { return m_Constraints; } } - private void OnDisable() + void OnDisable() { if (m_HandleTip != null) m_HandleTip.gameObject.SetActive(false); @@ -58,7 +60,7 @@ protected override void OnHandleHoverEnded(HandleEventData eventData) base.OnHandleHoverEnded(eventData); } - private void UpdateHandleTip(LinearHandleEventData eventData) + void UpdateHandleTip(LinearHandleEventData eventData) { if (m_HandleTip != null) { @@ -103,13 +105,13 @@ protected override void OnHandleDragStarted(HandleEventData eventData) protected override void OnHandleDragging(HandleEventData eventData) { - Transform rayOrigin = eventData.rayOrigin; - Vector3 worldPosition = m_LastPosition; + var rayOrigin = eventData.rayOrigin; + var worldPosition = m_LastPosition; UpdatePlaneOrientation(rayOrigin); - float distance = 0f; - Ray ray = new Ray(rayOrigin.position, rayOrigin.forward); + float distance; + var ray = new Ray(rayOrigin.position, rayOrigin.forward); if (m_Plane.Raycast(ray, out distance)) worldPosition = ray.GetPoint(Mathf.Min(distance, k_MaxDragDistance)); diff --git a/Scripts/Handles/PlaneHandle.cs b/Scripts/Handles/PlaneHandle.cs index 2f7da4857..5b702e897 100644 --- a/Scripts/Handles/PlaneHandle.cs +++ b/Scripts/Handles/PlaneHandle.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR using UnityEditor.Experimental.EditorVR.Modules; +using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -7,7 +8,9 @@ namespace UnityEditor.Experimental.EditorVR.Handles { sealed class PlaneHandle : BaseHandle { - private class PlaneHandleEventData : HandleEventData + const float k_MaxDragDistance = 1000f; + + class PlaneHandleEventData : HandleEventData { public Vector3 raycastHitWorldPosition; @@ -15,15 +18,14 @@ public PlaneHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, } [SerializeField] - private Material m_PlaneMaterial; + Material m_PlaneMaterial; + [FlagsProperty] [SerializeField] ConstrainedAxis m_Constraints; - private const float k_MaxDragDistance = 1000f; - - private Plane m_Plane; - private Vector3 m_LastPosition; + Plane m_Plane; + Vector3 m_LastPosition; public ConstrainedAxis constraints { get { return m_Constraints; } } @@ -44,12 +46,12 @@ protected override void OnHandleDragStarted(HandleEventData eventData) protected override void OnHandleDragging(HandleEventData eventData) { - Transform rayOrigin = eventData.rayOrigin; + var rayOrigin = eventData.rayOrigin; var worldPosition = m_LastPosition; float distance; - Ray ray = new Ray(rayOrigin.position, rayOrigin.forward); + var ray = new Ray(rayOrigin.position, rayOrigin.forward); if (m_Plane.Raycast(ray, out distance)) worldPosition = ray.GetPoint(Mathf.Min(Mathf.Abs(distance), k_MaxDragDistance)); diff --git a/Scripts/Interfaces/IUsesSnapping.cs b/Scripts/Interfaces/IUsesSnapping.cs index 32f77baa5..4a8ce5885 100644 --- a/Scripts/Interfaces/IUsesSnapping.cs +++ b/Scripts/Interfaces/IUsesSnapping.cs @@ -13,13 +13,11 @@ public interface IUsesSnapping public static class IUsesSnappingMethods { - internal delegate bool ManipulatorSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta); + internal delegate bool ManipulatorSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode); internal delegate bool DirectSnapDelegate(Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation); - internal delegate bool ConstrainedSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints); internal static ManipulatorSnapDelegate manipulatorSnap { get; set; } internal static DirectSnapDelegate directSnap { get; set; } - internal static ConstrainedSnapDelegate constrainedSnap { get; set; } internal static Action clearSnappingState { get; set; } /// @@ -30,10 +28,12 @@ public static class IUsesSnappingMethods /// The position being modified by delta. This will be set with a snapped position if possible /// The rotation to be modified if rotation snapping is enabled /// The position delta to apply + /// The axis constraints + /// The manipulator's pivot mode /// Whether the position was set to a snapped position - public static bool ManipulatorSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta) + public static bool ManipulatorSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode) { - return manipulatorSnap(rayOrigin, transforms, ref position, ref rotation, delta); + return manipulatorSnap(rayOrigin, transforms, ref position, ref rotation, delta, constraints, pivotMode); } /// @@ -59,21 +59,6 @@ public static void ClearSnappingState(this IUsesSnapping usesSnaping, Transform { clearSnappingState(rayOrigin); } - - /// - /// Perform constrained snapping: Translate a position vector using deltas while also respecting constraints and snapping - /// - /// The ray doing the translating - /// The transforms being translated (used to determine bounds; Transforms do not get modified) - /// The position being modified by delta. This will be set with a snapped position if possible - /// The rotation to be modified if rotation snapping is enabled - /// The position delta to apply - /// The axis constraints - /// Whether the position was set to a snapped position - public static bool ConstrainedSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints) - { - return constrainedSnap(rayOrigin, transforms, ref position, ref rotation, delta, constraints); - } } } #endif diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 9963205df..138520a4e 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -429,7 +429,7 @@ void Update() } } - public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta) + public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode) { if (transforms.Length == 0) return false; @@ -446,37 +446,63 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec var breakScale = Vector3.Distance(camera.transform.position, targetPosition); AddToIgnoreList(transforms); - if (surfaceSnappingEnabled && ManipulatorSnapToSurface(rayOrigin, ref position, ref rotation, targetPosition, state, targetRotation, breakScale * k_ManipulatorSurfaceSnapBreakDist)) - return true; - if (localOnly) - { - if (groundSnappingEnabled && SnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_ManipulatorGroundSnapMin, breakScale * k_ManipulatorGroundSnapMax)) - return true; - } - else + switch (constraints) { - var groundPlane = new Plane(Vector3.up, k_GroundHeight); - var origin = rayOrigin.position; - var direction = rayOrigin.forward; - var pointerRay = new Ray(origin, direction); - var raycastDistance = k_GroundSnappingMaxRayLength * this.GetViewerScale(); - float distance; - if (groundPlane.Raycast(pointerRay, out distance) && distance <= raycastDistance) - { - state.groundSnapping = true; - - position = origin + direction * distance; - - if (rotationSnappingEnabled) - rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); - - return true; - } - - state.groundSnapping = false; - position = targetPosition; - rotation = targetRotation; + case ConstrainedAxis.None: + if (surfaceSnappingEnabled && ManipulatorSnapToSurface(rayOrigin, ref position, ref rotation, targetPosition, state, targetRotation, breakScale * k_ManipulatorSurfaceSnapBreakDist)) + return true; + + if (groundSnappingEnabled) + { + if (localOnly) + { + if (SnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_ManipulatorGroundSnapMin, breakScale * k_ManipulatorGroundSnapMax)) + return true; + } + else + { + var groundPlane = new Plane(Vector3.up, k_GroundHeight); + var origin = rayOrigin.position; + var direction = rayOrigin.forward; + var pointerRay = new Ray(origin, direction); + var raycastDistance = k_GroundSnappingMaxRayLength * this.GetViewerScale(); + float distance; + if (groundPlane.Raycast(pointerRay, out distance) && distance <= raycastDistance) + { + state.groundSnapping = true; + + position = origin + direction * distance; + + if (rotationSnappingEnabled) + rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); + + return true; + } + + state.groundSnapping = false; + position = targetPosition; + rotation = targetRotation; + } + } + break; + default: + if (surfaceSnappingEnabled) + { + var bounds = state.identityBounds; + var boundsExtents = bounds.extents; + var projectedExtents = Vector3.Project(boundsExtents, Vector3.down); + var offset = projectedExtents - bounds.center; + var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); + var startRotation = state.startRotation; + var upVector = startRotation * Vector3.back; + var maxRayLength = k_SurfaceSnappingMaxRayLength * this.GetViewerScale(); + + var axisRay = new Ray(position, delta.normalized); + return SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakScale, maxRayLength) + || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakScale); + } + break; } } @@ -605,6 +631,7 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp GameObject go; if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { + GizmoModule.instance.DrawSphere(go.transform.position, 0.01f, Color.red); var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; var hitPoint = hit.point; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 8474752e4..1ab4ae1ab 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -537,17 +537,9 @@ public void DropHeldObjects(Node node) this.ClearSnappingState(rayOrigin); } - void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraint) + void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints) { - switch (constraint) - { - case ConstrainedAxis.None: - this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta); - break; - default: - m_TargetPosition += delta; - break; - } + this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); } void Rotate(Quaternion delta) From 4ccb65e0ffb3a0088b22237ab125836315e409a3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 17:42:49 -0700 Subject: [PATCH 322/870] Add functionality to stop all pulses on a single device, or all devices, in HapticsModule --- .../HapticsModuleConnector.cs | 3 ++- Scripts/Interfaces/IPerformHaptics.cs | 21 +++++++++++++++---- Scripts/Modules/HapticsModule.cs | 17 +++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs index 79eb25d94..ef55be790 100644 --- a/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs +++ b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs @@ -9,7 +9,8 @@ class HapticsModuleConnector : Nested, ILateBindInterfaceMethods { public void LateBindInterfaceMethods(HapticsModule provider) { - IPerformHapticsMethods.performHaptics = provider.Pulse; + IPerformHapticsMethods.pulse = provider.Pulse; + IPerformHapticsMethods.stopPulses = provider.StopPulses; } } } diff --git a/Scripts/Interfaces/IPerformHaptics.cs b/Scripts/Interfaces/IPerformHaptics.cs index ea2706dab..d0ee8058e 100644 --- a/Scripts/Interfaces/IPerformHaptics.cs +++ b/Scripts/Interfaces/IPerformHaptics.cs @@ -12,21 +12,34 @@ public interface IPerformHaptics public static class IPerformHapticsMethods { - internal delegate void PerformHapticsDelegate(Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false); + internal delegate void PulseDelegate(Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false); - internal static PerformHapticsDelegate performHaptics { get; set; } + internal static PulseDelegate pulse { get; set; } /// /// Perform haptic feedback /// - /// Device RayOrigin Transform on which to perform the pulse. A NULL value will pulse on all devices + /// Device RayOrigin/Transform on which to perform the pulse. A NULL value will pulse on all devices /// Duration of haptic feedback /// Intensity of haptic feedback (optional) /// Fade the pulse in /// Fade the pulse out public static void Pulse(this IPerformHaptics obj, Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { - performHaptics(rayOrigin, duration, intensity, fadeIn, fadeOut); + pulse(rayOrigin, duration, intensity, fadeIn, fadeOut); + } + + internal delegate void StopPulsesDelegate(Transform rayOrigin); + + internal static StopPulsesDelegate stopPulses { get; set; } + + /// + /// Stop all haptic feedback on a specific device, or all devices + /// + /// Device RayOrigin/Transform on which to stop all pulses. A NULL value will stop pulses on all devices + public static void StopPulses(this IPerformHaptics obj, Transform rayOrigin) + { + stopPulses(rayOrigin); } } } diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index 7e7d76ffe..2341a2db5 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -121,6 +121,23 @@ public void Pulse(Transform rayOrigin, float duration, float intensity = 1f, boo } } + public void StopPulses(Transform rayOrigin = null) + { + // Stop haptic feedback on only one device, if specific via the function parameter + // Otherwise stop all haptic feedback on all devices + if (rayOrigin == null) + { + m_RHapticsChannel.Clear(); + m_LHapticsChannel.Clear(); + } + else + { + var channel = GetTargetChannel(rayOrigin); + if (channel != null) + channel.Clear(); + } + } + OVRHaptics.OVRHapticsChannel GetTargetChannel(Transform rayOrigin) { OVRHaptics.OVRHapticsChannel channel = null; From 98ef5531825f620de518bb02554fc5c698cf19ab Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 18:05:51 -0700 Subject: [PATCH 323/870] Update haptic implementations in WorkspaceUI, WorkspaceButton, and ListViewControllerBase --- Scripts/ListView/ListViewControllerBase.cs | 5 +++-- Workspaces/Base/WorkspaceUI.cs | 2 ++ Workspaces/Common/Scripts/WorkspaceButton.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index 25acc8e18..820796b56 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -81,6 +81,9 @@ void Start() void Update() { UpdateView(); + + if (m_Scrolling) + this.Pulse(null, 0.25f, 0.055f, false, true); } protected abstract void Setup(); @@ -233,8 +236,6 @@ public void OnScroll(PointerEventData eventData) return; scrollOffset += eventData.scrollDelta.y * scrollSpeed * Time.deltaTime; - - this.Pulse(null, 0.001f, 0.125f); } protected virtual void StartSettling(Action onComplete = null) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 922fd1256..2b588c359 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -245,10 +245,12 @@ public void OnDragging() + transform.forward * (absForward - (currentExtents.z - extents.z)) * Mathf.Sign(positionOffsetForward); m_WorkspaceUI.transform.parent.position = m_PositionStart + positionOffset * viewerScale; + m_WorkspaceUI.Pulse(rayOrigin, 0.25f, 0.2f, true, true); } else { MathUtilsExt.SetTransformOffset(rayOrigin, m_WorkspaceUI.transform.parent, m_PositionOffset, m_RotationOffset); + m_WorkspaceUI.Pulse(rayOrigin, 0.25f, 0.055f, false, true); } } } diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 5ec54d201..690be4624 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -323,7 +323,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.Pulse(m_RayOrigin, 0.005f, 0.075f); + this.Pulse(m_RayOrigin, 0.005f, 0.082f); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); From 558dc447d5121c34dfbd7c79473ad738736b3cec Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 19:23:36 -0700 Subject: [PATCH 324/870] Remove stray space in WorkspaceUI --- Workspaces/Base/WorkspaceUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 2b588c359..df140aadf 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -774,7 +774,7 @@ void OnDestroy() { ObjectUtils.Destroy(m_TopFaceMaterial); ObjectUtils.Destroy(m_FrontFaceMaterial); - } + } public void CloseClick() { From e87e1bed73b9dcdb660578fce126aa46dfdc33e1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 19:24:37 -0700 Subject: [PATCH 325/870] Add OVR conditionals to HapticsModule; Vive is not currently supported --- Scripts/Modules/HapticsModule.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index 2341a2db5..244fcb5bf 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -22,17 +22,24 @@ sealed class HapticsModule : MonoBehaviour, IUsesGameObjectLocking /// public Func getNodeFromRayOrigin { private get; set; } +#if ENABLE_OVR_INPUT OVRHaptics.OVRHapticsChannel m_LHapticsChannel; OVRHaptics.OVRHapticsChannel m_RHapticsChannel; OVRHapticsClip m_GeneratedHapticClip; +#endif + /// + /// Allow for a single warning that informs the user of an attempted pulse with a length greater than 0.8f + /// bool m_SampleLengthWarningShown; void Start() { +#if ENABLE_OVR_INPUT m_LHapticsChannel = OVRHaptics.LeftChannel; m_RHapticsChannel = OVRHaptics.RightChannel; m_GeneratedHapticClip = new OVRHapticsClip(); +#endif } void LateUpdate() @@ -51,12 +58,13 @@ void LateUpdate() /// Fade the pulse out public void Pulse(Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { +#if ENABLE_OVR_INPUT // Clip buffer can hold up to 800 milliseconds of samples // At 320Hz, each sample is 3.125f milliseconds if (Mathf.Approximately(m_MasterIntensity, 0)) return; - m_GeneratedHapticClip.Reset(); // TODO: Support multiple generated clips + m_GeneratedHapticClip.Reset(); const float kMaxDuration = 0.8f; if (duration > kMaxDuration) @@ -119,10 +127,12 @@ public void Pulse(Transform rayOrigin, float duration, float intensity = 1f, boo m_LHapticsChannel.Mix(m_GeneratedHapticClip); } } +#endif } public void StopPulses(Transform rayOrigin = null) { +#if ENABLE_OVR_INPUT // Stop haptic feedback on only one device, if specific via the function parameter // Otherwise stop all haptic feedback on all devices if (rayOrigin == null) @@ -136,8 +146,10 @@ public void StopPulses(Transform rayOrigin = null) if (channel != null) channel.Clear(); } +#endif } +#if ENABLE_OVR_INPUT OVRHaptics.OVRHapticsChannel GetTargetChannel(Transform rayOrigin) { OVRHaptics.OVRHapticsChannel channel = null; @@ -154,6 +166,7 @@ OVRHaptics.OVRHapticsChannel GetTargetChannel(Transform rayOrigin) return channel; } +#endif } } #endif From feef8b5da0e57cb009deb0cc372e24b84d43ae3e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 5 Jun 2017 19:41:52 -0700 Subject: [PATCH 326/870] Refine WorkspaceUI haptics --- Workspaces/Base/WorkspaceUI.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index df140aadf..47c5d5765 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -245,7 +245,7 @@ public void OnDragging() + transform.forward * (absForward - (currentExtents.z - extents.z)) * Mathf.Sign(positionOffsetForward); m_WorkspaceUI.transform.parent.position = m_PositionStart + positionOffset * viewerScale; - m_WorkspaceUI.Pulse(rayOrigin, 0.25f, 0.2f, true, true); + m_WorkspaceUI.Pulse(rayOrigin, 0.25f, 0.35f, true, true); } else { @@ -818,7 +818,7 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount, Transform rayOrigin) // If hovering the frame, and not dragging, perform haptic feedback if (m_HovereringRayOrigins.Count > 0 && m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.Pulse(rayOrigin, 0.8f, 0.1f, true, true); + this.Pulse(rayOrigin, 0.8f, 0.065f, true, true); m_FrameThicknessCoroutine = null; } From 31ab6dc40f79318ec30b12c674d96a9cfb871235 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 11:21:11 -0700 Subject: [PATCH 327/870] Reduce unnecessary logic in WorkspaceButton pressed property --- Workspaces/Common/Scripts/WorkspaceButton.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 690be4624..5fa4a1330 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -48,9 +48,7 @@ public bool pressed get { return m_Pressed; } set { - if (!m_Highlighted) - value = false; - else if (value != m_Pressed && value) // proceed only if value is true after previously being false + if (m_Highlighted && value != m_Pressed && value) // proceed only if value is true after previously being false { m_Pressed = value; From c893c962804b227158cb39393e0394b25f046063 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 11:22:11 -0700 Subject: [PATCH 328/870] Remove unnecessary default assignment of bool member in WorkspaceButton --- Workspaces/Common/Scripts/WorkspaceButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 5fa4a1330..0e1b7d20f 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -123,7 +123,7 @@ public bool alternateIconVisible Graphic[] m_HighlightItems; [SerializeField] - bool m_GrayscaleGradient = false; + bool m_GrayscaleGradient; [Header("Animated Reveal Settings")] [SerializeField] From a43c1d725f53e0d49b4f2c5023808e958b323e03 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 11:30:44 -0700 Subject: [PATCH 329/870] Optimize scope of shapedTransition variables in WorkspaceButton --- Workspaces/Common/Scripts/WorkspaceButton.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 0e1b7d20f..362ea1f57 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -327,7 +327,6 @@ IEnumerator BeginHighlight() const float kTargetTransitionAmount = 1f; var transitionAmount = Time.deltaTime; - var shapedTransitionAmount = 0f; var topColor = Color.clear; var bottomColor = Color.clear; var currentTopColor = m_ButtonMaterial.GetColor(k_MaterialColorTopProperty); @@ -340,7 +339,7 @@ IEnumerator BeginHighlight() while (transitionAmount < kTargetTransitionAmount) { transitionAmount += Time.deltaTime * transitionAmountMultiplier; - shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); + var shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); transform.localScale = Vector3.Lerp(currentLocalScale, highlightedLocalScale, shapedTransitionAmount); topColor = Color.Lerp(currentTopColor, topHighlightColor, shapedTransitionAmount); @@ -363,7 +362,6 @@ IEnumerator EndHighlight() const float kTargetTransitionAmount = 1f; var transitionAmount = Time.deltaTime; - var shapedTransitionAmount = 0f; var topColor = Color.clear; var bottomColor = Color.clear; var currentTopColor = m_ButtonMaterial.GetColor(k_MaterialColorTopProperty); @@ -375,7 +373,7 @@ IEnumerator EndHighlight() while (transitionAmount < kTargetTransitionAmount) { transitionAmount += Time.deltaTime * 3; - shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); + var shapedTransitionAmount = Mathf.Pow(transitionAmount, 2); topColor = Color.Lerp(currentTopColor, topOriginalColor, shapedTransitionAmount); bottomColor = Color.Lerp(currentBottomColor, bottomOriginalColor, shapedTransitionAmount); From 7de74f3dfe4862143b958bc358cfd8cb2691c48b Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Tue, 6 Jun 2017 13:57:38 -0700 Subject: [PATCH 330/870] Move interfaces into better named folders (Capability, Entity, FunctionalityInjection) and rename a few interfaces --- Scripts/Core/EditorVR.MiniWorlds.cs | 6 +-- Scripts/Core/EditorVR.Rays.cs | 26 +++++------- Scripts/Interfaces/Capability.meta | 9 ++++ .../{ => Capability}/ICustomHighlight.cs | 0 .../{ => Capability}/ICustomHighlight.cs.meta | 0 .../{ => Capability}/IDropReceiver.cs | 0 .../{ => Capability}/IDropReceiver.cs.meta | 0 .../Interfaces/{ => Capability}/IDroppable.cs | 0 .../{ => Capability}/IDroppable.cs.meta | 0 .../IManipulatorVisibility.cs | 0 .../IManipulatorVisibility.cs.meta | 0 .../{ => Capability}/ISelectionChanged.cs | 0 .../ISelectionChanged.cs.meta | 0 .../{ => Capability}/ISerializeWorkspace.cs | 0 .../ISerializeWorkspace.cs.meta | 0 .../{ => Capability}/ISettingsMenuProvider.cs | 0 .../ISettingsMenuProvider.cs.meta | 0 .../{ => Capability}/ITooltipPlacement.cs | 0 .../ITooltipPlacement.cs.meta | 0 .../{ => Capability}/IVacuumable.cs | 0 .../{ => Capability}/IVacuumable.cs.meta | 0 Scripts/Interfaces/Entity.meta | 9 ++++ Scripts/Interfaces/{ => Entity}/IAction.cs | 0 .../Interfaces/{ => Entity}/IAction.cs.meta | 0 .../Interfaces/{ => Entity}/IAlternateMenu.cs | 0 .../{ => Entity}/IAlternateMenu.cs.meta | 0 .../{ => Entity}/IEditingContext.cs | 0 .../{ => Entity}/IEditingContext.cs.meta | 0 Scripts/Interfaces/{ => Entity}/ILocomotor.cs | 0 .../{ => Entity}/ILocomotor.cs.meta | 0 Scripts/Interfaces/{ => Entity}/IMainMenu.cs | 0 .../Interfaces/{ => Entity}/IMainMenu.cs.meta | 0 .../Interfaces/{ => Entity}/IManipulator.cs | 0 .../{ => Entity}/IManipulator.cs.meta | 0 Scripts/Interfaces/{ => Entity}/IMenu.cs | 0 Scripts/Interfaces/{ => Entity}/IMenu.cs.meta | 0 .../Interfaces/{ => Entity}/IPreviewCamera.cs | 0 .../{ => Entity}/IPreviewCamera.cs.meta | 0 Scripts/Interfaces/{ => Entity}/IProxy.cs | 0 .../Interfaces/{ => Entity}/IProxy.cs.meta | 0 Scripts/Interfaces/{ => Entity}/ITool.cs | 0 Scripts/Interfaces/{ => Entity}/ITool.cs.meta | 0 Scripts/Interfaces/{ => Entity}/ITooltip.cs | 0 .../Interfaces/{ => Entity}/ITooltip.cs.meta | 0 .../Interfaces/{ => Entity}/ITransformer.cs | 0 .../{ => Entity}/ITransformer.cs.meta | 0 Scripts/Interfaces/{ => Entity}/IWorkspace.cs | 0 .../{ => Entity}/IWorkspace.cs.meta | 0 .../Interfaces/FunctionalityInjection.meta | 9 ++++ .../{ => FunctionalityInjection}/IActions.cs | 0 .../IActions.cs.meta | 0 .../IAllWorkspaces.cs | 0 .../IAllWorkspaces.cs.meta | 0 .../ICanGrabObject.cs | 0 .../ICanGrabObject.cs.meta | 0 .../IConnectInterfaces.cs | 0 .../IConnectInterfaces.cs.meta | 0 .../ICreateWorkspace.cs | 0 .../ICreateWorkspace.cs.meta | 0 .../ICustomActionMap.cs | 0 .../ICustomActionMap.cs.meta | 0 .../IDeleteSceneObject.cs | 0 .../IDeleteSceneObject.cs.meta | 0 .../IExclusiveMode.cs | 0 .../IExclusiveMode.cs.meta | 0 .../{ => FunctionalityInjection}/IFilterUI.cs | 0 .../IFilterUI.cs.meta | 0 .../IGetFieldGrabOrigin.cs | 0 .../IGetFieldGrabOrigin.cs.meta | 0 .../IGetPreviewOrigin.cs | 0 .../IGetPreviewOrigin.cs.meta | 0 .../IGrabObjects.cs | 0 .../IGrabObjects.cs.meta | 0 .../IInstantiateMenuUI.cs | 0 .../IInstantiateMenuUI.cs.meta | 0 .../IInstantiateUI.cs | 0 .../IInstantiateUI.cs.meta | 0 .../IIsHoveringOverUI.cs | 0 .../IIsHoveringOverUI.cs.meta | 0 .../ILinkedObject.cs | 0 .../ILinkedObject.cs.meta | 0 .../IMoveCameraRig.cs | 0 .../IMoveCameraRig.cs.meta | 0 .../IPlaceSceneObject.cs | 0 .../IPlaceSceneObject.cs.meta | 0 .../IPlaceSceneObjects.cs | 0 .../IPlaceSceneObjects.cs.meta | 0 .../IProcessInput.cs | 0 .../IProcessInput.cs.meta | 0 .../IRequestStencilRef.cs | 0 .../IRequestStencilRef.cs.meta | 0 .../IResetWorkspaces.cs | 0 .../IResetWorkspaces.cs.meta | 0 .../ISelectObject.cs | 0 .../ISelectObject.cs.meta | 0 .../ISelectTool.cs | 0 .../ISelectTool.cs.meta | 0 .../ISetDefaultRayVisibility.cs | 31 ++++++++++++++ .../ISetDefaultRayVisibility.cs.meta} | 0 .../ISetEditingContext.cs | 0 .../ISetEditingContext.cs.meta | 0 .../ISetHighlight.cs | 0 .../ISetHighlight.cs.meta | 0 .../ISetManipulatorsVisible.cs | 0 .../ISetManipulatorsVisible.cs.meta | 0 .../ISetTooltipVisibility.cs | 0 .../ISetTooltipVisibility.cs.meta | 0 .../IStandardActionMap.cs | 0 .../IStandardActionMap.cs.meta | 0 .../ITrackedObjectActionMap.cs | 0 .../ITrackedObjectActionMap.cs.meta | 0 .../IUsesCameraRig.cs | 0 .../IUsesCameraRig.cs.meta | 0 .../IUsesDirectSelection.cs | 0 .../IUsesDirectSelection.cs.meta | 0 .../IUsesGameObjectLocking.cs | 0 .../IUsesGameObjectLocking.cs.meta | 0 .../IUsesHandedRayOrigin.cs | 0 .../IUsesHandedRayOrigin.cs.meta | 0 .../IUsesMenuActions.cs | 0 .../IUsesMenuActions.cs.meta | 0 .../IUsesMenuOrigins.cs | 0 .../IUsesMenuOrigins.cs.meta | 0 .../{ => FunctionalityInjection}/IUsesNode.cs | 0 .../IUsesNode.cs.meta | 0 .../IUsesProxyType.cs | 0 .../IUsesProxyType.cs.meta | 0 .../IUsesRayLocking.cs | 0 .../IUsesRayLocking.cs.meta | 0 .../IUsesRayOrigin.cs | 0 .../IUsesRayOrigin.cs.meta | 0 .../IUsesRaycastResults.cs | 0 .../IUsesRaycastResults.cs.meta | 0 .../IUsesSnapping.cs | 0 .../IUsesSnapping.cs.meta | 0 .../IUsesSpatialHash.cs | 0 .../IUsesSpatialHash.cs.meta | 0 .../IUsesStencilRef.cs | 0 .../IUsesStencilRef.cs.meta | 0 .../IUsesViewerBody.cs | 0 .../IUsesViewerBody.cs.meta | 0 .../IUsesViewerScale.cs | 0 .../IUsesViewerScale.cs.meta | 0 Scripts/Interfaces/ICustomRay.cs | 41 ------------------- Scripts/Modules/KeyboardModule.cs | 7 ++-- .../BlinkLocomotionTool.cs | 9 ++-- .../MoveWorkspacesTool/MoveWorkspacesTool.cs | 6 +-- Tools/TransformTool/TransformTool.cs | 6 +-- 148 files changed, 85 insertions(+), 74 deletions(-) create mode 100644 Scripts/Interfaces/Capability.meta rename Scripts/Interfaces/{ => Capability}/ICustomHighlight.cs (100%) rename Scripts/Interfaces/{ => Capability}/ICustomHighlight.cs.meta (100%) rename Scripts/Interfaces/{ => Capability}/IDropReceiver.cs (100%) rename Scripts/Interfaces/{ => Capability}/IDropReceiver.cs.meta (100%) rename Scripts/Interfaces/{ => Capability}/IDroppable.cs (100%) rename Scripts/Interfaces/{ => Capability}/IDroppable.cs.meta (100%) rename Scripts/Interfaces/{ => Capability}/IManipulatorVisibility.cs (100%) rename Scripts/Interfaces/{ => Capability}/IManipulatorVisibility.cs.meta (100%) rename Scripts/Interfaces/{ => Capability}/ISelectionChanged.cs (100%) rename Scripts/Interfaces/{ => Capability}/ISelectionChanged.cs.meta (100%) rename Scripts/Interfaces/{ => Capability}/ISerializeWorkspace.cs (100%) rename Scripts/Interfaces/{ => Capability}/ISerializeWorkspace.cs.meta (100%) rename Scripts/Interfaces/{ => Capability}/ISettingsMenuProvider.cs (100%) rename Scripts/Interfaces/{ => Capability}/ISettingsMenuProvider.cs.meta (100%) rename Scripts/Interfaces/{ => Capability}/ITooltipPlacement.cs (100%) rename Scripts/Interfaces/{ => Capability}/ITooltipPlacement.cs.meta (100%) rename Scripts/Interfaces/{ => Capability}/IVacuumable.cs (100%) rename Scripts/Interfaces/{ => Capability}/IVacuumable.cs.meta (100%) create mode 100644 Scripts/Interfaces/Entity.meta rename Scripts/Interfaces/{ => Entity}/IAction.cs (100%) rename Scripts/Interfaces/{ => Entity}/IAction.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/IAlternateMenu.cs (100%) rename Scripts/Interfaces/{ => Entity}/IAlternateMenu.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/IEditingContext.cs (100%) rename Scripts/Interfaces/{ => Entity}/IEditingContext.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/ILocomotor.cs (100%) rename Scripts/Interfaces/{ => Entity}/ILocomotor.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/IMainMenu.cs (100%) rename Scripts/Interfaces/{ => Entity}/IMainMenu.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/IManipulator.cs (100%) rename Scripts/Interfaces/{ => Entity}/IManipulator.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/IMenu.cs (100%) rename Scripts/Interfaces/{ => Entity}/IMenu.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/IPreviewCamera.cs (100%) rename Scripts/Interfaces/{ => Entity}/IPreviewCamera.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/IProxy.cs (100%) rename Scripts/Interfaces/{ => Entity}/IProxy.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/ITool.cs (100%) rename Scripts/Interfaces/{ => Entity}/ITool.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/ITooltip.cs (100%) rename Scripts/Interfaces/{ => Entity}/ITooltip.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/ITransformer.cs (100%) rename Scripts/Interfaces/{ => Entity}/ITransformer.cs.meta (100%) rename Scripts/Interfaces/{ => Entity}/IWorkspace.cs (100%) rename Scripts/Interfaces/{ => Entity}/IWorkspace.cs.meta (100%) create mode 100644 Scripts/Interfaces/FunctionalityInjection.meta rename Scripts/Interfaces/{ => FunctionalityInjection}/IActions.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IActions.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IAllWorkspaces.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IAllWorkspaces.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ICanGrabObject.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ICanGrabObject.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IConnectInterfaces.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IConnectInterfaces.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ICreateWorkspace.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ICreateWorkspace.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ICustomActionMap.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ICustomActionMap.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IDeleteSceneObject.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IDeleteSceneObject.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IExclusiveMode.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IExclusiveMode.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IFilterUI.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IFilterUI.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IGetFieldGrabOrigin.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IGetFieldGrabOrigin.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IGetPreviewOrigin.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IGetPreviewOrigin.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IGrabObjects.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IGrabObjects.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IInstantiateMenuUI.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IInstantiateMenuUI.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IInstantiateUI.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IInstantiateUI.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IIsHoveringOverUI.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IIsHoveringOverUI.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ILinkedObject.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ILinkedObject.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IMoveCameraRig.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IMoveCameraRig.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IPlaceSceneObject.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IPlaceSceneObject.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IPlaceSceneObjects.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IPlaceSceneObjects.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IProcessInput.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IProcessInput.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IRequestStencilRef.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IRequestStencilRef.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IResetWorkspaces.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IResetWorkspaces.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISelectObject.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISelectObject.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISelectTool.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISelectTool.cs.meta (100%) create mode 100644 Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs rename Scripts/Interfaces/{ICustomRay.cs.meta => FunctionalityInjection/ISetDefaultRayVisibility.cs.meta} (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISetEditingContext.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISetEditingContext.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISetHighlight.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISetHighlight.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISetManipulatorsVisible.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISetManipulatorsVisible.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISetTooltipVisibility.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ISetTooltipVisibility.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IStandardActionMap.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IStandardActionMap.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ITrackedObjectActionMap.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/ITrackedObjectActionMap.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesCameraRig.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesCameraRig.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesDirectSelection.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesDirectSelection.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesGameObjectLocking.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesGameObjectLocking.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesHandedRayOrigin.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesHandedRayOrigin.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesMenuActions.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesMenuActions.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesMenuOrigins.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesMenuOrigins.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesNode.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesNode.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesProxyType.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesProxyType.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesRayLocking.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesRayLocking.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesRayOrigin.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesRayOrigin.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesRaycastResults.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesRaycastResults.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesSnapping.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesSnapping.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesSpatialHash.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesSpatialHash.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesStencilRef.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesStencilRef.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesViewerBody.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesViewerBody.cs.meta (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesViewerScale.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IUsesViewerScale.cs.meta (100%) delete mode 100644 Scripts/Interfaces/ICustomRay.cs diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index d2d4da4bd..22a9161eb 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -461,14 +461,14 @@ internal void UpdateMiniWorlds() if (isContained && !wasContained) { - Rays.HideRay(rayOrigin, true); + Rays.SetDefaultRayVisibility(rayOrigin, false, true); Rays.LockRay(rayOrigin, this); } if (!isContained && wasContained) { Rays.UnlockRay(rayOrigin, this); - Rays.ShowRay(rayOrigin, true); + Rays.SetDefaultRayVisibility(rayOrigin, true, true); } m_RayWasContained[rayOrigin] = isContained; @@ -579,7 +579,7 @@ void OnObjectsDropped(Transform rayOrigin, Transform[] grabbedObjects) if (!miniWorldRay.isContained) { Rays.UnlockRay(rayOrigin, this); - Rays.ShowRay(rayOrigin, true); + Rays.SetDefaultRayVisibility(rayOrigin, true, true); } } } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 672377da0..642085c4e 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -36,8 +36,7 @@ class Rays : Nested, IInterfaceConnector public Rays() { - ICustomRayMethods.showDefaultRay = ShowRay; - ICustomRayMethods.hideDefaultRay = HideRay; + ISetDefaultRayVisibilityMethods.setDefaultRayVisibility = SetDefaultRayVisibility; IUsesRayLockingMethods.lockRay = LockRay; IUsesRayLockingMethods.unlockRay = UnlockRay; @@ -108,13 +107,13 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig var customMenu = deviceData.customMenu; if (mainMenu.visible || (customMenu != null && customMenu.visible)) { - HideRay(rayOrigin); + SetDefaultRayVisibility(rayOrigin, false); LockRay(rayOrigin, mainMenu); } else { UnlockRay(rayOrigin, mainMenu); - ShowRay(rayOrigin); + SetDefaultRayVisibility(rayOrigin, true); } } @@ -390,23 +389,18 @@ internal static bool IsRayActive(Transform rayOrigin) return dpr == null || dpr.rayVisible; } - internal static void ShowRay(Transform rayOrigin, bool rayOnly = false) + internal static void SetDefaultRayVisibility(Transform rayOrigin, bool visible, bool rayOnly = false) { if (rayOrigin) { var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - dpr.Show(rayOnly); - } - } - - internal static void HideRay(Transform rayOrigin, bool rayOnly = false) - { - if (rayOrigin) - { - var dpr = rayOrigin.GetComponentInChildren(); - if (dpr) - dpr.Hide(rayOnly); + { + if (visible) + dpr.Show(rayOnly); + else + dpr.Hide(rayOnly); + } } } diff --git a/Scripts/Interfaces/Capability.meta b/Scripts/Interfaces/Capability.meta new file mode 100644 index 000000000..2ca976701 --- /dev/null +++ b/Scripts/Interfaces/Capability.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6f88368dfa0bbda44877e49f34930cba +folderAsset: yes +timeCreated: 1496774497 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/ICustomHighlight.cs b/Scripts/Interfaces/Capability/ICustomHighlight.cs similarity index 100% rename from Scripts/Interfaces/ICustomHighlight.cs rename to Scripts/Interfaces/Capability/ICustomHighlight.cs diff --git a/Scripts/Interfaces/ICustomHighlight.cs.meta b/Scripts/Interfaces/Capability/ICustomHighlight.cs.meta similarity index 100% rename from Scripts/Interfaces/ICustomHighlight.cs.meta rename to Scripts/Interfaces/Capability/ICustomHighlight.cs.meta diff --git a/Scripts/Interfaces/IDropReceiver.cs b/Scripts/Interfaces/Capability/IDropReceiver.cs similarity index 100% rename from Scripts/Interfaces/IDropReceiver.cs rename to Scripts/Interfaces/Capability/IDropReceiver.cs diff --git a/Scripts/Interfaces/IDropReceiver.cs.meta b/Scripts/Interfaces/Capability/IDropReceiver.cs.meta similarity index 100% rename from Scripts/Interfaces/IDropReceiver.cs.meta rename to Scripts/Interfaces/Capability/IDropReceiver.cs.meta diff --git a/Scripts/Interfaces/IDroppable.cs b/Scripts/Interfaces/Capability/IDroppable.cs similarity index 100% rename from Scripts/Interfaces/IDroppable.cs rename to Scripts/Interfaces/Capability/IDroppable.cs diff --git a/Scripts/Interfaces/IDroppable.cs.meta b/Scripts/Interfaces/Capability/IDroppable.cs.meta similarity index 100% rename from Scripts/Interfaces/IDroppable.cs.meta rename to Scripts/Interfaces/Capability/IDroppable.cs.meta diff --git a/Scripts/Interfaces/IManipulatorVisibility.cs b/Scripts/Interfaces/Capability/IManipulatorVisibility.cs similarity index 100% rename from Scripts/Interfaces/IManipulatorVisibility.cs rename to Scripts/Interfaces/Capability/IManipulatorVisibility.cs diff --git a/Scripts/Interfaces/IManipulatorVisibility.cs.meta b/Scripts/Interfaces/Capability/IManipulatorVisibility.cs.meta similarity index 100% rename from Scripts/Interfaces/IManipulatorVisibility.cs.meta rename to Scripts/Interfaces/Capability/IManipulatorVisibility.cs.meta diff --git a/Scripts/Interfaces/ISelectionChanged.cs b/Scripts/Interfaces/Capability/ISelectionChanged.cs similarity index 100% rename from Scripts/Interfaces/ISelectionChanged.cs rename to Scripts/Interfaces/Capability/ISelectionChanged.cs diff --git a/Scripts/Interfaces/ISelectionChanged.cs.meta b/Scripts/Interfaces/Capability/ISelectionChanged.cs.meta similarity index 100% rename from Scripts/Interfaces/ISelectionChanged.cs.meta rename to Scripts/Interfaces/Capability/ISelectionChanged.cs.meta diff --git a/Scripts/Interfaces/ISerializeWorkspace.cs b/Scripts/Interfaces/Capability/ISerializeWorkspace.cs similarity index 100% rename from Scripts/Interfaces/ISerializeWorkspace.cs rename to Scripts/Interfaces/Capability/ISerializeWorkspace.cs diff --git a/Scripts/Interfaces/ISerializeWorkspace.cs.meta b/Scripts/Interfaces/Capability/ISerializeWorkspace.cs.meta similarity index 100% rename from Scripts/Interfaces/ISerializeWorkspace.cs.meta rename to Scripts/Interfaces/Capability/ISerializeWorkspace.cs.meta diff --git a/Scripts/Interfaces/ISettingsMenuProvider.cs b/Scripts/Interfaces/Capability/ISettingsMenuProvider.cs similarity index 100% rename from Scripts/Interfaces/ISettingsMenuProvider.cs rename to Scripts/Interfaces/Capability/ISettingsMenuProvider.cs diff --git a/Scripts/Interfaces/ISettingsMenuProvider.cs.meta b/Scripts/Interfaces/Capability/ISettingsMenuProvider.cs.meta similarity index 100% rename from Scripts/Interfaces/ISettingsMenuProvider.cs.meta rename to Scripts/Interfaces/Capability/ISettingsMenuProvider.cs.meta diff --git a/Scripts/Interfaces/ITooltipPlacement.cs b/Scripts/Interfaces/Capability/ITooltipPlacement.cs similarity index 100% rename from Scripts/Interfaces/ITooltipPlacement.cs rename to Scripts/Interfaces/Capability/ITooltipPlacement.cs diff --git a/Scripts/Interfaces/ITooltipPlacement.cs.meta b/Scripts/Interfaces/Capability/ITooltipPlacement.cs.meta similarity index 100% rename from Scripts/Interfaces/ITooltipPlacement.cs.meta rename to Scripts/Interfaces/Capability/ITooltipPlacement.cs.meta diff --git a/Scripts/Interfaces/IVacuumable.cs b/Scripts/Interfaces/Capability/IVacuumable.cs similarity index 100% rename from Scripts/Interfaces/IVacuumable.cs rename to Scripts/Interfaces/Capability/IVacuumable.cs diff --git a/Scripts/Interfaces/IVacuumable.cs.meta b/Scripts/Interfaces/Capability/IVacuumable.cs.meta similarity index 100% rename from Scripts/Interfaces/IVacuumable.cs.meta rename to Scripts/Interfaces/Capability/IVacuumable.cs.meta diff --git a/Scripts/Interfaces/Entity.meta b/Scripts/Interfaces/Entity.meta new file mode 100644 index 000000000..e52225c87 --- /dev/null +++ b/Scripts/Interfaces/Entity.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8c42a5913b0b1e941aa7c60b211479f9 +folderAsset: yes +timeCreated: 1496774123 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/IAction.cs b/Scripts/Interfaces/Entity/IAction.cs similarity index 100% rename from Scripts/Interfaces/IAction.cs rename to Scripts/Interfaces/Entity/IAction.cs diff --git a/Scripts/Interfaces/IAction.cs.meta b/Scripts/Interfaces/Entity/IAction.cs.meta similarity index 100% rename from Scripts/Interfaces/IAction.cs.meta rename to Scripts/Interfaces/Entity/IAction.cs.meta diff --git a/Scripts/Interfaces/IAlternateMenu.cs b/Scripts/Interfaces/Entity/IAlternateMenu.cs similarity index 100% rename from Scripts/Interfaces/IAlternateMenu.cs rename to Scripts/Interfaces/Entity/IAlternateMenu.cs diff --git a/Scripts/Interfaces/IAlternateMenu.cs.meta b/Scripts/Interfaces/Entity/IAlternateMenu.cs.meta similarity index 100% rename from Scripts/Interfaces/IAlternateMenu.cs.meta rename to Scripts/Interfaces/Entity/IAlternateMenu.cs.meta diff --git a/Scripts/Interfaces/IEditingContext.cs b/Scripts/Interfaces/Entity/IEditingContext.cs similarity index 100% rename from Scripts/Interfaces/IEditingContext.cs rename to Scripts/Interfaces/Entity/IEditingContext.cs diff --git a/Scripts/Interfaces/IEditingContext.cs.meta b/Scripts/Interfaces/Entity/IEditingContext.cs.meta similarity index 100% rename from Scripts/Interfaces/IEditingContext.cs.meta rename to Scripts/Interfaces/Entity/IEditingContext.cs.meta diff --git a/Scripts/Interfaces/ILocomotor.cs b/Scripts/Interfaces/Entity/ILocomotor.cs similarity index 100% rename from Scripts/Interfaces/ILocomotor.cs rename to Scripts/Interfaces/Entity/ILocomotor.cs diff --git a/Scripts/Interfaces/ILocomotor.cs.meta b/Scripts/Interfaces/Entity/ILocomotor.cs.meta similarity index 100% rename from Scripts/Interfaces/ILocomotor.cs.meta rename to Scripts/Interfaces/Entity/ILocomotor.cs.meta diff --git a/Scripts/Interfaces/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs similarity index 100% rename from Scripts/Interfaces/IMainMenu.cs rename to Scripts/Interfaces/Entity/IMainMenu.cs diff --git a/Scripts/Interfaces/IMainMenu.cs.meta b/Scripts/Interfaces/Entity/IMainMenu.cs.meta similarity index 100% rename from Scripts/Interfaces/IMainMenu.cs.meta rename to Scripts/Interfaces/Entity/IMainMenu.cs.meta diff --git a/Scripts/Interfaces/IManipulator.cs b/Scripts/Interfaces/Entity/IManipulator.cs similarity index 100% rename from Scripts/Interfaces/IManipulator.cs rename to Scripts/Interfaces/Entity/IManipulator.cs diff --git a/Scripts/Interfaces/IManipulator.cs.meta b/Scripts/Interfaces/Entity/IManipulator.cs.meta similarity index 100% rename from Scripts/Interfaces/IManipulator.cs.meta rename to Scripts/Interfaces/Entity/IManipulator.cs.meta diff --git a/Scripts/Interfaces/IMenu.cs b/Scripts/Interfaces/Entity/IMenu.cs similarity index 100% rename from Scripts/Interfaces/IMenu.cs rename to Scripts/Interfaces/Entity/IMenu.cs diff --git a/Scripts/Interfaces/IMenu.cs.meta b/Scripts/Interfaces/Entity/IMenu.cs.meta similarity index 100% rename from Scripts/Interfaces/IMenu.cs.meta rename to Scripts/Interfaces/Entity/IMenu.cs.meta diff --git a/Scripts/Interfaces/IPreviewCamera.cs b/Scripts/Interfaces/Entity/IPreviewCamera.cs similarity index 100% rename from Scripts/Interfaces/IPreviewCamera.cs rename to Scripts/Interfaces/Entity/IPreviewCamera.cs diff --git a/Scripts/Interfaces/IPreviewCamera.cs.meta b/Scripts/Interfaces/Entity/IPreviewCamera.cs.meta similarity index 100% rename from Scripts/Interfaces/IPreviewCamera.cs.meta rename to Scripts/Interfaces/Entity/IPreviewCamera.cs.meta diff --git a/Scripts/Interfaces/IProxy.cs b/Scripts/Interfaces/Entity/IProxy.cs similarity index 100% rename from Scripts/Interfaces/IProxy.cs rename to Scripts/Interfaces/Entity/IProxy.cs diff --git a/Scripts/Interfaces/IProxy.cs.meta b/Scripts/Interfaces/Entity/IProxy.cs.meta similarity index 100% rename from Scripts/Interfaces/IProxy.cs.meta rename to Scripts/Interfaces/Entity/IProxy.cs.meta diff --git a/Scripts/Interfaces/ITool.cs b/Scripts/Interfaces/Entity/ITool.cs similarity index 100% rename from Scripts/Interfaces/ITool.cs rename to Scripts/Interfaces/Entity/ITool.cs diff --git a/Scripts/Interfaces/ITool.cs.meta b/Scripts/Interfaces/Entity/ITool.cs.meta similarity index 100% rename from Scripts/Interfaces/ITool.cs.meta rename to Scripts/Interfaces/Entity/ITool.cs.meta diff --git a/Scripts/Interfaces/ITooltip.cs b/Scripts/Interfaces/Entity/ITooltip.cs similarity index 100% rename from Scripts/Interfaces/ITooltip.cs rename to Scripts/Interfaces/Entity/ITooltip.cs diff --git a/Scripts/Interfaces/ITooltip.cs.meta b/Scripts/Interfaces/Entity/ITooltip.cs.meta similarity index 100% rename from Scripts/Interfaces/ITooltip.cs.meta rename to Scripts/Interfaces/Entity/ITooltip.cs.meta diff --git a/Scripts/Interfaces/ITransformer.cs b/Scripts/Interfaces/Entity/ITransformer.cs similarity index 100% rename from Scripts/Interfaces/ITransformer.cs rename to Scripts/Interfaces/Entity/ITransformer.cs diff --git a/Scripts/Interfaces/ITransformer.cs.meta b/Scripts/Interfaces/Entity/ITransformer.cs.meta similarity index 100% rename from Scripts/Interfaces/ITransformer.cs.meta rename to Scripts/Interfaces/Entity/ITransformer.cs.meta diff --git a/Scripts/Interfaces/IWorkspace.cs b/Scripts/Interfaces/Entity/IWorkspace.cs similarity index 100% rename from Scripts/Interfaces/IWorkspace.cs rename to Scripts/Interfaces/Entity/IWorkspace.cs diff --git a/Scripts/Interfaces/IWorkspace.cs.meta b/Scripts/Interfaces/Entity/IWorkspace.cs.meta similarity index 100% rename from Scripts/Interfaces/IWorkspace.cs.meta rename to Scripts/Interfaces/Entity/IWorkspace.cs.meta diff --git a/Scripts/Interfaces/FunctionalityInjection.meta b/Scripts/Interfaces/FunctionalityInjection.meta new file mode 100644 index 000000000..96d9da1c8 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5dc81a790c4202d4ca05b640c8b42d6c +folderAsset: yes +timeCreated: 1496774104 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/IActions.cs b/Scripts/Interfaces/FunctionalityInjection/IActions.cs similarity index 100% rename from Scripts/Interfaces/IActions.cs rename to Scripts/Interfaces/FunctionalityInjection/IActions.cs diff --git a/Scripts/Interfaces/IActions.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IActions.cs.meta similarity index 100% rename from Scripts/Interfaces/IActions.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IActions.cs.meta diff --git a/Scripts/Interfaces/IAllWorkspaces.cs b/Scripts/Interfaces/FunctionalityInjection/IAllWorkspaces.cs similarity index 100% rename from Scripts/Interfaces/IAllWorkspaces.cs rename to Scripts/Interfaces/FunctionalityInjection/IAllWorkspaces.cs diff --git a/Scripts/Interfaces/IAllWorkspaces.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IAllWorkspaces.cs.meta similarity index 100% rename from Scripts/Interfaces/IAllWorkspaces.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IAllWorkspaces.cs.meta diff --git a/Scripts/Interfaces/ICanGrabObject.cs b/Scripts/Interfaces/FunctionalityInjection/ICanGrabObject.cs similarity index 100% rename from Scripts/Interfaces/ICanGrabObject.cs rename to Scripts/Interfaces/FunctionalityInjection/ICanGrabObject.cs diff --git a/Scripts/Interfaces/ICanGrabObject.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ICanGrabObject.cs.meta similarity index 100% rename from Scripts/Interfaces/ICanGrabObject.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ICanGrabObject.cs.meta diff --git a/Scripts/Interfaces/IConnectInterfaces.cs b/Scripts/Interfaces/FunctionalityInjection/IConnectInterfaces.cs similarity index 100% rename from Scripts/Interfaces/IConnectInterfaces.cs rename to Scripts/Interfaces/FunctionalityInjection/IConnectInterfaces.cs diff --git a/Scripts/Interfaces/IConnectInterfaces.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IConnectInterfaces.cs.meta similarity index 100% rename from Scripts/Interfaces/IConnectInterfaces.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IConnectInterfaces.cs.meta diff --git a/Scripts/Interfaces/ICreateWorkspace.cs b/Scripts/Interfaces/FunctionalityInjection/ICreateWorkspace.cs similarity index 100% rename from Scripts/Interfaces/ICreateWorkspace.cs rename to Scripts/Interfaces/FunctionalityInjection/ICreateWorkspace.cs diff --git a/Scripts/Interfaces/ICreateWorkspace.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ICreateWorkspace.cs.meta similarity index 100% rename from Scripts/Interfaces/ICreateWorkspace.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ICreateWorkspace.cs.meta diff --git a/Scripts/Interfaces/ICustomActionMap.cs b/Scripts/Interfaces/FunctionalityInjection/ICustomActionMap.cs similarity index 100% rename from Scripts/Interfaces/ICustomActionMap.cs rename to Scripts/Interfaces/FunctionalityInjection/ICustomActionMap.cs diff --git a/Scripts/Interfaces/ICustomActionMap.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ICustomActionMap.cs.meta similarity index 100% rename from Scripts/Interfaces/ICustomActionMap.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ICustomActionMap.cs.meta diff --git a/Scripts/Interfaces/IDeleteSceneObject.cs b/Scripts/Interfaces/FunctionalityInjection/IDeleteSceneObject.cs similarity index 100% rename from Scripts/Interfaces/IDeleteSceneObject.cs rename to Scripts/Interfaces/FunctionalityInjection/IDeleteSceneObject.cs diff --git a/Scripts/Interfaces/IDeleteSceneObject.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IDeleteSceneObject.cs.meta similarity index 100% rename from Scripts/Interfaces/IDeleteSceneObject.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IDeleteSceneObject.cs.meta diff --git a/Scripts/Interfaces/IExclusiveMode.cs b/Scripts/Interfaces/FunctionalityInjection/IExclusiveMode.cs similarity index 100% rename from Scripts/Interfaces/IExclusiveMode.cs rename to Scripts/Interfaces/FunctionalityInjection/IExclusiveMode.cs diff --git a/Scripts/Interfaces/IExclusiveMode.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IExclusiveMode.cs.meta similarity index 100% rename from Scripts/Interfaces/IExclusiveMode.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IExclusiveMode.cs.meta diff --git a/Scripts/Interfaces/IFilterUI.cs b/Scripts/Interfaces/FunctionalityInjection/IFilterUI.cs similarity index 100% rename from Scripts/Interfaces/IFilterUI.cs rename to Scripts/Interfaces/FunctionalityInjection/IFilterUI.cs diff --git a/Scripts/Interfaces/IFilterUI.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IFilterUI.cs.meta similarity index 100% rename from Scripts/Interfaces/IFilterUI.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IFilterUI.cs.meta diff --git a/Scripts/Interfaces/IGetFieldGrabOrigin.cs b/Scripts/Interfaces/FunctionalityInjection/IGetFieldGrabOrigin.cs similarity index 100% rename from Scripts/Interfaces/IGetFieldGrabOrigin.cs rename to Scripts/Interfaces/FunctionalityInjection/IGetFieldGrabOrigin.cs diff --git a/Scripts/Interfaces/IGetFieldGrabOrigin.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IGetFieldGrabOrigin.cs.meta similarity index 100% rename from Scripts/Interfaces/IGetFieldGrabOrigin.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IGetFieldGrabOrigin.cs.meta diff --git a/Scripts/Interfaces/IGetPreviewOrigin.cs b/Scripts/Interfaces/FunctionalityInjection/IGetPreviewOrigin.cs similarity index 100% rename from Scripts/Interfaces/IGetPreviewOrigin.cs rename to Scripts/Interfaces/FunctionalityInjection/IGetPreviewOrigin.cs diff --git a/Scripts/Interfaces/IGetPreviewOrigin.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IGetPreviewOrigin.cs.meta similarity index 100% rename from Scripts/Interfaces/IGetPreviewOrigin.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IGetPreviewOrigin.cs.meta diff --git a/Scripts/Interfaces/IGrabObjects.cs b/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs similarity index 100% rename from Scripts/Interfaces/IGrabObjects.cs rename to Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs diff --git a/Scripts/Interfaces/IGrabObjects.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs.meta similarity index 100% rename from Scripts/Interfaces/IGrabObjects.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs.meta diff --git a/Scripts/Interfaces/IInstantiateMenuUI.cs b/Scripts/Interfaces/FunctionalityInjection/IInstantiateMenuUI.cs similarity index 100% rename from Scripts/Interfaces/IInstantiateMenuUI.cs rename to Scripts/Interfaces/FunctionalityInjection/IInstantiateMenuUI.cs diff --git a/Scripts/Interfaces/IInstantiateMenuUI.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IInstantiateMenuUI.cs.meta similarity index 100% rename from Scripts/Interfaces/IInstantiateMenuUI.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IInstantiateMenuUI.cs.meta diff --git a/Scripts/Interfaces/IInstantiateUI.cs b/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs similarity index 100% rename from Scripts/Interfaces/IInstantiateUI.cs rename to Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs diff --git a/Scripts/Interfaces/IInstantiateUI.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs.meta similarity index 100% rename from Scripts/Interfaces/IInstantiateUI.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs.meta diff --git a/Scripts/Interfaces/IIsHoveringOverUI.cs b/Scripts/Interfaces/FunctionalityInjection/IIsHoveringOverUI.cs similarity index 100% rename from Scripts/Interfaces/IIsHoveringOverUI.cs rename to Scripts/Interfaces/FunctionalityInjection/IIsHoveringOverUI.cs diff --git a/Scripts/Interfaces/IIsHoveringOverUI.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IIsHoveringOverUI.cs.meta similarity index 100% rename from Scripts/Interfaces/IIsHoveringOverUI.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IIsHoveringOverUI.cs.meta diff --git a/Scripts/Interfaces/ILinkedObject.cs b/Scripts/Interfaces/FunctionalityInjection/ILinkedObject.cs similarity index 100% rename from Scripts/Interfaces/ILinkedObject.cs rename to Scripts/Interfaces/FunctionalityInjection/ILinkedObject.cs diff --git a/Scripts/Interfaces/ILinkedObject.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ILinkedObject.cs.meta similarity index 100% rename from Scripts/Interfaces/ILinkedObject.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ILinkedObject.cs.meta diff --git a/Scripts/Interfaces/IMoveCameraRig.cs b/Scripts/Interfaces/FunctionalityInjection/IMoveCameraRig.cs similarity index 100% rename from Scripts/Interfaces/IMoveCameraRig.cs rename to Scripts/Interfaces/FunctionalityInjection/IMoveCameraRig.cs diff --git a/Scripts/Interfaces/IMoveCameraRig.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IMoveCameraRig.cs.meta similarity index 100% rename from Scripts/Interfaces/IMoveCameraRig.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IMoveCameraRig.cs.meta diff --git a/Scripts/Interfaces/IPlaceSceneObject.cs b/Scripts/Interfaces/FunctionalityInjection/IPlaceSceneObject.cs similarity index 100% rename from Scripts/Interfaces/IPlaceSceneObject.cs rename to Scripts/Interfaces/FunctionalityInjection/IPlaceSceneObject.cs diff --git a/Scripts/Interfaces/IPlaceSceneObject.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IPlaceSceneObject.cs.meta similarity index 100% rename from Scripts/Interfaces/IPlaceSceneObject.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IPlaceSceneObject.cs.meta diff --git a/Scripts/Interfaces/IPlaceSceneObjects.cs b/Scripts/Interfaces/FunctionalityInjection/IPlaceSceneObjects.cs similarity index 100% rename from Scripts/Interfaces/IPlaceSceneObjects.cs rename to Scripts/Interfaces/FunctionalityInjection/IPlaceSceneObjects.cs diff --git a/Scripts/Interfaces/IPlaceSceneObjects.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IPlaceSceneObjects.cs.meta similarity index 100% rename from Scripts/Interfaces/IPlaceSceneObjects.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IPlaceSceneObjects.cs.meta diff --git a/Scripts/Interfaces/IProcessInput.cs b/Scripts/Interfaces/FunctionalityInjection/IProcessInput.cs similarity index 100% rename from Scripts/Interfaces/IProcessInput.cs rename to Scripts/Interfaces/FunctionalityInjection/IProcessInput.cs diff --git a/Scripts/Interfaces/IProcessInput.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IProcessInput.cs.meta similarity index 100% rename from Scripts/Interfaces/IProcessInput.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IProcessInput.cs.meta diff --git a/Scripts/Interfaces/IRequestStencilRef.cs b/Scripts/Interfaces/FunctionalityInjection/IRequestStencilRef.cs similarity index 100% rename from Scripts/Interfaces/IRequestStencilRef.cs rename to Scripts/Interfaces/FunctionalityInjection/IRequestStencilRef.cs diff --git a/Scripts/Interfaces/IRequestStencilRef.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IRequestStencilRef.cs.meta similarity index 100% rename from Scripts/Interfaces/IRequestStencilRef.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IRequestStencilRef.cs.meta diff --git a/Scripts/Interfaces/IResetWorkspaces.cs b/Scripts/Interfaces/FunctionalityInjection/IResetWorkspaces.cs similarity index 100% rename from Scripts/Interfaces/IResetWorkspaces.cs rename to Scripts/Interfaces/FunctionalityInjection/IResetWorkspaces.cs diff --git a/Scripts/Interfaces/IResetWorkspaces.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IResetWorkspaces.cs.meta similarity index 100% rename from Scripts/Interfaces/IResetWorkspaces.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IResetWorkspaces.cs.meta diff --git a/Scripts/Interfaces/ISelectObject.cs b/Scripts/Interfaces/FunctionalityInjection/ISelectObject.cs similarity index 100% rename from Scripts/Interfaces/ISelectObject.cs rename to Scripts/Interfaces/FunctionalityInjection/ISelectObject.cs diff --git a/Scripts/Interfaces/ISelectObject.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ISelectObject.cs.meta similarity index 100% rename from Scripts/Interfaces/ISelectObject.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ISelectObject.cs.meta diff --git a/Scripts/Interfaces/ISelectTool.cs b/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs similarity index 100% rename from Scripts/Interfaces/ISelectTool.cs rename to Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs diff --git a/Scripts/Interfaces/ISelectTool.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs.meta similarity index 100% rename from Scripts/Interfaces/ISelectTool.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs.meta diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs new file mode 100644 index 000000000..50476b279 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs @@ -0,0 +1,31 @@ +#if UNITY_EDITOR +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Implementors can show & hide the default ray + /// + public interface ISetDefaultRayVisibility : IUsesRayLocking + { + } + + public static class ISetDefaultRayVisibilityMethods + { + internal delegate void DefaultRayVisibilityDelegate(Transform rayOrigin, bool visible, bool rayOnly = false); + + internal static DefaultRayVisibilityDelegate setDefaultRayVisibility { get; set; } + + /// + /// Show the default proxy ray/cone + /// + /// The ray to hide or show + /// Show or hide + /// An optional parameter to hide or show only the ray and not the cone + public static void SetDefaultRayVisibility(this ISetDefaultRayVisibility customRay, Transform rayOrigin, bool visible, bool rayOnly = false) + { + setDefaultRayVisibility(rayOrigin, visible, rayOnly); + } + } +} +#endif diff --git a/Scripts/Interfaces/ICustomRay.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs.meta similarity index 100% rename from Scripts/Interfaces/ICustomRay.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs.meta diff --git a/Scripts/Interfaces/ISetEditingContext.cs b/Scripts/Interfaces/FunctionalityInjection/ISetEditingContext.cs similarity index 100% rename from Scripts/Interfaces/ISetEditingContext.cs rename to Scripts/Interfaces/FunctionalityInjection/ISetEditingContext.cs diff --git a/Scripts/Interfaces/ISetEditingContext.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ISetEditingContext.cs.meta similarity index 100% rename from Scripts/Interfaces/ISetEditingContext.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ISetEditingContext.cs.meta diff --git a/Scripts/Interfaces/ISetHighlight.cs b/Scripts/Interfaces/FunctionalityInjection/ISetHighlight.cs similarity index 100% rename from Scripts/Interfaces/ISetHighlight.cs rename to Scripts/Interfaces/FunctionalityInjection/ISetHighlight.cs diff --git a/Scripts/Interfaces/ISetHighlight.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ISetHighlight.cs.meta similarity index 100% rename from Scripts/Interfaces/ISetHighlight.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ISetHighlight.cs.meta diff --git a/Scripts/Interfaces/ISetManipulatorsVisible.cs b/Scripts/Interfaces/FunctionalityInjection/ISetManipulatorsVisible.cs similarity index 100% rename from Scripts/Interfaces/ISetManipulatorsVisible.cs rename to Scripts/Interfaces/FunctionalityInjection/ISetManipulatorsVisible.cs diff --git a/Scripts/Interfaces/ISetManipulatorsVisible.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ISetManipulatorsVisible.cs.meta similarity index 100% rename from Scripts/Interfaces/ISetManipulatorsVisible.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ISetManipulatorsVisible.cs.meta diff --git a/Scripts/Interfaces/ISetTooltipVisibility.cs b/Scripts/Interfaces/FunctionalityInjection/ISetTooltipVisibility.cs similarity index 100% rename from Scripts/Interfaces/ISetTooltipVisibility.cs rename to Scripts/Interfaces/FunctionalityInjection/ISetTooltipVisibility.cs diff --git a/Scripts/Interfaces/ISetTooltipVisibility.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ISetTooltipVisibility.cs.meta similarity index 100% rename from Scripts/Interfaces/ISetTooltipVisibility.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ISetTooltipVisibility.cs.meta diff --git a/Scripts/Interfaces/IStandardActionMap.cs b/Scripts/Interfaces/FunctionalityInjection/IStandardActionMap.cs similarity index 100% rename from Scripts/Interfaces/IStandardActionMap.cs rename to Scripts/Interfaces/FunctionalityInjection/IStandardActionMap.cs diff --git a/Scripts/Interfaces/IStandardActionMap.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IStandardActionMap.cs.meta similarity index 100% rename from Scripts/Interfaces/IStandardActionMap.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IStandardActionMap.cs.meta diff --git a/Scripts/Interfaces/ITrackedObjectActionMap.cs b/Scripts/Interfaces/FunctionalityInjection/ITrackedObjectActionMap.cs similarity index 100% rename from Scripts/Interfaces/ITrackedObjectActionMap.cs rename to Scripts/Interfaces/FunctionalityInjection/ITrackedObjectActionMap.cs diff --git a/Scripts/Interfaces/ITrackedObjectActionMap.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ITrackedObjectActionMap.cs.meta similarity index 100% rename from Scripts/Interfaces/ITrackedObjectActionMap.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/ITrackedObjectActionMap.cs.meta diff --git a/Scripts/Interfaces/IUsesCameraRig.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesCameraRig.cs similarity index 100% rename from Scripts/Interfaces/IUsesCameraRig.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesCameraRig.cs diff --git a/Scripts/Interfaces/IUsesCameraRig.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesCameraRig.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesCameraRig.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesCameraRig.cs.meta diff --git a/Scripts/Interfaces/IUsesDirectSelection.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs similarity index 100% rename from Scripts/Interfaces/IUsesDirectSelection.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs diff --git a/Scripts/Interfaces/IUsesDirectSelection.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesDirectSelection.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs.meta diff --git a/Scripts/Interfaces/IUsesGameObjectLocking.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesGameObjectLocking.cs similarity index 100% rename from Scripts/Interfaces/IUsesGameObjectLocking.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesGameObjectLocking.cs diff --git a/Scripts/Interfaces/IUsesGameObjectLocking.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesGameObjectLocking.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesGameObjectLocking.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesGameObjectLocking.cs.meta diff --git a/Scripts/Interfaces/IUsesHandedRayOrigin.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesHandedRayOrigin.cs similarity index 100% rename from Scripts/Interfaces/IUsesHandedRayOrigin.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesHandedRayOrigin.cs diff --git a/Scripts/Interfaces/IUsesHandedRayOrigin.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesHandedRayOrigin.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesHandedRayOrigin.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesHandedRayOrigin.cs.meta diff --git a/Scripts/Interfaces/IUsesMenuActions.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesMenuActions.cs similarity index 100% rename from Scripts/Interfaces/IUsesMenuActions.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesMenuActions.cs diff --git a/Scripts/Interfaces/IUsesMenuActions.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesMenuActions.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesMenuActions.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesMenuActions.cs.meta diff --git a/Scripts/Interfaces/IUsesMenuOrigins.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesMenuOrigins.cs similarity index 100% rename from Scripts/Interfaces/IUsesMenuOrigins.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesMenuOrigins.cs diff --git a/Scripts/Interfaces/IUsesMenuOrigins.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesMenuOrigins.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesMenuOrigins.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesMenuOrigins.cs.meta diff --git a/Scripts/Interfaces/IUsesNode.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesNode.cs similarity index 100% rename from Scripts/Interfaces/IUsesNode.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesNode.cs diff --git a/Scripts/Interfaces/IUsesNode.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesNode.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesNode.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesNode.cs.meta diff --git a/Scripts/Interfaces/IUsesProxyType.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesProxyType.cs similarity index 100% rename from Scripts/Interfaces/IUsesProxyType.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesProxyType.cs diff --git a/Scripts/Interfaces/IUsesProxyType.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesProxyType.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesProxyType.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesProxyType.cs.meta diff --git a/Scripts/Interfaces/IUsesRayLocking.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs similarity index 100% rename from Scripts/Interfaces/IUsesRayLocking.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs diff --git a/Scripts/Interfaces/IUsesRayLocking.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesRayLocking.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs.meta diff --git a/Scripts/Interfaces/IUsesRayOrigin.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesRayOrigin.cs similarity index 100% rename from Scripts/Interfaces/IUsesRayOrigin.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesRayOrigin.cs diff --git a/Scripts/Interfaces/IUsesRayOrigin.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesRayOrigin.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesRayOrigin.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesRayOrigin.cs.meta diff --git a/Scripts/Interfaces/IUsesRaycastResults.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesRaycastResults.cs similarity index 100% rename from Scripts/Interfaces/IUsesRaycastResults.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesRaycastResults.cs diff --git a/Scripts/Interfaces/IUsesRaycastResults.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesRaycastResults.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesRaycastResults.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesRaycastResults.cs.meta diff --git a/Scripts/Interfaces/IUsesSnapping.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs similarity index 100% rename from Scripts/Interfaces/IUsesSnapping.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs diff --git a/Scripts/Interfaces/IUsesSnapping.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesSnapping.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs.meta diff --git a/Scripts/Interfaces/IUsesSpatialHash.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesSpatialHash.cs similarity index 100% rename from Scripts/Interfaces/IUsesSpatialHash.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesSpatialHash.cs diff --git a/Scripts/Interfaces/IUsesSpatialHash.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesSpatialHash.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesSpatialHash.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesSpatialHash.cs.meta diff --git a/Scripts/Interfaces/IUsesStencilRef.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesStencilRef.cs similarity index 100% rename from Scripts/Interfaces/IUsesStencilRef.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesStencilRef.cs diff --git a/Scripts/Interfaces/IUsesStencilRef.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesStencilRef.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesStencilRef.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesStencilRef.cs.meta diff --git a/Scripts/Interfaces/IUsesViewerBody.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesViewerBody.cs similarity index 100% rename from Scripts/Interfaces/IUsesViewerBody.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesViewerBody.cs diff --git a/Scripts/Interfaces/IUsesViewerBody.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesViewerBody.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesViewerBody.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesViewerBody.cs.meta diff --git a/Scripts/Interfaces/IUsesViewerScale.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesViewerScale.cs similarity index 100% rename from Scripts/Interfaces/IUsesViewerScale.cs rename to Scripts/Interfaces/FunctionalityInjection/IUsesViewerScale.cs diff --git a/Scripts/Interfaces/IUsesViewerScale.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesViewerScale.cs.meta similarity index 100% rename from Scripts/Interfaces/IUsesViewerScale.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IUsesViewerScale.cs.meta diff --git a/Scripts/Interfaces/ICustomRay.cs b/Scripts/Interfaces/ICustomRay.cs deleted file mode 100644 index 38f67c69c..000000000 --- a/Scripts/Interfaces/ICustomRay.cs +++ /dev/null @@ -1,41 +0,0 @@ -#if UNITY_EDITOR -using UnityEngine; - -namespace UnityEditor.Experimental.EditorVR -{ - /// - /// Implementors can show & hide the default ray - /// - public interface ICustomRay : IUsesRayLocking - { - } - - public static class ICustomRayMethods - { - internal delegate void DefaultRayVisibilityDelegate(Transform rayOrigin, bool onlyRay = false); - - internal static DefaultRayVisibilityDelegate showDefaultRay { get; set; } - internal static DefaultRayVisibilityDelegate hideDefaultRay { get; set; } - - /// - /// Show the default proxy ray/cone - /// - /// The ray to hide or show - /// An optional parameter to hide or show only the ray - public static void ShowDefaultRay(this ICustomRay customRay, Transform rayOrigin, bool rayOnly = false) - { - showDefaultRay(rayOrigin, rayOnly); - } - - /// - /// Hide the default proxy ray/cone - /// - /// The ray to hide or show - /// An optional parameter to hide or show only the ray - public static void HideDefaultRay(this ICustomRay customRay, Transform rayOrigin, bool rayOnly = false) - { - hideDefaultRay(rayOrigin, rayOnly); - } - } -} -#endif diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index 6ef80fd88..a2604db44 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class KeyboardModule : MonoBehaviour, ICustomRay, IForEachRayOrigin, IConnectInterfaces + sealed class KeyboardModule : MonoBehaviour, ISetDefaultRayVisibility, IForEachRayOrigin, IConnectInterfaces { [SerializeField] KeyboardMallet m_KeyboardMalletPrefab; @@ -97,10 +97,11 @@ public void UpdateKeyboardMallets() if (mallet.visible != malletVisible) { mallet.visible = malletVisible; + this.SetDefaultRayVisibility(rayOrigin, !malletVisible); if (malletVisible) - this.HideDefaultRay(rayOrigin); + this.LockRay(rayOrigin, this); else - this.ShowDefaultRay(rayOrigin); + this.UnlockRay(rayOrigin, this); } // TODO remove this after physics is in diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs index 6f5eeff3f..b1d47a70d 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs @@ -10,9 +10,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, ICustomRay, IUsesHandedRayOrigin, + sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, ISetDefaultRayVisibility, IUsesHandedRayOrigin, ICustomActionMap, ILinkedObject, IUsesProxyType, IUsesViewerScale - { const float k_FastRotationSpeed = 300f; const float k_RotationThreshold = 0.9f; @@ -105,7 +104,7 @@ private void OnDisable() private void OnDestroy() { - this.ShowDefaultRay(rayOrigin); + this.SetDefaultRayVisibility(rayOrigin, true); } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -287,7 +286,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - this.HideDefaultRay(rayOrigin); + this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); m_BlinkVisuals.ShowVisuals(); @@ -297,7 +296,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon else if (m_State == State.Aiming && blinkInput.blink.wasJustReleased) { this.UnlockRay(rayOrigin, this); - this.ShowDefaultRay(rayOrigin); + this.SetDefaultRayVisibility(rayOrigin, true); if (!m_BlinkVisuals.outOfMaxRange) { diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index 11fd31431..d62a40e8a 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -7,7 +7,7 @@ using UnityEngine.InputNew; [ExecuteInEditMode] -public class MoveWorkspacesTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, ICustomRay, IUsesViewerBody, +public class MoveWorkspacesTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, ISetDefaultRayVisibility, IUsesViewerBody, IResetWorkspaces, IAllWorkspaces, IUsesViewerScale { enum State @@ -158,7 +158,7 @@ void StartMove() m_State = State.MoveWorkspaces; - this.HideDefaultRay(rayOrigin); + this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); foreach (var ws in allWorkspaces) @@ -194,7 +194,7 @@ void EndMove() m_State = State.WaitingForInput; this.UnlockRay(rayOrigin, this); - this.ShowDefaultRay(rayOrigin); + this.SetDefaultRayVisibility(rayOrigin, true); foreach (var ws in allWorkspaces) { diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 144a9961f..2c4ad4fda 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, - IGrabObjects, ICustomRay, IProcessInput, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, + IGrabObjects, ISetDefaultRayVisibility, IProcessInput, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, ILinkedObject { const float k_LazyFollowTranslate = 8f; @@ -325,7 +325,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_GrabData[grabbingNode] = new GrabData(directRayOrigin, directSelectInput, grabbedObjects.ToArray()); - this.HideDefaultRay(directRayOrigin, true); // This will also unhighlight the object + this.SetDefaultRayVisibility(directRayOrigin, false, true); // This will also unhighlight the object this.LockRay(directRayOrigin, this); // Wait a frame since OnSelectionChanged is called at the end of the frame, and will set m_DirectSelected to false @@ -532,7 +532,7 @@ public void DropHeldObjects(Node node) m_GrabData.Remove(node); this.UnlockRay(grabData.rayOrigin, this); - this.ShowDefaultRay(grabData.rayOrigin, true); + this.SetDefaultRayVisibility(grabData.rayOrigin, true, true); this.ClearSnappingState(rayOrigin); } From 3e09e1966605643fd5045382cd813d4d841eaba3 Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Tue, 6 Jun 2017 15:44:37 -0700 Subject: [PATCH 331/870] Remove thresholds for movement/rotation speed; Reduce transition time for moving camera rig --- Scripts/Core/EditorVR.Viewer.cs | 2 +- .../BlinkLocomotionTool.cs | 25 ++++--------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/Scripts/Core/EditorVR.Viewer.cs b/Scripts/Core/EditorVR.Viewer.cs index 76cdb39e7..0a68bc1f8 100644 --- a/Scripts/Core/EditorVR.Viewer.cs +++ b/Scripts/Core/EditorVR.Viewer.cs @@ -34,7 +34,7 @@ class Preferences public float cameraRigScale { get { return m_CameraRigScale; } set { m_CameraRigScale = value; } } } - const float k_CameraRigTransitionTime = 0.75f; + const float k_CameraRigTransitionTime = 0.25f; PlayerBody m_PlayerBody; float m_OriginalNearClipPlane; diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs index b1d47a70d..46ed32977 100644 --- a/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs +++ b/Tools/BlinkLocomotionTool/BlinkLocomotionTool.cs @@ -13,16 +13,9 @@ namespace UnityEditor.Experimental.EditorVR.Tools sealed class BlinkLocomotionTool : MonoBehaviour, ITool, ILocomotor, ISetDefaultRayVisibility, IUsesHandedRayOrigin, ICustomActionMap, ILinkedObject, IUsesProxyType, IUsesViewerScale { - const float k_FastRotationSpeed = 300f; - const float k_RotationThreshold = 0.9f; - const float k_SlowRotationSpeed = 15f; - const float k_FastMoveSpeed = 10f; - const float k_MoveThreshold = 0.9f; - const float k_SlowMoveSpeed = 3f; - - const float k_MoveThresholdVive = 0.8f; - const float k_RotationThresholdVive = 0.8f; - + const float k_RotationSpeed = 150f; + const float k_MoveSpeed = 9f; + //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; const float k_MaxScale = 1000f; @@ -253,11 +246,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else { - var speed = yawValue * k_SlowRotationSpeed; - var threshold = m_IsVive ? k_RotationThresholdVive : k_RotationThreshold; - if (Mathf.Abs(yawValue) > threshold) - speed = k_FastRotationSpeed * Mathf.Sign(yawValue); - + var speed = Mathf.Sign(yawValue) * Mathf.Pow(yawValue, 2f) * k_RotationSpeed; cameraRig.RotateAround(viewerCamera.transform.position, Vector3.up, speed * Time.deltaTime); } @@ -313,11 +302,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon void Translate(float inputValue, bool isVive, Vector3 direction) { - var speed = inputValue * k_SlowMoveSpeed; - var threshold = isVive ? k_MoveThresholdVive : k_MoveThreshold; - if (Mathf.Abs(inputValue) > threshold) - speed = k_FastMoveSpeed * Mathf.Sign(inputValue); - + var speed = Mathf.Sign(inputValue) * Mathf.Pow(inputValue, 2f) * k_MoveSpeed; speed *= this.GetViewerScale(); cameraRig.Translate(direction * speed * Time.deltaTime, Space.World); From 5fc5a1cb468a3423fee0bbc36ce04bab09d1047b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 6 Jun 2017 16:23:27 -0700 Subject: [PATCH 332/870] Fix ConstrainedAxis flags; Implement single-axis constrained snapping --- Manipulators/DirectManipulator.cs | 2 +- Manipulators/StandardManipulator.cs | 2 +- Manipulators/StandardManipulator.prefab | 12 ++-- Scripts/Interfaces/IManipulator.cs | 7 +-- .../Modules/SnappingModule/SnappingModule.cs | 60 ++++++++++++++++--- libs/UnityOctree | 2 +- 6 files changed, 64 insertions(+), 21 deletions(-) diff --git a/Manipulators/DirectManipulator.cs b/Manipulators/DirectManipulator.cs index 5ed4f837e..aeb3a1e6d 100644 --- a/Manipulators/DirectManipulator.cs +++ b/Manipulators/DirectManipulator.cs @@ -74,7 +74,7 @@ void OnHandleDragging(BaseHandle handle, HandleEventData eventData) var target = m_Target == null ? transform : m_Target; var rayOrigin = eventData.rayOrigin; - translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, ConstrainedAxis.None); + translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, 0); rotate(Quaternion.Inverse(target.rotation) * rayOrigin.rotation * m_RotationOffset); } diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index d7fb2557d..0d823887b 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -67,7 +67,7 @@ void Update() void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) { - var constraints = ConstrainedAxis.None; + ConstrainedAxis constraints = 0; var linear = handle as LinearHandle; if (linear) constraints = linear.constraints; diff --git a/Manipulators/StandardManipulator.prefab b/Manipulators/StandardManipulator.prefab index e9d5044ed..62593f60d 100644 --- a/Manipulators/StandardManipulator.prefab +++ b/Manipulators/StandardManipulator.prefab @@ -1306,7 +1306,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} - m_Constraints: 10 + m_Constraints: 5 --- !u!114 &114000011169532704 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1320,7 +1320,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} - m_Constraints: 12 + m_Constraints: 14 --- !u!114 &114000011250465190 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1335,7 +1335,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000014115655252} m_OrientDragPlaneToRay: 1 - m_Constraints: 2 + m_Constraints: 1 --- !u!114 &114000011261594914 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1350,7 +1350,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000013116023314} m_OrientDragPlaneToRay: 1 - m_Constraints: 8 + m_Constraints: 4 --- !u!114 &114000011660595710 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1365,7 +1365,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000012695962256} m_OrientDragPlaneToRay: 1 - m_Constraints: 4 + m_Constraints: 2 --- !u!114 &114000012004783302 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1407,7 +1407,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} - m_Constraints: 6 + m_Constraints: 3 --- !u!114 &114000012657926048 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Scripts/Interfaces/IManipulator.cs b/Scripts/Interfaces/IManipulator.cs index e46554767..bda561069 100644 --- a/Scripts/Interfaces/IManipulator.cs +++ b/Scripts/Interfaces/IManipulator.cs @@ -7,10 +7,9 @@ namespace UnityEditor.Experimental.EditorVR [Flags] public enum ConstrainedAxis { - None = 0, - X = 1, - Y = 2, - Z = 4 + X = 1 << 0, + Y = 1 << 1, + Z = 1 << 2 } /// diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 138520a4e..803f78a2b 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -434,6 +434,9 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec if (transforms.Length == 0) return false; + if (delta == Vector3.zero) + return false; + if (snappingEnabled && manipulatorSnappingEnabled) { var state = GetSnappingState(rayOrigin, transforms, position, rotation); @@ -449,7 +452,7 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec switch (constraints) { - case ConstrainedAxis.None: + case 0: if (surfaceSnappingEnabled && ManipulatorSnapToSurface(rayOrigin, ref position, ref rotation, targetPosition, state, targetRotation, breakScale * k_ManipulatorSurfaceSnapBreakDist)) return true; @@ -491,16 +494,52 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec { var bounds = state.identityBounds; var boundsExtents = bounds.extents; - var projectedExtents = Vector3.Project(boundsExtents, Vector3.down); + var direction = delta.normalized; + var projectedExtents = Vector3.Project(boundsExtents, direction); var offset = projectedExtents - bounds.center; var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); var startRotation = state.startRotation; var upVector = startRotation * Vector3.back; - var maxRayLength = k_SurfaceSnappingMaxRayLength * this.GetViewerScale(); + var maxRayLength = Vector3.Project(boundsExtents, direction).magnitude; + var breakDistance = breakScale * k_ManipulatorSurfaceSnapBreakDist; + + switch (constraints) + { + case ConstrainedAxis.X: + if (Vector3.Dot(targetRotation * Vector3.left, direction) > 0) + offset *= -1; + break; + case ConstrainedAxis.Y: + if (Vector3.Dot(targetRotation * Vector3.up, direction) > 0) + offset *= -1; + break; + case ConstrainedAxis.Z: + if (Vector3.Dot(targetRotation * Vector3.forward, direction) > 0) + offset *= -1; + break; + } + + //Debug.Log(constraints + ", " + Vector3.Dot(targetRotation * Vector3.forward, direction)); + + var axisRay = new Ray(targetPosition, direction); - var axisRay = new Ray(position, delta.normalized); - return SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakScale, maxRayLength) - || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakScale); + debug = Color.red; + GizmoModule.instance.DrawSphere(axisRay.origin, 0.01f, Color.red); + GizmoModule.instance.DrawRay(axisRay.origin, axisRay.direction, Color.red, breakDistance); + + if (SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, maxRayLength) + || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) + return true; + + axisRay = new Ray(targetPosition, -direction); + + debug = Color.blue; + GizmoModule.instance.DrawSphere(axisRay.origin, 0.01f, Color.blue); + GizmoModule.instance.DrawRay(axisRay.origin, axisRay.direction, Color.blue, breakDistance); + + if (SnapToSurface(axisRay, ref position, ref rotation, state, -offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, maxRayLength) + || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) + return true; } break; } @@ -511,6 +550,8 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec return false; } + static Color debug = Color.black; + public bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation) { if (snappingEnabled && directSnappingEnabled) @@ -574,6 +615,8 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 else offset += projectedExtents; + offset = rotation * offset; + if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, raycastDistance)) return true; } @@ -631,12 +674,13 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp GameObject go; if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { - GizmoModule.instance.DrawSphere(go.transform.position, 0.01f, Color.red); + GizmoModule.instance.DrawSphere(hit.point, 0.01f * this.GetViewerScale(), debug); var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; var hitPoint = hit.point; m_CurrentSurfaceSnappingHit = hitPoint; - var snappedPosition = pivotSnappingEnabled ? hitPoint : hitPoint + rotation * boundsOffset; + var snappedPosition = pivotSnappingEnabled ? hitPoint : hitPoint + boundsOffset; + //Debug.Log(snappedPosition + " , " + boundsOffset); if (localOnly && Vector3.Distance(snappedPosition, targetPosition) > breakDistance) return false; diff --git a/libs/UnityOctree b/libs/UnityOctree index e31ee9457..f6d18bfda 160000 --- a/libs/UnityOctree +++ b/libs/UnityOctree @@ -1 +1 @@ -Subproject commit e31ee9457796a4c0796d753c7ebeb66f232639e4 +Subproject commit f6d18bfda9e24e354d6924b2875ebfb7b19eabdc From b4b4ff61f43f76f9fc156721dccd861e045b348f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 16:42:01 -0700 Subject: [PATCH 333/870] Add haptics to PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 224601695..3dd892c7c 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -4,10 +4,11 @@ using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using UnityEngine.EventSystems; namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolButton : MonoBehaviour, ISelectTool + sealed class PinnedToolButton : MonoBehaviour, ISelectTool, IPointerEnterHandler, IPerformHaptics { public Type toolType { @@ -44,6 +45,12 @@ void Start() void OnClick() { SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); + this.Pulse(rayOrigin, 0.5f, 0.085f, true, true); + } + + public void OnPointerEnter(PointerEventData eventData) + { + this.Pulse(rayOrigin, 0.005f, 0.125f); } // Create periodic table-style names for types From 4b3eb423f8fa859f922a7e99d0f93f725eb9fcf3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 16:42:29 -0700 Subject: [PATCH 334/870] Add haptics to MainMenuActivator --- Scripts/UI/MainMenuActivator.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index bc1965dd4..05e973412 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IUsesRayOrigin + sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IUsesRayOrigin, IPerformHaptics { readonly Vector3 m_OriginalActivatorLocalPosition = new Vector3(0f, 0f, -0.075f); static readonly float kAlternateLocationOffset = 0.06f; @@ -108,11 +108,15 @@ public void OnPointerClick(PointerEventData eventData) { var rayEventData = eventData as RayEventData; if (selected != null) + { + this.Pulse(rayOrigin, 0.5f, 0.06f, true, true); selected(rayOrigin, rayEventData != null ? rayEventData.rayOrigin : null); + } } IEnumerator Highlight(bool transitionIn = true) { + this.Pulse(rayOrigin, 0.005f, 0.125f); var amount = 0f; var currentScale = m_Icon.localScale; var currentPosition = m_Icon.localPosition; From e6325223214ea47ae006e61c2a33580f33fa14ec Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 16:43:03 -0700 Subject: [PATCH 335/870] Refine haptics in WorkspaceButton --- Workspaces/Common/Scripts/WorkspaceButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 362ea1f57..47cff0f91 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -321,7 +321,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.Pulse(m_RayOrigin, 0.005f, 0.082f); + this.Pulse(m_RayOrigin, 0.005f, 0.125f); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); @@ -473,7 +473,7 @@ void SwapIconSprite() void OnButtonClicked() { - this.Pulse(m_RayOrigin, 0.25f, 0.065f, false, true); + this.Pulse(m_RayOrigin, 0.25f, 0.085f, true, true); } } } From ce9b674e98fc7a4d61cf1af2b47861b8a64b9780 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 16:43:25 -0700 Subject: [PATCH 336/870] Refine haptics in WorkspaceUI --- Workspaces/Base/WorkspaceUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 47c5d5765..c1791d746 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -250,7 +250,7 @@ public void OnDragging() else { MathUtilsExt.SetTransformOffset(rayOrigin, m_WorkspaceUI.transform.parent, m_PositionOffset, m_RotationOffset); - m_WorkspaceUI.Pulse(rayOrigin, 0.25f, 0.055f, false, true); + m_WorkspaceUI.Pulse(rayOrigin, 0.25f, 0.075f, false, true); } } } From 3380f840973722165ef6d62e0ba41ddee101938a Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 6 Jun 2017 17:02:17 -0700 Subject: [PATCH 337/870] Fix offset logic --- .../Modules/SnappingModule/SnappingModule.cs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 803f78a2b..b399acd94 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -500,43 +500,35 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); var startRotation = state.startRotation; var upVector = startRotation * Vector3.back; - var maxRayLength = Vector3.Project(boundsExtents, direction).magnitude; + var maxRayLength = projectedExtents.magnitude; var breakDistance = breakScale * k_ManipulatorSurfaceSnapBreakDist; switch (constraints) { case ConstrainedAxis.X: - if (Vector3.Dot(targetRotation * Vector3.left, direction) > 0) + if (Vector3.Dot(Vector3.left, direction) > 0) offset *= -1; break; case ConstrainedAxis.Y: - if (Vector3.Dot(targetRotation * Vector3.up, direction) > 0) + if (Vector3.Dot(Vector3.up, direction) > 0) offset *= -1; break; case ConstrainedAxis.Z: - if (Vector3.Dot(targetRotation * Vector3.forward, direction) > 0) + if (Vector3.Dot(Vector3.forward, direction) > 0) offset *= -1; break; } - //Debug.Log(constraints + ", " + Vector3.Dot(targetRotation * Vector3.forward, direction)); + Debug.Log(constraints + ", " + offset + ", " + targetPosition + ", " + direction); var axisRay = new Ray(targetPosition, direction); - debug = Color.red; - GizmoModule.instance.DrawSphere(axisRay.origin, 0.01f, Color.red); - GizmoModule.instance.DrawRay(axisRay.origin, axisRay.direction, Color.red, breakDistance); - if (SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, maxRayLength) || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) return true; axisRay = new Ray(targetPosition, -direction); - debug = Color.blue; - GizmoModule.instance.DrawSphere(axisRay.origin, 0.01f, Color.blue); - GizmoModule.instance.DrawRay(axisRay.origin, axisRay.direction, Color.blue, breakDistance); - if (SnapToSurface(axisRay, ref position, ref rotation, state, -offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, maxRayLength) || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) return true; @@ -680,7 +672,6 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp var hitPoint = hit.point; m_CurrentSurfaceSnappingHit = hitPoint; var snappedPosition = pivotSnappingEnabled ? hitPoint : hitPoint + boundsOffset; - //Debug.Log(snappedPosition + " , " + boundsOffset); if (localOnly && Vector3.Distance(snappedPosition, targetPosition) > breakDistance) return false; From db3a933be62f321e5351763f3dcb486fead8fe52 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 17:40:26 -0700 Subject: [PATCH 338/870] Refine haptics in MainMenuActivator --- Scripts/UI/MainMenuActivator.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index 05e973412..05bbd4da7 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -85,6 +85,7 @@ public void OnPointerEnter(PointerEventData eventData) m_HighlightCoroutine = null; m_HighlightCoroutine = StartCoroutine(Highlight()); + this.Pulse(rayOrigin, 0.005f, 0.2f); } public void OnPointerExit(PointerEventData eventData) @@ -108,15 +109,11 @@ public void OnPointerClick(PointerEventData eventData) { var rayEventData = eventData as RayEventData; if (selected != null) - { - this.Pulse(rayOrigin, 0.5f, 0.06f, true, true); selected(rayOrigin, rayEventData != null ? rayEventData.rayOrigin : null); - } } IEnumerator Highlight(bool transitionIn = true) { - this.Pulse(rayOrigin, 0.005f, 0.125f); var amount = 0f; var currentScale = m_Icon.localScale; var currentPosition = m_Icon.localPosition; From 68d7664e0a2c020e20864d254c95ed0b9a6892ac Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 17:40:47 -0700 Subject: [PATCH 339/870] Refine haptics in WorkspaceButton --- Workspaces/Common/Scripts/WorkspaceButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 47cff0f91..e7b3c9ef1 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -321,7 +321,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.Pulse(m_RayOrigin, 0.005f, 0.125f); + this.Pulse(m_RayOrigin, 0.005f, 0.175f); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); @@ -473,7 +473,7 @@ void SwapIconSprite() void OnButtonClicked() { - this.Pulse(m_RayOrigin, 0.25f, 0.085f, true, true); + this.Pulse(m_RayOrigin, 0.25f, 0.15f, true, true); } } } From cc0a47cc67804f44bd2bc7de7579c203a7eb46e1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 17:41:11 -0700 Subject: [PATCH 340/870] Refine haptics in PinnedToolButton --- Scripts/UI/PinnedToolButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 3dd892c7c..ed95fe865 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -45,12 +45,12 @@ void Start() void OnClick() { SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); - this.Pulse(rayOrigin, 0.5f, 0.085f, true, true); + this.Pulse(rayOrigin, 0.5f, 0.2f, true, true); } public void OnPointerEnter(PointerEventData eventData) { - this.Pulse(rayOrigin, 0.005f, 0.125f); + this.Pulse(rayOrigin, 0.005f, 0.2f); } // Create periodic table-style names for types From 86f303367d84a0bcd9acf5233ea9b350e37fb0b9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 17:44:11 -0700 Subject: [PATCH 341/870] Add haptics to MainMenu --- Menus/MainMenu/MainMenu.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index e3b645b8a..7df430875 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType + sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IUsesRayOrigin, IPerformHaptics { public ActionMap actionMap { get {return m_MainMenuActionMap; } } [SerializeField] @@ -71,6 +71,7 @@ public bool visible public List menuActions { get; set; } public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } + public Transform rayOrigin { get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } @@ -103,7 +104,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon || mainMenuInput.flickFace.wasJustReleased) { m_MainMenuUI.targetFaceIndex += (int)Mathf.Sign(rotationInput); - + this.Pulse(rayOrigin, 0.5f, 0.055f, true, true); consumeControl(mainMenuInput.flickFace); } From b5becb50386f635cf5683b71fee4cfc77bae2f34 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 6 Jun 2017 17:44:51 -0700 Subject: [PATCH 342/870] Add haptics to MainMenuUI --- Menus/MainMenu/Scripts/MainMenuUI.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 8fd6b5d33..4aa8f6311 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuUI : MonoBehaviour, IInstantiateUI + sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IUsesRayOrigin, IPerformHaptics { public class ButtonData { @@ -128,6 +128,8 @@ public Transform alternateMenuOrigin public int faceCount { get { return m_MenuFaces.Length; } } + public Transform rayOrigin { get; set; } + public bool visible { get { return m_VisibilityState == VisibilityState.Visible || m_VisibilityState == VisibilityState.TransitioningIn; } @@ -399,6 +401,8 @@ IEnumerator AnimateShow() m_VisibilityState = VisibilityState.TransitioningIn; + this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); + foreach (var face in m_MenuFaces) { face.Show(); @@ -440,6 +444,8 @@ IEnumerator AnimateHide() m_VisibilityState = VisibilityState.TransitioningOut; + this.Pulse(rayOrigin, 0.75f, 0.075f, false, true); + foreach (var face in m_MenuFaces) { face.Hide(); From be954a97705a46adaf432c794767944776af48ea Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 7 Jun 2017 10:30:22 -0700 Subject: [PATCH 343/870] Add haptics to MainMenuButton --- Menus/MainMenu/Scripts/MainMenuButton.cs | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 5dca0e252..b8e72ba48 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -1,10 +1,12 @@ #if UNITY_EDITOR +using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; +using UnityEngine.EventSystems; using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuButton : MonoBehaviour, ITooltip + sealed class MainMenuButton : MonoBehaviour, ITooltip, IPerformHaptics, IRayEnterHandler, IPointerClickHandler { public Button button { get { return m_Button; } } [SerializeField] @@ -16,9 +18,15 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip private Text m_ButtonTitle; Color m_OriginalColor; + Transform m_RayOrigin; public string tooltipText { get; set; } + public void OnPointerClick(PointerEventData eventData) + { + this.Pulse(m_RayOrigin, 0.5f, 0.095f, true, true); + } + public bool selected { set @@ -41,11 +49,27 @@ private void Awake() m_OriginalColor = m_Button.targetGraphic.color; } + void OnDisable() + { + m_RayOrigin = null; + } + public void SetData(string name, string description) { m_ButtonTitle.text = name; m_ButtonDescription.text = description; } + + public void OnRayEnter(RayEventData eventData) + { + m_RayOrigin = eventData.rayOrigin; + this.Pulse(eventData.rayOrigin, 0.005f, 0.175f); + } + + public void OnRayExit(RayEventData eventData) + { + m_RayOrigin = null; + } } } #endif From 64d44fb948529fa1256baa56717e8b6094298524 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 7 Jun 2017 13:37:40 -0700 Subject: [PATCH 344/870] Add haptics to RadialMenu --- Menus/RadialMenu/RadialMenu.cs | 5 ++++- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 6 +++++- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index a3b27090d..ced60cd6e 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap + sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap, IPerformHaptics { public ActionMap actionMap { get {return m_RadialMenuActionMap; } } [SerializeField] @@ -76,6 +76,7 @@ void Start() m_RadialMenuUI.actions = menuActions; m_RadialMenuUI.Setup(); m_RadialMenuUI.visible = m_Visible; + m_RadialMenuUI.rayOrigin = rayOrigin; } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -102,6 +103,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (radialMenuInput.selectItem.wasJustReleased) { + this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); + m_RadialMenuUI.SelectionOccurred(); if (itemWasSelected != null) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index bfebcbf19..5447d2b14 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler + sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler, IPerformHaptics { static Color s_FrameOpaqueColor; static readonly Vector3 k_HiddenLocalScale = new Vector3(1f, 0f, 1f); @@ -88,6 +88,8 @@ public bool highlighted // Only start the highlight coroutine if the highlight coroutine isnt already playing. Otherwise allow it to gracefully finish. if (m_HighlightCoroutine == null) m_HighlightCoroutine = StartCoroutine(Highlight()); + + this.Pulse(rayOrigin, 0.005f, 0.2f); } else { @@ -204,6 +206,8 @@ public Material borderRendererMaterial // For overriding text (i.e. TransformActions) public ITooltip tooltip { private get; set; } + public Transform rayOrigin { get; set; } + void Awake() { m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index 245725af3..fd013610c 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces + sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IPerformHaptics { const int k_SlotCount = 16; @@ -26,6 +26,8 @@ sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces RadialMenuSlot m_HighlightedButton; float m_PhaseOffset; // Correcting the coordinates, based on actions count, so that the menu is centered at the bottom + public Transform rayOrigin { private get; set; } + public Transform alternateMenuOrigin { get { return m_AlternateMenuOrigin; } @@ -333,6 +335,8 @@ public void SelectionOccurred() { if (m_HighlightedButton != null) m_HighlightedButton.button.onClick.Invoke(); + + this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); } } } From 7713d5628c7cec45a5748a48163934c0f17018f6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 7 Jun 2017 13:41:10 -0700 Subject: [PATCH 345/870] Add haptics to object selection --- Scripts/Modules/SelectionModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/Modules/SelectionModule.cs b/Scripts/Modules/SelectionModule.cs index 8920953dc..a3282b56a 100644 --- a/Scripts/Modules/SelectionModule.cs +++ b/Scripts/Modules/SelectionModule.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelectionChanged + sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelectionChanged, IPerformHaptics { GameObject m_CurrentGroupRoot; readonly List m_SelectedObjects = new List(); // Keep the list to avoid allocations--we do not use it to maintain state @@ -64,6 +64,9 @@ public void SelectObject(GameObject hoveredObject, Transform rayOrigin, bool mul m_SelectedObjects.Clear(); + if (hoveredObject) + this.Pulse(rayOrigin, 0.45f, 0.075f, false, true); + // Multi-Select if (multiSelect) { From 1dc489be1f3ce005e2cbeb0868a5529b4044783c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 7 Jun 2017 17:08:53 -0700 Subject: [PATCH 346/870] Implement planar handle snapping by splitting into two calls to translate --- Manipulators/StandardManipulator.cs | 36 +++++++++++++++++-- Manipulators/StandardManipulator.prefab | 2 +- Scripts/Core/EditorVR.cs | 2 -- .../Modules/SnappingModule/SnappingModule.cs | 13 +++---- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index 0d823887b..d49a3586a 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -74,9 +74,41 @@ void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) var plane = handle as PlaneHandle; if (plane) + { constraints = plane.constraints; - - translate(eventData.deltaPosition, eventData.rayOrigin, constraints); + var delta = eventData.deltaPosition; + switch (constraints) + { + case ConstrainedAxis.X | ConstrainedAxis.Y: + { + var xComponent = Vector3.Project(delta, transform.right); + translate(xComponent, eventData.rayOrigin, ConstrainedAxis.X); + var yComponent = Vector3.Project(delta, transform.up); + translate(yComponent, eventData.rayOrigin, ConstrainedAxis.Y); + } + break; + case ConstrainedAxis.Y | ConstrainedAxis.Z: + { + var yComponent = Vector3.Project(delta, transform.up); + translate(yComponent, eventData.rayOrigin, ConstrainedAxis.Y); + var zComponent = Vector3.Project(delta, transform.forward); + translate(zComponent, eventData.rayOrigin, ConstrainedAxis.Z); + } + break; + case ConstrainedAxis.X | ConstrainedAxis.Z: + { + var xComponent = Vector3.Project(delta, transform.right); + translate(xComponent, eventData.rayOrigin, ConstrainedAxis.X); + var zComponent = Vector3.Project(delta, transform.forward); + translate(zComponent, eventData.rayOrigin, ConstrainedAxis.Z); + } + break; + } + } + else + { + translate(eventData.deltaPosition, eventData.rayOrigin, constraints); + } } void OnRotateDragging(BaseHandle handle, HandleEventData eventData) diff --git a/Manipulators/StandardManipulator.prefab b/Manipulators/StandardManipulator.prefab index 62593f60d..09fb04117 100644 --- a/Manipulators/StandardManipulator.prefab +++ b/Manipulators/StandardManipulator.prefab @@ -1320,7 +1320,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} - m_Constraints: 14 + m_Constraints: 6 --- !u!114 &114000011250465190 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 0e1e777d7..1e6675bca 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -176,8 +176,6 @@ void Awake() UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedLightGradient(); - AddModule(); - var sceneObjectModule = AddModule(); sceneObjectModule.tryPlaceObject = (obj, targetScale) => { diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index b399acd94..aa7b2438b 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -500,13 +500,13 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); var startRotation = state.startRotation; var upVector = startRotation * Vector3.back; - var maxRayLength = projectedExtents.magnitude; + var maxRayLength = projectedExtents.magnitude * 2; var breakDistance = breakScale * k_ManipulatorSurfaceSnapBreakDist; switch (constraints) { case ConstrainedAxis.X: - if (Vector3.Dot(Vector3.left, direction) > 0) + if (Vector3.Dot(Vector3.right, direction) > 0) offset *= -1; break; case ConstrainedAxis.Y: @@ -519,12 +519,11 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec break; } - Debug.Log(constraints + ", " + offset + ", " + targetPosition + ", " + direction); - var axisRay = new Ray(targetPosition, direction); if (SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, maxRayLength) - || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) + || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance) + ) return true; axisRay = new Ray(targetPosition, -direction); @@ -542,8 +541,6 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec return false; } - static Color debug = Color.black; - public bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation) { if (snappingEnabled && directSnappingEnabled) @@ -666,7 +663,6 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp GameObject go; if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { - GizmoModule.instance.DrawSphere(hit.point, 0.01f * this.GetViewerScale(), debug); var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; var hitPoint = hit.point; @@ -684,6 +680,7 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp m_CurrentSurfaceSnappingPosition = position; m_CurrentSurfaceSnappingRotation = snappedRotation; + return true; } From 47dc91cd6eacaba40416785b04e48754b579d384 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 7 Jun 2017 17:12:52 -0700 Subject: [PATCH 347/870] Removed unused PivotMode argument from ManipulatorSnap --- Scripts/Interfaces/IUsesSnapping.cs | 7 +++---- Scripts/Modules/SnappingModule/SnappingModule.cs | 2 +- Tools/TransformTool/TransformTool.cs | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Scripts/Interfaces/IUsesSnapping.cs b/Scripts/Interfaces/IUsesSnapping.cs index 4a8ce5885..41fd2dbbf 100644 --- a/Scripts/Interfaces/IUsesSnapping.cs +++ b/Scripts/Interfaces/IUsesSnapping.cs @@ -13,7 +13,7 @@ public interface IUsesSnapping public static class IUsesSnappingMethods { - internal delegate bool ManipulatorSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode); + internal delegate bool ManipulatorSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints); internal delegate bool DirectSnapDelegate(Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation); internal static ManipulatorSnapDelegate manipulatorSnap { get; set; } @@ -29,11 +29,10 @@ public static class IUsesSnappingMethods /// The rotation to be modified if rotation snapping is enabled /// The position delta to apply /// The axis constraints - /// The manipulator's pivot mode /// Whether the position was set to a snapped position - public static bool ManipulatorSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode) + public static bool ManipulatorSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints) { - return manipulatorSnap(rayOrigin, transforms, ref position, ref rotation, delta, constraints, pivotMode); + return manipulatorSnap(rayOrigin, transforms, ref position, ref rotation, delta, constraints); } /// diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index aa7b2438b..5c6c37d77 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -429,7 +429,7 @@ void Update() } } - public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode) + public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints) { if (transforms.Length == 0) return false; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 1ab4ae1ab..84db3344f 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -539,7 +539,7 @@ public void DropHeldObjects(Node node) void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints) { - this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); + this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints); } void Rotate(Quaternion delta) From 7a8dbeb1ff33f0e1923dde7df790ee2ce5da8eaa Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 7 Jun 2017 17:14:57 -0700 Subject: [PATCH 348/870] Add invalid ray origin warning to StopPulses function in HapticsModule --- Scripts/Modules/HapticsModule.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule.cs index 244fcb5bf..17fadd0bc 100644 --- a/Scripts/Modules/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule.cs @@ -133,7 +133,7 @@ public void Pulse(Transform rayOrigin, float duration, float intensity = 1f, boo public void StopPulses(Transform rayOrigin = null) { #if ENABLE_OVR_INPUT - // Stop haptic feedback on only one device, if specific via the function parameter + // Stop haptic feedback on only one device, if specified via the function parameter // Otherwise stop all haptic feedback on all devices if (rayOrigin == null) { @@ -145,6 +145,8 @@ public void StopPulses(Transform rayOrigin = null) var channel = GetTargetChannel(rayOrigin); if (channel != null) channel.Clear(); + else + Debug.LogWarning("Only null, or valid ray origins can stop pulse playback."); } #endif } From 5f2f73d5304558052c888f02f76e79374c70f3a4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 7 Jun 2017 19:03:29 -0700 Subject: [PATCH 349/870] Add initial haptics to PinnedToolsMenu & PinnedToolButtons --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 5 ++++- Scripts/UI/PinnedToolButton.cs | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 5a13f98a3..f66f349da 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IPerformHaptics { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -59,6 +59,7 @@ public bool allButtonsVisible } else { + this.Pulse(rayOrigin, 0.5f, 0.065f, false, true); ShowOnlyMenuAndActiveToolButtons(); } } @@ -265,6 +266,8 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); if (!existingButton) this.SelectTool(rayOrigin, pinnedToolButton.toolType); + + this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); } /// diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index 46410caf8..3721a101a 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor + public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IPerformHaptics { static Color s_FrameOpaqueColor; static Color s_SemiTransparentFrameColor; @@ -377,8 +377,8 @@ public bool highlighted if (!m_Highlighted) this.HideTooltip(this); - //else - // perform haptics here for spatial scrolling + else + this.Pulse(rayOrigin, 0.005f, 0.2f); // Used for spatial selection highlighting only if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) { @@ -649,6 +649,8 @@ void OnBackgroundHoverEnter () s_Hovered = true; + this.Pulse(rayOrigin, 0.005f, 0.175f); + if (isMainMenu) { m_GradientButton.highlighted = true; @@ -810,6 +812,7 @@ void OnSecondaryButtonClicked() { this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); closeButton(); + this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); //deleteHighlightedButton(rayOrigin); //deletePinnedToolButton(rayOrigin, this); ActionButtonHoverExit(false); From a97835d9fffcca98e621bff6338cdb6c84f6ce51 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 8 Jun 2017 11:34:52 -0700 Subject: [PATCH 350/870] Rename IPerformHaptics to IControlHaptics --- Menus/MainMenu/MainMenu.cs | 2 +- Menus/MainMenu/Scripts/MainMenuButton.cs | 2 +- Menus/MainMenu/Scripts/MainMenuUI.cs | 2 +- Menus/RadialMenu/RadialMenu.cs | 2 +- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 2 +- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 2 +- .../Core/InterfaceConnectors/HapticsModuleConnector.cs | 4 ++-- .../Interfaces/{IPerformHaptics.cs => IControlHaptics.cs} | 8 ++++---- .../{IPerformHaptics.cs.meta => IControlHaptics.cs.meta} | 0 Scripts/ListView/ListViewControllerBase.cs | 2 +- Scripts/Modules/SelectionModule.cs | 2 +- Scripts/UI/MainMenuActivator.cs | 2 +- Scripts/UI/PinnedToolButton.cs | 2 +- Workspaces/Base/WorkspaceUI.cs | 2 +- Workspaces/Common/Scripts/WorkspaceButton.cs | 2 +- 15 files changed, 18 insertions(+), 18 deletions(-) rename Scripts/Interfaces/{IPerformHaptics.cs => IControlHaptics.cs} (87%) rename Scripts/Interfaces/{IPerformHaptics.cs.meta => IControlHaptics.cs.meta} (100%) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 7df430875..a86c953d5 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IUsesRayOrigin, IPerformHaptics + sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IUsesRayOrigin, IControlHaptics { public ActionMap actionMap { get {return m_MainMenuActionMap; } } [SerializeField] diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index b8e72ba48..194c501e7 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuButton : MonoBehaviour, ITooltip, IPerformHaptics, IRayEnterHandler, IPointerClickHandler + sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnterHandler, IPointerClickHandler { public Button button { get { return m_Button; } } [SerializeField] diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 4aa8f6311..400f74501 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IUsesRayOrigin, IPerformHaptics + sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IUsesRayOrigin, IControlHaptics { public class ButtonData { diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index ced60cd6e..6934d0ae3 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap, IPerformHaptics + sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap, IControlHaptics { public ActionMap actionMap { get {return m_RadialMenuActionMap; } } [SerializeField] diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 5447d2b14..c78541b6b 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler, IPerformHaptics + sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler, IControlHaptics { static Color s_FrameOpaqueColor; static readonly Vector3 k_HiddenLocalScale = new Vector3(1f, 0f, 1f); diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index fd013610c..495631d5b 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IPerformHaptics + sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IControlHaptics { const int k_SlotCount = 16; diff --git a/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs index ef55be790..b55dc3e66 100644 --- a/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs +++ b/Scripts/Core/InterfaceConnectors/HapticsModuleConnector.cs @@ -9,8 +9,8 @@ class HapticsModuleConnector : Nested, ILateBindInterfaceMethods { public void LateBindInterfaceMethods(HapticsModule provider) { - IPerformHapticsMethods.pulse = provider.Pulse; - IPerformHapticsMethods.stopPulses = provider.StopPulses; + IControlHapticsMethods.pulse = provider.Pulse; + IControlHapticsMethods.stopPulses = provider.StopPulses; } } } diff --git a/Scripts/Interfaces/IPerformHaptics.cs b/Scripts/Interfaces/IControlHaptics.cs similarity index 87% rename from Scripts/Interfaces/IPerformHaptics.cs rename to Scripts/Interfaces/IControlHaptics.cs index d0ee8058e..377797abb 100644 --- a/Scripts/Interfaces/IPerformHaptics.cs +++ b/Scripts/Interfaces/IControlHaptics.cs @@ -6,11 +6,11 @@ namespace UnityEditor.Experimental.EditorVR /// /// Gives decorated class ability to perform haptic feedback /// - public interface IPerformHaptics + public interface IControlHaptics { } - public static class IPerformHapticsMethods + public static class IControlHapticsMethods { internal delegate void PulseDelegate(Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false); @@ -24,7 +24,7 @@ public static class IPerformHapticsMethods /// Intensity of haptic feedback (optional) /// Fade the pulse in /// Fade the pulse out - public static void Pulse(this IPerformHaptics obj, Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) + public static void Pulse(this IControlHaptics obj, Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) { pulse(rayOrigin, duration, intensity, fadeIn, fadeOut); } @@ -37,7 +37,7 @@ public static void Pulse(this IPerformHaptics obj, Transform rayOrigin, float du /// Stop all haptic feedback on a specific device, or all devices /// /// Device RayOrigin/Transform on which to stop all pulses. A NULL value will stop pulses on all devices - public static void StopPulses(this IPerformHaptics obj, Transform rayOrigin) + public static void StopPulses(this IControlHaptics obj, Transform rayOrigin) { stopPulses(rayOrigin); } diff --git a/Scripts/Interfaces/IPerformHaptics.cs.meta b/Scripts/Interfaces/IControlHaptics.cs.meta similarity index 100% rename from Scripts/Interfaces/IPerformHaptics.cs.meta rename to Scripts/Interfaces/IControlHaptics.cs.meta diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index 820796b56..ba887bfbe 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -6,7 +6,7 @@ namespace ListView { - public abstract class ListViewControllerBase : MonoBehaviour, IScrollHandler, IPerformHaptics + public abstract class ListViewControllerBase : MonoBehaviour, IScrollHandler, IControlHaptics { public float scrollOffset { get { return m_ScrollOffset; } set { m_ScrollOffset = value; } } diff --git a/Scripts/Modules/SelectionModule.cs b/Scripts/Modules/SelectionModule.cs index a3282b56a..d47eb1adc 100644 --- a/Scripts/Modules/SelectionModule.cs +++ b/Scripts/Modules/SelectionModule.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelectionChanged, IPerformHaptics + sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelectionChanged, IControlHaptics { GameObject m_CurrentGroupRoot; readonly List m_SelectedObjects = new List(); // Keep the list to avoid allocations--we do not use it to maintain state diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index 05bbd4da7..005faf8d1 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IUsesRayOrigin, IPerformHaptics + sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IUsesRayOrigin, IControlHaptics { readonly Vector3 m_OriginalActivatorLocalPosition = new Vector3(0f, 0f, -0.075f); static readonly float kAlternateLocationOffset = 0.06f; diff --git a/Scripts/UI/PinnedToolButton.cs b/Scripts/UI/PinnedToolButton.cs index ed95fe865..ff33708e1 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Scripts/UI/PinnedToolButton.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolButton : MonoBehaviour, ISelectTool, IPointerEnterHandler, IPerformHaptics + sealed class PinnedToolButton : MonoBehaviour, ISelectTool, IPointerEnterHandler, IControlHaptics { public Type toolType { diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index c1791d746..54453eedc 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IPerformHaptics + sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IControlHaptics { const int k_AngledFaceBlendShapeIndex = 2; const int k_ThinFrameBlendShapeIndex = 3; diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index e7b3c9ef1..ae4b9ab19 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, IUsesStencilRef, IPerformHaptics + sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, IUsesStencilRef, IControlHaptics { const float k_IconHighlightedLocalZOffset = -0.0015f; const string k_MaterialAlphaProperty = "_Alpha"; From 6794ccf09810c7ead2031f1ce5d5a752bd042710 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 8 Jun 2017 11:37:44 -0700 Subject: [PATCH 351/870] Change "perform" comment references to "control" in IControlHaptics comments --- Scripts/Interfaces/IControlHaptics.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Interfaces/IControlHaptics.cs b/Scripts/Interfaces/IControlHaptics.cs index 377797abb..6fbfc81be 100644 --- a/Scripts/Interfaces/IControlHaptics.cs +++ b/Scripts/Interfaces/IControlHaptics.cs @@ -4,7 +4,7 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Gives decorated class ability to perform haptic feedback + /// Gives decorated class ability to control haptic feedback /// public interface IControlHaptics { @@ -17,9 +17,9 @@ public static class IControlHapticsMethods internal static PulseDelegate pulse { get; set; } /// - /// Perform haptic feedback + /// Perform a haptic feedback pulse /// - /// Device RayOrigin/Transform on which to perform the pulse. A NULL value will pulse on all devices + /// Device RayOrigin/Transform on which to control the pulse. A NULL value will pulse on all devices /// Duration of haptic feedback /// Intensity of haptic feedback (optional) /// Fade the pulse in From c3012c57cce4e4974d413b935262b2972b6cf033 Mon Sep 17 00:00:00 2001 From: Amir Ebrahimi Date: Thu, 8 Jun 2017 12:23:53 -0700 Subject: [PATCH 352/870] Match conventions --- Scripts/Core/Contexts/EditingContextManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Core/Contexts/EditingContextManager.cs b/Scripts/Core/Contexts/EditingContextManager.cs index d24047457..231bad4fa 100644 --- a/Scripts/Core/Contexts/EditingContextManager.cs +++ b/Scripts/Core/Contexts/EditingContextManager.cs @@ -99,7 +99,7 @@ static void EditProjectSettings() // we watch until playmode is done and then relaunch. static void ReopenOnExitPlaymode() { - bool launch = EditorPrefs.GetBool(k_LaunchOnExitPlaymode, false); + var launch = EditorPrefs.GetBool(k_LaunchOnExitPlaymode, false); if (!launch || !EditorApplication.isPlaying) { EditorPrefs.DeleteKey(k_LaunchOnExitPlaymode); @@ -114,7 +114,7 @@ private void OnPlaymodeStateChanged() if (EditorApplication.isPlayingOrWillChangePlaymode) { EditorPrefs.SetBool(k_LaunchOnExitPlaymode, true); - VRView view = VRView.activeView; + var view = VRView.activeView; if (view) view.Close(); } From 446bb6c67106c9c22620bc1da73e4ecbe88e554c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 8 Jun 2017 13:06:20 -0700 Subject: [PATCH 353/870] Fix bug where Cast Shadows dropdown could not be closed because of UI event sorting --- Scripts/ListView/ListViewController.cs | 7 ++++--- Scripts/ListView/ListViewControllerBase.cs | 8 +++++--- .../Common/Scripts/NestedListViewController.cs | 13 +++++++------ .../Scripts/HierarchyListViewController.cs | 14 +++++++------- .../Scripts/InspectorListViewController.cs | 17 +++++++++-------- .../Scripts/AssetGridViewController.cs | 11 +++++++---- .../Scripts/FolderListViewController.cs | 10 +++++----- 7 files changed, 44 insertions(+), 36 deletions(-) diff --git a/Scripts/ListView/ListViewController.cs b/Scripts/ListView/ListViewController.cs index 5294fe2f7..72635a05d 100644 --- a/Scripts/ListView/ListViewController.cs +++ b/Scripts/ListView/ListViewController.cs @@ -55,13 +55,14 @@ protected override void UpdateItems() var doneSettling = true; var offset = 0f; + var order = 0; for (int i = 0; i < m_Data.Count; i++) { var datum = m_Data[i]; if (offset + scrollOffset + itemSize.z < 0 || offset + scrollOffset > m_Size.z) Recycle(datum.index); else - UpdateVisibleItem(datum, i * itemSize.z + m_ScrollOffset, ref doneSettling); + UpdateVisibleItem(datum, order++, i * itemSize.z + m_ScrollOffset, ref doneSettling); offset += itemSize.z; } @@ -92,7 +93,7 @@ protected virtual void RecycleItem(string template, TItem item) item.gameObject.SetActive(false); } - protected virtual void UpdateVisibleItem(TData data, float offset, ref bool doneSettling) + protected virtual void UpdateVisibleItem(TData data, int order, float offset, ref bool doneSettling) { TItem item; var index = data.index; @@ -102,7 +103,7 @@ protected virtual void UpdateVisibleItem(TData data, float offset, ref bool done m_ListItems[index] = item; } - UpdateItem(item.transform, offset, ref doneSettling); + UpdateItem(item.transform, order, offset, ref doneSettling); } protected virtual void SetRowGrabbed(TIndex index, Transform rayOrigin, bool grabbed) diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index 4846a9c8a..88c80f1ae 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -158,14 +158,14 @@ public virtual void ScrollTo(int index) m_ScrollOffset = index * itemSize.z; } - protected virtual void UpdateItem(Transform t, float offset, ref bool doneSettling) + protected virtual void UpdateItem(Transform t, int order, float offset, ref bool doneSettling) { var targetPosition = m_StartPosition + offset * Vector3.back; var targetRotation = Quaternion.identity; - UpdateItemTransform(t, targetPosition, targetRotation, false, ref doneSettling); + UpdateItemTransform(t, order, targetPosition, targetRotation, false, ref doneSettling); } - protected virtual void UpdateItemTransform(Transform t, Vector3 targetPosition, Quaternion targetRotation, bool dontSettle, ref bool doneSettling) + protected virtual void UpdateItemTransform(Transform t, int order, Vector3 targetPosition, Quaternion targetRotation, bool dontSettle, ref bool doneSettling) { if (m_Settling && !dontSettle) { @@ -182,6 +182,8 @@ protected virtual void UpdateItemTransform(Transform t, Vector3 targetPosition, t.localPosition = targetPosition; t.localRotation = targetRotation; } + + t.SetSiblingIndex(order); } protected virtual Vector3 GetObjectSize(GameObject g) diff --git a/Workspaces/Common/Scripts/NestedListViewController.cs b/Workspaces/Common/Scripts/NestedListViewController.cs index d9c1b1382..acbd98040 100644 --- a/Workspaces/Common/Scripts/NestedListViewController.cs +++ b/Workspaces/Common/Scripts/NestedListViewController.cs @@ -69,15 +69,16 @@ protected override void UpdateItems() { var doneSettling = true; var count = 0f; + var order = 0; - UpdateRecursively(m_Data, ref count, ref doneSettling); + UpdateRecursively(m_Data, ref order, ref count, ref doneSettling); m_ExpandedDataLength = count; if (m_Settling && doneSettling) EndSettling(); } - protected virtual void UpdateRecursively(List data, ref float offset, ref bool doneSettling, int depth = 0) + protected virtual void UpdateRecursively(List data, ref int order, ref float offset, ref bool doneSettling, int depth = 0) { for (int i = 0; i < data.Count; i++) { @@ -93,23 +94,23 @@ protected virtual void UpdateRecursively(List data, ref float offset, ref if (offset + scrollOffset + itemSize.z < 0 || offset + scrollOffset > m_Size.z) Recycle(index); else - UpdateNestedItem(datum, offset, depth, ref doneSettling); + UpdateNestedItem(datum, order++, offset, depth, ref doneSettling); offset += itemSize.z; if (datum.children != null) { if (expanded) - UpdateRecursively(datum.children, ref offset, ref doneSettling, depth + 1); + UpdateRecursively(datum.children, ref order, ref offset, ref doneSettling, depth + 1); else RecycleChildren(datum); } } } - protected virtual void UpdateNestedItem(TData data, float count, int depth, ref bool doneSettling) + protected virtual void UpdateNestedItem(TData data, int order, float count, int depth, ref bool doneSettling) { - UpdateVisibleItem(data, count, ref doneSettling); + UpdateVisibleItem(data, order, count, ref doneSettling); } protected void RecycleChildren(TData data) diff --git a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs index f304504f5..c6d2e3ba0 100644 --- a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs +++ b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs @@ -127,7 +127,7 @@ void UpdateDropZones() } } - void UpdateHierarchyItem(HierarchyData data, ref float offset, int depth, bool? expanded, ref bool doneSettling) + void UpdateHierarchyItem(HierarchyData data, int order, ref float offset, int depth, bool? expanded, ref bool doneSettling) { var index = data.index; HierarchyListItem item; @@ -154,14 +154,14 @@ void UpdateHierarchyItem(HierarchyData data, ref float offset, int depth, bool? SetMaterialClip(item.dropZoneMaterial, transform.worldToLocalMatrix); m_VisibleItemHeight+= itemSize.z; - UpdateItem(item.transform, offset + m_ScrollOffset, ref doneSettling); + UpdateItem(item.transform, order, offset + m_ScrollOffset, ref doneSettling); var extraSpace = item.extraSpace * itemSize.z; offset += extraSpace; m_VisibleItemHeight += extraSpace; } - protected override void UpdateRecursively(List data, ref float offset, ref bool doneSettling, int depth = 0) + protected override void UpdateRecursively(List data, ref int order, ref float offset, ref bool doneSettling, int depth = 0) { for (int i = 0; i < data.Count; i++) { @@ -211,27 +211,27 @@ protected override void UpdateRecursively(List data, ref float of if (shouldRecycle) Recycle(index); else - UpdateHierarchyItem(datum, ref offset, 0, null, ref doneSettling); + UpdateHierarchyItem(datum, order++, ref offset, 0, null, ref doneSettling); offset += itemSize.z; } if (hasChildren) - UpdateRecursively(datum.children, ref offset, ref doneSettling); + UpdateRecursively(datum.children, ref order, ref offset, ref doneSettling); } else { if (shouldRecycle) Recycle(index); else - UpdateHierarchyItem(datum, ref offset, depth, expanded, ref doneSettling); + UpdateHierarchyItem(datum, order++, ref offset, depth, expanded, ref doneSettling); offset += itemSize.z; if (hasChildren) { if (expanded) - UpdateRecursively(datum.children, ref offset, ref doneSettling, depth + 1); + UpdateRecursively(datum.children, ref order, ref offset, ref doneSettling, depth + 1); else RecycleChildren(datum); } diff --git a/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs b/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs index abf59980d..19c0f8258 100644 --- a/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs +++ b/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs @@ -116,7 +116,7 @@ public void OnObjectModified() } } - protected override void UpdateRecursively(List data, ref float offset, ref bool doneSettling, int depth = 0) + protected override void UpdateRecursively(List data, ref int order, ref float offset, ref bool doneSettling, int depth = 0) { for (int i = 0; i < data.Count; i++) { @@ -140,41 +140,42 @@ protected override void UpdateRecursively(List data, ref float of if (offset + scrollOffset + itemSize.z < 0 || offset + scrollOffset > m_Size.z) Recycle(index); else - UpdateItemRecursive(datum, offset, depth, expanded, ref doneSettling); + UpdateItemRecursive(datum, order++, offset, depth, expanded, ref doneSettling); offset += itemSize.z; if (datum.children != null) { if (expanded) - UpdateRecursively(datum.children, ref offset, ref doneSettling, depth + 1); + UpdateRecursively(datum.children, ref order, ref offset, ref doneSettling, depth + 1); else RecycleChildren(datum); } } } - void UpdateItemRecursive(InspectorData data, float offset, int depth, bool expanded, ref bool doneSettling) + void UpdateItemRecursive(InspectorData data, int order, float offset, int depth, bool expanded, ref bool doneSettling) { InspectorListItem item; if (!m_ListItems.TryGetValue(data.index, out item)) { item = GetItem(data); - UpdateItem(item.transform, offset, true, ref doneSettling); + UpdateItem(item.transform, order, offset, true, ref doneSettling); } item.UpdateSelf(m_Size.x - k_ClipMargin, depth, expanded); item.UpdateClipTexts(transform.worldToLocalMatrix, m_Extents); - UpdateItem(item.transform, offset, false, ref doneSettling); + UpdateItem(item.transform, order, offset, false, ref doneSettling); } - void UpdateItem(Transform t, float offset, bool dontSettle, ref bool doneSettling) + void UpdateItem(Transform t, int order, float offset, bool dontSettle, ref bool doneSettling) { var targetPosition = m_StartPosition + (offset + m_ScrollOffset) * Vector3.forward; var targetRotation = Quaternion.identity; - UpdateItemTransform(t, targetPosition, targetRotation, dontSettle, ref doneSettling); + // order is reversed because Inspector draws bottom-to-top, hence the "0" below + UpdateItemTransform(t, 0, targetPosition, targetRotation, dontSettle, ref doneSettling); } protected override InspectorListItem GetItem(InspectorData listData) diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs index 03a419adc..8fe29b0ed 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs @@ -105,6 +105,7 @@ protected override Vector3 GetObjectSize(GameObject g) protected override void UpdateItems() { var count = 0; + var order = 0; foreach (var data in m_Data) { if (m_NumPerRow == 0) // If the list is too narrow, display nothing @@ -125,7 +126,7 @@ protected override void UpdateItems() else { var ignored = true; - UpdateVisibleItem(data, count, ref ignored); + UpdateVisibleItem(data, order++, count, ref ignored); } count++; @@ -150,14 +151,14 @@ void RecycleGridItem(AssetData data) }); } - protected override void UpdateVisibleItem(AssetData data, float offset, ref bool doneSettling) + protected override void UpdateVisibleItem(AssetData data, int order, float offset, ref bool doneSettling) { AssetGridItem item; if (!m_ListItems.TryGetValue(data.index, out item)) item = GetItem(data); if (item) - UpdateGridItem(item, (int)offset); + UpdateGridItem(item, order, (int)offset); } public override void OnScrollEnded() @@ -176,7 +177,7 @@ public override void OnScrollEnded() } } - void UpdateGridItem(AssetGridItem item, int count) + void UpdateGridItem(AssetGridItem item, int order, int count) { item.UpdateTransforms(m_ScaleFactor); @@ -187,6 +188,8 @@ void UpdateGridItem(AssetGridItem item, int count) t.localPosition = Vector3.Lerp(t.localPosition, m_StartPosition + zOffset * Vector3.back + xOffset * Vector3.right, k_PositionFollow); t.localRotation = Quaternion.identity; + + t.SetSiblingIndex(order); } protected override AssetGridItem GetItem(AssetData data) diff --git a/Workspaces/ProjectWorkspace/Scripts/FolderListViewController.cs b/Workspaces/ProjectWorkspace/Scripts/FolderListViewController.cs index 078e87513..416d009c9 100644 --- a/Workspaces/ProjectWorkspace/Scripts/FolderListViewController.cs +++ b/Workspaces/ProjectWorkspace/Scripts/FolderListViewController.cs @@ -78,7 +78,7 @@ protected override void UpdateItems() base.UpdateItems(); } - void UpdateFolderItem(FolderData data, float offset, int depth, bool expanded, ref bool doneSettling) + void UpdateFolderItem(FolderData data, int order, float offset, int depth, bool expanded, ref bool doneSettling) { var index = data.index; FolderListItem item; @@ -89,10 +89,10 @@ void UpdateFolderItem(FolderData data, float offset, int depth, bool expanded, r SetMaterialClip(item.cubeMaterial, transform.worldToLocalMatrix); - UpdateItem(item.transform, offset, ref doneSettling); + UpdateItem(item.transform, order, offset, ref doneSettling); } - protected override void UpdateRecursively(List data, ref float offset, ref bool doneSettling, int depth = 0) + protected override void UpdateRecursively(List data, ref int order, ref float offset, ref bool doneSettling, int depth = 0) { for (int i = 0; i < data.Count; i++) { @@ -105,14 +105,14 @@ protected override void UpdateRecursively(List data, ref float offse if (offset + scrollOffset + itemSize.z < 0 || offset + scrollOffset > m_Size.z) Recycle(index); else - UpdateFolderItem(datum, offset + m_ScrollOffset, depth, expanded, ref doneSettling); + UpdateFolderItem(datum, order++, offset + m_ScrollOffset, depth, expanded, ref doneSettling); offset += itemSize.z; if (datum.children != null) { if (expanded) - UpdateRecursively(datum.children, ref offset, ref doneSettling, depth + 1); + UpdateRecursively(datum.children, ref order, ref offset, ref doneSettling, depth + 1); else RecycleChildren(datum); } From e12d234e830f5b0ec3439576505fdc878b81267e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 8 Jun 2017 16:32:04 -0700 Subject: [PATCH 354/870] Reorganize haptics related project structure --- .../{ => FunctionalityInjection}/IControlHaptics.cs | 0 .../{ => FunctionalityInjection}/IControlHaptics.cs.meta | 0 Scripts/Modules/HapticsModule.meta | 9 +++++++++ Scripts/Modules/{ => HapticsModule}/HapticsModule.cs | 0 .../Modules/{ => HapticsModule}/HapticsModule.cs.meta | 0 Scripts/Modules/HapticsModule/Pulses.meta | 9 +++++++++ 6 files changed, 18 insertions(+) rename Scripts/Interfaces/{ => FunctionalityInjection}/IControlHaptics.cs (100%) rename Scripts/Interfaces/{ => FunctionalityInjection}/IControlHaptics.cs.meta (100%) create mode 100644 Scripts/Modules/HapticsModule.meta rename Scripts/Modules/{ => HapticsModule}/HapticsModule.cs (100%) rename Scripts/Modules/{ => HapticsModule}/HapticsModule.cs.meta (100%) create mode 100644 Scripts/Modules/HapticsModule/Pulses.meta diff --git a/Scripts/Interfaces/IControlHaptics.cs b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs similarity index 100% rename from Scripts/Interfaces/IControlHaptics.cs rename to Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs diff --git a/Scripts/Interfaces/IControlHaptics.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs.meta similarity index 100% rename from Scripts/Interfaces/IControlHaptics.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs.meta diff --git a/Scripts/Modules/HapticsModule.meta b/Scripts/Modules/HapticsModule.meta new file mode 100644 index 000000000..8b01b6e03 --- /dev/null +++ b/Scripts/Modules/HapticsModule.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1488377b09045d74e8058796f8d64248 +folderAsset: yes +timeCreated: 1496963634 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs similarity index 100% rename from Scripts/Modules/HapticsModule.cs rename to Scripts/Modules/HapticsModule/HapticsModule.cs diff --git a/Scripts/Modules/HapticsModule.cs.meta b/Scripts/Modules/HapticsModule/HapticsModule.cs.meta similarity index 100% rename from Scripts/Modules/HapticsModule.cs.meta rename to Scripts/Modules/HapticsModule/HapticsModule.cs.meta diff --git a/Scripts/Modules/HapticsModule/Pulses.meta b/Scripts/Modules/HapticsModule/Pulses.meta new file mode 100644 index 000000000..7890898f4 --- /dev/null +++ b/Scripts/Modules/HapticsModule/Pulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d44588d45192ffc40b08d6b78ace2e62 +folderAsset: yes +timeCreated: 1496959557 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: From c26f503937de81ce6c1d69e815c404c213b76928 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 8 Jun 2017 17:03:18 -0700 Subject: [PATCH 355/870] Add creation of haptic pulses via scriptable objects --- .../HapticsModule/CreateHapticPulse.cs | 29 +++++++++++++++++++ .../HapticsModule/CreateHapticPulse.cs.meta | 12 ++++++++ Scripts/Modules/HapticsModule/HapticPulse.cs | 29 +++++++++++++++++++ .../Modules/HapticsModule/HapticPulse.cs.meta | 12 ++++++++ 4 files changed, 82 insertions(+) create mode 100644 Scripts/Modules/HapticsModule/CreateHapticPulse.cs create mode 100644 Scripts/Modules/HapticsModule/CreateHapticPulse.cs.meta create mode 100644 Scripts/Modules/HapticsModule/HapticPulse.cs create mode 100644 Scripts/Modules/HapticsModule/HapticPulse.cs.meta diff --git a/Scripts/Modules/HapticsModule/CreateHapticPulse.cs b/Scripts/Modules/HapticsModule/CreateHapticPulse.cs new file mode 100644 index 000000000..722939e46 --- /dev/null +++ b/Scripts/Modules/HapticsModule/CreateHapticPulse.cs @@ -0,0 +1,29 @@ +#if UNITY_EDITOR +using System.IO; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Core +{ + public class CreateHapticPulse + { + [MenuItem("Assets/Create/EditorVR/HapticPulse")] + public static void CreateMyAsset() + { + HapticPulse asset = ScriptableObject.CreateInstance(); + + string path = AssetDatabase.GetAssetPath(Selection.activeObject); + if (path == string.Empty) + path = "Assets"; + else if (Path.GetExtension(path) != string.Empty) + path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), string.Empty); + + string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/NewHapticPulse.asset"); + + AssetDatabase.CreateAsset(asset, assetPathAndName); + AssetDatabase.SaveAssets(); + EditorUtility.FocusProjectWindow(); + Selection.activeObject = asset; + } + } +} +#endif diff --git a/Scripts/Modules/HapticsModule/CreateHapticPulse.cs.meta b/Scripts/Modules/HapticsModule/CreateHapticPulse.cs.meta new file mode 100644 index 000000000..f73255ee2 --- /dev/null +++ b/Scripts/Modules/HapticsModule/CreateHapticPulse.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 16ec16f4938f32f439b4bda4ac946b08 +timeCreated: 1496960625 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/HapticsModule/HapticPulse.cs b/Scripts/Modules/HapticsModule/HapticPulse.cs new file mode 100644 index 000000000..53c6bd722 --- /dev/null +++ b/Scripts/Modules/HapticsModule/HapticPulse.cs @@ -0,0 +1,29 @@ +#if UNITY_EDITOR +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Core +{ + class HapticPulse : ScriptableObject + { + [SerializeField] + [Range(0.001f, 1f)] + float m_Duration = 0.25f; + + [SerializeField] + [Range(0f, 1f)] + float m_Intensity = 1f; + + [SerializeField] + bool m_FadeIn = false; + + [SerializeField] + bool m_FadeOut = false; + + // Don't allow public setting of value; use inspector-set values + public float duration { get { return m_Duration; } } + public float intensity { get { return m_Intensity; } } + public bool fadeIn { get { return m_FadeIn; } } + public bool fadeOut { get { return m_FadeOut; } } + } +} +#endif diff --git a/Scripts/Modules/HapticsModule/HapticPulse.cs.meta b/Scripts/Modules/HapticsModule/HapticPulse.cs.meta new file mode 100644 index 000000000..0fd41724f --- /dev/null +++ b/Scripts/Modules/HapticsModule/HapticPulse.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1efd705dfe960584581b3390e04777f1 +timeCreated: 1496959572 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 90de3a5bf2235c2a45c88e4be384995297556e77 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 8 Jun 2017 18:14:20 -0700 Subject: [PATCH 356/870] Fix planar handle snapping; Fix snapping when pivot in center mode --- .../FunctionalityInjection/IUsesSnapping.cs | 6 +- .../Modules/SnappingModule/SnappingModule.cs | 75 ++++++++++++------- Tools/TransformTool/TransformTool.cs | 2 +- 3 files changed, 52 insertions(+), 31 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs index 41fd2dbbf..2f80df6ff 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs @@ -13,7 +13,7 @@ public interface IUsesSnapping public static class IUsesSnappingMethods { - internal delegate bool ManipulatorSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints); + internal delegate bool ManipulatorSnapDelegate(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode); internal delegate bool DirectSnapDelegate(Transform rayOrigin, Transform transform, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation); internal static ManipulatorSnapDelegate manipulatorSnap { get; set; } @@ -30,9 +30,9 @@ public static class IUsesSnappingMethods /// The position delta to apply /// The axis constraints /// Whether the position was set to a snapped position - public static bool ManipulatorSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints) + public static bool ManipulatorSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode) { - return manipulatorSnap(rayOrigin, transforms, ref position, ref rotation, delta, constraints); + return manipulatorSnap(rayOrigin, transforms, ref position, ref rotation, delta, constraints, pivotMode); } /// diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 5c6c37d77..e6170f8bb 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -429,7 +429,7 @@ void Update() } } - public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints) + public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode) { if (transforms.Length == 0) return false; @@ -492,44 +492,60 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec default: if (surfaceSnappingEnabled) { - var bounds = state.identityBounds; - var boundsExtents = bounds.extents; var direction = delta.normalized; - var projectedExtents = Vector3.Project(boundsExtents, direction); - var offset = projectedExtents - bounds.center; var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); var startRotation = state.startRotation; var upVector = startRotation * Vector3.back; - var maxRayLength = projectedExtents.magnitude * 2; var breakDistance = breakScale * k_ManipulatorSurfaceSnapBreakDist; - switch (constraints) + var axisRay = new Ray(targetPosition, direction); + var objectCenter = Vector3.zero; + var rayOffset = Vector3.zero; + var boundsOffset = Vector3.zero; + + if (!pivotSnappingEnabled) { - case ConstrainedAxis.X: - if (Vector3.Dot(Vector3.right, direction) > 0) - offset *= -1; - break; - case ConstrainedAxis.Y: - if (Vector3.Dot(Vector3.up, direction) > 0) - offset *= -1; - break; - case ConstrainedAxis.Z: - if (Vector3.Dot(Vector3.forward, direction) > 0) - offset *= -1; - break; - } + var bounds = state.identityBounds; + rayOffset = Vector3.Project(rotation * bounds.extents, direction); + objectCenter = targetPosition; + if (pivotMode != PivotMode.Center) + objectCenter += targetRotation * bounds.center; - var axisRay = new Ray(targetPosition, direction); + switch (constraints) + { + case ConstrainedAxis.X: + if (Vector3.Dot(rotation * Vector3.right, direction) > 0) + rayOffset *= -1; + break; + case ConstrainedAxis.Y: + if (Vector3.Dot(rotation * Vector3.up, direction) > 0) + rayOffset *= -1; + break; + case ConstrainedAxis.Z: + if (Vector3.Dot(rotation * Vector3.forward, direction) > 0) + rayOffset *= -1; + break; + } - if (SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, maxRayLength) - || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance) - ) + axisRay.origin = objectCenter - rayOffset; + boundsOffset = targetPosition - axisRay.origin; + } + + if (SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, breakDistance * 0.75f)) return true; - axisRay = new Ray(targetPosition, -direction); + // Check other direction + axisRay.direction *= -1; + if (!pivotSnappingEnabled) + { + axisRay.origin = objectCenter + rayOffset; + boundsOffset = targetPosition - axisRay.origin; + } + + if (SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, breakDistance * 0.75f)) + return true; - if (SnapToSurface(axisRay, ref position, ref rotation, state, -offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, maxRayLength) - || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) + if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) return true; } break; @@ -661,8 +677,13 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp { RaycastHit hit; GameObject go; + GizmoModule.instance.DrawSphere(ray.origin, 0.1f, Color.blue); + GizmoModule.instance.DrawRay(ray.origin, ray.direction, Color.blue, raycastDistance); if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { + GizmoModule.instance.DrawSphere(hit.point, 0.1f, Color.red); + GizmoModule.instance.DrawSphere(hit.point + rotation * boundsOffset, 0.1f, Color.blue); + GizmoModule.instance.DrawRay(hit.point, boundsOffset, Color.green, boundsOffset.magnitude); var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; var hitPoint = hit.point; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index f3f5a45cb..6a97b6d35 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -539,7 +539,7 @@ public void DropHeldObjects(Node node) void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints) { - this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints); + this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); } void Rotate(Quaternion delta) From ea912a0b43d6f6456ba7a7c2ae3a55c527c6b8a6 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 8 Jun 2017 18:15:50 -0700 Subject: [PATCH 357/870] Remove debug code --- Scripts/Modules/SnappingModule/SnappingModule.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index e6170f8bb..c076cb58e 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -677,13 +677,8 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp { RaycastHit hit; GameObject go; - GizmoModule.instance.DrawSphere(ray.origin, 0.1f, Color.blue); - GizmoModule.instance.DrawRay(ray.origin, ray.direction, Color.blue, raycastDistance); if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { - GizmoModule.instance.DrawSphere(hit.point, 0.1f, Color.red); - GizmoModule.instance.DrawSphere(hit.point + rotation * boundsOffset, 0.1f, Color.blue); - GizmoModule.instance.DrawRay(hit.point, boundsOffset, Color.green, boundsOffset.magnitude); var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; var hitPoint = hit.point; From d7d8f14f2bd8ce539faad7261ff200a61dfcb040 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 9 Jun 2017 15:36:06 -0700 Subject: [PATCH 358/870] Add ground snapping for constrained manipulators; Refine component-wise approach for planar manipulators --- Manipulators/BaseManipulator.cs | 2 +- Manipulators/DirectManipulator.cs | 4 +- Manipulators/StandardManipulator.cs | 14 +- Scripts/Core/EditorVR.cs | 2 + Scripts/Interfaces/Entity/IManipulator.cs | 4 +- .../Modules/SnappingModule/SnappingModule.cs | 248 ++++++++++-------- Scripts/UI/KeyboardUI.cs | 4 +- Tools/TransformTool/TransformTool.cs | 8 +- 8 files changed, 159 insertions(+), 127 deletions(-) diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index 86667082f..b037f4ecf 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -10,7 +10,7 @@ class BaseManipulator : MonoBehaviour, IManipulator public bool adjustScaleForCamera { get; set; } - public Action translate { protected get; set; } + public Func translate { protected get; set; } public Action rotate { protected get; set; } public Action scale { protected get; set; } diff --git a/Manipulators/DirectManipulator.cs b/Manipulators/DirectManipulator.cs index aeb3a1e6d..0a55f13a8 100644 --- a/Manipulators/DirectManipulator.cs +++ b/Manipulators/DirectManipulator.cs @@ -22,7 +22,7 @@ public Transform target Vector3 m_PositionOffset; Quaternion m_RotationOffset; - public Action translate { private get; set; } + public Func translate { private get; set; } public Action rotate { private get; set; } public Action scale { private get; set; } @@ -74,7 +74,7 @@ void OnHandleDragging(BaseHandle handle, HandleEventData eventData) var target = m_Target == null ? transform : m_Target; var rayOrigin = eventData.rayOrigin; - translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, 0); + translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, 0, true); rotate(Quaternion.Inverse(target.rotation) * rayOrigin.rotation * m_RotationOffset); } diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index d49a3586a..d9c9979bc 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -82,32 +82,32 @@ void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) case ConstrainedAxis.X | ConstrainedAxis.Y: { var xComponent = Vector3.Project(delta, transform.right); - translate(xComponent, eventData.rayOrigin, ConstrainedAxis.X); + var snapped = translate(xComponent, eventData.rayOrigin, ConstrainedAxis.X, true); var yComponent = Vector3.Project(delta, transform.up); - translate(yComponent, eventData.rayOrigin, ConstrainedAxis.Y); + translate(yComponent, eventData.rayOrigin, ConstrainedAxis.Y, !snapped); } break; case ConstrainedAxis.Y | ConstrainedAxis.Z: { var yComponent = Vector3.Project(delta, transform.up); - translate(yComponent, eventData.rayOrigin, ConstrainedAxis.Y); + var snapped = translate(yComponent, eventData.rayOrigin, ConstrainedAxis.Y, true); var zComponent = Vector3.Project(delta, transform.forward); - translate(zComponent, eventData.rayOrigin, ConstrainedAxis.Z); + translate(zComponent, eventData.rayOrigin, ConstrainedAxis.Z, !snapped); } break; case ConstrainedAxis.X | ConstrainedAxis.Z: { var xComponent = Vector3.Project(delta, transform.right); - translate(xComponent, eventData.rayOrigin, ConstrainedAxis.X); + var snapped = translate(xComponent, eventData.rayOrigin, ConstrainedAxis.X, true); var zComponent = Vector3.Project(delta, transform.forward); - translate(zComponent, eventData.rayOrigin, ConstrainedAxis.Z); + translate(zComponent, eventData.rayOrigin, ConstrainedAxis.Z, !snapped); } break; } } else { - translate(eventData.deltaPosition, eventData.rayOrigin, constraints); + translate(eventData.deltaPosition, eventData.rayOrigin, constraints, true); } } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 1e6675bca..1095a55b4 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -174,6 +174,8 @@ void Awake() workspaceModule.workspaceDestroyed += vacuumables.OnWorkspaceDestroyed; workspaceModule.workspaceDestroyed += miniWorlds.OnWorkspaceDestroyed; + AddModule(); + UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedLightGradient(); var sceneObjectModule = AddModule(); diff --git a/Scripts/Interfaces/Entity/IManipulator.cs b/Scripts/Interfaces/Entity/IManipulator.cs index bda561069..93b483ce8 100644 --- a/Scripts/Interfaces/Entity/IManipulator.cs +++ b/Scripts/Interfaces/Entity/IManipulator.cs @@ -19,9 +19,9 @@ public interface IManipulator { /// /// Delegate that processes the translation, using the vector3 passed in - /// Caller also provides the ray origin that is doing the action, and whether or not this translation is axis-constrained + /// Caller also provides the ray origin that is doing the action whether or not this translation is axis-constrained, and whether to apply snapping /// - Action translate { set; } + Func translate { set; } /// /// Delegate that processes the rotation, using the quaternion passed in diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index c076cb58e..e397ab4ec 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -24,6 +24,7 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_ManipulatorGroundSnapMin = 0.05f; const float k_ManipulatorGroundSnapMax = 0.15f; const float k_ManipulatorSurfaceSnapBreakDist = 0.1f; + const float k_ManipulatorSurfaceSearchScale = 0.75f; const float k_DirectSurfaceSearchScale = 1.1f; const float k_DirectSurfaceSnapBreakDist = 0.03f; @@ -50,6 +51,7 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv class SnappingState { public Vector3 currentPosition { get; set; } + public Vector3 snappedPosition { get; set; } public bool groundSnapping { get; set; } public bool surfaceSnapping { get; set; } @@ -450,104 +452,32 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec AddToIgnoreList(transforms); + var manipulatorBreakScale = breakScale * k_ManipulatorSurfaceSnapBreakDist; switch (constraints) { case 0: - if (surfaceSnappingEnabled && ManipulatorSnapToSurface(rayOrigin, ref position, ref rotation, targetPosition, state, targetRotation, breakScale * k_ManipulatorSurfaceSnapBreakDist)) + if (surfaceSnappingEnabled && ManipulatorSnapToSurface(rayOrigin, ref position, ref rotation, targetPosition, state, targetRotation, manipulatorBreakScale)) return true; if (groundSnappingEnabled) { if (localOnly) { - if (SnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_ManipulatorGroundSnapMin, breakScale * k_ManipulatorGroundSnapMax)) + if (LocalSnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_ManipulatorGroundSnapMin, breakScale * k_ManipulatorGroundSnapMax)) return true; } else { - var groundPlane = new Plane(Vector3.up, k_GroundHeight); - var origin = rayOrigin.position; - var direction = rayOrigin.forward; - var pointerRay = new Ray(origin, direction); - var raycastDistance = k_GroundSnappingMaxRayLength * this.GetViewerScale(); - float distance; - if (groundPlane.Raycast(pointerRay, out distance) && distance <= raycastDistance) - { - state.groundSnapping = true; - - position = origin + direction * distance; - - if (rotationSnappingEnabled) - rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); - + if (GlobalSnapToGround(new Ray(rayOrigin.position, rayOrigin.forward), ref position, ref rotation, targetPosition, targetRotation, state, k_GroundSnappingMaxRayLength * this.GetViewerScale())) return true; - } - - state.groundSnapping = false; - position = targetPosition; - rotation = targetRotation; } } + break; default: - if (surfaceSnappingEnabled) - { - var direction = delta.normalized; - var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); - var startRotation = state.startRotation; - var upVector = startRotation * Vector3.back; - var breakDistance = breakScale * k_ManipulatorSurfaceSnapBreakDist; - - var axisRay = new Ray(targetPosition, direction); - var objectCenter = Vector3.zero; - var rayOffset = Vector3.zero; - var boundsOffset = Vector3.zero; - - if (!pivotSnappingEnabled) - { - var bounds = state.identityBounds; - rayOffset = Vector3.Project(rotation * bounds.extents, direction); - objectCenter = targetPosition; - if (pivotMode != PivotMode.Center) - objectCenter += targetRotation * bounds.center; - - switch (constraints) - { - case ConstrainedAxis.X: - if (Vector3.Dot(rotation * Vector3.right, direction) > 0) - rayOffset *= -1; - break; - case ConstrainedAxis.Y: - if (Vector3.Dot(rotation * Vector3.up, direction) > 0) - rayOffset *= -1; - break; - case ConstrainedAxis.Z: - if (Vector3.Dot(rotation * Vector3.forward, direction) > 0) - rayOffset *= -1; - break; - } - - axisRay.origin = objectCenter - rayOffset; - boundsOffset = targetPosition - axisRay.origin; - } - - if (SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, breakDistance * 0.75f)) - return true; - - // Check other direction - axisRay.direction *= -1; - if (!pivotSnappingEnabled) - { - axisRay.origin = objectCenter + rayOffset; - boundsOffset = targetPosition - axisRay.origin; - } - - if (SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, breakDistance * 0.75f)) - return true; + if (ManipulatorSnapConstrained(ref position, ref rotation, delta, targetPosition, state, targetRotation, manipulatorBreakScale, constraints, pivotMode)) + return true; - if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) - return true; - } break; } } @@ -573,7 +503,7 @@ public bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 pos if (surfaceSnappingEnabled && DirectSnapToSurface(ref position, ref rotation, targetPosition, state, targetRotation, breakDistance)) return true; - if (groundSnappingEnabled && SnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_DirectGroundSnapMin, breakScale * k_DirectGroundSnapMax)) + if (groundSnappingEnabled && LocalSnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_DirectGroundSnapMin, breakScale * k_DirectGroundSnapMax)) return true; } @@ -599,11 +529,78 @@ bool ManipulatorSnapToSurface(Transform rayOrigin, ref Vector3 position, ref Qua || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance); } + bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, Vector3 delta, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, float breakDistance, ConstrainedAxis constraints, PivotMode pivotMode) + { + var direction = delta.normalized; + var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); + var startRotation = state.startRotation; + var upVector = startRotation * Vector3.back; + var raycastDistance = breakDistance * k_ManipulatorSurfaceSearchScale; // Shorten ray to avoid jitter at the edge of the break distance + + var axisRay = new Ray(targetPosition, direction); + var objectCenter = Vector3.zero; + var rayOffset = Vector3.zero; + var boundsOffset = Vector3.zero; + + if (!pivotSnappingEnabled) + { + var bounds = state.identityBounds; + rayOffset = Vector3.Project(rotation * bounds.extents, direction); + objectCenter = targetPosition; + if (pivotMode != PivotMode.Center) + objectCenter += targetRotation * bounds.center; + + switch (constraints) + { + case ConstrainedAxis.X: + if (Vector3.Dot(rotation * Vector3.right, direction) > 0) + rayOffset *= -1; + break; + case ConstrainedAxis.Y: + if (Vector3.Dot(rotation * Vector3.up, direction) > 0) + rayOffset *= -1; + break; + case ConstrainedAxis.Z: + if (Vector3.Dot(rotation * Vector3.forward, direction) > 0) + rayOffset *= -1; + break; + } + + axisRay.origin = objectCenter - rayOffset; + boundsOffset = targetPosition - axisRay.origin; + } + + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, raycastDistance)) + return true; + + if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) + return true; + + // Check other direction + axisRay.direction *= -1; + if (!pivotSnappingEnabled) + { + axisRay.origin = objectCenter + rayOffset; + boundsOffset = targetPosition - axisRay.origin; + } + + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, raycastDistance)) + return true; + + if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) + return true; + + if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) + return true; + + return false; + } + bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, float breakDistance) { var bounds = state.identityBounds; var boundsCenter = bounds.center; - for (int i = 0; i < k_Directions.Length; i++) + for (var i = 0; i < k_Directions.Length; i++) { var direction = k_Directions[i]; var upVector = targetRotation * direction.upVector; @@ -636,7 +633,7 @@ static bool TryBreakSurfaceSnap(ref Vector3 position, ref Quaternion rotation, V { if (state.surfaceSnapping) { - if (Vector3.Distance(position, targetPosition) > breakDistance) + if (Vector3.Distance(state.snappedPosition, targetPosition) > breakDistance) { position = targetPosition; rotation = targetRotation; @@ -658,7 +655,7 @@ void AddToIgnoreList(Transform[] transforms) { m_CombinedIgnoreList.Clear(); - for (int i = 0; i < transforms.Length; i++) + for (var i = 0; i < transforms.Length; i++) { var renderers = transforms[i].GetComponentsInChildren(); for (var j = 0; j < renderers.Length; j++) @@ -667,7 +664,7 @@ void AddToIgnoreList(Transform[] transforms) } } - for (int i = 0; i < ignoreList.Length; i++) + for (var i = 0; i < ignoreList.Length; i++) { m_CombinedIgnoreList.Add(ignoreList[i].gameObject); } @@ -677,8 +674,13 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp { RaycastHit hit; GameObject go; + GizmoModule.instance.DrawSphere(ray.origin, 0.1f, Color.blue); + GizmoModule.instance.DrawRay(ray.origin, ray.direction, Color.blue, raycastDistance); if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { + GizmoModule.instance.DrawSphere(hit.point, 0.1f, Color.red); + GizmoModule.instance.DrawSphere(hit.point + rotation * boundsOffset, 0.1f, Color.blue); + GizmoModule.instance.DrawRay(hit.point, boundsOffset, Color.green, boundsOffset.magnitude); var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; var hitPoint = hit.point; @@ -704,47 +706,69 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp } - bool SnapToGround(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float groundSnapMin, float groundSnapMax) + bool LocalSnapToGround(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float groundSnapMin, float groundSnapMax) { - if (groundSnappingEnabled) + var diffGround = Mathf.Abs(targetPosition.y - k_GroundHeight); + + var bounds = state.rotatedBounds; + if (rotationSnappingEnabled) + bounds = state.identityBounds; + + var offset = bounds.center.y - bounds.extents.y; + + if (!pivotSnappingEnabled) + diffGround = Mathf.Abs(targetPosition.y + offset - k_GroundHeight); + + if (diffGround < groundSnapMin) + state.groundSnapping = true; + + if (diffGround > groundSnapMax) { - var diffGround = Mathf.Abs(targetPosition.y - k_GroundHeight); + state.groundSnapping = false; + position = targetPosition; + rotation = targetRotation; + } - var bounds = state.rotatedBounds; - if (rotationSnappingEnabled) - bounds = state.identityBounds; + if (state.groundSnapping) + { + if (pivotSnappingEnabled) + targetPosition.y = k_GroundHeight; + else + targetPosition.y = k_GroundHeight - offset; - var offset = bounds.center.y - bounds.extents.y; + position = targetPosition; - if (!pivotSnappingEnabled) - diffGround = Mathf.Abs(targetPosition.y + offset - k_GroundHeight); + if (rotationSnappingEnabled) + rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); - if (diffGround < groundSnapMin) - state.groundSnapping = true; + return true; + } - if (diffGround > groundSnapMax) - { - state.groundSnapping = false; - position = targetPosition; - rotation = targetRotation; - } + return false; + } - if (state.groundSnapping) - { - if (pivotSnappingEnabled) - targetPosition.y = k_GroundHeight; - else - targetPosition.y = k_GroundHeight - offset; + bool GlobalSnapToGround(Ray ray, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, Vector3 boundsOffset = default(Vector3)) + { + var groundPlane = new Plane(Vector3.up, k_GroundHeight); + float distance; + if (groundPlane.Raycast(ray, out distance) && distance <= raycastDistance) + { + state.groundSnapping = true; - position = targetPosition; + var hitPoint = ray.origin + ray.direction * distance; + var snappedPosition = pivotSnappingEnabled ? hitPoint : hitPoint + boundsOffset; + position = snappedPosition; - if (rotationSnappingEnabled) - rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); + if (rotationSnappingEnabled) + rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); - return true; - } + return true; } + state.groundSnapping = false; + position = targetPosition; + rotation = targetRotation; + return false; } diff --git a/Scripts/UI/KeyboardUI.cs b/Scripts/UI/KeyboardUI.cs index 734eb6da2..cd1cb2817 100644 --- a/Scripts/UI/KeyboardUI.cs +++ b/Scripts/UI/KeyboardUI.cs @@ -341,10 +341,12 @@ bool InTransition() return collapsing || m_EligibleForDrag; } - void Translate(Vector3 deltaPosition, Transform rayOrigin, ConstrainedAxis constraints) + bool Translate(Vector3 deltaPosition, Transform rayOrigin, ConstrainedAxis constraints, bool snapping) { if (m_EligibleForDrag) transform.position += deltaPosition; + + return false; } void Rotate(Quaternion deltaRotation) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 6a97b6d35..d5286a13a 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -537,9 +537,13 @@ public void DropHeldObjects(Node node) this.ClearSnappingState(rayOrigin); } - void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints) + bool Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints, bool snapping) { - this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); + if (snapping) + return this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); + + m_TargetPosition += delta; + return false; } void Rotate(Quaternion delta) From cdee412b886f7271bd3dcecd795959a87a40b6ae Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 9 Jun 2017 15:47:59 -0700 Subject: [PATCH 359/870] Remove plane manipulator snapping --- Manipulators/BaseManipulator.cs | 2 +- Manipulators/DirectManipulator.cs | 4 +-- Manipulators/StandardManipulator.cs | 36 ++----------------- Scripts/Core/EditorVR.cs | 2 -- Scripts/Interfaces/Entity/IManipulator.cs | 4 +-- .../FunctionalityInjection/IUsesSnapping.cs | 1 + .../Modules/SnappingModule/SnappingModule.cs | 8 +---- Scripts/UI/KeyboardUI.cs | 4 +-- Tools/TransformTool/TransformTool.cs | 18 ++++++---- 9 files changed, 22 insertions(+), 57 deletions(-) diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index b037f4ecf..86667082f 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -10,7 +10,7 @@ class BaseManipulator : MonoBehaviour, IManipulator public bool adjustScaleForCamera { get; set; } - public Func translate { protected get; set; } + public Action translate { protected get; set; } public Action rotate { protected get; set; } public Action scale { protected get; set; } diff --git a/Manipulators/DirectManipulator.cs b/Manipulators/DirectManipulator.cs index 0a55f13a8..aeb3a1e6d 100644 --- a/Manipulators/DirectManipulator.cs +++ b/Manipulators/DirectManipulator.cs @@ -22,7 +22,7 @@ public Transform target Vector3 m_PositionOffset; Quaternion m_RotationOffset; - public Func translate { private get; set; } + public Action translate { private get; set; } public Action rotate { private get; set; } public Action scale { private get; set; } @@ -74,7 +74,7 @@ void OnHandleDragging(BaseHandle handle, HandleEventData eventData) var target = m_Target == null ? transform : m_Target; var rayOrigin = eventData.rayOrigin; - translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, 0, true); + translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, 0); rotate(Quaternion.Inverse(target.rotation) * rayOrigin.rotation * m_RotationOffset); } diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index d9c9979bc..0d823887b 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -74,41 +74,9 @@ void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) var plane = handle as PlaneHandle; if (plane) - { constraints = plane.constraints; - var delta = eventData.deltaPosition; - switch (constraints) - { - case ConstrainedAxis.X | ConstrainedAxis.Y: - { - var xComponent = Vector3.Project(delta, transform.right); - var snapped = translate(xComponent, eventData.rayOrigin, ConstrainedAxis.X, true); - var yComponent = Vector3.Project(delta, transform.up); - translate(yComponent, eventData.rayOrigin, ConstrainedAxis.Y, !snapped); - } - break; - case ConstrainedAxis.Y | ConstrainedAxis.Z: - { - var yComponent = Vector3.Project(delta, transform.up); - var snapped = translate(yComponent, eventData.rayOrigin, ConstrainedAxis.Y, true); - var zComponent = Vector3.Project(delta, transform.forward); - translate(zComponent, eventData.rayOrigin, ConstrainedAxis.Z, !snapped); - } - break; - case ConstrainedAxis.X | ConstrainedAxis.Z: - { - var xComponent = Vector3.Project(delta, transform.right); - var snapped = translate(xComponent, eventData.rayOrigin, ConstrainedAxis.X, true); - var zComponent = Vector3.Project(delta, transform.forward); - translate(zComponent, eventData.rayOrigin, ConstrainedAxis.Z, !snapped); - } - break; - } - } - else - { - translate(eventData.deltaPosition, eventData.rayOrigin, constraints, true); - } + + translate(eventData.deltaPosition, eventData.rayOrigin, constraints); } void OnRotateDragging(BaseHandle handle, HandleEventData eventData) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 1095a55b4..1e6675bca 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -174,8 +174,6 @@ void Awake() workspaceModule.workspaceDestroyed += vacuumables.OnWorkspaceDestroyed; workspaceModule.workspaceDestroyed += miniWorlds.OnWorkspaceDestroyed; - AddModule(); - UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedLightGradient(); var sceneObjectModule = AddModule(); diff --git a/Scripts/Interfaces/Entity/IManipulator.cs b/Scripts/Interfaces/Entity/IManipulator.cs index 93b483ce8..bda561069 100644 --- a/Scripts/Interfaces/Entity/IManipulator.cs +++ b/Scripts/Interfaces/Entity/IManipulator.cs @@ -19,9 +19,9 @@ public interface IManipulator { /// /// Delegate that processes the translation, using the vector3 passed in - /// Caller also provides the ray origin that is doing the action whether or not this translation is axis-constrained, and whether to apply snapping + /// Caller also provides the ray origin that is doing the action, and whether or not this translation is axis-constrained /// - Func translate { set; } + Action translate { set; } /// /// Delegate that processes the rotation, using the quaternion passed in diff --git a/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs index 2f80df6ff..b791721f9 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IUsesSnapping.cs @@ -29,6 +29,7 @@ public static class IUsesSnappingMethods /// The rotation to be modified if rotation snapping is enabled /// The position delta to apply /// The axis constraints + /// The current pivot mode /// Whether the position was set to a snapped position public static bool ManipulatorSnap(this IUsesSnapping usesSnaping, Transform rayOrigin, Transform[] transforms, ref Vector3 position, ref Quaternion rotation, Vector3 delta, ConstrainedAxis constraints, PivotMode pivotMode) { diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index e397ab4ec..92d2a9da2 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -51,7 +51,6 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv class SnappingState { public Vector3 currentPosition { get; set; } - public Vector3 snappedPosition { get; set; } public bool groundSnapping { get; set; } public bool surfaceSnapping { get; set; } @@ -633,7 +632,7 @@ static bool TryBreakSurfaceSnap(ref Vector3 position, ref Quaternion rotation, V { if (state.surfaceSnapping) { - if (Vector3.Distance(state.snappedPosition, targetPosition) > breakDistance) + if (Vector3.Distance(position, targetPosition) > breakDistance) { position = targetPosition; rotation = targetRotation; @@ -674,13 +673,8 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp { RaycastHit hit; GameObject go; - GizmoModule.instance.DrawSphere(ray.origin, 0.1f, Color.blue); - GizmoModule.instance.DrawRay(ray.origin, ray.direction, Color.blue, raycastDistance); if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { - GizmoModule.instance.DrawSphere(hit.point, 0.1f, Color.red); - GizmoModule.instance.DrawSphere(hit.point + rotation * boundsOffset, 0.1f, Color.blue); - GizmoModule.instance.DrawRay(hit.point, boundsOffset, Color.green, boundsOffset.magnitude); var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; var hitPoint = hit.point; diff --git a/Scripts/UI/KeyboardUI.cs b/Scripts/UI/KeyboardUI.cs index cd1cb2817..734eb6da2 100644 --- a/Scripts/UI/KeyboardUI.cs +++ b/Scripts/UI/KeyboardUI.cs @@ -341,12 +341,10 @@ bool InTransition() return collapsing || m_EligibleForDrag; } - bool Translate(Vector3 deltaPosition, Transform rayOrigin, ConstrainedAxis constraints, bool snapping) + void Translate(Vector3 deltaPosition, Transform rayOrigin, ConstrainedAxis constraints) { if (m_EligibleForDrag) transform.position += deltaPosition; - - return false; } void Rotate(Quaternion deltaRotation) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index d5286a13a..c7fadbcfe 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -537,13 +537,19 @@ public void DropHeldObjects(Node node) this.ClearSnappingState(rayOrigin); } - bool Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints, bool snapping) + void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints) { - if (snapping) - return this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); - - m_TargetPosition += delta; - return false; + switch (constraints) + { + case ConstrainedAxis.X | ConstrainedAxis.Y: + case ConstrainedAxis.Y | ConstrainedAxis.Z: + case ConstrainedAxis.X | ConstrainedAxis.Z: + m_TargetPosition += delta; + break; + default: + this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); + break; + } } void Rotate(Quaternion delta) From 3e30377b5ac4ee585c11c3179b2525837d422c6c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 9 Jun 2017 17:04:45 -0700 Subject: [PATCH 360/870] Refine how we determine breakDistance --- .../Modules/SnappingModule/SnappingModule.cs | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 92d2a9da2..c3811562d 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -23,7 +23,7 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_ManipulatorGroundSnapMin = 0.05f; const float k_ManipulatorGroundSnapMax = 0.15f; - const float k_ManipulatorSurfaceSnapBreakDist = 0.1f; + const float k_ManipulatorSurfaceSnapBreakDist = 0.2f; const float k_ManipulatorSurfaceSearchScale = 0.75f; const float k_DirectSurfaceSearchScale = 1.1f; @@ -446,16 +446,22 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec var targetPosition = state.currentPosition; var targetRotation = state.startRotation; + GizmoModule.instance.DrawSphere(targetPosition, 1f, Color.red); + var camera = CameraUtils.GetMainCamera(); var breakScale = Vector3.Distance(camera.transform.position, targetPosition); AddToIgnoreList(transforms); - var manipulatorBreakScale = breakScale * k_ManipulatorSurfaceSnapBreakDist; + var bounds = state.identityBounds; + var direction = delta.normalized; + var projectedExtents = Vector3.Project(rotation * bounds.extents, direction); + var manipulatorBreakDistance = (breakScale * k_ManipulatorSurfaceSnapBreakDist + projectedExtents.magnitude) * 0.5f; + switch (constraints) { case 0: - if (surfaceSnappingEnabled && ManipulatorSnapToSurface(rayOrigin, ref position, ref rotation, targetPosition, state, targetRotation, manipulatorBreakScale)) + if (surfaceSnappingEnabled && ManipulatorSnapToSurface(rayOrigin, ref position, ref rotation, targetPosition, state, targetRotation, manipulatorBreakDistance)) return true; if (groundSnappingEnabled) @@ -474,7 +480,8 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec break; default: - if (ManipulatorSnapConstrained(ref position, ref rotation, delta, targetPosition, state, targetRotation, manipulatorBreakScale, constraints, pivotMode)) + manipulatorBreakDistance = Mathf.Max(manipulatorBreakDistance, (delta.magnitude / breakScale) / Time.deltaTime); + if (ManipulatorSnapConstrained(ref position, ref rotation, direction, targetPosition, state, targetRotation, projectedExtents, manipulatorBreakDistance, constraints, pivotMode)) return true; break; @@ -528,9 +535,8 @@ bool ManipulatorSnapToSurface(Transform rayOrigin, ref Vector3 position, ref Qua || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance); } - bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, Vector3 delta, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, float breakDistance, ConstrainedAxis constraints, PivotMode pivotMode) + bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, Vector3 direction, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, Vector3 projectedExtents, float breakDistance, ConstrainedAxis constraints, PivotMode pivotMode) { - var direction = delta.normalized; var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); var startRotation = state.startRotation; var upVector = startRotation * Vector3.back; @@ -538,34 +544,31 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V var axisRay = new Ray(targetPosition, direction); var objectCenter = Vector3.zero; - var rayOffset = Vector3.zero; var boundsOffset = Vector3.zero; if (!pivotSnappingEnabled) { - var bounds = state.identityBounds; - rayOffset = Vector3.Project(rotation * bounds.extents, direction); objectCenter = targetPosition; if (pivotMode != PivotMode.Center) - objectCenter += targetRotation * bounds.center; + objectCenter += targetRotation * state.identityBounds.center; switch (constraints) { case ConstrainedAxis.X: if (Vector3.Dot(rotation * Vector3.right, direction) > 0) - rayOffset *= -1; + projectedExtents *= -1; break; case ConstrainedAxis.Y: if (Vector3.Dot(rotation * Vector3.up, direction) > 0) - rayOffset *= -1; + projectedExtents *= -1; break; case ConstrainedAxis.Z: if (Vector3.Dot(rotation * Vector3.forward, direction) > 0) - rayOffset *= -1; + projectedExtents *= -1; break; } - axisRay.origin = objectCenter - rayOffset; + axisRay.origin = objectCenter - projectedExtents; boundsOffset = targetPosition - axisRay.origin; } @@ -579,7 +582,7 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V axisRay.direction *= -1; if (!pivotSnappingEnabled) { - axisRay.origin = objectCenter + rayOffset; + axisRay.origin = objectCenter + projectedExtents; boundsOffset = targetPosition - axisRay.origin; } From 9c118c862d46d9256bc793441e8e283fc15b3d14 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 12 Jun 2017 11:09:31 -0700 Subject: [PATCH 361/870] Add a timer for constrained snapping --- .../Modules/SnappingModule/SnappingModule.cs | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index c3811562d..c58416b8a 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -25,6 +25,7 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_ManipulatorGroundSnapMax = 0.15f; const float k_ManipulatorSurfaceSnapBreakDist = 0.2f; const float k_ManipulatorSurfaceSearchScale = 0.75f; + const float k_ConstrainedBreakTime = 0.4f; const float k_DirectSurfaceSearchScale = 1.1f; const float k_DirectSurfaceSnapBreakDist = 0.03f; @@ -53,6 +54,7 @@ class SnappingState public Vector3 currentPosition { get; set; } public bool groundSnapping { get; set; } public bool surfaceSnapping { get; set; } + public float lastSnapTime { get; set; } public Quaternion startRotation { get; private set; } public Bounds identityBounds { get; private set; } @@ -446,8 +448,6 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec var targetPosition = state.currentPosition; var targetRotation = state.startRotation; - GizmoModule.instance.DrawSphere(targetPosition, 1f, Color.red); - var camera = CameraUtils.GetMainCamera(); var breakScale = Vector3.Distance(camera.transform.position, targetPosition); @@ -480,10 +480,9 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec break; default: - manipulatorBreakDistance = Mathf.Max(manipulatorBreakDistance, (delta.magnitude / breakScale) / Time.deltaTime); + //manipulatorBreakDistance = Mathf.Max(manipulatorBreakDistance, (delta.magnitude / breakScale) / Time.deltaTime); if (ManipulatorSnapConstrained(ref position, ref rotation, direction, targetPosition, state, targetRotation, projectedExtents, manipulatorBreakDistance, constraints, pivotMode)) return true; - break; } } @@ -592,7 +591,7 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) return true; - if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance)) + if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance, true)) return true; return false; @@ -631,15 +630,22 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 return false; } - static bool TryBreakSurfaceSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance) + bool TryBreakSurfaceSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance, bool withTimer = false) { if (state.surfaceSnapping) { + if (state.lastSnapTime + k_ConstrainedBreakTime > Time.time) + { + GizmoModule.instance.DrawSphere(m_CurrentSurfaceSnappingPosition, 0.3f, Color.red); + return true; + } + if (Vector3.Distance(position, targetPosition) > breakDistance) { position = targetPosition; rotation = targetRotation; state.surfaceSnapping = false; + state.lastSnapTime = 0; } return true; @@ -687,6 +693,8 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp if (localOnly && Vector3.Distance(snappedPosition, targetPosition) > breakDistance) return false; + state.lastSnapTime = Time.time; + state.surfaceSnapping = true; state.groundSnapping = false; From 5e62734c78e07c2be0cf51fefae769d1f544c5a2 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 12 Jun 2017 13:58:41 -0700 Subject: [PATCH 362/870] Replace widget with a sphere and re-enable; Remove easing on manipulator transform when snapping --- .../{WidgetCenter.mat => Widget.mat} | 0 ...{WidgetCenter.mat.meta => Widget.mat.meta} | 0 .../SnappingModule/Materials/WidgetOuter.mat | 75 ----------- .../Materials/WidgetOuter.mat.meta | 8 -- .../SnappingModule/Prefabs/Widget.prefab | 122 +++--------------- .../Modules/SnappingModule/SnappingModule.cs | 44 ++++--- Tools/TransformTool/TransformTool.cs | 6 +- 7 files changed, 48 insertions(+), 207 deletions(-) rename Scripts/Modules/SnappingModule/Materials/{WidgetCenter.mat => Widget.mat} (100%) rename Scripts/Modules/SnappingModule/Materials/{WidgetCenter.mat.meta => Widget.mat.meta} (100%) delete mode 100644 Scripts/Modules/SnappingModule/Materials/WidgetOuter.mat delete mode 100644 Scripts/Modules/SnappingModule/Materials/WidgetOuter.mat.meta diff --git a/Scripts/Modules/SnappingModule/Materials/WidgetCenter.mat b/Scripts/Modules/SnappingModule/Materials/Widget.mat similarity index 100% rename from Scripts/Modules/SnappingModule/Materials/WidgetCenter.mat rename to Scripts/Modules/SnappingModule/Materials/Widget.mat diff --git a/Scripts/Modules/SnappingModule/Materials/WidgetCenter.mat.meta b/Scripts/Modules/SnappingModule/Materials/Widget.mat.meta similarity index 100% rename from Scripts/Modules/SnappingModule/Materials/WidgetCenter.mat.meta rename to Scripts/Modules/SnappingModule/Materials/Widget.mat.meta diff --git a/Scripts/Modules/SnappingModule/Materials/WidgetOuter.mat b/Scripts/Modules/SnappingModule/Materials/WidgetOuter.mat deleted file mode 100644 index d7e251492..000000000 --- a/Scripts/Modules/SnappingModule/Materials/WidgetOuter.mat +++ /dev/null @@ -1,75 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: WidgetOuter - m_Shader: {fileID: 4800000, guid: 17d79fd9a3d634a40ae219ffcf9befd4, type: 3} - m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF - m_LightmapFlags: 0 - m_EnableInstancingVariants: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _GlossMapScale: 0 - - _Glossiness: 0.5 - - _GlossyReflections: 0 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 1 - - _SpecularHighlights: 0 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 0.19679932, g: 0.5147059, b: 0.37000364, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Scripts/Modules/SnappingModule/Materials/WidgetOuter.mat.meta b/Scripts/Modules/SnappingModule/Materials/WidgetOuter.mat.meta deleted file mode 100644 index 420d329e0..000000000 --- a/Scripts/Modules/SnappingModule/Materials/WidgetOuter.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c22a2103e0fbf6041846d3ecb09a5476 -timeCreated: 1490126793 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Modules/SnappingModule/Prefabs/Widget.prefab b/Scripts/Modules/SnappingModule/Prefabs/Widget.prefab index 2a4cbed06..5047de9c1 100644 --- a/Scripts/Modules/SnappingModule/Prefabs/Widget.prefab +++ b/Scripts/Modules/SnappingModule/Prefabs/Widget.prefab @@ -11,23 +11,6 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 1000012520273730} m_IsPrefabParent: 1 ---- !u!1 &1000012109644610 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000012222931450} - - component: {fileID: 33000013906357358} - - component: {fileID: 23000013710866640} - m_Layer: 0 - m_Name: Cone - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000012520273730 GameObject: m_ObjectHideFlags: 0 @@ -36,6 +19,9 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000010520652132} + - component: {fileID: 33610698486094930} + - component: {fileID: 135219271835638626} + - component: {fileID: 23182554004850134} m_Layer: 0 m_Name: Widget m_TagString: Untagged @@ -43,23 +29,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013476533522 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000012588193340} - - component: {fileID: 33000010611606650} - - component: {fileID: 23000010139767550} - m_Layer: 0 - m_Name: Cylinder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!4 &4000010520652132 Transform: m_ObjectHideFlags: 1 @@ -69,44 +38,16 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4000012588193340} - - {fileID: 4000012222931450} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012222931450 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012109644610} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 2, z: 0} - m_LocalScale: {x: 0.12624495, y: 0.32507172, z: 0.12624495} - m_Children: [] - m_Father: {fileID: 4000010520652132} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012588193340 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013476533522} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: 0} - m_LocalScale: {x: 0.05, y: 1, z: 0.05} m_Children: [] - m_Father: {fileID: 4000010520652132} + m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23000010139767550 +--- !u!23 &23182554004850134 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013476533522} + m_GameObject: {fileID: 1000012520273730} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -133,49 +74,22 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000013710866640 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012109644610} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 20211bc20218fc944b7c691815f9400e, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &33000010611606650 +--- !u!33 &33610698486094930 MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013476533522} - m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33000013906357358 -MeshFilter: + m_GameObject: {fileID: 1000012520273730} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!135 &135219271835638626 +SphereCollider: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012109644610} - m_Mesh: {fileID: 4300000, guid: c28fa8d61f81fb742b1180a6d4516625, type: 3} + m_GameObject: {fileID: 1000012520273730} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index c58416b8a..7681c1f35 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -25,10 +25,10 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_ManipulatorGroundSnapMax = 0.15f; const float k_ManipulatorSurfaceSnapBreakDist = 0.2f; const float k_ManipulatorSurfaceSearchScale = 0.75f; - const float k_ConstrainedBreakTime = 0.4f; + const float k_ConstrainedBreakTime = 0.0f; const float k_DirectSurfaceSearchScale = 1.1f; - const float k_DirectSurfaceSnapBreakDist = 0.03f; + const float k_DirectSurfaceSnapBreakDist = 0.3f; const float k_DirectGroundSnapMin = 0.03f; const float k_DirectGroundSnapMax = 0.07f; @@ -54,7 +54,8 @@ class SnappingState public Vector3 currentPosition { get; set; } public bool groundSnapping { get; set; } public bool surfaceSnapping { get; set; } - public float lastSnapTime { get; set; } + public float snapStartTime { get; set; } + public bool firstFrame { get; set; } public Quaternion startRotation { get; private set; } public Bounds identityBounds { get; private set; } @@ -64,6 +65,7 @@ public SnappingState(Transform[] transforms, Vector3 position, Quaternion rotati { currentPosition = position; startRotation = rotation; + firstFrame = true; Bounds rotatedBounds; Bounds identityBounds; @@ -380,6 +382,8 @@ void Awake() m_Widget.SetActive(false); m_ButtonHighlightMaterialClone = Instantiate(m_ButtonHighlightMaterial); + + widgetEnabled = true; } public object OnSerializePreferences() @@ -396,7 +400,7 @@ void Update() { if (snappingEnabled) { - SnappingState surfaceSnapping = null; + var surfaceSnapping = false; var shouldActivateGroundPlane = false; foreach (var statesForRay in m_SnappingStates.Values) { @@ -406,16 +410,15 @@ void Update() shouldActivateGroundPlane = true; if (state.surfaceSnapping) - surfaceSnapping = state; + surfaceSnapping = true; } } m_GroundPlane.SetActive(shouldActivateGroundPlane); if (widgetEnabled) { - var shouldActivateWidget = surfaceSnapping != null; - m_Widget.SetActive(shouldActivateWidget); - if (shouldActivateWidget) + m_Widget.SetActive(surfaceSnapping); + if (surfaceSnapping) { var camera = CameraUtils.GetMainCamera(); var distanceToCamera = Vector3.Distance(camera.transform.position, m_CurrentSurfaceSnappingPosition); @@ -448,6 +451,8 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec var targetPosition = state.currentPosition; var targetRotation = state.startRotation; + //GizmoModule.instance.DrawSphere(targetPosition, 1f, Color.red); + var camera = CameraUtils.GetMainCamera(); var breakScale = Vector3.Distance(camera.transform.position, targetPosition); @@ -531,7 +536,7 @@ bool ManipulatorSnapToSurface(Transform rayOrigin, ref Vector3 position, ref Qua var pointerRay = new Ray(rayOrigin.position, rayOrigin.forward); return SnapToSurface(pointerRay, ref position, ref rotation, state, offset, targetPosition, targetRotation , rotationOffset, upVector, breakDistance, maxRayLength) - || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance); + || TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance); } bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, Vector3 direction, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, Vector3 projectedExtents, float breakDistance, ConstrainedAxis constraints, PivotMode pivotMode) @@ -591,7 +596,7 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) return true; - if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance, true)) + if (TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance, true)) return true; return false; @@ -624,28 +629,27 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 return true; } - if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) + if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) return true; return false; } - bool TryBreakSurfaceSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance, bool withTimer = false) + bool TryBreakSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance, bool withTimer = false) { + state.firstFrame = false; + if (state.surfaceSnapping) { - if (state.lastSnapTime + k_ConstrainedBreakTime > Time.time) - { - GizmoModule.instance.DrawSphere(m_CurrentSurfaceSnappingPosition, 0.3f, Color.red); + if (withTimer && state.snapStartTime + k_ConstrainedBreakTime > Time.time) return true; - } if (Vector3.Distance(position, targetPosition) > breakDistance) { position = targetPosition; rotation = targetRotation; state.surfaceSnapping = false; - state.lastSnapTime = 0; + state.snapStartTime = 0; } return true; @@ -680,6 +684,9 @@ void AddToIgnoreList(Transform[] transforms) bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, SnappingState state, Vector3 boundsOffset, Vector3 targetPosition, Quaternion targetRotation, Quaternion rotationOffset, Vector3 upVector, float breakDistance, float raycastDistance) { + if (state.surfaceSnapping && state.snapStartTime + k_ConstrainedBreakTime > Time.time) + return true; + RaycastHit hit; GameObject go; if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) @@ -693,7 +700,8 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp if (localOnly && Vector3.Distance(snappedPosition, targetPosition) > breakDistance) return false; - state.lastSnapTime = Time.time; + if (!state.surfaceSnapping && !state.firstFrame) + state.snapStartTime = Time.time; state.surfaceSnapping = true; state.groundSnapping = false; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index c7fadbcfe..21f7f02c0 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -195,6 +195,7 @@ public List actions Node m_ScaleFirstNode; float m_ScaleFactor; bool m_Scaling; + bool m_CurrentlySnapping; readonly TransformAction m_PivotModeToggleAction = new TransformAction(); readonly TransformAction m_PivotRotationToggleAction = new TransformAction(); @@ -447,7 +448,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var deltaTime = Time.deltaTime; var manipulatorTransform = manipulatorGameObject.transform; - manipulatorTransform.position = Vector3.Lerp(manipulatorTransform.position, m_TargetPosition, k_LazyFollowTranslate * deltaTime); + var lerp = m_CurrentlySnapping ? 1f : k_LazyFollowTranslate * deltaTime; + manipulatorTransform.position = Vector3.Lerp(manipulatorTransform.position, m_TargetPosition, lerp); if (m_PivotRotation == PivotRotation.Local) // Manipulator does not rotate when in global mode manipulatorTransform.rotation = Quaternion.Slerp(manipulatorTransform.rotation, m_TargetRotation, k_LazyFollowRotate * deltaTime); @@ -547,7 +549,7 @@ void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints) m_TargetPosition += delta; break; default: - this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); + m_CurrentlySnapping = this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); break; } } From 2c283fffceb5e7d5127d5e9fd979f20c9bf936fb Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 12 Jun 2017 16:01:32 -0700 Subject: [PATCH 363/870] Refine direct snapping after design review --- .../Modules/SnappingModule/SnappingModule.cs | 87 ++++++++++++++++--- Tools/TransformTool/TransformTool.cs | 8 +- 2 files changed, 78 insertions(+), 17 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 7681c1f35..8e586f5e4 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -27,10 +27,13 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_ManipulatorSurfaceSearchScale = 0.75f; const float k_ConstrainedBreakTime = 0.0f; - const float k_DirectSurfaceSearchScale = 1.1f; - const float k_DirectSurfaceSnapBreakDist = 0.3f; + const float k_DirectBreakDistance = 0.03f; + const float k_DirectSurfaceSearchScale = 0.75f; + const float k_DirectSurfaceSnapBreakScaleLow = 0.5f; + const float k_DirectSurfaceSnapBreakScaleHigh = 5f; const float k_DirectGroundSnapMin = 0.03f; const float k_DirectGroundSnapMax = 0.07f; + const float k_MaxRayDot = -0.5f; const float k_WidgetScale = 0.03f; @@ -172,7 +175,7 @@ class Preferences [SerializeField] bool m_RotationSnappingEnabled; [SerializeField] - bool m_LocalOnly; + bool m_LocalOnly = true; // Sources [SerializeField] @@ -237,7 +240,9 @@ public bool directSnappingEnabled readonly Dictionary> m_SnappingStates = new Dictionary>(); Vector3 m_CurrentSurfaceSnappingHit; Vector3 m_CurrentSurfaceSnappingPosition; + Vector3 m_CurrentSurfaceSnappingNormal; Quaternion m_CurrentSurfaceSnappingRotation; + GameObject m_CurrentSurfaceSnappingObject; public bool widgetEnabled { get; set; } @@ -507,7 +512,7 @@ public bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 pos var viewerScale = this.GetViewerScale(); var breakScale = viewerScale; - var breakDistance = breakScale * k_DirectSurfaceSnapBreakDist; + var breakDistance = breakScale * k_DirectBreakDistance; AddToIgnoreList(transform); if (surfaceSnappingEnabled && DirectSnapToSurface(ref position, ref rotation, targetPosition, state, targetRotation, breakDistance)) @@ -605,18 +610,36 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, float breakDistance) { var bounds = state.identityBounds; + + //if (state.surfaceSnapping) + //{ + // var directionVector = targetPosition - position; + // var boundsExtents = bounds.extents; + // var projectedExtents = Vector3.Project(boundsExtents, directionVector); + // var breakdist = breakDistance; + // if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; + // else + // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; + + // if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakdist)) + // return true; + //} + + var breakdist = breakDistance; + var directionVector = targetPosition - position; + var boundsExtents = bounds.extents; + var projectedExtents = Vector3.Project(boundsExtents, directionVector); var boundsCenter = bounds.center; for (var i = 0; i < k_Directions.Length; i++) { var direction = k_Directions[i]; var upVector = targetRotation * direction.upVector; - var directionVector = direction.direction; + directionVector = direction.direction; var rotationOffset = direction.rotationOffset; - var boundsRay = new Ray(targetPosition + targetRotation * boundsCenter, targetRotation * directionVector); - var boundsExtents = bounds.extents; - var projectedExtents = Vector3.Project(boundsExtents, directionVector); - var raycastDistance = projectedExtents.magnitude * k_DirectSurfaceSearchScale; + boundsExtents = bounds.extents; + projectedExtents = Vector3.Project(boundsExtents, directionVector); var offset = -boundsCenter; if (i > 2) offset -= projectedExtents; @@ -625,11 +648,36 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 offset = rotation * offset; - if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, raycastDistance)) + var raycastDistance = breakDistance * k_DirectSurfaceSearchScale; + + //if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; + //else + // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; + + if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + breakdist = breakDistance * k_DirectSurfaceSnapBreakScaleHigh; + else + breakdist = breakDistance * k_DirectSurfaceSnapBreakScaleLow; + + var boundsRay = new Ray(targetPosition - offset, targetRotation * directionVector); + + GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.yellow, raycastDistance); + + if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakdist, raycastDistance)) return true; } - if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) + directionVector = targetPosition - position; + boundsExtents = bounds.extents; + projectedExtents = Vector3.Project(boundsExtents, directionVector); + + if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; + else + breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; + + if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakdist)) return true; return false; @@ -639,6 +687,9 @@ bool TryBreakSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetP { state.firstFrame = false; + GizmoModule.instance.DrawRay(position, targetPosition - position, Color.blue, breakDistance); + GizmoModule.instance.DrawRay(position, targetPosition - position, Color.green, Vector3.Distance(position, targetPosition)); + if (state.surfaceSnapping) { if (withTimer && state.snapStartTime + k_ConstrainedBreakTime > Time.time) @@ -649,6 +700,8 @@ bool TryBreakSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetP position = targetPosition; rotation = targetRotation; state.surfaceSnapping = false; + m_CurrentSurfaceSnappingNormal = Vector3.up; + m_CurrentSurfaceSnappingObject = null; state.snapStartTime = 0; } @@ -684,15 +737,19 @@ void AddToIgnoreList(Transform[] transforms) bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, SnappingState state, Vector3 boundsOffset, Vector3 targetPosition, Quaternion targetRotation, Quaternion rotationOffset, Vector3 upVector, float breakDistance, float raycastDistance) { - if (state.surfaceSnapping && state.snapStartTime + k_ConstrainedBreakTime > Time.time) - return true; - RaycastHit hit; GameObject go; if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { + if (m_CurrentSurfaceSnappingObject != null && go != m_CurrentSurfaceSnappingObject) + return false; + + if (Vector3.Dot(ray.direction, hit.normal) > k_MaxRayDot) + return false; + var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; + m_CurrentSurfaceSnappingNormal = hit.normal; var hitPoint = hit.point; m_CurrentSurfaceSnappingHit = hitPoint; var snappedPosition = pivotSnappingEnabled ? hitPoint : hitPoint + boundsOffset; @@ -700,6 +757,8 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp if (localOnly && Vector3.Distance(snappedPosition, targetPosition) > breakDistance) return false; + m_CurrentSurfaceSnappingObject = go; + if (!state.surfaceSnapping && !state.firstFrame) state.snapStartTime = Time.time; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 21f7f02c0..1a4f3aea8 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -72,9 +72,11 @@ public void UpdatePositions(IUsesSnapping usesSnapping) if (usesSnapping.DirectSnap(rayOrigin, grabbedObject, ref position, ref rotation, targetPosition, targetRotation)) { - var deltaTime = Time.deltaTime; - grabbedObject.position = Vector3.Lerp(grabbedObject.position, position, k_DirectLazyFollowTranslate * deltaTime); - grabbedObject.rotation = Quaternion.Lerp(grabbedObject.rotation, rotation, k_DirectLazyFollowRotate * deltaTime); + //var deltaTime = Time.deltaTime; + //grabbedObject.position = Vector3.Lerp(grabbedObject.position, position, k_DirectLazyFollowTranslate * deltaTime); + //grabbedObject.rotation = Quaternion.Lerp(grabbedObject.rotation, rotation, k_DirectLazyFollowRotate * deltaTime); + grabbedObject.position = position; + grabbedObject.rotation = rotation; } else { From 2e60c1565d499c53fcb9ee66032bf06fbb39387e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 12 Jun 2017 17:26:16 -0700 Subject: [PATCH 364/870] Implement sliding on surfaces --- .../Modules/SnappingModule/SnappingModule.cs | 99 +++++++++++++------ 1 file changed, 67 insertions(+), 32 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 8e586f5e4..4e8e5af2e 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -243,6 +243,7 @@ public bool directSnappingEnabled Vector3 m_CurrentSurfaceSnappingNormal; Quaternion m_CurrentSurfaceSnappingRotation; GameObject m_CurrentSurfaceSnappingObject; + int m_CurrentSnappingDirection = -1; public bool widgetEnabled { get; set; } @@ -610,27 +611,56 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, float breakDistance) { var bounds = state.identityBounds; - - //if (state.surfaceSnapping) - //{ - // var directionVector = targetPosition - position; - // var boundsExtents = bounds.extents; - // var projectedExtents = Vector3.Project(boundsExtents, directionVector); - // var breakdist = breakDistance; - // if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) - // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; - // else - // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; - - // if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakdist)) - // return true; - //} + var boundsCenter = bounds.center; var breakdist = breakDistance; var directionVector = targetPosition - position; var boundsExtents = bounds.extents; var projectedExtents = Vector3.Project(boundsExtents, directionVector); - var boundsCenter = bounds.center; + + if (m_CurrentSnappingDirection > -1) + { + var direction = k_Directions[m_CurrentSnappingDirection]; + var upVector = targetRotation * direction.upVector; + directionVector = direction.direction; + var rotationOffset = direction.rotationOffset; + + boundsExtents = bounds.extents; + projectedExtents = Vector3.Project(boundsExtents, directionVector); + var offset = -boundsCenter; + if (m_CurrentSnappingDirection > 2) + offset -= projectedExtents; + else + offset += projectedExtents; + + offset = rotation * offset; + + //var raycastDistance = projectedExtents.magnitude * 2 + breakDistance * k_DirectSurfaceSearchScale; + breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude); + + if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + { + breakdist *= k_DirectSurfaceSnapBreakScaleHigh; + var raycastDistance = breakdist; + + //if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; + //else + // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; + + var boundsRay = new Ray(targetPosition - offset - rotation * direction.direction * (targetPosition - position).magnitude * 1.01f, targetRotation * directionVector); + + GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.blue, raycastDistance); + GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.green, (targetPosition - position).magnitude); + + if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakdist, raycastDistance)) + return true; + + if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakdist)) + return true; + } + } + for (var i = 0; i < k_Directions.Length; i++) { var direction = k_Directions[i]; @@ -648,36 +678,40 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 offset = rotation * offset; - var raycastDistance = breakDistance * k_DirectSurfaceSearchScale; + breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude); + var raycastDistance = breakdist * k_DirectSurfaceSearchScale; - //if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) - // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; + if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + breakdist *= k_DirectSurfaceSnapBreakScaleHigh; //else - // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; + // breakdist *= k_DirectSurfaceSnapBreakScaleLow; - if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) - breakdist = breakDistance * k_DirectSurfaceSnapBreakScaleHigh; - else - breakdist = breakDistance * k_DirectSurfaceSnapBreakScaleLow; + //if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + // breakdist = breakDistance * k_DirectSurfaceSnapBreakScaleHigh; + //else + // breakdist = breakDistance * k_DirectSurfaceSnapBreakScaleLow; var boundsRay = new Ray(targetPosition - offset, targetRotation * directionVector); GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.yellow, raycastDistance); if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakdist, raycastDistance)) + { + m_CurrentSnappingDirection = i; return true; + } } - directionVector = targetPosition - position; - boundsExtents = bounds.extents; - projectedExtents = Vector3.Project(boundsExtents, directionVector); + //directionVector = targetPosition - position; + //boundsExtents = bounds.extents; + //projectedExtents = Vector3.Project(boundsExtents, directionVector); - if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) - breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; - else - breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; + //if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; + //else + // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; - if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakdist)) + if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) return true; return false; @@ -702,6 +736,7 @@ bool TryBreakSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetP state.surfaceSnapping = false; m_CurrentSurfaceSnappingNormal = Vector3.up; m_CurrentSurfaceSnappingObject = null; + m_CurrentSnappingDirection = -1; state.snapStartTime = 0; } From 651aeb4e10bb317f1a759d7b79a659040ed4eb37 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 11:46:22 -0700 Subject: [PATCH 365/870] Make HapticPulse public --- Scripts/Modules/HapticsModule/HapticPulse.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Modules/HapticsModule/HapticPulse.cs b/Scripts/Modules/HapticsModule/HapticPulse.cs index 53c6bd722..862d2b465 100644 --- a/Scripts/Modules/HapticsModule/HapticPulse.cs +++ b/Scripts/Modules/HapticsModule/HapticPulse.cs @@ -3,7 +3,7 @@ namespace UnityEditor.Experimental.EditorVR.Core { - class HapticPulse : ScriptableObject + public class HapticPulse : ScriptableObject { [SerializeField] [Range(0.001f, 1f)] From c7f1a3fa4fd87e441a0026c6a461b69f6a242a68 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 11:47:31 -0700 Subject: [PATCH 366/870] Add PinnedToolButton haptic pulses --- Menus/PinnedToolButton/HapticPulses.meta | 9 +++++++++ .../HapticPulses/ClickPulse.asset | 17 +++++++++++++++++ .../HapticPulses/ClickPulse.asset.meta | 9 +++++++++ .../HapticPulses/HoverPulse.asset | 17 +++++++++++++++++ .../HapticPulses/HoverPulse.asset.meta | 9 +++++++++ 5 files changed, 61 insertions(+) create mode 100644 Menus/PinnedToolButton/HapticPulses.meta create mode 100644 Menus/PinnedToolButton/HapticPulses/ClickPulse.asset create mode 100644 Menus/PinnedToolButton/HapticPulses/ClickPulse.asset.meta create mode 100644 Menus/PinnedToolButton/HapticPulses/HoverPulse.asset create mode 100644 Menus/PinnedToolButton/HapticPulses/HoverPulse.asset.meta diff --git a/Menus/PinnedToolButton/HapticPulses.meta b/Menus/PinnedToolButton/HapticPulses.meta new file mode 100644 index 000000000..4ff1709b5 --- /dev/null +++ b/Menus/PinnedToolButton/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d30a6ebaf8ecac9459419f0f9aaf318f +folderAsset: yes +timeCreated: 1496975243 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset b/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset new file mode 100644 index 000000000..472e131ad --- /dev/null +++ b/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: ClickPulse + m_EditorClassIdentifier: + m_Duration: 0.5 + m_Intensity: 0.2 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset.meta b/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset.meta new file mode 100644 index 000000000..950984b33 --- /dev/null +++ b/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 90be55fd9292d1e4eb8af66c479333b6 +timeCreated: 1496975270 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset b/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset new file mode 100644 index 000000000..2bafd1c7d --- /dev/null +++ b/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: HoverPulse + m_EditorClassIdentifier: + m_Duration: 0.005 + m_Intensity: 0.2 + m_FadeIn: 0 + m_FadeOut: 0 diff --git a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset.meta b/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset.meta new file mode 100644 index 000000000..c180c7437 --- /dev/null +++ b/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 53f100a1dd0839141bcace2ecd8cc6b1 +timeCreated: 1496975334 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 68866c0b17ce2df57121a86dc775af1aec77377e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 11:48:25 -0700 Subject: [PATCH 367/870] Add MainMenu haptic pulses --- Menus/MainMenu/HapticPulses.meta | 9 +++++++++ .../HapticPulses/FaceRotationPulse.asset | 17 +++++++++++++++++ .../HapticPulses/FaceRotationPulse.asset.meta | 9 +++++++++ Menus/MainMenu/HapticPulses/HideMenuPulse.asset | 17 +++++++++++++++++ .../HapticPulses/HideMenuPulse.asset.meta | 9 +++++++++ .../MainMenuActivatorHoverPulse.asset | 17 +++++++++++++++++ .../MainMenuActivatorHoverPulse.asset.meta | 9 +++++++++ .../HapticPulses/MainMenuButtonClickPulse.asset | 17 +++++++++++++++++ .../MainMenuButtonClickPulse.asset.meta | 9 +++++++++ .../HapticPulses/MainMenuButtonHoverPulse.asset | 17 +++++++++++++++++ .../MainMenuButtonHoverPulse.asset.meta | 9 +++++++++ 11 files changed, 139 insertions(+) create mode 100644 Menus/MainMenu/HapticPulses.meta create mode 100644 Menus/MainMenu/HapticPulses/FaceRotationPulse.asset create mode 100644 Menus/MainMenu/HapticPulses/FaceRotationPulse.asset.meta create mode 100644 Menus/MainMenu/HapticPulses/HideMenuPulse.asset create mode 100644 Menus/MainMenu/HapticPulses/HideMenuPulse.asset.meta create mode 100644 Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset create mode 100644 Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset.meta create mode 100644 Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset create mode 100644 Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset.meta create mode 100644 Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset create mode 100644 Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset.meta diff --git a/Menus/MainMenu/HapticPulses.meta b/Menus/MainMenu/HapticPulses.meta new file mode 100644 index 000000000..5ea57b45c --- /dev/null +++ b/Menus/MainMenu/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2f9651f27c885824ebcbae5628c00d91 +folderAsset: yes +timeCreated: 1496968378 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset b/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset new file mode 100644 index 000000000..7b73cbb01 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: FaceRotationPulse + m_EditorClassIdentifier: + m_Duration: 0.5 + m_Intensity: 0.055 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset.meta b/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset.meta new file mode 100644 index 000000000..a98aaa076 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f5f56317312943d4da218b9b2e6ea9d0 +timeCreated: 1496967975 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/MainMenu/HapticPulses/HideMenuPulse.asset b/Menus/MainMenu/HapticPulses/HideMenuPulse.asset new file mode 100644 index 000000000..6caa84382 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/HideMenuPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: HideMenuPulse + m_EditorClassIdentifier: + m_Duration: 0.75 + m_Intensity: 0.075 + m_FadeIn: 0 + m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/HideMenuPulse.asset.meta b/Menus/MainMenu/HapticPulses/HideMenuPulse.asset.meta new file mode 100644 index 000000000..7c757828a --- /dev/null +++ b/Menus/MainMenu/HapticPulses/HideMenuPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 29832200cc7e1744b9e98febd6d30db8 +timeCreated: 1496968454 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset new file mode 100644 index 000000000..cdda7adc7 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: MainMenuActivatorHoverPulse + m_EditorClassIdentifier: + m_Duration: 0.005 + m_Intensity: 0.2 + m_FadeIn: 0 + m_FadeOut: 0 diff --git a/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset.meta b/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset.meta new file mode 100644 index 000000000..f79bcda05 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d4ac399f781bc824c8c1392fb126398e +timeCreated: 1496974798 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset new file mode 100644 index 000000000..082a7d134 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: MainMenuButtonClickPulse + m_EditorClassIdentifier: + m_Duration: 0.5 + m_Intensity: 0.095 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset.meta b/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset.meta new file mode 100644 index 000000000..b7e812135 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f66cb0a158f54124aa4158bbad3ed702 +timeCreated: 1496973814 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset new file mode 100644 index 000000000..7050b9cfe --- /dev/null +++ b/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: MainMenuButtonHoverPulse + m_EditorClassIdentifier: + m_Duration: 0.005 + m_Intensity: 0.175 + m_FadeIn: 0 + m_FadeOut: 0 diff --git a/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset.meta b/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset.meta new file mode 100644 index 000000000..0a2a195d8 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: dd561ccb8162d1040adba0a7ea60eadc +timeCreated: 1496973884 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From f524449fc4db55248883c6745447e0dfc6511025 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 14:21:08 -0700 Subject: [PATCH 368/870] Add Radial Menu haptic pulses --- Menus/RadialMenu/HapticPulses.meta | 9 +++++++++ .../HapticPulses/HighlightedPulse.asset | 17 +++++++++++++++++ .../HapticPulses/HighlightedPulse.asset.meta | 9 +++++++++ .../RadialMenu/HapticPulses/ReleasedPulse.asset | 17 +++++++++++++++++ .../HapticPulses/ReleasedPulse.asset.meta | 9 +++++++++ .../HapticPulses/SelectionOccurred.asset | 17 +++++++++++++++++ .../HapticPulses/SelectionOccurred.asset.meta | 9 +++++++++ 7 files changed, 87 insertions(+) create mode 100644 Menus/RadialMenu/HapticPulses.meta create mode 100644 Menus/RadialMenu/HapticPulses/HighlightedPulse.asset create mode 100644 Menus/RadialMenu/HapticPulses/HighlightedPulse.asset.meta create mode 100644 Menus/RadialMenu/HapticPulses/ReleasedPulse.asset create mode 100644 Menus/RadialMenu/HapticPulses/ReleasedPulse.asset.meta create mode 100644 Menus/RadialMenu/HapticPulses/SelectionOccurred.asset create mode 100644 Menus/RadialMenu/HapticPulses/SelectionOccurred.asset.meta diff --git a/Menus/RadialMenu/HapticPulses.meta b/Menus/RadialMenu/HapticPulses.meta new file mode 100644 index 000000000..bfece2d54 --- /dev/null +++ b/Menus/RadialMenu/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ffc91ab52d5dd1d47972f4921b81bd7c +folderAsset: yes +timeCreated: 1497386216 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/RadialMenu/HapticPulses/HighlightedPulse.asset b/Menus/RadialMenu/HapticPulses/HighlightedPulse.asset new file mode 100644 index 000000000..0c3071fe8 --- /dev/null +++ b/Menus/RadialMenu/HapticPulses/HighlightedPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: HighlightedPulse + m_EditorClassIdentifier: + m_Duration: 0.005 + m_Intensity: 0.2 + m_FadeIn: 0 + m_FadeOut: 0 diff --git a/Menus/RadialMenu/HapticPulses/HighlightedPulse.asset.meta b/Menus/RadialMenu/HapticPulses/HighlightedPulse.asset.meta new file mode 100644 index 000000000..2de04bd11 --- /dev/null +++ b/Menus/RadialMenu/HapticPulses/HighlightedPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f4d6d7970557c44408a22ad5f3bce270 +timeCreated: 1497388681 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/RadialMenu/HapticPulses/ReleasedPulse.asset b/Menus/RadialMenu/HapticPulses/ReleasedPulse.asset new file mode 100644 index 000000000..f1cd42a0a --- /dev/null +++ b/Menus/RadialMenu/HapticPulses/ReleasedPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: ReleasedPulse + m_EditorClassIdentifier: + m_Duration: 0.5 + m_Intensity: 0.1 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Menus/RadialMenu/HapticPulses/ReleasedPulse.asset.meta b/Menus/RadialMenu/HapticPulses/ReleasedPulse.asset.meta new file mode 100644 index 000000000..0644b19d9 --- /dev/null +++ b/Menus/RadialMenu/HapticPulses/ReleasedPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a6ee67beed128b24cb4ab7a7399d6584 +timeCreated: 1497388663 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/RadialMenu/HapticPulses/SelectionOccurred.asset b/Menus/RadialMenu/HapticPulses/SelectionOccurred.asset new file mode 100644 index 000000000..0649036f1 --- /dev/null +++ b/Menus/RadialMenu/HapticPulses/SelectionOccurred.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: SelectionOccurred + m_EditorClassIdentifier: + m_Duration: 0.5 + m_Intensity: 0.1 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Menus/RadialMenu/HapticPulses/SelectionOccurred.asset.meta b/Menus/RadialMenu/HapticPulses/SelectionOccurred.asset.meta new file mode 100644 index 000000000..03ae22612 --- /dev/null +++ b/Menus/RadialMenu/HapticPulses/SelectionOccurred.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d86223b7a32efef4b89034ed0b2b2a29 +timeCreated: 1497388701 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 3325a05863fd6ac407da33d723fcd0fc9fd32d60 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 14:36:50 -0700 Subject: [PATCH 369/870] Convert MainMenuActivator haptics to support new Pulse format. --- Scripts/UI/MainMenuActivator.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index 005faf8d1..d5f7b3f3e 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; @@ -52,9 +53,13 @@ public bool activatorButtonMoveAway [SerializeField] Transform m_Icon; + [SerializeField] Transform m_HighlightedPRS; + [SerializeField] + HapticPulse m_HoverPulse; + Vector3 m_OriginalActivatorIconLocalScale; Vector3 m_OriginalActivatorIconLocalPosition; Vector3 m_HighlightedActivatorIconLocalScale; @@ -85,7 +90,7 @@ public void OnPointerEnter(PointerEventData eventData) m_HighlightCoroutine = null; m_HighlightCoroutine = StartCoroutine(Highlight()); - this.Pulse(rayOrigin, 0.005f, 0.2f); + this.Pulse(rayOrigin, m_HoverPulse); } public void OnPointerExit(PointerEventData eventData) From ca7f9d2f37d306da1120634c7e0d6857af4bba8a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 14:38:52 -0700 Subject: [PATCH 370/870] Convert WorkspaceButton haptics to support new Pulse format. --- Workspaces/Common/Scripts/WorkspaceButton.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index ae4b9ab19..1d367e23c 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR using System.Collections; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Modules; @@ -134,6 +135,12 @@ public bool alternateIconVisible [Range(0f, 2f)] float m_DelayBeforeReveal = 0.25f; + [SerializeField] + HapticPulse m_ClickPulse; + + [SerializeField] + HapticPulse m_HighlightPulse; + GradientPair m_OriginalGradientPair; GradientPair m_HighlightGradientPair; Transform m_RayOrigin; @@ -321,7 +328,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.Pulse(m_RayOrigin, 0.005f, 0.175f); + this.Pulse(m_RayOrigin, m_HighlightPulse); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); @@ -473,7 +480,7 @@ void SwapIconSprite() void OnButtonClicked() { - this.Pulse(m_RayOrigin, 0.25f, 0.15f, true, true); + this.Pulse(m_RayOrigin, m_ClickPulse); } } } From a5fa252375a911645c5750b0c4f83efdc89fa445 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 14:41:48 -0700 Subject: [PATCH 371/870] Convert MainMenuButton haptics to support new Pulse format. --- Menus/MainMenu/Scripts/MainMenuButton.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 194c501e7..21b0e06ab 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; using UnityEngine.EventSystems; @@ -14,9 +15,16 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnte [SerializeField] private Text m_ButtonDescription; + [SerializeField] private Text m_ButtonTitle; + [SerializeField] + HapticPulse m_ClickPulse; + + [SerializeField] + HapticPulse m_HoverPulse; + Color m_OriginalColor; Transform m_RayOrigin; @@ -24,7 +32,7 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnte public void OnPointerClick(PointerEventData eventData) { - this.Pulse(m_RayOrigin, 0.5f, 0.095f, true, true); + this.Pulse(m_RayOrigin, m_ClickPulse); } public bool selected @@ -63,7 +71,7 @@ public void SetData(string name, string description) public void OnRayEnter(RayEventData eventData) { m_RayOrigin = eventData.rayOrigin; - this.Pulse(eventData.rayOrigin, 0.005f, 0.175f); + this.Pulse(eventData.rayOrigin, m_HoverPulse); } public void OnRayExit(RayEventData eventData) From 2fdb49a516b0f4a1d76424173dbc89a1cae944dc Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 14:42:40 -0700 Subject: [PATCH 372/870] Convert ListViewControllerBase haptics to support new Pulse format. --- Scripts/ListView/ListViewControllerBase.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index ba887bfbe..ebc00ab42 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Core; using UnityEngine; using UnityEngine.EventSystems; @@ -30,6 +31,9 @@ public abstract class ListViewControllerBase : MonoBehaviour, IScrollHandler, IC [SerializeField] protected GameObject[] m_Templates; + [SerializeField] + HapticPulse m_ScrollPulse; + [SerializeField] protected float m_SettleSpeed = 0.4f; @@ -83,7 +87,7 @@ void Update() UpdateView(); if (m_Scrolling) - this.Pulse(null, 0.25f, 0.055f, false, true); + this.Pulse(null, m_ScrollPulse); } protected abstract void Setup(); From 22243b98736dff8e0e91814dcf416a4972e678c7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 14:43:34 -0700 Subject: [PATCH 373/870] Convert RadialMenuUI haptics to support new Pulse format. --- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index 495631d5b..f4e86d3b0 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -21,6 +22,9 @@ sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IControlHaptics [SerializeField] Transform m_SlotContainer; + [SerializeField] + HapticPulse m_SelectionPulse; + List m_RadialMenuSlots; Coroutine m_VisibilityCoroutine; RadialMenuSlot m_HighlightedButton; @@ -336,7 +340,7 @@ public void SelectionOccurred() if (m_HighlightedButton != null) m_HighlightedButton.button.onClick.Invoke(); - this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); + this.Pulse(rayOrigin, m_SelectionPulse); } } } From 8ff1b916b2c1009b0075f50d6bdba453ec40980a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 14:44:10 -0700 Subject: [PATCH 374/870] Convert RadialMenuSlot haptics to support new Pulse format. --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index c78541b6b..492318b73 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR using System.Collections; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Modules; @@ -44,6 +45,9 @@ sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, IT [SerializeField] MeshRenderer m_FrameRenderer; + [SerializeField] + HapticPulse m_HighlightedPulse; + public Transform tooltipTarget { get { return m_TooltipTarget; } } [SerializeField] Transform m_TooltipTarget; @@ -89,7 +93,7 @@ public bool highlighted if (m_HighlightCoroutine == null) m_HighlightCoroutine = StartCoroutine(Highlight()); - this.Pulse(rayOrigin, 0.005f, 0.2f); + this.Pulse(rayOrigin, m_HighlightedPulse); } else { From 55878317f2169166540a38bc6398ba3937a87644 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 14:49:26 -0700 Subject: [PATCH 375/870] Convert RadialMenu haptics to support new Pulse format. --- Menus/RadialMenu/RadialMenu.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index 6934d0ae3..153c44ffb 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Core; using UnityEngine; using UnityEngine.InputNew; @@ -14,7 +15,10 @@ sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMe [SerializeField] RadialMenuUI m_RadialMenuPrefab; - + + [SerializeField] + HapticPulse m_ReleasePulse; + RadialMenuUI m_RadialMenuUI; public List menuActions @@ -103,7 +107,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (radialMenuInput.selectItem.wasJustReleased) { - this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); + this.Pulse(rayOrigin, m_ReleasePulse); m_RadialMenuUI.SelectionOccurred(); From 0911f0c25bcfb09ffe9fa85bcd0d578bcfb2505b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 15:00:52 -0700 Subject: [PATCH 376/870] Convert MainMenu + UI haptics to support new Pulse format. --- Menus/MainMenu/MainMenu.cs | 7 ++++++- Menus/MainMenu/Scripts/MainMenuUI.cs | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index a86c953d5..c0de73048 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEditor.Experimental.EditorVR.Workspaces; @@ -61,6 +62,7 @@ public bool visible [SerializeField] MainMenuUI m_MainMenuPrefab; + HapticPulse m_FaceRotationPulse; // Not set in inspector, due to instantiation order MainMenuUI m_MainMenuUI; float m_LastRotationInput; readonly Dictionary m_ToolButtons = new Dictionary(); @@ -84,6 +86,9 @@ void Start() m_MainMenuUI.Setup(); m_MainMenuUI.visible = m_Visible; + // Pulse reference is set on the UI prefab. Fetching & cacheing for local use. + m_FaceRotationPulse = m_MainMenuUI.faceRotationPulse; + CreateFaceButtons(menuTools); CreateFaceButtons(menuWorkspaces); CreateFaceButtons(settingsMenuProviders.Keys.ToList()); @@ -104,7 +109,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon || mainMenuInput.flickFace.wasJustReleased) { m_MainMenuUI.targetFaceIndex += (int)Mathf.Sign(rotationInput); - this.Pulse(rayOrigin, 0.5f, 0.055f, true, true); + this.Pulse(rayOrigin, m_FaceRotationPulse); consumeControl(mainMenuInput.flickFace); } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 400f74501..dade33c20 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Utilities; @@ -51,6 +52,15 @@ enum VisibilityState [SerializeField] Transform m_AlternateMenu; + [SerializeField] + HapticPulse m_RotatePulse; + + [SerializeField] + HapticPulse m_ShowPulse; + + [SerializeField] + HapticPulse m_HidePulse; + public int targetFaceIndex { get { return m_TargetFaceIndex; } @@ -130,6 +140,8 @@ public Transform alternateMenuOrigin public Transform rayOrigin { get; set; } + public HapticPulse faceRotationPulse { get { return m_RotatePulse; } } + public bool visible { get { return m_VisibilityState == VisibilityState.Visible || m_VisibilityState == VisibilityState.TransitioningIn; } @@ -401,7 +413,7 @@ IEnumerator AnimateShow() m_VisibilityState = VisibilityState.TransitioningIn; - this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); + this.Pulse(rayOrigin, m_ShowPulse); foreach (var face in m_MenuFaces) { @@ -444,7 +456,7 @@ IEnumerator AnimateHide() m_VisibilityState = VisibilityState.TransitioningOut; - this.Pulse(rayOrigin, 0.75f, 0.075f, false, true); + this.Pulse(rayOrigin, m_HidePulse); foreach (var face in m_MenuFaces) { From c4cd0e6bc0f5724d43212a9b98b40b7bddc08b63 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 15:02:22 -0700 Subject: [PATCH 377/870] Convert WorkSpaceUI haptics to support new Pulse format. --- Workspaces/Base/WorkspaceUI.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 54453eedc..787e9a0df 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Handles; using UnityEditor.Experimental.EditorVR.Helpers; @@ -128,6 +129,15 @@ sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGe [SerializeField] bool m_DynamicFaceAdjustment = true; + [SerializeField] + static HapticPulse m_ResizePulse; // remove static + + [SerializeField] + static HapticPulse m_MovePulse; // remove static + + [SerializeField] + HapticPulse m_FrameThicknessPulse; // remove static + Bounds m_Bounds; float? m_TopPanelDividerOffset; @@ -245,12 +255,12 @@ public void OnDragging() + transform.forward * (absForward - (currentExtents.z - extents.z)) * Mathf.Sign(positionOffsetForward); m_WorkspaceUI.transform.parent.position = m_PositionStart + positionOffset * viewerScale; - m_WorkspaceUI.Pulse(rayOrigin, 0.25f, 0.35f, true, true); + m_WorkspaceUI.Pulse(rayOrigin, m_ResizePulse); } else { MathUtilsExt.SetTransformOffset(rayOrigin, m_WorkspaceUI.transform.parent, m_PositionOffset, m_RotationOffset); - m_WorkspaceUI.Pulse(rayOrigin, 0.25f, 0.075f, false, true); + m_WorkspaceUI.Pulse(rayOrigin, m_MovePulse); } } } @@ -818,7 +828,7 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount, Transform rayOrigin) // If hovering the frame, and not dragging, perform haptic feedback if (m_HovereringRayOrigins.Count > 0 && m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.Pulse(rayOrigin, 0.8f, 0.065f, true, true); + this.Pulse(rayOrigin, m_FrameThicknessPulse); m_FrameThicknessCoroutine = null; } From 160595bb0ee40ac2d280e202efcf6378b743bd56 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 15:04:09 -0700 Subject: [PATCH 378/870] Add MainMenu ShowMenu haptic pulse --- Menus/MainMenu/HapticPulses/ShowMenuPulse.asset | 17 +++++++++++++++++ .../HapticPulses/ShowMenuPulse.asset.meta | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 Menus/MainMenu/HapticPulses/ShowMenuPulse.asset create mode 100644 Menus/MainMenu/HapticPulses/ShowMenuPulse.asset.meta diff --git a/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset b/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset new file mode 100644 index 000000000..1e28033cc --- /dev/null +++ b/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: ShowMenuPulse + m_EditorClassIdentifier: + m_Duration: 0.5 + m_Intensity: 0.1 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset.meta b/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset.meta new file mode 100644 index 000000000..3f4f91f00 --- /dev/null +++ b/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7c69a56582b55ec41b36b49c44a42905 +timeCreated: 1496968525 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From c0c4578482111bac39377ca2230069cf929273c9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 16:29:46 -0700 Subject: [PATCH 379/870] Remove HapticModule pulses folder meta --- Scripts/Modules/HapticsModule/Pulses.meta | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 Scripts/Modules/HapticsModule/Pulses.meta diff --git a/Scripts/Modules/HapticsModule/Pulses.meta b/Scripts/Modules/HapticsModule/Pulses.meta deleted file mode 100644 index 7890898f4..000000000 --- a/Scripts/Modules/HapticsModule/Pulses.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: d44588d45192ffc40b08d6b78ace2e62 -folderAsset: yes -timeCreated: 1496959557 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: From a4f97166f82d7d5ea9f411cc75199dfb7206237f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 16:31:05 -0700 Subject: [PATCH 380/870] Move PinnedToolButton related contents into their own Menus folder --- Menus/PinnedToolButton.meta | 9 +++++++++ Menus/PinnedToolButton/Materials.meta | 9 +++++++++ .../PinnedToolButton}/Materials/PinnedToolButton.mat | 0 .../Materials/PinnedToolButton.mat.meta | 0 .../Materials/PinnedToolButtonBorder.mat | 0 .../Materials/PinnedToolButtonBorder.mat.meta | 0 .../Materials/PinnedToolButtonFaceMask.mat | 0 .../Materials/PinnedToolButtonFaceMask.mat.meta | 0 .../Materials/PinnedToolButtonUIContent.mat | 0 .../Materials/PinnedToolButtonUIContent.mat.meta | 0 .../UI => Menus/PinnedToolButton}/PinnedToolButton.cs | 11 +++++++++-- .../PinnedToolButton}/PinnedToolButton.cs.meta | 0 .../PinnedToolButton}/PinnedToolButton.prefab | 0 .../PinnedToolButton}/PinnedToolButton.prefab.meta | 0 14 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 Menus/PinnedToolButton.meta create mode 100644 Menus/PinnedToolButton/Materials.meta rename {Prefabs/UI => Menus/PinnedToolButton}/Materials/PinnedToolButton.mat (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/Materials/PinnedToolButton.mat.meta (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/Materials/PinnedToolButtonBorder.mat (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/Materials/PinnedToolButtonBorder.mat.meta (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/Materials/PinnedToolButtonFaceMask.mat (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/Materials/PinnedToolButtonFaceMask.mat.meta (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/Materials/PinnedToolButtonUIContent.mat (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/Materials/PinnedToolButtonUIContent.mat.meta (100%) rename {Scripts/UI => Menus/PinnedToolButton}/PinnedToolButton.cs (89%) rename {Scripts/UI => Menus/PinnedToolButton}/PinnedToolButton.cs.meta (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/PinnedToolButton.prefab (100%) rename {Prefabs/UI => Menus/PinnedToolButton}/PinnedToolButton.prefab.meta (100%) diff --git a/Menus/PinnedToolButton.meta b/Menus/PinnedToolButton.meta new file mode 100644 index 000000000..403732562 --- /dev/null +++ b/Menus/PinnedToolButton.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7746387eca80e444a883a4e9337c4769 +folderAsset: yes +timeCreated: 1496975208 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolButton/Materials.meta b/Menus/PinnedToolButton/Materials.meta new file mode 100644 index 000000000..90ab8b9b8 --- /dev/null +++ b/Menus/PinnedToolButton/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6fc5feafe95478747ad1fd7d8f61f26f +folderAsset: yes +timeCreated: 1496975228 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/UI/Materials/PinnedToolButton.mat b/Menus/PinnedToolButton/Materials/PinnedToolButton.mat similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButton.mat rename to Menus/PinnedToolButton/Materials/PinnedToolButton.mat diff --git a/Prefabs/UI/Materials/PinnedToolButton.mat.meta b/Menus/PinnedToolButton/Materials/PinnedToolButton.mat.meta similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButton.mat.meta rename to Menus/PinnedToolButton/Materials/PinnedToolButton.mat.meta diff --git a/Prefabs/UI/Materials/PinnedToolButtonBorder.mat b/Menus/PinnedToolButton/Materials/PinnedToolButtonBorder.mat similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButtonBorder.mat rename to Menus/PinnedToolButton/Materials/PinnedToolButtonBorder.mat diff --git a/Prefabs/UI/Materials/PinnedToolButtonBorder.mat.meta b/Menus/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButtonBorder.mat.meta rename to Menus/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta diff --git a/Prefabs/UI/Materials/PinnedToolButtonFaceMask.mat b/Menus/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButtonFaceMask.mat rename to Menus/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat diff --git a/Prefabs/UI/Materials/PinnedToolButtonFaceMask.mat.meta b/Menus/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButtonFaceMask.mat.meta rename to Menus/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta diff --git a/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat b/Menus/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButtonUIContent.mat rename to Menus/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat diff --git a/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat.meta b/Menus/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButtonUIContent.mat.meta rename to Menus/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta diff --git a/Scripts/UI/PinnedToolButton.cs b/Menus/PinnedToolButton/PinnedToolButton.cs similarity index 89% rename from Scripts/UI/PinnedToolButton.cs rename to Menus/PinnedToolButton/PinnedToolButton.cs index ff33708e1..f629a02d7 100644 --- a/Scripts/UI/PinnedToolButton.cs +++ b/Menus/PinnedToolButton/PinnedToolButton.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Text; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -34,6 +35,12 @@ public Type toolType [SerializeField] GradientButton m_GradientButton; + [SerializeField] + HapticPulse m_HoverPulse; + + [SerializeField] + HapticPulse m_ClickPulse; + public Transform rayOrigin { get; set; } void Start() @@ -45,12 +52,12 @@ void Start() void OnClick() { SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); - this.Pulse(rayOrigin, 0.5f, 0.2f, true, true); + this.Pulse(rayOrigin, m_ClickPulse); } public void OnPointerEnter(PointerEventData eventData) { - this.Pulse(rayOrigin, 0.005f, 0.2f); + this.Pulse(rayOrigin, m_HoverPulse); } // Create periodic table-style names for types diff --git a/Scripts/UI/PinnedToolButton.cs.meta b/Menus/PinnedToolButton/PinnedToolButton.cs.meta similarity index 100% rename from Scripts/UI/PinnedToolButton.cs.meta rename to Menus/PinnedToolButton/PinnedToolButton.cs.meta diff --git a/Prefabs/UI/PinnedToolButton.prefab b/Menus/PinnedToolButton/PinnedToolButton.prefab similarity index 100% rename from Prefabs/UI/PinnedToolButton.prefab rename to Menus/PinnedToolButton/PinnedToolButton.prefab diff --git a/Prefabs/UI/PinnedToolButton.prefab.meta b/Menus/PinnedToolButton/PinnedToolButton.prefab.meta similarity index 100% rename from Prefabs/UI/PinnedToolButton.prefab.meta rename to Menus/PinnedToolButton/PinnedToolButton.prefab.meta From e1170b4d5365756e1118878124485d01603a77ee Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 16:34:42 -0700 Subject: [PATCH 381/870] Make Haptic Pulse naming uniform --- .../HapticPulses/{HighlightedPulse.asset => HighlightPulse.asset} | 0 .../{HighlightedPulse.asset.meta => HighlightPulse.asset.meta} | 0 .../HapticPulses/{ReleasedPulse.asset => ReleasePulse.asset} | 0 .../{ReleasedPulse.asset.meta => ReleasePulse.asset.meta} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename Menus/RadialMenu/HapticPulses/{HighlightedPulse.asset => HighlightPulse.asset} (100%) rename Menus/RadialMenu/HapticPulses/{HighlightedPulse.asset.meta => HighlightPulse.asset.meta} (100%) rename Menus/RadialMenu/HapticPulses/{ReleasedPulse.asset => ReleasePulse.asset} (100%) rename Menus/RadialMenu/HapticPulses/{ReleasedPulse.asset.meta => ReleasePulse.asset.meta} (100%) diff --git a/Menus/RadialMenu/HapticPulses/HighlightedPulse.asset b/Menus/RadialMenu/HapticPulses/HighlightPulse.asset similarity index 100% rename from Menus/RadialMenu/HapticPulses/HighlightedPulse.asset rename to Menus/RadialMenu/HapticPulses/HighlightPulse.asset diff --git a/Menus/RadialMenu/HapticPulses/HighlightedPulse.asset.meta b/Menus/RadialMenu/HapticPulses/HighlightPulse.asset.meta similarity index 100% rename from Menus/RadialMenu/HapticPulses/HighlightedPulse.asset.meta rename to Menus/RadialMenu/HapticPulses/HighlightPulse.asset.meta diff --git a/Menus/RadialMenu/HapticPulses/ReleasedPulse.asset b/Menus/RadialMenu/HapticPulses/ReleasePulse.asset similarity index 100% rename from Menus/RadialMenu/HapticPulses/ReleasedPulse.asset rename to Menus/RadialMenu/HapticPulses/ReleasePulse.asset diff --git a/Menus/RadialMenu/HapticPulses/ReleasedPulse.asset.meta b/Menus/RadialMenu/HapticPulses/ReleasePulse.asset.meta similarity index 100% rename from Menus/RadialMenu/HapticPulses/ReleasedPulse.asset.meta rename to Menus/RadialMenu/HapticPulses/ReleasePulse.asset.meta From 2ad969cb5a1c97e3d84cb4712e3a50d456dd0dc6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 16:38:37 -0700 Subject: [PATCH 382/870] Refactor IControlHaptics to support the new Pulse format. --- .../FunctionalityInjection/IControlHaptics.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs index 6fbfc81be..37810da51 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using UnityEditor.Experimental.EditorVR.Core; using UnityEngine; namespace UnityEditor.Experimental.EditorVR @@ -12,7 +13,7 @@ public interface IControlHaptics public static class IControlHapticsMethods { - internal delegate void PulseDelegate(Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false); + internal delegate void PulseDelegate(Transform rayOrigin, HapticPulse hapticPulse); internal static PulseDelegate pulse { get; set; } @@ -20,13 +21,9 @@ public static class IControlHapticsMethods /// Perform a haptic feedback pulse /// /// Device RayOrigin/Transform on which to control the pulse. A NULL value will pulse on all devices - /// Duration of haptic feedback - /// Intensity of haptic feedback (optional) - /// Fade the pulse in - /// Fade the pulse out - public static void Pulse(this IControlHaptics obj, Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) + public static void Pulse(this IControlHaptics obj, Transform rayOrigin, HapticPulse hapticPulse) { - pulse(rayOrigin, duration, intensity, fadeIn, fadeOut); + pulse(rayOrigin, hapticPulse); } internal delegate void StopPulsesDelegate(Transform rayOrigin); From c1268032a70409af340b2b05857cb94fcf96b435 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 16:41:11 -0700 Subject: [PATCH 383/870] Refactor HapticsModule to support the new Pulse format. --- Scripts/Modules/HapticsModule/HapticsModule.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index 17fadd0bc..d1db817db 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR using System; +using UnityEditor.Experimental.EditorVR.Core; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Modules @@ -52,11 +53,8 @@ void LateUpdate() /// Pulse haptic feedback /// /// Device RayOrigin Transform on which to perform the pulse. A NULL value will pulse on all devices - /// Duration of pulse. Currently a maximum duration of 0.8f is supported. - /// Strength of pulse. - /// Fade the pulse in - /// Fade the pulse out - public void Pulse(Transform rayOrigin, float duration, float intensity = 1f, bool fadeIn = false, bool fadeOut = false) + /// Haptic pulse + public void Pulse(Transform rayOrigin, HapticPulse hapticPulse) { #if ENABLE_OVR_INPUT // Clip buffer can hold up to 800 milliseconds of samples @@ -67,6 +65,10 @@ public void Pulse(Transform rayOrigin, float duration, float intensity = 1f, boo m_GeneratedHapticClip.Reset(); const float kMaxDuration = 0.8f; + var duration = hapticPulse.duration; + var intensity = hapticPulse.intensity; + var fadeIn = hapticPulse.fadeIn; + var fadeOut = hapticPulse.fadeOut; if (duration > kMaxDuration) { duration = Mathf.Clamp(duration, 0f, kMaxDuration); // Clamp at maxiumum 800ms for sample buffer From 13387e2d92b50ff22c29359f39fb327b3e1b22bb Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 16:42:55 -0700 Subject: [PATCH 384/870] Add haptic param summary to IControlHaptics --- Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs index 37810da51..a3f746ee9 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs @@ -21,6 +21,7 @@ public static class IControlHapticsMethods /// Perform a haptic feedback pulse /// /// Device RayOrigin/Transform on which to control the pulse. A NULL value will pulse on all devices + /// Haptic pulse to perform public static void Pulse(this IControlHaptics obj, Transform rayOrigin, HapticPulse hapticPulse) { pulse(rayOrigin, hapticPulse); From 3fdec1214d70b933ec5dd30d6f5529525200698a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 16:45:28 -0700 Subject: [PATCH 385/870] Assign haptic pulse reference to MainMenu prefabs --- Menus/MainMenu/Prefabs/MainMenu.prefab | 3 +++ Menus/MainMenu/Prefabs/MenuButton.prefab | 2 ++ Prefabs/UI/MainMenuActivator.prefab | 1 + 3 files changed, 6 insertions(+) diff --git a/Menus/MainMenu/Prefabs/MainMenu.prefab b/Menus/MainMenu/Prefabs/MainMenu.prefab index 638898895..c0064b0ff 100644 --- a/Menus/MainMenu/Prefabs/MainMenu.prefab +++ b/Menus/MainMenu/Prefabs/MainMenu.prefab @@ -555,6 +555,9 @@ MonoBehaviour: m_MenuFaceRotationOrigin: {fileID: 4000012948932736} m_MenuFrameRenderer: {fileID: 137000013719920994} m_AlternateMenu: {fileID: 4000011216484522} + m_RotatePulse: {fileID: 11400000, guid: f5f56317312943d4da218b9b2e6ea9d0, type: 2} + m_ShowPulse: {fileID: 11400000, guid: 7c69a56582b55ec41b36b49c44a42905, type: 2} + m_HidePulse: {fileID: 11400000, guid: 29832200cc7e1744b9e98febd6d30db8, type: 2} --- !u!137 &137000013719920994 SkinnedMeshRenderer: m_ObjectHideFlags: 1 diff --git a/Menus/MainMenu/Prefabs/MenuButton.prefab b/Menus/MainMenu/Prefabs/MenuButton.prefab index 815d9600e..83039688c 100644 --- a/Menus/MainMenu/Prefabs/MenuButton.prefab +++ b/Menus/MainMenu/Prefabs/MenuButton.prefab @@ -163,6 +163,8 @@ MonoBehaviour: m_Button: {fileID: 114000011038114608} m_ButtonDescription: {fileID: 114000013996147424} m_ButtonTitle: {fileID: 114000010258074492} + m_ClickPulse: {fileID: 11400000, guid: f66cb0a158f54124aa4158bbad3ed702, type: 2} + m_HoverPulse: {fileID: 11400000, guid: dd561ccb8162d1040adba0a7ea60eadc, type: 2} --- !u!114 &114000013676702038 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Prefabs/UI/MainMenuActivator.prefab b/Prefabs/UI/MainMenuActivator.prefab index ee98876b2..9d4bfda1d 100644 --- a/Prefabs/UI/MainMenuActivator.prefab +++ b/Prefabs/UI/MainMenuActivator.prefab @@ -248,3 +248,4 @@ MonoBehaviour: m_EditorClassIdentifier: m_Icon: {fileID: 4000010854155806} m_HighlightedPRS: {fileID: 4000011430756646} + m_HoverPulse: {fileID: 11400000, guid: d4ac399f781bc824c8c1392fb126398e, type: 2} From d48264e48638b8cdb6563ce6e75095354e09888c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 16:46:03 -0700 Subject: [PATCH 386/870] Make naming of RadialMenu haptic pulses uniform --- Menus/RadialMenu/HapticPulses/HighlightPulse.asset | 2 +- Menus/RadialMenu/HapticPulses/ReleasePulse.asset | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Menus/RadialMenu/HapticPulses/HighlightPulse.asset b/Menus/RadialMenu/HapticPulses/HighlightPulse.asset index 0c3071fe8..5ce4698d7 100644 --- a/Menus/RadialMenu/HapticPulses/HighlightPulse.asset +++ b/Menus/RadialMenu/HapticPulses/HighlightPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: HighlightedPulse + m_Name: HighlightPulse m_EditorClassIdentifier: m_Duration: 0.005 m_Intensity: 0.2 diff --git a/Menus/RadialMenu/HapticPulses/ReleasePulse.asset b/Menus/RadialMenu/HapticPulses/ReleasePulse.asset index f1cd42a0a..0c337d8c5 100644 --- a/Menus/RadialMenu/HapticPulses/ReleasePulse.asset +++ b/Menus/RadialMenu/HapticPulses/ReleasePulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ReleasedPulse + m_Name: ReleasePulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.1 From cb80fddc1ec0143e68e46e0d0f101e2d87047925 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 17:00:01 -0700 Subject: [PATCH 387/870] Adding common workspace haptic pulses --- Workspaces/Common/HapticPulses.meta | 9 +++++++++ .../Common/HapticPulses/FrameHoverPulse.asset | 17 +++++++++++++++++ .../HapticPulses/FrameHoverPulse.asset.meta | 9 +++++++++ Workspaces/Common/HapticPulses/MovePulse.asset | 17 +++++++++++++++++ .../Common/HapticPulses/MovePulse.asset.meta | 9 +++++++++ .../Common/HapticPulses/ResizePulse.asset | 17 +++++++++++++++++ .../Common/HapticPulses/ResizePulse.asset.meta | 9 +++++++++ 7 files changed, 87 insertions(+) create mode 100644 Workspaces/Common/HapticPulses.meta create mode 100644 Workspaces/Common/HapticPulses/FrameHoverPulse.asset create mode 100644 Workspaces/Common/HapticPulses/FrameHoverPulse.asset.meta create mode 100644 Workspaces/Common/HapticPulses/MovePulse.asset create mode 100644 Workspaces/Common/HapticPulses/MovePulse.asset.meta create mode 100644 Workspaces/Common/HapticPulses/ResizePulse.asset create mode 100644 Workspaces/Common/HapticPulses/ResizePulse.asset.meta diff --git a/Workspaces/Common/HapticPulses.meta b/Workspaces/Common/HapticPulses.meta new file mode 100644 index 000000000..5abab4afe --- /dev/null +++ b/Workspaces/Common/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d0f2c13fdfa56da4e9726023100f0874 +folderAsset: yes +timeCreated: 1497398062 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Workspaces/Common/HapticPulses/FrameHoverPulse.asset b/Workspaces/Common/HapticPulses/FrameHoverPulse.asset new file mode 100644 index 000000000..89960b6cf --- /dev/null +++ b/Workspaces/Common/HapticPulses/FrameHoverPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: FrameHoverPulse + m_EditorClassIdentifier: + m_Duration: 0.8 + m_Intensity: 0.065 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Workspaces/Common/HapticPulses/FrameHoverPulse.asset.meta b/Workspaces/Common/HapticPulses/FrameHoverPulse.asset.meta new file mode 100644 index 000000000..0f9fa3196 --- /dev/null +++ b/Workspaces/Common/HapticPulses/FrameHoverPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7eda595fb79c2124fb4ea55f6253a847 +timeCreated: 1497398108 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Workspaces/Common/HapticPulses/MovePulse.asset b/Workspaces/Common/HapticPulses/MovePulse.asset new file mode 100644 index 000000000..7a58c99d1 --- /dev/null +++ b/Workspaces/Common/HapticPulses/MovePulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: MovePulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 0.075 + m_FadeIn: 0 + m_FadeOut: 1 diff --git a/Workspaces/Common/HapticPulses/MovePulse.asset.meta b/Workspaces/Common/HapticPulses/MovePulse.asset.meta new file mode 100644 index 000000000..beeb1fe73 --- /dev/null +++ b/Workspaces/Common/HapticPulses/MovePulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 83427d10dc20237408e0246b4b672682 +timeCreated: 1497398097 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Workspaces/Common/HapticPulses/ResizePulse.asset b/Workspaces/Common/HapticPulses/ResizePulse.asset new file mode 100644 index 000000000..c284cb1c9 --- /dev/null +++ b/Workspaces/Common/HapticPulses/ResizePulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: ResizePulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 0.35 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Workspaces/Common/HapticPulses/ResizePulse.asset.meta b/Workspaces/Common/HapticPulses/ResizePulse.asset.meta new file mode 100644 index 000000000..38aa8eb2d --- /dev/null +++ b/Workspaces/Common/HapticPulses/ResizePulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: daa1fd8c3e222aa4db108e0a2b0f7a7d +timeCreated: 1497398079 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 1a94190c17e795a496f2991dc9bbe76b49e8518b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 17:16:33 -0700 Subject: [PATCH 388/870] Cleanup move and resize haptic implementation in WorkspaceUI --- Workspaces/Base/WorkspaceUI.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 787e9a0df..68a80d696 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -130,13 +130,13 @@ sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGe bool m_DynamicFaceAdjustment = true; [SerializeField] - static HapticPulse m_ResizePulse; // remove static + HapticPulse m_ResizePulse; [SerializeField] - static HapticPulse m_MovePulse; // remove static + HapticPulse m_MovePulse; [SerializeField] - HapticPulse m_FrameThicknessPulse; // remove static + HapticPulse m_FrameHoverPulse; Bounds m_Bounds; float? m_TopPanelDividerOffset; @@ -255,12 +255,12 @@ public void OnDragging() + transform.forward * (absForward - (currentExtents.z - extents.z)) * Mathf.Sign(positionOffsetForward); m_WorkspaceUI.transform.parent.position = m_PositionStart + positionOffset * viewerScale; - m_WorkspaceUI.Pulse(rayOrigin, m_ResizePulse); + m_WorkspaceUI.PerformResizeHaptic(rayOrigin); } else { MathUtilsExt.SetTransformOffset(rayOrigin, m_WorkspaceUI.transform.parent, m_PositionOffset, m_RotationOffset); - m_WorkspaceUI.Pulse(rayOrigin, m_MovePulse); + m_WorkspaceUI.PerformMoveHaptic(rayOrigin); } } } @@ -828,7 +828,7 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount, Transform rayOrigin) // If hovering the frame, and not dragging, perform haptic feedback if (m_HovereringRayOrigins.Count > 0 && m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.Pulse(rayOrigin, m_FrameThicknessPulse); + this.Pulse(rayOrigin, m_FrameHoverPulse); m_FrameThicknessCoroutine = null; } @@ -870,6 +870,16 @@ IEnumerator HideTopFace() m_TopFaceVisibleCoroutine = null; } + + void PerformMoveHaptic(Transform rayOrigin) + { + this.Pulse(rayOrigin, m_MovePulse); + } + + void PerformResizeHaptic(Transform rayOrigin) + { + this.Pulse(rayOrigin, m_ResizePulse); + } } } #endif From a082372be6eedb5676780b3a24bc3c6597c79e77 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 17:17:54 -0700 Subject: [PATCH 389/870] Assign haptic pulses to WorkspaceBase prefab's WorkspaceUI --- Workspaces/Base/WorkspaceBase.prefab | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index c434fba5f..daaf17f5f 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -2494,6 +2494,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 + m_ClickPulse: {fileID: 0} + m_HighlightPulse: {fileID: 0} --- !u!114 &114000012775033414 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2600,6 +2602,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 + m_ClickPulse: {fileID: 0} + m_HighlightPulse: {fileID: 0} --- !u!114 &114000013720459270 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2744,6 +2748,7 @@ MonoBehaviour: m_ResizeHandleMargin: 0.08 m_ResizeCornerSize: 0.03 m_DynamicFaceAdjustment: 1 + m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, type: 2} --- !u!137 &137000012547310740 SkinnedMeshRenderer: m_ObjectHideFlags: 1 From 5c4d91742c6967150def696f3c5156a812fa143e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 17:34:34 -0700 Subject: [PATCH 390/870] Move SelectionModule into its own folder; needed for haptic pulses sub/folder --- Scripts/Modules/SelectionModule.meta | 9 +++++++++ Scripts/Modules/{ => SelectionModule}/SelectionModule.cs | 6 +++++- .../{ => SelectionModule}/SelectionModule.cs.meta | 0 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Scripts/Modules/SelectionModule.meta rename Scripts/Modules/{ => SelectionModule}/SelectionModule.cs (94%) rename Scripts/Modules/{ => SelectionModule}/SelectionModule.cs.meta (100%) diff --git a/Scripts/Modules/SelectionModule.meta b/Scripts/Modules/SelectionModule.meta new file mode 100644 index 000000000..7610a2f5d --- /dev/null +++ b/Scripts/Modules/SelectionModule.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bb5b7f8ff172de847bb56bc79d88bd5d +folderAsset: yes +timeCreated: 1497400386 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SelectionModule.cs b/Scripts/Modules/SelectionModule/SelectionModule.cs similarity index 94% rename from Scripts/Modules/SelectionModule.cs rename to Scripts/Modules/SelectionModule/SelectionModule.cs index d47eb1adc..102ee0dc4 100644 --- a/Scripts/Modules/SelectionModule.cs +++ b/Scripts/Modules/SelectionModule/SelectionModule.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Core; using UnityEngine; using Object = UnityEngine.Object; @@ -16,6 +17,9 @@ sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelection public event Action selected; + [SerializeField] + HapticPulse m_HoverPulse; + public GameObject GetSelectionCandidate(GameObject hoveredObject, bool useGrouping = false) { // If we can't even select the object we're starting with, then skip any further logic @@ -65,7 +69,7 @@ public void SelectObject(GameObject hoveredObject, Transform rayOrigin, bool mul m_SelectedObjects.Clear(); if (hoveredObject) - this.Pulse(rayOrigin, 0.45f, 0.075f, false, true); + //this.Pulse(rayOrigin, 0.45f, 0.075f, false, true); // DO FOR EACH RAYORIGIN HERE // Multi-Select if (multiSelect) diff --git a/Scripts/Modules/SelectionModule.cs.meta b/Scripts/Modules/SelectionModule/SelectionModule.cs.meta similarity index 100% rename from Scripts/Modules/SelectionModule.cs.meta rename to Scripts/Modules/SelectionModule/SelectionModule.cs.meta From 57f3967f4b6d67b2f51d6e06e94a760a275e58f7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 17:36:22 -0700 Subject: [PATCH 391/870] Add new SelectionModule haptic pulse --- .../Modules/SelectionModule/HapticPulses.meta | 9 +++++++++ .../HapticPulses/HoverPulse.asset | 17 +++++++++++++++++ .../HapticPulses/HoverPulse.asset.meta | 9 +++++++++ 3 files changed, 35 insertions(+) create mode 100644 Scripts/Modules/SelectionModule/HapticPulses.meta create mode 100644 Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset create mode 100644 Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset.meta diff --git a/Scripts/Modules/SelectionModule/HapticPulses.meta b/Scripts/Modules/SelectionModule/HapticPulses.meta new file mode 100644 index 000000000..87bca37bd --- /dev/null +++ b/Scripts/Modules/SelectionModule/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3bdc79f2df606904d9bfaa553cc1ce6a +folderAsset: yes +timeCreated: 1497400484 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset new file mode 100644 index 000000000..73499bfa1 --- /dev/null +++ b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: NewHapticPulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 1 + m_FadeIn: 0 + m_FadeOut: 0 diff --git a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset.meta b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset.meta new file mode 100644 index 000000000..20f7007c3 --- /dev/null +++ b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 964923da60ab9c54cbd2d8d87f614673 +timeCreated: 1497400488 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 38dd1e75d3a49de65f5458a79c1d4210d52a43a4 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 13 Jun 2017 17:36:58 -0700 Subject: [PATCH 392/870] Implement design review feedback; Clean up code --- .../Modules/SnappingModule/SnappingModule.cs | 327 +++++++++--------- .../SnappingModuleSettingsUI.cs | 7 +- Tools/TransformTool/TransformTool.cs | 8 +- 3 files changed, 169 insertions(+), 173 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 4e8e5af2e..4dc7a27c1 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -23,14 +23,11 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_ManipulatorGroundSnapMin = 0.05f; const float k_ManipulatorGroundSnapMax = 0.15f; - const float k_ManipulatorSurfaceSnapBreakDist = 0.2f; - const float k_ManipulatorSurfaceSearchScale = 0.75f; - const float k_ConstrainedBreakTime = 0.0f; - - const float k_DirectBreakDistance = 0.03f; - const float k_DirectSurfaceSearchScale = 0.75f; - const float k_DirectSurfaceSnapBreakScaleLow = 0.5f; - const float k_DirectSurfaceSnapBreakScaleHigh = 5f; + const float k_ManipulatorSurfaceSnapConstrainedBreakDist = 0.1f; + + const float k_DirectMinSearchDistance = 0.03f; + const float k_SnapDistanceScale = 0.75f; + const float k_BlockedBreakScale = 5f; const float k_DirectGroundSnapMin = 0.03f; const float k_DirectGroundSnapMax = 0.07f; const float k_MaxRayDot = -0.5f; @@ -57,18 +54,21 @@ class SnappingState public Vector3 currentPosition { get; set; } public bool groundSnapping { get; set; } public bool surfaceSnapping { get; set; } - public float snapStartTime { get; set; } - public bool firstFrame { get; set; } public Quaternion startRotation { get; private set; } public Bounds identityBounds { get; private set; } public Bounds rotatedBounds { get; private set; } + public Transform widget { get; set; } + public Vector3 snappingPosition { get; set; } + public Quaternion snappingRotation { get; set; } + public Vector3 snappingNormal { get; set; } + public int directionIndex { get; set; } + public SnappingState(Transform[] transforms, Vector3 position, Quaternion rotation) { currentPosition = position; startRotation = rotation; - firstFrame = true; Bounds rotatedBounds; Bounds identityBounds; @@ -108,6 +108,12 @@ public SnappingState(Transform[] transforms, Vector3 position, Quaternion rotati identityBounds.center -= position; this.identityBounds = identityBounds; } + + public void OnDestroy() + { + if (widget) + ObjectUtils.Destroy(widget.gameObject); + } } struct SnappingDirection @@ -175,7 +181,7 @@ class Preferences [SerializeField] bool m_RotationSnappingEnabled; [SerializeField] - bool m_LocalOnly = true; + bool m_LimitRadius = true; // Sources [SerializeField] @@ -213,10 +219,10 @@ public bool rotationSnappingEnabled set { m_RotationSnappingEnabled = value; } } - public bool localOnly + public bool limitRadius { - get { return m_LocalOnly; } - set { m_LocalOnly = value; } + get { return m_LimitRadius; } + set { m_LimitRadius = value; } } public bool manipulatorSnappingEnabled @@ -238,12 +244,6 @@ public bool directSnappingEnabled Material m_ButtonHighlightMaterialClone; readonly Dictionary> m_SnappingStates = new Dictionary>(); - Vector3 m_CurrentSurfaceSnappingHit; - Vector3 m_CurrentSurfaceSnappingPosition; - Vector3 m_CurrentSurfaceSnappingNormal; - Quaternion m_CurrentSurfaceSnappingRotation; - GameObject m_CurrentSurfaceSnappingObject; - int m_CurrentSnappingDirection = -1; public bool widgetEnabled { get; set; } @@ -336,15 +336,15 @@ public bool rotationSnappingEnabled } } - public bool localOnly + public bool limitRadius { - get { return m_Preferences.localOnly; } + get { return m_Preferences.limitRadius; } set { - m_Preferences.localOnly = value; + m_Preferences.limitRadius = value; if (m_SnappingModuleSettingsUI) - m_SnappingModuleSettingsUI.localOnly.isOn = value; + m_SnappingModuleSettingsUI.limitRadius.isOn = value; } } @@ -384,9 +384,6 @@ void Awake() m_GroundPlane = ObjectUtils.Instantiate(m_GroundPlane, transform); m_GroundPlane.SetActive(false); - m_Widget = ObjectUtils.Instantiate(m_Widget, transform); - m_Widget.SetActive(false); - m_ButtonHighlightMaterialClone = Instantiate(m_ButtonHighlightMaterial); widgetEnabled = true; @@ -406,33 +403,38 @@ void Update() { if (snappingEnabled) { - var surfaceSnapping = false; + var camera = CameraUtils.GetMainCamera(); var shouldActivateGroundPlane = false; - foreach (var statesForRay in m_SnappingStates.Values) + foreach (var statesForRay in m_SnappingStates) { - foreach (var state in statesForRay.Values) + foreach (var kvp in statesForRay.Value) { + var state = kvp.Value; if (state.groundSnapping) shouldActivateGroundPlane = true; - if (state.surfaceSnapping) - surfaceSnapping = true; - } - } - m_GroundPlane.SetActive(shouldActivateGroundPlane); + var widget = state.widget; + if (state.surfaceSnapping && widgetEnabled) + { + if (widget == null) + { + widget = ObjectUtils.Instantiate(m_Widget, transform).transform; + state.widget = widget; + } - if (widgetEnabled) - { - m_Widget.SetActive(surfaceSnapping); - if (surfaceSnapping) - { - var camera = CameraUtils.GetMainCamera(); - var distanceToCamera = Vector3.Distance(camera.transform.position, m_CurrentSurfaceSnappingPosition); - m_Widget.transform.position = m_CurrentSurfaceSnappingHit; - m_Widget.transform.rotation = m_CurrentSurfaceSnappingRotation; - m_Widget.transform.localScale = Vector3.one * k_WidgetScale * distanceToCamera; + widget.gameObject.SetActive(true); + + var distanceToCamera = Vector3.Distance(camera.transform.position, state.snappingPosition); + widget.position = state.snappingPosition; + widget.rotation = state.snappingRotation; + widget.localScale = Vector3.one * k_WidgetScale * distanceToCamera; + } + else if(state.widget != null) + widget.gameObject.SetActive(false); } } + + m_GroundPlane.SetActive(shouldActivateGroundPlane); } else { @@ -457,42 +459,46 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec var targetPosition = state.currentPosition; var targetRotation = state.startRotation; - //GizmoModule.instance.DrawSphere(targetPosition, 1f, Color.red); - - var camera = CameraUtils.GetMainCamera(); - var breakScale = Vector3.Distance(camera.transform.position, targetPosition); - AddToIgnoreList(transforms); - var bounds = state.identityBounds; - var direction = delta.normalized; - var projectedExtents = Vector3.Project(rotation * bounds.extents, direction); - var manipulatorBreakDistance = (breakScale * k_ManipulatorSurfaceSnapBreakDist + projectedExtents.magnitude) * 0.5f; + var breakScale = Vector3.Distance(CameraUtils.GetMainCamera().transform.position, position); switch (constraints) { case 0: - if (surfaceSnappingEnabled && ManipulatorSnapToSurface(rayOrigin, ref position, ref rotation, targetPosition, state, targetRotation, manipulatorBreakDistance)) - return true; + var pointerRay = new Ray(rayOrigin.position, rayOrigin.forward); + if (surfaceSnappingEnabled) + { + if (limitRadius) + { + if (DirectSnapToSurface(ref position, ref rotation, targetPosition, targetRotation, state)) + return true; + } + else + { + if(ManipulatorSnapToSurface(pointerRay, ref position, ref rotation, targetPosition, targetRotation, state)) + return true; + } + } if (groundSnappingEnabled) { - if (localOnly) + if (limitRadius) { if (LocalSnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_ManipulatorGroundSnapMin, breakScale * k_ManipulatorGroundSnapMax)) return true; } else { - if (GlobalSnapToGround(new Ray(rayOrigin.position, rayOrigin.forward), ref position, ref rotation, targetPosition, targetRotation, state, k_GroundSnappingMaxRayLength * this.GetViewerScale())) + var raycastDistance = this.GetViewerScale() * k_GroundSnappingMaxRayLength; + if (GlobalSnapToGround(pointerRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance)) return true; } } break; default: - //manipulatorBreakDistance = Mathf.Max(manipulatorBreakDistance, (delta.magnitude / breakScale) / Time.deltaTime); - if (ManipulatorSnapConstrained(ref position, ref rotation, direction, targetPosition, state, targetRotation, projectedExtents, manipulatorBreakDistance, constraints, pivotMode)) + if (ManipulatorSnapConstrained(ref position, ref rotation, delta, targetPosition, targetRotation, state, breakScale * k_ManipulatorSurfaceSnapConstrainedBreakDist, constraints, pivotMode)) return true; break; } @@ -511,15 +517,12 @@ public bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 pos state.currentPosition = targetPosition; - var viewerScale = this.GetViewerScale(); - var breakScale = viewerScale; - var breakDistance = breakScale * k_DirectBreakDistance; - AddToIgnoreList(transform); - if (surfaceSnappingEnabled && DirectSnapToSurface(ref position, ref rotation, targetPosition, state, targetRotation, breakDistance)) + if (surfaceSnappingEnabled && DirectSnapToSurface(ref position, ref rotation, targetPosition, targetRotation, state)) return true; - if (groundSnappingEnabled && LocalSnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_DirectGroundSnapMin, breakScale * k_DirectGroundSnapMax)) + var viewerScale = this.GetViewerScale(); + if (groundSnappingEnabled && LocalSnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, viewerScale * k_DirectGroundSnapMin, viewerScale * k_DirectGroundSnapMax)) return true; } @@ -529,7 +532,7 @@ public bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 pos return false; } - bool ManipulatorSnapToSurface(Transform rayOrigin, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, float breakDistance) + bool ManipulatorSnapToSurface(Ray pointerRay, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state) { var bounds = state.identityBounds; var boundsExtents = bounds.extents; @@ -538,21 +541,23 @@ bool ManipulatorSnapToSurface(Transform rayOrigin, ref Vector3 position, ref Qua var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); var startRotation = state.startRotation; var upVector = startRotation * Vector3.back; - var maxRayLength = k_SurfaceSnappingMaxRayLength * this.GetViewerScale(); + var maxRayLength = this.GetViewerScale() * k_SurfaceSnappingMaxRayLength; - var pointerRay = new Ray(rayOrigin.position, rayOrigin.forward); - return SnapToSurface(pointerRay, ref position, ref rotation, state, offset, targetPosition, targetRotation , rotationOffset, upVector, breakDistance, maxRayLength) - || TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance); + return SnapToSurface(pointerRay, ref position, ref rotation, state, offset, targetRotation , rotationOffset, upVector, maxRayLength) + || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, 0); } - bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, Vector3 direction, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, Vector3 projectedExtents, float breakDistance, ConstrainedAxis constraints, PivotMode pivotMode) + bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, Vector3 delta, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, ConstrainedAxis constraints, PivotMode pivotMode) { var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); var startRotation = state.startRotation; var upVector = startRotation * Vector3.back; - var raycastDistance = breakDistance * k_ManipulatorSurfaceSearchScale; // Shorten ray to avoid jitter at the edge of the break distance + var direction = delta.normalized; + var bounds = state.identityBounds; + var projectedExtents = Vector3.Project(rotation * bounds.extents, direction); var axisRay = new Ray(targetPosition, direction); + var objectCenter = Vector3.zero; var boundsOffset = Vector3.zero; @@ -582,7 +587,17 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V boundsOffset = targetPosition - axisRay.origin; } - if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, raycastDistance)) + if (state.surfaceSnapping) + { + var breakDistance = raycastDistance; + if (Vector3.Dot(targetPosition - position, state.snappingNormal) < 0) + breakDistance *= k_BlockedBreakScale; + + TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance); + return true; + } + + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) @@ -596,151 +611,125 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V boundsOffset = targetPosition - axisRay.origin; } - if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetPosition, targetRotation, rotationOffset, upVector, breakDistance, raycastDistance)) + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) return true; - if (TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance, true)) + if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, raycastDistance)) return true; + GizmoModule.instance.DrawSphere(targetPosition + Vector3.up, 0.01f, Color.gray); + return false; } - bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, SnappingState state, Quaternion targetRotation, float breakDistance) + bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state) { var bounds = state.identityBounds; var boundsCenter = bounds.center; - var breakdist = breakDistance; - var directionVector = targetPosition - position; - var boundsExtents = bounds.extents; - var projectedExtents = Vector3.Project(boundsExtents, directionVector); + var breakDistance = this.GetViewerScale() * k_DirectMinSearchDistance; - if (m_CurrentSnappingDirection > -1) + if (state.surfaceSnapping) { - var direction = k_Directions[m_CurrentSnappingDirection]; + var directionIndex = state.directionIndex; + var direction = k_Directions[directionIndex]; var upVector = targetRotation * direction.upVector; - directionVector = direction.direction; + var directionVector = direction.direction; var rotationOffset = direction.rotationOffset; - boundsExtents = bounds.extents; - projectedExtents = Vector3.Project(boundsExtents, directionVector); + var boundsExtents = bounds.extents; + var projectedExtents = Vector3.Project(boundsExtents, directionVector); var offset = -boundsCenter; - if (m_CurrentSnappingDirection > 2) + if (directionIndex > 2) offset -= projectedExtents; else offset += projectedExtents; offset = rotation * offset; - //var raycastDistance = projectedExtents.magnitude * 2 + breakDistance * k_DirectSurfaceSearchScale; - breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude); + var boundsBreakDist = Mathf.Max(breakDistance, projectedExtents.magnitude); - if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) + var snappingNormal = state.snappingNormal; + var breakVector = targetPosition - position; + if (Vector3.Dot(snappingNormal, breakVector) < 0) { - breakdist *= k_DirectSurfaceSnapBreakScaleHigh; - var raycastDistance = breakdist; - - //if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) - // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; - //else - // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; + boundsBreakDist *= k_BlockedBreakScale; + var rayBackOutDist = projectedExtents.magnitude * 2; + var raycastDistance = projectedExtents.magnitude * 3; - var boundsRay = new Ray(targetPosition - offset - rotation * direction.direction * (targetPosition - position).magnitude * 1.01f, targetRotation * directionVector); + var boundsRay = new Ray(targetPosition - offset + snappingNormal * (breakVector.magnitude + rayBackOutDist), -snappingNormal); - GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.blue, raycastDistance); - GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.green, (targetPosition - position).magnitude); + GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.blue, boundsBreakDist); + GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.green, breakVector.magnitude); - if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakdist, raycastDistance)) + if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; - if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakdist)) + if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, boundsBreakDist)) return true; } + else + { + GizmoModule.instance.DrawRay(position, targetPosition - position, Color.blue, breakDistance); + GizmoModule.instance.DrawRay(position, targetPosition - position, Color.green, Vector3.Distance(position, targetPosition)); + } } for (var i = 0; i < k_Directions.Length; i++) { var direction = k_Directions[i]; var upVector = targetRotation * direction.upVector; - directionVector = direction.direction; + var directionVector = direction.direction; var rotationOffset = direction.rotationOffset; - boundsExtents = bounds.extents; - projectedExtents = Vector3.Project(boundsExtents, directionVector); + var boundsExtents = bounds.extents; + var projectedExtents = Vector3.Project(boundsExtents, directionVector); var offset = -boundsCenter; if (i > 2) offset -= projectedExtents; else offset += projectedExtents; - offset = rotation * offset; - - breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude); - var raycastDistance = breakdist * k_DirectSurfaceSearchScale; + var placementOffset = rotation * offset; + offset = targetRotation * offset; - if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) - breakdist *= k_DirectSurfaceSnapBreakScaleHigh; - //else - // breakdist *= k_DirectSurfaceSnapBreakScaleLow; - - //if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) - // breakdist = breakDistance * k_DirectSurfaceSnapBreakScaleHigh; - //else - // breakdist = breakDistance * k_DirectSurfaceSnapBreakScaleLow; + var raycastDistance = Mathf.Max(breakDistance, projectedExtents.magnitude); var boundsRay = new Ray(targetPosition - offset, targetRotation * directionVector); GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.yellow, raycastDistance); - if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetPosition, targetRotation, rotationOffset, upVector, breakdist, raycastDistance)) + if (SnapToSurface(boundsRay, ref position, ref rotation, state, placementOffset, targetRotation, rotationOffset, upVector, raycastDistance, k_MaxRayDot)) { - m_CurrentSnappingDirection = i; + state.directionIndex = i; return true; } } - //directionVector = targetPosition - position; - //boundsExtents = bounds.extents; - //projectedExtents = Vector3.Project(boundsExtents, directionVector); - - //if (state.surfaceSnapping && Vector3.Dot(m_CurrentSurfaceSnappingNormal, targetPosition - position) < 0) - // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleHigh; - //else - // breakdist = Mathf.Max(breakDistance, projectedExtents.magnitude) * k_DirectSurfaceSnapBreakScaleLow; - - if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) + if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) return true; return false; } - bool TryBreakSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance, bool withTimer = false) + static bool TryBreakSurfaceSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance) { - state.firstFrame = false; - - GizmoModule.instance.DrawRay(position, targetPosition - position, Color.blue, breakDistance); - GizmoModule.instance.DrawRay(position, targetPosition - position, Color.green, Vector3.Distance(position, targetPosition)); - if (state.surfaceSnapping) { - if (withTimer && state.snapStartTime + k_ConstrainedBreakTime > Time.time) - return true; + GizmoModule.instance.DrawRay(position, targetPosition - position, Color.blue, breakDistance); + GizmoModule.instance.DrawRay(position, targetPosition - position, Color.green, Vector3.Distance(position, targetPosition)); if (Vector3.Distance(position, targetPosition) > breakDistance) { position = targetPosition; rotation = targetRotation; state.surfaceSnapping = false; - m_CurrentSurfaceSnappingNormal = Vector3.up; - m_CurrentSurfaceSnappingObject = null; - m_CurrentSnappingDirection = -1; - state.snapStartTime = 0; + state.snappingNormal = Vector3.up; + return true; } - - return true; } return false; } @@ -770,41 +759,34 @@ void AddToIgnoreList(Transform[] transforms) } } - bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, SnappingState state, Vector3 boundsOffset, Vector3 targetPosition, Quaternion targetRotation, Quaternion rotationOffset, Vector3 upVector, float breakDistance, float raycastDistance) + bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, SnappingState state, Vector3 boundsOffset, Quaternion targetRotation, Quaternion rotationOffset, Vector3 upVector, float raycastDistance, float maxRayDot = Mathf.Infinity) { RaycastHit hit; GameObject go; if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { - if (m_CurrentSurfaceSnappingObject != null && go != m_CurrentSurfaceSnappingObject) + if (Vector3.Dot(ray.direction, hit.normal) > maxRayDot) return false; - if (Vector3.Dot(ray.direction, hit.normal) > k_MaxRayDot) + if (!state.surfaceSnapping && hit.distance > raycastDistance * k_SnapDistanceScale) return false; var snappedRotation = Quaternion.LookRotation(hit.normal, upVector) * rotationOffset; - m_CurrentSurfaceSnappingNormal = hit.normal; + state.snappingNormal = hit.normal; var hitPoint = hit.point; - m_CurrentSurfaceSnappingHit = hitPoint; + var snappedPosition = pivotSnappingEnabled ? hitPoint : hitPoint + boundsOffset; - if (localOnly && Vector3.Distance(snappedPosition, targetPosition) > breakDistance) - return false; - - m_CurrentSurfaceSnappingObject = go; - - if (!state.surfaceSnapping && !state.firstFrame) - state.snapStartTime = Time.time; - state.surfaceSnapping = true; state.groundSnapping = false; + GizmoModule.instance.DrawSphere(snappedPosition, 0.01f, Color.green); position = snappedPosition; rotation = rotationSnappingEnabled ? snappedRotation : targetRotation; - m_CurrentSurfaceSnappingPosition = position; - m_CurrentSurfaceSnappingRotation = snappedRotation; + state.snappingPosition = hitPoint; + state.snappingRotation = snappedRotation; return true; } @@ -906,11 +888,26 @@ SnappingState GetSnappingState(Transform rayOrigin, Transform[] transforms, Vect public void ClearSnappingState(Transform rayOrigin) { - m_SnappingStates.Remove(rayOrigin); + Dictionary states; + if (m_SnappingStates.TryGetValue(rayOrigin, out states)) + { + foreach (var kvp in states) + { + kvp.Value.OnDestroy(); + } + m_SnappingStates.Remove(rayOrigin); + } } void Reset() { + foreach (var statesForRay in m_SnappingStates) + { + foreach (var kvp in statesForRay.Value) + { + kvp.Value.OnDestroy(); + } + } m_SnappingStates.Clear(); } @@ -955,9 +952,9 @@ void SetupUI() snapRotationUI.isOn = m_Preferences.rotationSnappingEnabled; snapRotationUI.onValueChanged.AddListener(b => { m_Preferences.rotationSnappingEnabled = snapRotationUI.isOn; }); - var localOnlyUI = m_SnappingModuleSettingsUI.localOnly; - localOnlyUI.isOn = m_Preferences.localOnly; - localOnlyUI.onValueChanged.AddListener(b => { m_Preferences.localOnly = localOnlyUI.isOn; }); + var localOnlyUI = m_SnappingModuleSettingsUI.limitRadius; + localOnlyUI.isOn = m_Preferences.limitRadius; + localOnlyUI.onValueChanged.AddListener(b => { m_Preferences.limitRadius = localOnlyUI.isOn; }); var manipulatorSnappingUI = m_SnappingModuleSettingsUI.manipulatorSnappingEnabled; manipulatorSnappingUI.isOn = m_Preferences.manipulatorSnappingEnabled; @@ -979,7 +976,7 @@ void SetDependentTogglesGhosted() m_SnappingModuleSettingsUI.groundSnappingEnabled, m_SnappingModuleSettingsUI.surfaceSnappingEnabled, m_SnappingModuleSettingsUI.rotationSnappingEnabled, - m_SnappingModuleSettingsUI.localOnly, + m_SnappingModuleSettingsUI.limitRadius, m_SnappingModuleSettingsUI.manipulatorSnappingEnabled, m_SnappingModuleSettingsUI.directSnappingEnabled }; diff --git a/Scripts/Modules/SnappingModule/SnappingModuleSettingsUI.cs b/Scripts/Modules/SnappingModule/SnappingModuleSettingsUI.cs index 5027211d4..caa894bd5 100644 --- a/Scripts/Modules/SnappingModule/SnappingModuleSettingsUI.cs +++ b/Scripts/Modules/SnappingModule/SnappingModuleSettingsUI.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR using UnityEngine; +using UnityEngine.Serialization; using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR @@ -22,7 +23,7 @@ public class SnappingModuleSettingsUI : MonoBehaviour Toggle m_RotationSnappingEnabled; [SerializeField] - Toggle m_LocalOnly; + Toggle m_LimitRadius; [SerializeField] Toggle m_ManipulatorSnappingEnabled; @@ -55,9 +56,9 @@ public Toggle rotationSnappingEnabled get { return m_RotationSnappingEnabled; } } - public Toggle localOnly + public Toggle limitRadius { - get { return m_LocalOnly; } + get { return m_LimitRadius; } } public Toggle manipulatorSnappingEnabled diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 1a4f3aea8..21f7f02c0 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -72,11 +72,9 @@ public void UpdatePositions(IUsesSnapping usesSnapping) if (usesSnapping.DirectSnap(rayOrigin, grabbedObject, ref position, ref rotation, targetPosition, targetRotation)) { - //var deltaTime = Time.deltaTime; - //grabbedObject.position = Vector3.Lerp(grabbedObject.position, position, k_DirectLazyFollowTranslate * deltaTime); - //grabbedObject.rotation = Quaternion.Lerp(grabbedObject.rotation, rotation, k_DirectLazyFollowRotate * deltaTime); - grabbedObject.position = position; - grabbedObject.rotation = rotation; + var deltaTime = Time.deltaTime; + grabbedObject.position = Vector3.Lerp(grabbedObject.position, position, k_DirectLazyFollowTranslate * deltaTime); + grabbedObject.rotation = Quaternion.Lerp(grabbedObject.rotation, rotation, k_DirectLazyFollowRotate * deltaTime); } else { From a25ab94bed7211fe53535acfe44710bfb9ce6de0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 17:39:40 -0700 Subject: [PATCH 393/870] Add haptic pulse for hover state to SelectionModule --- Scripts/Modules/SelectionModule/SelectionModule.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/Modules/SelectionModule/SelectionModule.cs b/Scripts/Modules/SelectionModule/SelectionModule.cs index 102ee0dc4..cd0869a91 100644 --- a/Scripts/Modules/SelectionModule/SelectionModule.cs +++ b/Scripts/Modules/SelectionModule/SelectionModule.cs @@ -9,6 +9,9 @@ namespace UnityEditor.Experimental.EditorVR.Modules { sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelectionChanged, IControlHaptics { + [SerializeField] + HapticPulse m_HoverPulse; + GameObject m_CurrentGroupRoot; readonly List m_SelectedObjects = new List(); // Keep the list to avoid allocations--we do not use it to maintain state @@ -17,9 +20,6 @@ sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelection public event Action selected; - [SerializeField] - HapticPulse m_HoverPulse; - public GameObject GetSelectionCandidate(GameObject hoveredObject, bool useGrouping = false) { // If we can't even select the object we're starting with, then skip any further logic @@ -69,7 +69,7 @@ public void SelectObject(GameObject hoveredObject, Transform rayOrigin, bool mul m_SelectedObjects.Clear(); if (hoveredObject) - //this.Pulse(rayOrigin, 0.45f, 0.075f, false, true); // DO FOR EACH RAYORIGIN HERE + this.Pulse(rayOrigin, m_HoverPulse); // Multi-Select if (multiSelect) From ac1a5327c7d14f065e5b53c69f8a9dc5cc90f91e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 17:40:12 -0700 Subject: [PATCH 394/870] Refine SelectionModule hover state haptic pulse --- .../Modules/SelectionModule/HapticPulses/HoverPulse.asset | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset index 73499bfa1..93ac16b02 100644 --- a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset +++ b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset @@ -9,9 +9,9 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: NewHapticPulse + m_Name: HoverPulse m_EditorClassIdentifier: - m_Duration: 0.25 - m_Intensity: 1 + m_Duration: 0.45 + m_Intensity: 0.075 m_FadeIn: 0 - m_FadeOut: 0 + m_FadeOut: 1 From 94143248169125119a9d2d3a01cb8c71a492a52d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 17:59:15 -0700 Subject: [PATCH 395/870] Assign hover pulse to SelectionModule --- Scripts/Modules/SelectionModule/SelectionModule.cs.meta | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Scripts/Modules/SelectionModule/SelectionModule.cs.meta b/Scripts/Modules/SelectionModule/SelectionModule.cs.meta index 754e81419..53092ce46 100644 --- a/Scripts/Modules/SelectionModule/SelectionModule.cs.meta +++ b/Scripts/Modules/SelectionModule/SelectionModule.cs.meta @@ -1,12 +1,11 @@ fileFormatVersion: 2 guid: e1e415e42cfe5964e87b18be7792412f -timeCreated: 1469136056 +timeCreated: 1497400707 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - - selectedMaterial: {instanceID: 0} - - coneMaterial: {fileID: 2100000, guid: d33a89222f7efbf4a8c087bee7d33cc2, type: 2} + - m_HoverPulse: {fileID: 11400000, guid: 964923da60ab9c54cbd2d8d87f614673, type: 2} executionOrder: 0 icon: {instanceID: 0} userData: From d48ded484c3316f19885aa2e3b8ca44ad479e922 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 18:00:37 -0700 Subject: [PATCH 396/870] Assign haptic pulse reference to WorkspaceBase --- Workspaces/Base/WorkspaceBase.prefab | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index daaf17f5f..723967d02 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -2748,6 +2748,8 @@ MonoBehaviour: m_ResizeHandleMargin: 0.08 m_ResizeCornerSize: 0.03 m_DynamicFaceAdjustment: 1 + m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, type: 2} --- !u!137 &137000012547310740 SkinnedMeshRenderer: From 9da39dd4865c26899d42bcd0b370b8b0bbd9f889 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 18:08:16 -0700 Subject: [PATCH 397/870] Add WorkspaceButton haptics --- .../HapticPulses/WorkspaceButtonClick.asset | 17 +++++++++++++++++ .../WorkspaceButtonClick.asset.meta | 9 +++++++++ .../HapticPulses/WorkspaceButtonHighlight.asset | 17 +++++++++++++++++ .../WorkspaceButtonHighlight.asset.meta | 9 +++++++++ 4 files changed, 52 insertions(+) create mode 100644 Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset create mode 100644 Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset.meta create mode 100644 Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset create mode 100644 Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset.meta diff --git a/Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset b/Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset new file mode 100644 index 000000000..304ae3747 --- /dev/null +++ b/Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: WorkspaceButtonClick + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 0.15 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset.meta b/Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset.meta new file mode 100644 index 000000000..c9d3a1ba9 --- /dev/null +++ b/Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 43f6d76e312f45145bc1ef9af446edfe +timeCreated: 1497402345 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset b/Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset new file mode 100644 index 000000000..62bb59fde --- /dev/null +++ b/Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: WorkspaceButtonHighlight + m_EditorClassIdentifier: + m_Duration: 0.005 + m_Intensity: 0.175 + m_FadeIn: 0 + m_FadeOut: 0 diff --git a/Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset.meta b/Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset.meta new file mode 100644 index 000000000..d3b2674bc --- /dev/null +++ b/Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bf8c18d5dc5c90f4aa0782421bbaaf0e +timeCreated: 1497402382 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 3264f23cd7e1a90553986dbc59bdb1585ca4e3db Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 18:11:05 -0700 Subject: [PATCH 398/870] Assign click and highlight haptic pulses to WorkspaceButton prefab --- Workspaces/Common/Prefabs/WorkspaceButton.prefab | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Workspaces/Common/Prefabs/WorkspaceButton.prefab b/Workspaces/Common/Prefabs/WorkspaceButton.prefab index 0eb56fb98..d29c79532 100644 --- a/Workspaces/Common/Prefabs/WorkspaceButton.prefab +++ b/Workspaces/Common/Prefabs/WorkspaceButton.prefab @@ -187,6 +187,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.25 + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000011110648212 MonoBehaviour: m_ObjectHideFlags: 1 From b1b679e8f9868367d15fd4c1fb08561bd3de219f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 18:48:10 -0700 Subject: [PATCH 399/870] Add StandardManipulator haptic pulses --- Manipulators/HapticPulses.meta | 9 +++++++++ Manipulators/HapticPulses/DragPulse.asset | 17 +++++++++++++++++ Manipulators/HapticPulses/DragPulse.asset.meta | 9 +++++++++ Manipulators/HapticPulses/RotatePulse.asset | 17 +++++++++++++++++ .../HapticPulses/RotatePulse.asset.meta | 9 +++++++++ 5 files changed, 61 insertions(+) create mode 100644 Manipulators/HapticPulses.meta create mode 100644 Manipulators/HapticPulses/DragPulse.asset create mode 100644 Manipulators/HapticPulses/DragPulse.asset.meta create mode 100644 Manipulators/HapticPulses/RotatePulse.asset create mode 100644 Manipulators/HapticPulses/RotatePulse.asset.meta diff --git a/Manipulators/HapticPulses.meta b/Manipulators/HapticPulses.meta new file mode 100644 index 000000000..7835617ea --- /dev/null +++ b/Manipulators/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a60c16ec751fc9d41ae4f4238c15ada8 +folderAsset: yes +timeCreated: 1497404112 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Manipulators/HapticPulses/DragPulse.asset b/Manipulators/HapticPulses/DragPulse.asset new file mode 100644 index 000000000..d833ef5eb --- /dev/null +++ b/Manipulators/HapticPulses/DragPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: DragPulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 0.125 + m_FadeIn: 0 + m_FadeOut: 1 diff --git a/Manipulators/HapticPulses/DragPulse.asset.meta b/Manipulators/HapticPulses/DragPulse.asset.meta new file mode 100644 index 000000000..fa00b3c90 --- /dev/null +++ b/Manipulators/HapticPulses/DragPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a187e6c970cfc58498747aee6dca2919 +timeCreated: 1497398097 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Manipulators/HapticPulses/RotatePulse.asset b/Manipulators/HapticPulses/RotatePulse.asset new file mode 100644 index 000000000..4e4e94ae7 --- /dev/null +++ b/Manipulators/HapticPulses/RotatePulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: RotatePulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 0.25 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Manipulators/HapticPulses/RotatePulse.asset.meta b/Manipulators/HapticPulses/RotatePulse.asset.meta new file mode 100644 index 000000000..ab3d4e9de --- /dev/null +++ b/Manipulators/HapticPulses/RotatePulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2e2c8d33e61b196448657254e78ba15c +timeCreated: 1497398079 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 249d18e4851f8422ecad87610b2c054e77837948 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 18:48:51 -0700 Subject: [PATCH 400/870] Add haptic support to StandardManipulator --- Manipulators/StandardManipulator.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index 08cdee817..daadb3583 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -1,12 +1,13 @@ #if UNITY_EDITOR using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Handles; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Manipulators { - sealed class StandardManipulator : BaseManipulator + sealed class StandardManipulator : BaseManipulator, IControlHaptics { [SerializeField] Transform m_PlaneHandlesParent; @@ -14,6 +15,12 @@ sealed class StandardManipulator : BaseManipulator [SerializeField] List m_AllHandles; + [SerializeField] + HapticPulse m_DragPulse; + + [SerializeField] + HapticPulse m_RotatePulse; + protected override void OnEnable() { base.OnEnable(); @@ -68,11 +75,15 @@ void Update() void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) { translate(eventData.deltaPosition, eventData.rayOrigin, !(handle is SphereHandle)); + + this.Pulse(eventData.rayOrigin, m_DragPulse); } void OnRotateDragging(BaseHandle handle, HandleEventData eventData) { rotate(eventData.deltaRotation); + + this.Pulse(eventData.rayOrigin, m_RotatePulse); } void OnHandleDragStarted(BaseHandle handle, HandleEventData eventData) From 8f3fe3b36a26cc8de433396c32faf54e7d60a4bd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 18:49:25 -0700 Subject: [PATCH 401/870] Assign haptic pulse references to the StandardManipulator --- Manipulators/StandardManipulator.prefab | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Manipulators/StandardManipulator.prefab b/Manipulators/StandardManipulator.prefab index 2209655dd..1369fcef9 100644 --- a/Manipulators/StandardManipulator.prefab +++ b/Manipulators/StandardManipulator.prefab @@ -1425,6 +1425,8 @@ MonoBehaviour: - {fileID: 114000012656813054} - {fileID: 114000010105022974} - {fileID: 114000011169532704} + m_DragPulse: {fileID: 11400000, guid: a187e6c970cfc58498747aee6dca2919, type: 2} + m_RotatePulse: {fileID: 11400000, guid: 2e2c8d33e61b196448657254e78ba15c, type: 2} --- !u!114 &114000013109644058 MonoBehaviour: m_ObjectHideFlags: 1 From b7fb482d9ca78c2c9078a45bf49124f13a3902d3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 18:50:51 -0700 Subject: [PATCH 402/870] Assign click and highlight haptic pulse references to various prefabs that implement WorkspaceButton --- Workspaces/Common/Prefabs/FilterUI.prefab | 4 ++++ Workspaces/Common/Prefabs/ZoomSlider.prefab | 2 ++ Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab | 2 ++ Workspaces/HierarchyWorkspace/Prefabs/FocusUI.prefab | 2 ++ Workspaces/InspectorWorkspace/Prefabs/LockUI.prefab | 2 ++ 5 files changed, 12 insertions(+) diff --git a/Workspaces/Common/Prefabs/FilterUI.prefab b/Workspaces/Common/Prefabs/FilterUI.prefab index 1ba290349..4bf07d77c 100644 --- a/Workspaces/Common/Prefabs/FilterUI.prefab +++ b/Workspaces/Common/Prefabs/FilterUI.prefab @@ -626,6 +626,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 1 m_DelayBeforeReveal: 0.125 + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000010404580652 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1049,6 +1051,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 1 m_DelayBeforeReveal: 0.125 + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000013883654872 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Workspaces/Common/Prefabs/ZoomSlider.prefab b/Workspaces/Common/Prefabs/ZoomSlider.prefab index e81ee1bd2..8792cf4db 100644 --- a/Workspaces/Common/Prefabs/ZoomSlider.prefab +++ b/Workspaces/Common/Prefabs/ZoomSlider.prefab @@ -415,6 +415,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.25 + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000014065167194 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab b/Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab index 457302b32..09daef54b 100644 --- a/Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab +++ b/Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab @@ -296,6 +296,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000010778606354 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Workspaces/HierarchyWorkspace/Prefabs/FocusUI.prefab b/Workspaces/HierarchyWorkspace/Prefabs/FocusUI.prefab index 7e80e7646..092cbfe46 100644 --- a/Workspaces/HierarchyWorkspace/Prefabs/FocusUI.prefab +++ b/Workspaces/HierarchyWorkspace/Prefabs/FocusUI.prefab @@ -296,6 +296,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000010255987122 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Workspaces/InspectorWorkspace/Prefabs/LockUI.prefab b/Workspaces/InspectorWorkspace/Prefabs/LockUI.prefab index d7a49eafc..e4ac9a25e 100644 --- a/Workspaces/InspectorWorkspace/Prefabs/LockUI.prefab +++ b/Workspaces/InspectorWorkspace/Prefabs/LockUI.prefab @@ -279,6 +279,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000010717983400 MonoBehaviour: m_ObjectHideFlags: 1 From cd7ad35823ed276bd0e2dbf11b23c3877edc1d51 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 18:57:41 -0700 Subject: [PATCH 403/870] Refine manipulator haptic drag pulse --- Manipulators/HapticPulses/DragPulse.asset | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Manipulators/HapticPulses/DragPulse.asset b/Manipulators/HapticPulses/DragPulse.asset index d833ef5eb..3663a437f 100644 --- a/Manipulators/HapticPulses/DragPulse.asset +++ b/Manipulators/HapticPulses/DragPulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: DragPulse m_EditorClassIdentifier: - m_Duration: 0.25 - m_Intensity: 0.125 - m_FadeIn: 0 + m_Duration: 0.2 + m_Intensity: 0.175 + m_FadeIn: 1 m_FadeOut: 1 From 3dd4883f66981f16208b29659470da9ac60d50ea Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 19:06:43 -0700 Subject: [PATCH 404/870] Add ListView scrolling haptic pulse --- Scripts/ListView/HapticPulses.meta | 9 +++++++++ Scripts/ListView/HapticPulses/ScrollPulse.asset | 17 +++++++++++++++++ .../HapticPulses/ScrollPulse.asset.meta | 9 +++++++++ 3 files changed, 35 insertions(+) create mode 100644 Scripts/ListView/HapticPulses.meta create mode 100644 Scripts/ListView/HapticPulses/ScrollPulse.asset create mode 100644 Scripts/ListView/HapticPulses/ScrollPulse.asset.meta diff --git a/Scripts/ListView/HapticPulses.meta b/Scripts/ListView/HapticPulses.meta new file mode 100644 index 000000000..25662851d --- /dev/null +++ b/Scripts/ListView/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 84e533c3547705847afea00ac56b5268 +folderAsset: yes +timeCreated: 1497405314 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/ListView/HapticPulses/ScrollPulse.asset b/Scripts/ListView/HapticPulses/ScrollPulse.asset new file mode 100644 index 000000000..73499bfa1 --- /dev/null +++ b/Scripts/ListView/HapticPulses/ScrollPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: NewHapticPulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 1 + m_FadeIn: 0 + m_FadeOut: 0 diff --git a/Scripts/ListView/HapticPulses/ScrollPulse.asset.meta b/Scripts/ListView/HapticPulses/ScrollPulse.asset.meta new file mode 100644 index 000000000..6db384843 --- /dev/null +++ b/Scripts/ListView/HapticPulses/ScrollPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 77319cd620700db49a9223c7305480f9 +timeCreated: 1497405427 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From fef8dd0c5296a44043124739453411e5219d079a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 19:08:13 -0700 Subject: [PATCH 405/870] Assign scroll haptic pulses to Hierarchy & Inspector prefabs --- Workspaces/HierarchyWorkspace/Hierarchy.prefab | 1 + Workspaces/InspectorWorkspace/Inspector.prefab | 1 + 2 files changed, 2 insertions(+) diff --git a/Workspaces/HierarchyWorkspace/Hierarchy.prefab b/Workspaces/HierarchyWorkspace/Hierarchy.prefab index 110c88ee8..49617d399 100644 --- a/Workspaces/HierarchyWorkspace/Hierarchy.prefab +++ b/Workspaces/HierarchyWorkspace/Hierarchy.prefab @@ -351,6 +351,7 @@ MonoBehaviour: m_MaxMomentum: 2 m_Templates: - {fileID: 1000014066556564, guid: 3a8d15e2004808b45bbe8ddf381a4a53, type: 2} + m_ScrollPulse: {fileID: 11400000, guid: 77319cd620700db49a9223c7305480f9, type: 2} m_SettleSpeed: 0.3 m_ScrollSpeed: 0.3 m_TopDropZone: {fileID: 114000012826007938} diff --git a/Workspaces/InspectorWorkspace/Inspector.prefab b/Workspaces/InspectorWorkspace/Inspector.prefab index 820599456..86b50f58a 100644 --- a/Workspaces/InspectorWorkspace/Inspector.prefab +++ b/Workspaces/InspectorWorkspace/Inspector.prefab @@ -199,6 +199,7 @@ MonoBehaviour: - {fileID: 1000011895958286, guid: 725903e2d75124941aeef1b3b4665af7, type: 2} - {fileID: 1000011895958286, guid: 418bc42ed57b2d44f8ae875dea54b2a0, type: 2} - {fileID: 1000012284357972, guid: fe34d0f58fe4fe94d8e9316a1af1e79b, type: 2} + m_ScrollPulse: {fileID: 11400000, guid: 77319cd620700db49a9223c7305480f9, type: 2} m_SettleSpeed: 0.3 m_ScrollSpeed: 0.3 m_RowCubeMaterial: {fileID: 2100000, guid: 7076eefb0e29024489a88aac0cac7403, type: 2} From 177a9296e953fc88a495fccf84be7df3e7e99116 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 13 Jun 2017 19:09:00 -0700 Subject: [PATCH 406/870] Assign click and highlight haptic pulses to WorkspaceBases resize button --- Workspaces/Base/WorkspaceBase.prefab | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index 723967d02..d9e1795b8 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -2494,8 +2494,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 - m_ClickPulse: {fileID: 0} - m_HighlightPulse: {fileID: 0} + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000012775033414 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2602,8 +2602,8 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 - m_ClickPulse: {fileID: 0} - m_HighlightPulse: {fileID: 0} + m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} + m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000013720459270 MonoBehaviour: m_ObjectHideFlags: 1 From 239fb3f95919017dfce756c04f5551e03bff702d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 14 Jun 2017 11:36:48 -0700 Subject: [PATCH 407/870] Implement direct punch through using face normal --- .../Modules/SnappingModule/SnappingModule.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 4dc7a27c1..74b400a38 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -25,12 +25,13 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_ManipulatorGroundSnapMax = 0.15f; const float k_ManipulatorSurfaceSnapConstrainedBreakDist = 0.1f; - const float k_DirectMinSearchDistance = 0.03f; + const float k_DirectBreakDistance = 0.05f; const float k_SnapDistanceScale = 0.75f; const float k_BlockedBreakScale = 5f; const float k_DirectGroundSnapMin = 0.03f; const float k_DirectGroundSnapMax = 0.07f; const float k_MaxRayDot = -0.5f; + const float k_RayExtra = 0.05f; const float k_WidgetScale = 0.03f; @@ -630,7 +631,7 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 var bounds = state.identityBounds; var boundsCenter = bounds.center; - var breakDistance = this.GetViewerScale() * k_DirectMinSearchDistance; + var breakDistance = this.GetViewerScale() * k_DirectBreakDistance; if (state.surfaceSnapping) { @@ -650,31 +651,33 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 offset = rotation * offset; - var boundsBreakDist = Mathf.Max(breakDistance, projectedExtents.magnitude); + //var boundsBreakDist = Mathf.Max(breakDistance, projectedExtents.magnitude); var snappingNormal = state.snappingNormal; var breakVector = targetPosition - position; if (Vector3.Dot(snappingNormal, breakVector) < 0) { - boundsBreakDist *= k_BlockedBreakScale; - var rayBackOutDist = projectedExtents.magnitude * 2; - var raycastDistance = projectedExtents.magnitude * 3; + //var boundsBreakDist = Mathf.Max(projectedExtents.magnitude * 2, breakDistance * k_BlockedBreakScale); + var boundsBreakDist = breakDistance * k_BlockedBreakScale; + var raycastDistance = breakDistance + k_RayExtra * this.GetViewerScale(); + directionVector = rotation * directionVector; - var boundsRay = new Ray(targetPosition - offset + snappingNormal * (breakVector.magnitude + rayBackOutDist), -snappingNormal); + var boundsRay = new Ray(targetPosition + snappingNormal * breakVector.magnitude, directionVector); - GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.blue, boundsBreakDist); - GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.green, breakVector.magnitude); + GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.red, raycastDistance); + GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.blue, boundsBreakDist); + GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.green, breakVector.magnitude); - if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) - return true; + //if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, boundsBreakDist)) + // return true; - if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, boundsBreakDist)) + if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; } else { - GizmoModule.instance.DrawRay(position, targetPosition - position, Color.blue, breakDistance); - GizmoModule.instance.DrawRay(position, targetPosition - position, Color.green, Vector3.Distance(position, targetPosition)); + GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.blue, breakDistance); + GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.green, breakVector.magnitude); } } @@ -719,9 +722,6 @@ static bool TryBreakSurfaceSnap(ref Vector3 position, ref Quaternion rotation, V { if (state.surfaceSnapping) { - GizmoModule.instance.DrawRay(position, targetPosition - position, Color.blue, breakDistance); - GizmoModule.instance.DrawRay(position, targetPosition - position, Color.green, Vector3.Distance(position, targetPosition)); - if (Vector3.Distance(position, targetPosition) > breakDistance) { position = targetPosition; From 22c65614511990bb4126dd03dcf48ab4e58741fa Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 14 Jun 2017 14:51:26 -0700 Subject: [PATCH 408/870] Reduce flying speed; Change SelectionTool to consume multi-select as long as anything is selected --- Tools/LocomotionTool/LocomotionTool.cs | 5 ++--- Tools/SelectionTool/SelectionTool.cs | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index a0d69e6a2..72a1ad905 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -4,7 +4,6 @@ using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; -using UnityEngine.Serialization; using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Tools @@ -12,8 +11,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ISetDefaultRayVisibility, ICustomActionMap, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider { - const float k_FastMoveSpeed = 25f; - const float k_SlowMoveSpeed = 5f; + const float k_FastMoveSpeed = 20f; + const float k_SlowMoveSpeed = 4f; const float k_RotationDamping = 0.2f; //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index f1e018d57..02f413e5d 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -143,9 +143,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_PressedObject != null) this.SetHighlight(m_PressedObject, false, rayOrigin); - - if (selectionInput.multiSelect.isHeld) - consumeControl(selectionInput.multiSelect); } if (m_PressedObject) @@ -153,6 +150,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PressedObject = null; } + + if (Selection.gameObjects.Length > 0 && selectionInput.multiSelect.wasJustPressed) + consumeControl(selectionInput.multiSelect); } bool GetSelectionCandidate(ref GameObject hoveredObject) From fe5cac09e59dd24410a45d50f6fd96d88cce2dcb Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 14 Jun 2017 15:24:06 -0700 Subject: [PATCH 409/870] Disable monkey crawl on the hand which most recently selected an object --- Tools/SelectionTool/SelectionTool.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 02f413e5d..7ad255116 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -11,12 +11,13 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, ICanGrabObject { - GameObject m_PressedObject; - public ActionMap actionMap { get { return m_ActionMap; } } [SerializeField] ActionMap m_ActionMap; + GameObject m_PressedObject; + bool m_DidSelectObjects; + readonly Dictionary m_HoverGameObjects = new Dictionary(); readonly Dictionary m_SelectionHoverGameObjects = new Dictionary(); @@ -139,6 +140,17 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { if (m_PressedObject == hoveredObject) { + if (m_PressedObject != null) + { + m_DidSelectObjects = true; + + foreach (SelectionTool linkedObject in linkedObjects) + { + if (linkedObject != this) + linkedObject.m_DidSelectObjects = false; + } + } + this.SelectObject(m_PressedObject, rayOrigin, selectionInput.multiSelect.isHeld, true); if (m_PressedObject != null) @@ -151,7 +163,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PressedObject = null; } - if (Selection.gameObjects.Length > 0 && selectionInput.multiSelect.wasJustPressed) + if (m_DidSelectObjects && selectionInput.multiSelect.wasJustPressed) consumeControl(selectionInput.multiSelect); } From 72722bff53b1aa118f1e37447d8b6cb567a1dd22 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 14 Jun 2017 17:24:31 -0700 Subject: [PATCH 410/870] Clean up SnappingModule; Fix prefab issue in settings menu --- .../Prefabs/MenuFaceSnapping.prefab | 4 ++-- Scripts/Modules/SnappingModule/SnappingModule.cs | 15 ++++++--------- Tools/TransformTool/TransformTool.cs | 8 +++++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Scripts/Modules/SnappingModule/Prefabs/MenuFaceSnapping.prefab b/Scripts/Modules/SnappingModule/Prefabs/MenuFaceSnapping.prefab index 0e504449d..0eeb88213 100644 --- a/Scripts/Modules/SnappingModule/Prefabs/MenuFaceSnapping.prefab +++ b/Scripts/Modules/SnappingModule/Prefabs/MenuFaceSnapping.prefab @@ -403,7 +403,7 @@ GameObject: - component: {fileID: 114000012781285154} - component: {fileID: 222000013846753968} m_Layer: 5 - m_Name: LocalOnly + m_Name: LimitRadius m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -2158,7 +2158,7 @@ MonoBehaviour: m_SurfaceSnappingEnabled: {fileID: 114000012943056720} m_PivotSnappingEnabled: {fileID: 114000013071561082} m_RotationSnappingEnabled: {fileID: 114000010532990664} - m_LocalOnly: {fileID: 114000012781285154} + m_LimitRadius: {fileID: 114000012781285154} m_ManipulatorSnappingEnabled: {fileID: 114000010948304686} m_DirectSnappingEnabled: {fileID: 114000013490178622} --- !u!114 &114000013560910782 diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 74b400a38..ab17ab2fc 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -631,7 +631,8 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 var bounds = state.identityBounds; var boundsCenter = bounds.center; - var breakDistance = this.GetViewerScale() * k_DirectBreakDistance; + var viewerScale = this.GetViewerScale(); + var breakDistance = viewerScale * k_DirectBreakDistance; if (state.surfaceSnapping) { @@ -651,25 +652,21 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 offset = rotation * offset; - //var boundsBreakDist = Mathf.Max(breakDistance, projectedExtents.magnitude); - var snappingNormal = state.snappingNormal; var breakVector = targetPosition - position; if (Vector3.Dot(snappingNormal, breakVector) < 0) { - //var boundsBreakDist = Mathf.Max(projectedExtents.magnitude * 2, breakDistance * k_BlockedBreakScale); var boundsBreakDist = breakDistance * k_BlockedBreakScale; - var raycastDistance = breakDistance + k_RayExtra * this.GetViewerScale(); + var raycastDistance = breakDistance + k_RayExtra * viewerScale; directionVector = rotation * directionVector; - var boundsRay = new Ray(targetPosition + snappingNormal * breakVector.magnitude, directionVector); + var boundsRay = new Ray(targetPosition + rotation * boundsCenter - Vector3.Project(breakVector, directionVector), directionVector); - GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.red, raycastDistance); GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.blue, boundsBreakDist); GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.green, breakVector.magnitude); - //if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, boundsBreakDist)) - // return true; + if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, boundsBreakDist)) + return true; if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 21f7f02c0..1a4f3aea8 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -72,9 +72,11 @@ public void UpdatePositions(IUsesSnapping usesSnapping) if (usesSnapping.DirectSnap(rayOrigin, grabbedObject, ref position, ref rotation, targetPosition, targetRotation)) { - var deltaTime = Time.deltaTime; - grabbedObject.position = Vector3.Lerp(grabbedObject.position, position, k_DirectLazyFollowTranslate * deltaTime); - grabbedObject.rotation = Quaternion.Lerp(grabbedObject.rotation, rotation, k_DirectLazyFollowRotate * deltaTime); + //var deltaTime = Time.deltaTime; + //grabbedObject.position = Vector3.Lerp(grabbedObject.position, position, k_DirectLazyFollowTranslate * deltaTime); + //grabbedObject.rotation = Quaternion.Lerp(grabbedObject.rotation, rotation, k_DirectLazyFollowRotate * deltaTime); + grabbedObject.position = position; + grabbedObject.rotation = rotation; } else { From 790645679e9fc3c6237322f857aca7d43345fb8b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:08:32 -0700 Subject: [PATCH 411/870] Add new IRayToNode interface; used to request a node for a given ray origin --- .../FunctionalityInjection/IRayToNode.cs | 18 ++++++++++++++++++ .../FunctionalityInjection/IRayToNode.cs.meta | 12 ++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs.meta diff --git a/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs b/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs new file mode 100644 index 000000000..fbcb75263 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs @@ -0,0 +1,18 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provide the ability to request a corresponding node for a ray origin + /// + public interface IRayToNode + { + /// + /// Get the corresponding node for a given ray origin + /// + Func requestNodeFromRayOrigin { set; } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs.meta new file mode 100644 index 000000000..9386d47ff --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 7750aaabe645b7a42ba6054fba2ff272 +timeCreated: 1480994231 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 489aaabfda5eca37946642de4e6de0f40ec894b6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:11:24 -0700 Subject: [PATCH 412/870] Remove GetNodeFromRayOrigin function assignment to HapticModule, in EditorVR --- Scripts/Core/EditorVR.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 350c1179e..da63f78cd 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -197,8 +197,7 @@ void Awake() return false; }; - var hapticsModule = AddModule(); - hapticsModule.getNodeFromRayOrigin = Tools.GetNodeFromRayOrigin; + AddModule(); viewer.AddPlayerModel(); From aaf2e6d00f5c750509e3d2607d7ac2312d6ad1e2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:14:51 -0700 Subject: [PATCH 413/870] Add requestNodeFromRayOrigin functionality assignment to EditorVR.Rays ConnectInterface function --- Scripts/Core/EditorVR.Rays.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 642085c4e..e55edb5a5 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -88,6 +88,10 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) } } + var rayToNode = obj as IRayToNode; + if (rayToNode != null) + rayToNode.requestNodeFromRayOrigin = Tools.RequestNodeFromRayOrigin; + var selectionModule = obj as SelectionModule; if (selectionModule) { From d8f3a913da1413fe9ad281085b9b7feacaedead8 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:15:48 -0700 Subject: [PATCH 414/870] Rename GetNodeFromRayOrigin to RequestNodeFromRayOrigin in EditorVR.Tools --- Scripts/Core/EditorVR.Tools.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index f403a950b..0ed691842 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -367,7 +367,7 @@ internal static void UpdatePlayerHandleMaps(List maps) } } - internal static Node? GetNodeFromRayOrigin(Transform rayOrigin) + internal static Node? RequestNodeFromRayOrigin(Transform rayOrigin) { Node? node = null; Rays.ForEachProxyDevice(deviceData => From 41a2dfe3e67ff175797100f8a7c9c57e252ec9fe Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:21:10 -0700 Subject: [PATCH 415/870] Perform relevant ray origin to node architecture changes in HapticsModule; increase masterIntensity max clamped value to 10 --- .../Modules/HapticsModule/HapticsModule.cs | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index d1db817db..979a0dd0e 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class HapticsModule : MonoBehaviour, IUsesGameObjectLocking + sealed class HapticsModule : MonoBehaviour { [SerializeField] float m_MasterIntensity = 1f; @@ -15,13 +15,7 @@ sealed class HapticsModule : MonoBehaviour, IUsesGameObjectLocking /// A value to 0 will mute haptics. /// A value of 1 will allow haptics to be performed at normal intensity /// - public float masterIntensity { set { m_MasterIntensity = Mathf.Clamp01(value); } } - - /// - /// Fetch a corresponding node for a given transform. - /// Used to get the device node on which to perform the haptic feedback. - /// - public Func getNodeFromRayOrigin { private get; set; } + public float masterIntensity { set { m_MasterIntensity = Mathf.Clamp(value, 0f, 10f); } } #if ENABLE_OVR_INPUT OVRHaptics.OVRHapticsChannel m_LHapticsChannel; @@ -52,9 +46,9 @@ void LateUpdate() /// /// Pulse haptic feedback /// - /// Device RayOrigin Transform on which to perform the pulse. A NULL value will pulse on all devices + /// Node on which to perform the pulse. /// Haptic pulse - public void Pulse(Transform rayOrigin, HapticPulse hapticPulse) + public void Pulse(Node? node, HapticPulse hapticPulse) { #if ENABLE_OVR_INPUT // Clip buffer can hold up to 800 milliseconds of samples @@ -100,7 +94,7 @@ public void Pulse(Transform rayOrigin, HapticPulse hapticPulse) } const float kMaxSimultaneousClipDuration = 0.25f; - var channel = GetTargetChannel(rayOrigin); + var channel = GetTargetChannel(node); if (duration > kMaxSimultaneousClipDuration) { // Prevent multiple long clips from playing back simultaneously @@ -132,32 +126,32 @@ public void Pulse(Transform rayOrigin, HapticPulse hapticPulse) #endif } - public void StopPulses(Transform rayOrigin = null) + public void StopPulses(Node? node) { #if ENABLE_OVR_INPUT - // Stop haptic feedback on only one device, if specified via the function parameter - // Otherwise stop all haptic feedback on all devices - if (rayOrigin == null) - { - m_RHapticsChannel.Clear(); - m_LHapticsChannel.Clear(); - } + var channel = GetTargetChannel(node); + if (channel != null) + channel.Clear(); else - { - var channel = GetTargetChannel(rayOrigin); - if (channel != null) - channel.Clear(); - else - Debug.LogWarning("Only null, or valid ray origins can stop pulse playback."); - } + Debug.LogWarning("Only null, or valid ray origins can stop pulse playback."); +#endif + } + + public void StopPulses() + { +#if ENABLE_OVR_INPUT + m_RHapticsChannel.Clear(); + m_LHapticsChannel.Clear(); #endif } #if ENABLE_OVR_INPUT - OVRHaptics.OVRHapticsChannel GetTargetChannel(Transform rayOrigin) + OVRHaptics.OVRHapticsChannel GetTargetChannel(Node? node) { OVRHaptics.OVRHapticsChannel channel = null; - var node = getNodeFromRayOrigin (rayOrigin); + if (node == null) + return channel; + switch (node) { case Node.LeftHand: @@ -166,6 +160,9 @@ OVRHaptics.OVRHapticsChannel GetTargetChannel(Transform rayOrigin) case Node.RightHand: channel = m_RHapticsChannel; break; + default: + Debug.LogWarning("Invalid node. Could not fetch haptics channel."); + break; } return channel; From c226cb4e6a468d168ca6a1af4bc05090db31ece4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:23:26 -0700 Subject: [PATCH 416/870] Perform ray origin to node refactor on IControlHaptics --- .../FunctionalityInjection/IControlHaptics.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs index a3f746ee9..467ce4006 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs @@ -13,31 +13,31 @@ public interface IControlHaptics public static class IControlHapticsMethods { - internal delegate void PulseDelegate(Transform rayOrigin, HapticPulse hapticPulse); + internal delegate void PulseDelegate(Node? node, HapticPulse hapticPulse); internal static PulseDelegate pulse { get; set; } /// /// Perform a haptic feedback pulse /// - /// Device RayOrigin/Transform on which to control the pulse. A NULL value will pulse on all devices + /// Node on which to control the pulse /// Haptic pulse to perform - public static void Pulse(this IControlHaptics obj, Transform rayOrigin, HapticPulse hapticPulse) + public static void Pulse(this IControlHaptics obj, Node? node, HapticPulse hapticPulse) { - pulse(rayOrigin, hapticPulse); + pulse(node, hapticPulse); } - internal delegate void StopPulsesDelegate(Transform rayOrigin); + internal delegate void StopPulsesDelegate(Node? node); internal static StopPulsesDelegate stopPulses { get; set; } /// /// Stop all haptic feedback on a specific device, or all devices /// - /// Device RayOrigin/Transform on which to stop all pulses. A NULL value will stop pulses on all devices - public static void StopPulses(this IControlHaptics obj, Transform rayOrigin) + /// Device RayOrigin/Transform on which to stop all pulses. A NULL value will stop pulses on all devices + public static void StopPulses(this IControlHaptics obj, Node? node) { - stopPulses(rayOrigin); + stopPulses(node); } } } From afe8e1bd94e3062a38499888ea21db0778aebb60 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:24:51 -0700 Subject: [PATCH 417/870] Perform ray origin to node refactor on MainMenu --- Menus/MainMenu/MainMenu.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index c0de73048..2affa9093 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IUsesRayOrigin, IControlHaptics + sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IControlHaptics, IUsesNode { public ActionMap actionMap { get {return m_MainMenuActionMap; } } [SerializeField] @@ -73,7 +73,7 @@ public bool visible public List menuActions { get; set; } public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } - public Transform rayOrigin { get; set; } + public Node? node { get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } @@ -109,7 +109,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon || mainMenuInput.flickFace.wasJustReleased) { m_MainMenuUI.targetFaceIndex += (int)Mathf.Sign(rotationInput); - this.Pulse(rayOrigin, m_FaceRotationPulse); + this.Pulse(node, m_FaceRotationPulse); consumeControl(mainMenuInput.flickFace); } From 35b543ab8b3699f0fa977fd5a7715a1bb73fedd3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:25:24 -0700 Subject: [PATCH 418/870] Perform ray origin to node refactor on MainMenuActivator --- Scripts/UI/MainMenuActivator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index d5f7b3f3e..a637c52d7 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IUsesRayOrigin, IControlHaptics + sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IControlHaptics, IUsesHandedRayOrigin { readonly Vector3 m_OriginalActivatorLocalPosition = new Vector3(0f, 0f, -0.075f); static readonly float kAlternateLocationOffset = 0.06f; @@ -70,6 +70,7 @@ public bool activatorButtonMoveAway public Transform rayOrigin { private get; set; } public Transform menuOrigin { private get; set; } + public Node? node { get; set; } public event Action hoverStarted; public event Action hoverEnded; @@ -90,7 +91,7 @@ public void OnPointerEnter(PointerEventData eventData) m_HighlightCoroutine = null; m_HighlightCoroutine = StartCoroutine(Highlight()); - this.Pulse(rayOrigin, m_HoverPulse); + this.Pulse(node, m_HoverPulse); } public void OnPointerExit(PointerEventData eventData) From 93c7e7b3442112f3a6342638e5965ba9a29fd28c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:26:23 -0700 Subject: [PATCH 419/870] Perform ray origin to node refactor on MainMenuUI --- Menus/MainMenu/Scripts/MainMenuUI.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index dade33c20..e517ad33d 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IUsesRayOrigin, IControlHaptics + sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IControlHaptics, IUsesNode, IConnectInterfaces { public class ButtonData { @@ -138,10 +138,10 @@ public Transform alternateMenuOrigin public int faceCount { get { return m_MenuFaces.Length; } } - public Transform rayOrigin { get; set; } - public HapticPulse faceRotationPulse { get { return m_RotatePulse; } } + public Node? node { get; set; } + public bool visible { get { return m_VisibilityState == VisibilityState.Visible || m_VisibilityState == VisibilityState.TransitioningIn; } @@ -258,6 +258,7 @@ public void CreateFaceButton(ButtonData buttonData, Action butto buttonData.sectionName = k_UncategorizedFaceName; mainMenuButton.SetData(buttonData.name, buttonData.description); + this.ConnectInterfaces(mainMenuButton); var found = m_FaceButtons.Any(x => x.Key == buttonData.sectionName); if (found) @@ -413,7 +414,7 @@ IEnumerator AnimateShow() m_VisibilityState = VisibilityState.TransitioningIn; - this.Pulse(rayOrigin, m_ShowPulse); + this.Pulse(node, m_ShowPulse); foreach (var face in m_MenuFaces) { @@ -456,7 +457,7 @@ IEnumerator AnimateHide() m_VisibilityState = VisibilityState.TransitioningOut; - this.Pulse(rayOrigin, m_HidePulse); + this.Pulse(node , m_HidePulse); foreach (var face in m_MenuFaces) { From 41caebefc987a8708e59abcc44d309b0ea20e748 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:31:43 -0700 Subject: [PATCH 420/870] Perform ray origin to node refactor on MainMenuButton --- Menus/MainMenu/Scripts/MainMenuButton.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 21b0e06ab..acea0f146 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; @@ -7,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnterHandler, IPointerClickHandler + sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnterHandler, IPointerClickHandler, IRayToNode { public Button button { get { return m_Button; } } [SerializeField] @@ -26,13 +27,15 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnte HapticPulse m_HoverPulse; Color m_OriginalColor; - Transform m_RayOrigin; + Node? m_InputNode; public string tooltipText { get; set; } + public Func requestNodeFromRayOrigin { private get; set; } + public void OnPointerClick(PointerEventData eventData) { - this.Pulse(m_RayOrigin, m_ClickPulse); + this.Pulse(m_InputNode, m_ClickPulse); } public bool selected @@ -59,7 +62,7 @@ private void Awake() void OnDisable() { - m_RayOrigin = null; + m_InputNode = null; } public void SetData(string name, string description) @@ -70,13 +73,13 @@ public void SetData(string name, string description) public void OnRayEnter(RayEventData eventData) { - m_RayOrigin = eventData.rayOrigin; - this.Pulse(eventData.rayOrigin, m_HoverPulse); + m_InputNode = requestNodeFromRayOrigin(eventData.rayOrigin); + this.Pulse(m_InputNode, m_HoverPulse); } public void OnRayExit(RayEventData eventData) { - m_RayOrigin = null; + m_InputNode = null; } } } From d8f8754de44793ee452ceb781e0e75ba08567052 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:32:15 -0700 Subject: [PATCH 421/870] Perform ray origin to node refactor on PinnedToolButton --- Menus/PinnedToolButton/PinnedToolButton.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolButton/PinnedToolButton.cs index f629a02d7..f4b75700c 100644 --- a/Menus/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolButton/PinnedToolButton.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolButton : MonoBehaviour, ISelectTool, IPointerEnterHandler, IControlHaptics + sealed class PinnedToolButton : MonoBehaviour, ISelectTool, IPointerEnterHandler, IControlHaptics, IUsesNode { public Type toolType { @@ -43,6 +43,8 @@ public Type toolType public Transform rayOrigin { get; set; } + public Node? node { get; set; } + void Start() { m_GradientButton.click += OnClick; @@ -52,12 +54,12 @@ void Start() void OnClick() { SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); - this.Pulse(rayOrigin, m_ClickPulse); + this.Pulse(node, m_ClickPulse); } public void OnPointerEnter(PointerEventData eventData) { - this.Pulse(rayOrigin, m_HoverPulse); + this.Pulse(node, m_HoverPulse); } // Create periodic table-style names for types From 678d7842ce8d95c651c9df48e8ee9daa04802686 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:33:33 -0700 Subject: [PATCH 422/870] Perform ray origin to node refactor on WorkspaceButton --- Workspaces/Common/Scripts/WorkspaceButton.cs | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 1d367e23c..7c5587a90 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using System.Collections; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; @@ -10,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, IUsesStencilRef, IControlHaptics + sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, IUsesStencilRef, IControlHaptics, IRayToNode { const float k_IconHighlightedLocalZOffset = -0.0015f; const string k_MaterialAlphaProperty = "_Alpha"; @@ -143,7 +144,6 @@ public bool alternateIconVisible GradientPair m_OriginalGradientPair; GradientPair m_HighlightGradientPair; - Transform m_RayOrigin; Vector3 m_IconDirection; Material m_ButtonMaterial; Material m_ButtonMaskMaterial; @@ -155,6 +155,7 @@ public bool alternateIconVisible Color m_OriginalColor; Sprite m_OriginalIconSprite; float m_VisibleLocalZScale; + Node? m_Node; // The initial button reveal coroutines, before highlighting Coroutine m_VisibilityCoroutine; @@ -164,20 +165,19 @@ public bool alternateIconVisible Coroutine m_HighlightCoroutine; Coroutine m_IconHighlightCoroutine; - public Button button - { - get { return m_Button; } - } + public Button button { get { return m_Button; } } public byte stencilRef { get; set; } + public Func requestNodeFromRayOrigin { get; set; } + public void InstantClearState() { this.StopCoroutine(ref m_IconHighlightCoroutine); this.StopCoroutine(ref m_HighlightCoroutine); ResetColors(); - m_RayOrigin = null; + m_Node = null; } public void SetMaterialColors(GradientPair gradientPair) @@ -328,7 +328,7 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.Pulse(m_RayOrigin, m_HighlightPulse); + this.Pulse(m_Node, m_HighlightPulse); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); @@ -458,7 +458,7 @@ IEnumerator IconContainerContentsEndHighlight() public void OnRayEnter(RayEventData eventData) { - m_RayOrigin = eventData.rayOrigin; + m_Node = requestNodeFromRayOrigin(eventData.rayOrigin); if (autoHighlight) highlighted = true; @@ -466,7 +466,7 @@ public void OnRayEnter(RayEventData eventData) public void OnRayExit(RayEventData eventData) { - m_RayOrigin = null; + m_Node = null; if (autoHighlight) highlighted = false; @@ -480,7 +480,7 @@ void SwapIconSprite() void OnButtonClicked() { - this.Pulse(m_RayOrigin, m_ClickPulse); + this.Pulse(m_Node, m_ClickPulse); } } } From 8aaee875cd75fec0aabe0b4e6675e2821085f6b1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:35:00 -0700 Subject: [PATCH 423/870] Perform ray origin to node refactor on WorkspaceUI --- Workspaces/Base/WorkspaceUI.cs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 68a80d696..d8ab66734 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IControlHaptics + sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IControlHaptics, IRayToNode, IUsesNode { const int k_AngledFaceBlendShapeIndex = 2; const int k_ThinFrameBlendShapeIndex = 3; @@ -165,6 +165,7 @@ enum ResizeDirection class DragState { public Transform rayOrigin { get; private set; } + public Node? node { get; private set; } bool m_Resizing; Vector3 m_PositionOffset; Quaternion m_RotationOffset; @@ -174,7 +175,7 @@ class DragState Vector3 m_BoundsSizeStart; ResizeDirection m_Direction; - public DragState(WorkspaceUI workspaceUI, Transform rayOrigin, bool resizing) + public DragState(WorkspaceUI workspaceUI, Transform rayOrigin, Node? node, bool resizing) { m_WorkspaceUI = workspaceUI; m_Resizing = resizing; @@ -255,12 +256,12 @@ public void OnDragging() + transform.forward * (absForward - (currentExtents.z - extents.z)) * Mathf.Sign(positionOffsetForward); m_WorkspaceUI.transform.parent.position = m_PositionStart + positionOffset * viewerScale; - m_WorkspaceUI.PerformResizeHaptic(rayOrigin); + m_WorkspaceUI.PerformResizeHaptic(node); } else { MathUtilsExt.SetTransformOffset(rayOrigin, m_WorkspaceUI.transform.parent, m_PositionOffset, m_RotationOffset); - m_WorkspaceUI.PerformMoveHaptic(rayOrigin); + m_WorkspaceUI.PerformMoveHaptic(node); } } } @@ -347,6 +348,8 @@ public bool preventResize public Transform leftRayOrigin { private get; set; } public Transform rightRayOrigin { private get; set; } + public Node? node { get; set; } + public Func requestNodeFromRayOrigin { get; set; } public event Action resize; @@ -760,7 +763,7 @@ public void ProcessInput(WorkspaceInput input, ConsumeControlDelegate consumeCon if (dragRayOrigin) { - m_DragState = new DragState(this, dragRayOrigin, resizing); + m_DragState = new DragState(this, dragRayOrigin, requestNodeFromRayOrigin(dragRayOrigin), resizing); if (dragResizeIcon != null) dragResizeIcon.CrossFadeAlpha(0f, k_ResizeIconCrossfadeDuration, true); @@ -828,7 +831,7 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount, Transform rayOrigin) // If hovering the frame, and not dragging, perform haptic feedback if (m_HovereringRayOrigins.Count > 0 && m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.Pulse(rayOrigin, m_FrameHoverPulse); + this.Pulse(node, m_FrameHoverPulse); m_FrameThicknessCoroutine = null; } @@ -871,14 +874,14 @@ IEnumerator HideTopFace() m_TopFaceVisibleCoroutine = null; } - void PerformMoveHaptic(Transform rayOrigin) + void PerformMoveHaptic(Node? node) { - this.Pulse(rayOrigin, m_MovePulse); + this.Pulse(node, m_MovePulse); } - void PerformResizeHaptic(Transform rayOrigin) + void PerformResizeHaptic(Node? node) { - this.Pulse(rayOrigin, m_ResizePulse); + this.Pulse(node, m_ResizePulse); } } } From f5d9f3c62ca55f30682c3dafbcb08012375844b0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:36:42 -0700 Subject: [PATCH 424/870] Perform ray origin to node refactor on SelectionModule --- Scripts/Modules/SelectionModule/SelectionModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Scripts/Modules/SelectionModule/SelectionModule.cs b/Scripts/Modules/SelectionModule/SelectionModule.cs index cd0869a91..9207277ea 100644 --- a/Scripts/Modules/SelectionModule/SelectionModule.cs +++ b/Scripts/Modules/SelectionModule/SelectionModule.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelectionChanged, IControlHaptics + sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelectionChanged, IControlHaptics, IRayToNode { [SerializeField] HapticPulse m_HoverPulse; @@ -17,6 +17,7 @@ sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelection public Func getGroupRoot { private get; set; } public Func overrideSelectObject { private get; set; } + public Func requestNodeFromRayOrigin { get; set; } public event Action selected; @@ -69,7 +70,7 @@ public void SelectObject(GameObject hoveredObject, Transform rayOrigin, bool mul m_SelectedObjects.Clear(); if (hoveredObject) - this.Pulse(rayOrigin, m_HoverPulse); + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_HoverPulse); // Multi-Select if (multiSelect) From 45c222dde50285e0b78658ce5d98cc516e9595a1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:42:04 -0700 Subject: [PATCH 425/870] Assign haptic pulse references to PinnedToolButton prefab --- Menus/PinnedToolButton/PinnedToolButton.prefab | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Menus/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolButton/PinnedToolButton.prefab index c8559618a..2b3155f6c 100644 --- a/Menus/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolButton/PinnedToolButton.prefab @@ -368,6 +368,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_GradientButton: {fileID: 114000010373680160} + m_HoverPulse: {fileID: 11400000, guid: 53f100a1dd0839141bcace2ecd8cc6b1, type: 2} + m_ClickPulse: {fileID: 11400000, guid: 90be55fd9292d1e4eb8af66c479333b6, type: 2} --- !u!114 &114000012566785296 MonoBehaviour: m_ObjectHideFlags: 1 From 8c8f7761d4aa38f098218101142d938cd40b428f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:51:14 -0700 Subject: [PATCH 426/870] Perform ray origin to node refactor on StandardManupulator --- Manipulators/StandardManipulator.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index daadb3583..665dfb889 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Handles; @@ -7,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Manipulators { - sealed class StandardManipulator : BaseManipulator, IControlHaptics + sealed class StandardManipulator : BaseManipulator, IControlHaptics, IRayToNode { [SerializeField] Transform m_PlaneHandlesParent; @@ -21,6 +22,8 @@ sealed class StandardManipulator : BaseManipulator, IControlHaptics [SerializeField] HapticPulse m_RotatePulse; + public Func requestNodeFromRayOrigin { get; set; } + protected override void OnEnable() { base.OnEnable(); @@ -76,14 +79,14 @@ void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) { translate(eventData.deltaPosition, eventData.rayOrigin, !(handle is SphereHandle)); - this.Pulse(eventData.rayOrigin, m_DragPulse); + this.Pulse(requestNodeFromRayOrigin(eventData.rayOrigin), m_DragPulse); } void OnRotateDragging(BaseHandle handle, HandleEventData eventData) { rotate(eventData.deltaRotation); - this.Pulse(eventData.rayOrigin, m_RotatePulse); + this.Pulse(requestNodeFromRayOrigin(eventData.rayOrigin), m_RotatePulse); } void OnHandleDragStarted(BaseHandle handle, HandleEventData eventData) From 9669cdf3e159253dfb8ca8523da3d345d2693554 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 01:52:08 -0700 Subject: [PATCH 427/870] Connect interfaces on StandardManipulator after initially fetching it in EditorVR.Rays --- Scripts/Core/EditorVR.Rays.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index e55edb5a5..12aeea6d9 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -427,7 +427,10 @@ internal void PreProcessRaycastSource(Transform rayOrigin) var matrix = camera.worldToCameraMatrix; if (!m_StandardManipulator) + { m_StandardManipulator = evr.GetComponentInChildren(); + ConnectInterface(m_StandardManipulator); + } if (m_StandardManipulator) m_StandardManipulator.AdjustScale(cameraPosition, matrix); From 91db4cd70a78e2f3d2f3604603091276b8f003a0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 02:02:14 -0700 Subject: [PATCH 428/870] Rename RadialMenu's selection haptic pulse --- .../{SelectionOccurred.asset => SelectionPulse.asset} | 0 .../{SelectionOccurred.asset.meta => SelectionPulse.asset.meta} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Menus/RadialMenu/HapticPulses/{SelectionOccurred.asset => SelectionPulse.asset} (100%) rename Menus/RadialMenu/HapticPulses/{SelectionOccurred.asset.meta => SelectionPulse.asset.meta} (100%) diff --git a/Menus/RadialMenu/HapticPulses/SelectionOccurred.asset b/Menus/RadialMenu/HapticPulses/SelectionPulse.asset similarity index 100% rename from Menus/RadialMenu/HapticPulses/SelectionOccurred.asset rename to Menus/RadialMenu/HapticPulses/SelectionPulse.asset diff --git a/Menus/RadialMenu/HapticPulses/SelectionOccurred.asset.meta b/Menus/RadialMenu/HapticPulses/SelectionPulse.asset.meta similarity index 100% rename from Menus/RadialMenu/HapticPulses/SelectionOccurred.asset.meta rename to Menus/RadialMenu/HapticPulses/SelectionPulse.asset.meta From ad4cdfcbd174f9615947a2e9f016b4f96a760812 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 02:09:10 -0700 Subject: [PATCH 429/870] Perform ray origin to node refactor on RadialMenuUI --- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index f4e86d3b0..5c971ad44 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IControlHaptics + sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IControlHaptics, IUsesNode { const int k_SlotCount = 16; @@ -30,7 +30,7 @@ sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IControlHaptics RadialMenuSlot m_HighlightedButton; float m_PhaseOffset; // Correcting the coordinates, based on actions count, so that the menu is centered at the bottom - public Transform rayOrigin { private get; set; } + public Node? node { get; set; } public Transform alternateMenuOrigin { @@ -340,7 +340,7 @@ public void SelectionOccurred() if (m_HighlightedButton != null) m_HighlightedButton.button.onClick.Invoke(); - this.Pulse(rayOrigin, m_SelectionPulse); + this.Pulse(node, m_SelectionPulse); } } } From 45732ddca016524a06590c2d421566fea2fc5da3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 02:09:33 -0700 Subject: [PATCH 430/870] Perform ray origin to node refactor on RadialMenuSlot --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 492318b73..771a32181 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler, IControlHaptics + sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler, IControlHaptics, IUsesNode { static Color s_FrameOpaqueColor; static readonly Vector3 k_HiddenLocalScale = new Vector3(1f, 0f, 1f); @@ -93,7 +93,7 @@ public bool highlighted if (m_HighlightCoroutine == null) m_HighlightCoroutine = StartCoroutine(Highlight()); - this.Pulse(rayOrigin, m_HighlightedPulse); + this.Pulse(node, m_HighlightedPulse); } else { @@ -212,6 +212,8 @@ public Material borderRendererMaterial public Transform rayOrigin { get; set; } + public Node? node { get; set; } + void Awake() { m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); From 3c7dbfda86a93574e2b65b5986dc72ad9ac4b5b4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 02:10:08 -0700 Subject: [PATCH 431/870] Assign release button haptic pulse reference to RadialMenu --- Menus/RadialMenu/RadialMenu.cs.meta | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Menus/RadialMenu/RadialMenu.cs.meta b/Menus/RadialMenu/RadialMenu.cs.meta index 89bb1d210..4f5cfe043 100644 --- a/Menus/RadialMenu/RadialMenu.cs.meta +++ b/Menus/RadialMenu/RadialMenu.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 11fd46c50e83ee74083fc3e7b3f226d9 -timeCreated: 1474493510 +timeCreated: 1497517484 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -9,6 +9,7 @@ MonoImporter: type: 2} - m_RadialMenuPrefab: {fileID: 114000010592100496, guid: 7cc49adc1d2485a4e812f2c7d9697c2f, type: 2} + - m_ReleasePulse: {fileID: 11400000, guid: a6ee67beed128b24cb4ab7a7399d6584, type: 2} executionOrder: 0 icon: {instanceID: 0} userData: From fd63ed9aadf4e6a1973877b799d7354a80a98ab4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 02:11:40 -0700 Subject: [PATCH 432/870] Perform ray origin to node refactor on RadialMenu --- Menus/RadialMenu/RadialMenu.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index 153c44ffb..e5995381c 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap, IControlHaptics + sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap, IControlHaptics, IUsesNode, IConnectInterfaces { public ActionMap actionMap { get {return m_RadialMenuActionMap; } } [SerializeField] @@ -73,14 +73,16 @@ public bool visible public GameObject menuContent { get { return m_RadialMenuUI.gameObject; } } + public Node? node { get; set; } + void Start() { m_RadialMenuUI = this.InstantiateUI(m_RadialMenuPrefab.gameObject).GetComponent(); m_RadialMenuUI.alternateMenuOrigin = alternateMenuOrigin; m_RadialMenuUI.actions = menuActions; + this.ConnectInterfaces(m_RadialMenuUI); // Connect interfaces before performing setup on the UI m_RadialMenuUI.Setup(); m_RadialMenuUI.visible = m_Visible; - m_RadialMenuUI.rayOrigin = rayOrigin; } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -107,7 +109,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (radialMenuInput.selectItem.wasJustReleased) { - this.Pulse(rayOrigin, m_ReleasePulse); + this.Pulse(node, m_ReleasePulse); m_RadialMenuUI.SelectionOccurred(); From 97ad9d21b6a72f93feab1ecb2550400db14f0025 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 02:16:55 -0700 Subject: [PATCH 433/870] Perform haptic function renaming --- Workspaces/Base/WorkspaceUI.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index d8ab66734..c98952df0 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -256,12 +256,12 @@ public void OnDragging() + transform.forward * (absForward - (currentExtents.z - extents.z)) * Mathf.Sign(positionOffsetForward); m_WorkspaceUI.transform.parent.position = m_PositionStart + positionOffset * viewerScale; - m_WorkspaceUI.PerformResizeHaptic(node); + m_WorkspaceUI.ResizeHapticPulse(node); } else { MathUtilsExt.SetTransformOffset(rayOrigin, m_WorkspaceUI.transform.parent, m_PositionOffset, m_RotationOffset); - m_WorkspaceUI.PerformMoveHaptic(node); + m_WorkspaceUI.MoveHapticPulse(node); } } } @@ -874,12 +874,12 @@ IEnumerator HideTopFace() m_TopFaceVisibleCoroutine = null; } - void PerformMoveHaptic(Node? node) + void MoveHapticPulse(Node? node) { this.Pulse(node, m_MovePulse); } - void PerformResizeHaptic(Node? node) + void ResizeHapticPulse(Node? node) { this.Pulse(node, m_ResizePulse); } From e36c8c6d2fc6dbca0fde8c8fd3912fc55c387276 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 10:34:30 -0700 Subject: [PATCH 434/870] Assign haptic pulse references on Radial Menu prefabs --- Menus/RadialMenu/Prefabs/RadialMenu.prefab | 1 + Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab | 1 + 2 files changed, 2 insertions(+) diff --git a/Menus/RadialMenu/Prefabs/RadialMenu.prefab b/Menus/RadialMenu/Prefabs/RadialMenu.prefab index 4bfd93032..b50d6ecaf 100644 --- a/Menus/RadialMenu/Prefabs/RadialMenu.prefab +++ b/Menus/RadialMenu/Prefabs/RadialMenu.prefab @@ -161,6 +161,7 @@ MonoBehaviour: m_RadialMenuSlotTemplate: {fileID: 114000012271381704, guid: 4872d564ea911b540a7ab701540783ea, type: 2} m_SlotContainer: {fileID: 4000011673098958} + m_SelectionPulse: {fileID: 11400000, guid: d86223b7a32efef4b89034ed0b2b2a29, type: 2} --- !u!114 &114000010897832654 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab b/Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab index 09b1c2a43..6643eab72 100644 --- a/Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab +++ b/Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab @@ -534,6 +534,7 @@ MonoBehaviour: m_Button: {fileID: 114000011110648212} m_BorderRenderer: {fileID: 23000014264746152} m_FrameRenderer: {fileID: 23000010833860060} + m_HighlightedPulse: {fileID: 11400000, guid: f4d6d7970557c44408a22ad5f3bce270, type: 2} m_TooltipTarget: {fileID: 4000010666759626} m_TooltipSource: {fileID: 4000011568490198} --- !u!114 &114000013317744718 From b308b2a7914c9f9a9c61fe73b0954d33644485dc Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 12:35:02 -0700 Subject: [PATCH 435/870] Remove CreateHapticPulse class; will be handled with CreateAssetMenu attribute in HapticPulse --- .../HapticsModule/CreateHapticPulse.cs | 29 ------------------- .../HapticsModule/CreateHapticPulse.cs.meta | 12 -------- 2 files changed, 41 deletions(-) delete mode 100644 Scripts/Modules/HapticsModule/CreateHapticPulse.cs delete mode 100644 Scripts/Modules/HapticsModule/CreateHapticPulse.cs.meta diff --git a/Scripts/Modules/HapticsModule/CreateHapticPulse.cs b/Scripts/Modules/HapticsModule/CreateHapticPulse.cs deleted file mode 100644 index 722939e46..000000000 --- a/Scripts/Modules/HapticsModule/CreateHapticPulse.cs +++ /dev/null @@ -1,29 +0,0 @@ -#if UNITY_EDITOR -using System.IO; -using UnityEngine; - -namespace UnityEditor.Experimental.EditorVR.Core -{ - public class CreateHapticPulse - { - [MenuItem("Assets/Create/EditorVR/HapticPulse")] - public static void CreateMyAsset() - { - HapticPulse asset = ScriptableObject.CreateInstance(); - - string path = AssetDatabase.GetAssetPath(Selection.activeObject); - if (path == string.Empty) - path = "Assets"; - else if (Path.GetExtension(path) != string.Empty) - path = path.Replace(Path.GetFileName(AssetDatabase.GetAssetPath(Selection.activeObject)), string.Empty); - - string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/NewHapticPulse.asset"); - - AssetDatabase.CreateAsset(asset, assetPathAndName); - AssetDatabase.SaveAssets(); - EditorUtility.FocusProjectWindow(); - Selection.activeObject = asset; - } - } -} -#endif diff --git a/Scripts/Modules/HapticsModule/CreateHapticPulse.cs.meta b/Scripts/Modules/HapticsModule/CreateHapticPulse.cs.meta deleted file mode 100644 index f73255ee2..000000000 --- a/Scripts/Modules/HapticsModule/CreateHapticPulse.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 16ec16f4938f32f439b4bda4ac946b08 -timeCreated: 1496960625 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 5496954640f32878c0046df1613311dcd24d1735 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 12:36:22 -0700 Subject: [PATCH 436/870] Add CreateAssetMenu attribute to HapticPulse; used to create HapticPulses (scriptable objects) --- Scripts/Modules/HapticsModule/HapticPulse.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/Modules/HapticsModule/HapticPulse.cs b/Scripts/Modules/HapticsModule/HapticPulse.cs index 862d2b465..2b82e6842 100644 --- a/Scripts/Modules/HapticsModule/HapticPulse.cs +++ b/Scripts/Modules/HapticsModule/HapticPulse.cs @@ -3,6 +3,7 @@ namespace UnityEditor.Experimental.EditorVR.Core { + [CreateAssetMenu(menuName = "EditorVR/EditorVR Haptic Pulse", fileName = "NewHapticPulse.asset")] public class HapticPulse : ScriptableObject { [SerializeField] From 1f8c78f2da5b17880d42c47d34b113404ed0df80 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 15 Jun 2017 13:16:25 -0700 Subject: [PATCH 437/870] Move RequestNodeFromRayOrigin into EditorVR.Rays; remove ForEachProxyDevice call in the function; add proxy marching (for matching ray) to the function itself (less allocation) --- Scripts/Core/EditorVR.Rays.cs | 22 +++++++++++++++++++++- Scripts/Core/EditorVR.Tools.cs | 12 ------------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 12aeea6d9..a50a0cebb 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -90,7 +90,7 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) var rayToNode = obj as IRayToNode; if (rayToNode != null) - rayToNode.requestNodeFromRayOrigin = Tools.RequestNodeFromRayOrigin; + rayToNode.requestNodeFromRayOrigin = RequestNodeFromRayOrigin; var selectionModule = obj as SelectionModule; if (selectionModule) @@ -441,6 +441,26 @@ internal void PreProcessRaycastSource(Transform rayOrigin) if (m_ScaleManipulator) m_ScaleManipulator.AdjustScale(cameraPosition, matrix); } + + static Node? RequestNodeFromRayOrigin(Transform rayOrigin) + { + Node? node = null; + var evrDeviceData = evr.m_DeviceData; + for (var i = 0; i < evrDeviceData.Count; i++) + { + var deviceData = evrDeviceData[i]; + if (!deviceData.proxy.active) + continue; + + if (deviceData.rayOrigin == rayOrigin) + { + node = deviceData.node; + break; + } + } + + return node; + } } } } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 0ed691842..c2c1d019b 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -366,18 +366,6 @@ internal static void UpdatePlayerHandleMaps(List maps) } } } - - internal static Node? RequestNodeFromRayOrigin(Transform rayOrigin) - { - Node? node = null; - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - node = deviceData.node; - }); - - return node; - } } } } From db87154ab8cb779035189d7671080552e1009da5 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 15 Jun 2017 16:28:00 -0700 Subject: [PATCH 438/870] Clean up code; Fix edge cases --- .../Modules/SnappingModule/SnappingModule.cs | 80 ++++++++++++------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index ab17ab2fc..727e2c896 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -25,13 +25,13 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_ManipulatorGroundSnapMax = 0.15f; const float k_ManipulatorSurfaceSnapConstrainedBreakDist = 0.1f; - const float k_DirectBreakDistance = 0.05f; + const float k_DirectBreakDistance = 0.04f; const float k_SnapDistanceScale = 0.75f; const float k_BlockedBreakScale = 5f; const float k_DirectGroundSnapMin = 0.03f; const float k_DirectGroundSnapMax = 0.07f; const float k_MaxRayDot = -0.5f; - const float k_RayExtra = 0.05f; + const float k_RayExtra = 0.02f; const float k_WidgetScale = 0.03f; @@ -545,7 +545,7 @@ bool ManipulatorSnapToSurface(Ray pointerRay, ref Vector3 position, ref Quaterni var maxRayLength = this.GetViewerScale() * k_SurfaceSnappingMaxRayLength; return SnapToSurface(pointerRay, ref position, ref rotation, state, offset, targetRotation , rotationOffset, upVector, maxRayLength) - || TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, 0); + || TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, 0); } bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, Vector3 delta, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, ConstrainedAxis constraints, PivotMode pivotMode) @@ -588,16 +588,18 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V boundsOffset = targetPosition - axisRay.origin; } - if (state.surfaceSnapping) + if (state.surfaceSnapping || state.groundSnapping) { var breakDistance = raycastDistance; if (Vector3.Dot(targetPosition - position, state.snappingNormal) < 0) breakDistance *= k_BlockedBreakScale; - TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance); + TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, breakDistance); return true; } + //if (axisRay.or) + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; @@ -618,11 +620,9 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) return true; - if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, startRotation, state, raycastDistance)) + if (TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, raycastDistance)) return true; - GizmoModule.instance.DrawSphere(targetPosition + Vector3.up, 0.01f, Color.gray); - return false; } @@ -657,25 +657,32 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 if (Vector3.Dot(snappingNormal, breakVector) < 0) { var boundsBreakDist = breakDistance * k_BlockedBreakScale; - var raycastDistance = breakDistance + k_RayExtra * viewerScale; - directionVector = rotation * directionVector; + var raycastDistance = projectedExtents.magnitude + breakVector.magnitude; + directionVector = targetRotation * directionVector; - var boundsRay = new Ray(targetPosition + rotation * boundsCenter - Vector3.Project(breakVector, directionVector), directionVector); - - GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.blue, boundsBreakDist); - GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.green, breakVector.magnitude); + var boundsRay = new Ray(targetPosition - Vector3.Project(breakVector, directionVector), directionVector); + if (pivotSnappingEnabled) + { + var extra = k_RayExtra * viewerScale; + raycastDistance += extra; + boundsRay.origin -= directionVector * extra; + } + else + { + boundsRay.origin += targetRotation * boundsCenter; + } - if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, boundsBreakDist)) + if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, boundsBreakDist)) return true; if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; + + return true; } - else - { - GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.blue, breakDistance); - GizmoModule.instance.DrawRay(state.snappingPosition, breakVector, Color.green, breakVector.magnitude); - } + + if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) + return true; } for (var i = 0; i < k_Directions.Length; i++) @@ -693,37 +700,42 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 else offset += projectedExtents; - var placementOffset = rotation * offset; - offset = targetRotation * offset; - - var raycastDistance = Mathf.Max(breakDistance, projectedExtents.magnitude); + offset = rotation * offset; - var boundsRay = new Ray(targetPosition - offset, targetRotation * directionVector); + var raycastDistance = breakDistance; + if (!pivotSnappingEnabled) + raycastDistance += projectedExtents.magnitude; - GizmoModule.instance.DrawRay(boundsRay.origin, boundsRay.direction, Color.yellow, raycastDistance); + var boundsRay = new Ray(targetPosition, targetRotation * directionVector); + if (!pivotSnappingEnabled) + boundsRay.origin += targetRotation * boundsCenter; - if (SnapToSurface(boundsRay, ref position, ref rotation, state, placementOffset, targetRotation, rotationOffset, upVector, raycastDistance, k_MaxRayDot)) + if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance, k_MaxRayDot)) { state.directionIndex = i; return true; } } - if (TryBreakSurfaceSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) + if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakDistance)) + return true; + + if (TryBreakSnap(ref position, ref rotation, state.snappingPosition, targetRotation, state, breakDistance)) return true; return false; } - static bool TryBreakSurfaceSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance) + static bool TryBreakSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance) { - if (state.surfaceSnapping) + if (state.surfaceSnapping || state.groundSnapping) { if (Vector3.Distance(position, targetPosition) > breakDistance) { position = targetPosition; rotation = targetRotation; state.surfaceSnapping = false; + state.groundSnapping = false; state.snappingNormal = Vector3.up; return true; } @@ -778,7 +790,6 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp state.surfaceSnapping = true; state.groundSnapping = false; - GizmoModule.instance.DrawSphere(snappedPosition, 0.01f, Color.green); position = snappedPosition; rotation = rotationSnappingEnabled ? snappedRotation : targetRotation; @@ -835,12 +846,19 @@ bool LocalSnapToGround(ref Vector3 position, ref Quaternion rotation, Vector3 ta bool GlobalSnapToGround(Ray ray, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, Vector3 boundsOffset = default(Vector3)) { + if (Mathf.Approximately(Vector3.Dot(ray.direction, Vector3.up), 0)) + return false; + + GizmoModule.instance.DrawRay(ray.origin, ray.direction, Color.red, raycastDistance); + var groundPlane = new Plane(Vector3.up, k_GroundHeight); float distance; if (groundPlane.Raycast(ray, out distance) && distance <= raycastDistance) { state.groundSnapping = true; + state.snappingNormal = -Vector3.Project(ray.direction, Vector3.up).normalized; + var hitPoint = ray.origin + ray.direction * distance; var snappedPosition = pivotSnappingEnabled ? hitPoint : hitPoint + boundsOffset; position = snappedPosition; From a3d4077ffe0d68ae5d8453bfb5143fc23a6038b4 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 15 Jun 2017 16:50:04 -0700 Subject: [PATCH 439/870] Treat the ground like any other surface --- .../Modules/SnappingModule/SnappingModule.cs | 150 ++++++------------ 1 file changed, 47 insertions(+), 103 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 727e2c896..5755010c2 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -21,15 +21,9 @@ sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProv const float k_GroundHeight = 0f; - const float k_ManipulatorGroundSnapMin = 0.05f; - const float k_ManipulatorGroundSnapMax = 0.15f; - const float k_ManipulatorSurfaceSnapConstrainedBreakDist = 0.1f; - - const float k_DirectBreakDistance = 0.04f; + const float k_BreakDistance = 0.04f; const float k_SnapDistanceScale = 0.75f; const float k_BlockedBreakScale = 5f; - const float k_DirectGroundSnapMin = 0.03f; - const float k_DirectGroundSnapMax = 0.07f; const float k_MaxRayDot = -0.5f; const float k_RayExtra = 0.02f; @@ -467,39 +461,41 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec switch (constraints) { case 0: - var pointerRay = new Ray(rayOrigin.position, rayOrigin.forward); - if (surfaceSnappingEnabled) + if (limitRadius) { - if (limitRadius) - { - if (DirectSnapToSurface(ref position, ref rotation, targetPosition, targetRotation, state)) - return true; - } - else - { - if(ManipulatorSnapToSurface(pointerRay, ref position, ref rotation, targetPosition, targetRotation, state)) - return true; - } + if (LocalSnapToSurface(ref position, ref rotation, targetPosition, targetRotation, state)) + return true; } - - if (groundSnappingEnabled) + else { - if (limitRadius) + var pointerRay = new Ray(rayOrigin.position, rayOrigin.forward); + if (surfaceSnappingEnabled) { - if (LocalSnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_ManipulatorGroundSnapMin, breakScale * k_ManipulatorGroundSnapMax)) + var bounds = state.identityBounds; + var boundsExtents = bounds.extents; + var projectedExtents = Vector3.Project(boundsExtents, Vector3.down); + var offset = projectedExtents - bounds.center; + var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); + var startRotation = state.startRotation; + var upVector = startRotation * Vector3.back; + var maxRayLength = this.GetViewerScale() * k_SurfaceSnappingMaxRayLength; + + if (SnapToSurface(pointerRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, maxRayLength) + || TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, 0)) return true; } - else + + if (groundSnappingEnabled) { var raycastDistance = this.GetViewerScale() * k_GroundSnappingMaxRayLength; - if (GlobalSnapToGround(pointerRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance)) + if (SnapToGround(pointerRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance)) return true; } } break; default: - if (ManipulatorSnapConstrained(ref position, ref rotation, delta, targetPosition, targetRotation, state, breakScale * k_ManipulatorSurfaceSnapConstrainedBreakDist, constraints, pivotMode)) + if (ManipulatorSnapConstrained(ref position, ref rotation, delta, targetPosition, targetRotation, state, breakScale * k_BreakDistance, constraints, pivotMode)) return true; break; } @@ -519,11 +515,7 @@ public bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 pos state.currentPosition = targetPosition; AddToIgnoreList(transform); - if (surfaceSnappingEnabled && DirectSnapToSurface(ref position, ref rotation, targetPosition, targetRotation, state)) - return true; - - var viewerScale = this.GetViewerScale(); - if (groundSnappingEnabled && LocalSnapToGround(ref position, ref rotation, targetPosition, targetRotation, state, viewerScale * k_DirectGroundSnapMin, viewerScale * k_DirectGroundSnapMax)) + if (LocalSnapToSurface(ref position, ref rotation, targetPosition, targetRotation, state)) return true; } @@ -533,21 +525,6 @@ public bool DirectSnap(Transform rayOrigin, Transform transform, ref Vector3 pos return false; } - bool ManipulatorSnapToSurface(Ray pointerRay, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state) - { - var bounds = state.identityBounds; - var boundsExtents = bounds.extents; - var projectedExtents = Vector3.Project(boundsExtents, Vector3.down); - var offset = projectedExtents - bounds.center; - var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); - var startRotation = state.startRotation; - var upVector = startRotation * Vector3.back; - var maxRayLength = this.GetViewerScale() * k_SurfaceSnappingMaxRayLength; - - return SnapToSurface(pointerRay, ref position, ref rotation, state, offset, targetRotation , rotationOffset, upVector, maxRayLength) - || TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, 0); - } - bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, Vector3 delta, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, ConstrainedAxis constraints, PivotMode pivotMode) { var rotationOffset = Quaternion.AngleAxis(90, Vector3.right); @@ -560,7 +537,7 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V var axisRay = new Ray(targetPosition, direction); var objectCenter = Vector3.zero; - var boundsOffset = Vector3.zero; + var offset = Vector3.zero; if (!pivotSnappingEnabled) { @@ -585,7 +562,7 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V } axisRay.origin = objectCenter - projectedExtents; - boundsOffset = targetPosition - axisRay.origin; + offset = targetPosition - axisRay.origin; } if (state.surfaceSnapping || state.groundSnapping) @@ -600,10 +577,10 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V //if (axisRay.or) - if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetRotation, rotationOffset, upVector, raycastDistance)) + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; - if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) + if (groundSnappingEnabled && SnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, offset)) return true; // Check other direction @@ -611,13 +588,13 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V if (!pivotSnappingEnabled) { axisRay.origin = objectCenter + projectedExtents; - boundsOffset = targetPosition - axisRay.origin; + offset = targetPosition - axisRay.origin; } - if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, boundsOffset, targetRotation, rotationOffset, upVector, raycastDistance)) + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) return true; - if (groundSnappingEnabled && GlobalSnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, boundsOffset)) + if (groundSnappingEnabled && SnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, offset)) return true; if (TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, raycastDistance)) @@ -626,15 +603,15 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V return false; } - bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state) + bool LocalSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state) { var bounds = state.identityBounds; var boundsCenter = bounds.center; var viewerScale = this.GetViewerScale(); - var breakDistance = viewerScale * k_DirectBreakDistance; + var breakDistance = viewerScale * k_BreakDistance; - if (state.surfaceSnapping) + if (state.surfaceSnapping || state.groundSnapping) { var directionIndex = state.directionIndex; var direction = k_Directions[directionIndex]; @@ -675,7 +652,10 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, boundsBreakDist)) return true; - if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) + if (surfaceSnappingEnabled && SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) + return true; + + if (groundSnappingEnabled && SnapToGround(boundsRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, offset)) return true; return true; @@ -710,7 +690,13 @@ bool DirectSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 if (!pivotSnappingEnabled) boundsRay.origin += targetRotation * boundsCenter; - if (SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance, k_MaxRayDot)) + if (surfaceSnappingEnabled && SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance, k_MaxRayDot)) + { + state.directionIndex = i; + return true; + } + + if (groundSnappingEnabled && SnapToGround(boundsRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, offset)) { state.directionIndex = i; return true; @@ -802,55 +788,11 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp return false; } - - bool LocalSnapToGround(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float groundSnapMin, float groundSnapMax) - { - var diffGround = Mathf.Abs(targetPosition.y - k_GroundHeight); - - var bounds = state.rotatedBounds; - if (rotationSnappingEnabled) - bounds = state.identityBounds; - - var offset = bounds.center.y - bounds.extents.y; - - if (!pivotSnappingEnabled) - diffGround = Mathf.Abs(targetPosition.y + offset - k_GroundHeight); - - if (diffGround < groundSnapMin) - state.groundSnapping = true; - - if (diffGround > groundSnapMax) - { - state.groundSnapping = false; - position = targetPosition; - rotation = targetRotation; - } - - if (state.groundSnapping) - { - if (pivotSnappingEnabled) - targetPosition.y = k_GroundHeight; - else - targetPosition.y = k_GroundHeight - offset; - - position = targetPosition; - - if (rotationSnappingEnabled) - rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); - - return true; - } - - return false; - } - - bool GlobalSnapToGround(Ray ray, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, Vector3 boundsOffset = default(Vector3)) + bool SnapToGround(Ray ray, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, Vector3 boundsOffset = default(Vector3)) { if (Mathf.Approximately(Vector3.Dot(ray.direction, Vector3.up), 0)) return false; - GizmoModule.instance.DrawRay(ray.origin, ray.direction, Color.red, raycastDistance); - var groundPlane = new Plane(Vector3.up, k_GroundHeight); float distance; if (groundPlane.Raycast(ray, out distance) && distance <= raycastDistance) @@ -865,6 +807,8 @@ bool LocalSnapToGround(ref Vector3 position, ref Quaternion rotation, Vector3 ta if (rotationSnappingEnabled) rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); + else + rotation = targetRotation; return true; } From b97484590f53f06154dbdfea2b52ba4f5e338283 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 15 Jun 2017 18:17:53 -0700 Subject: [PATCH 440/870] Clean up more edge cases; Re-enable smoothing on direct snapping --- .../Modules/SnappingModule/SnappingModule.cs | 75 ++++++++----------- Tools/TransformTool/TransformTool.cs | 11 +-- 2 files changed, 39 insertions(+), 47 deletions(-) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 5755010c2..b5101d626 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -49,10 +49,10 @@ class SnappingState public Vector3 currentPosition { get; set; } public bool groundSnapping { get; set; } public bool surfaceSnapping { get; set; } + public bool snapping { get { return surfaceSnapping || groundSnapping; } } public Quaternion startRotation { get; private set; } public Bounds identityBounds { get; private set; } - public Bounds rotatedBounds { get; private set; } public Transform widget { get; set; } public Vector3 snappingPosition { get; set; } @@ -64,8 +64,6 @@ public SnappingState(Transform[] transforms, Vector3 position, Quaternion rotati { currentPosition = position; startRotation = rotation; - - Bounds rotatedBounds; Bounds identityBounds; if (transforms.Length == 1) @@ -73,15 +71,12 @@ public SnappingState(Transform[] transforms, Vector3 position, Quaternion rotati var transform = transforms[0]; var objRotation = transform.rotation; - rotatedBounds = ObjectUtils.GetBounds(transform); transform.rotation = Quaternion.identity; identityBounds = ObjectUtils.GetBounds(transform); transform.rotation = objRotation; } else { - rotatedBounds = ObjectUtils.GetBounds(transforms); - float angle; Vector3 axis; rotation.ToAngleAxis(out angle, out axis); @@ -97,9 +92,6 @@ public SnappingState(Transform[] transforms, Vector3 position, Quaternion rotati transform.transform.RotateAround(position, axis, angle); } } - - rotatedBounds.center -= position; - this.rotatedBounds = rotatedBounds; identityBounds.center -= position; this.identityBounds = identityBounds; } @@ -480,9 +472,10 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec var upVector = startRotation * Vector3.back; var maxRayLength = this.GetViewerScale() * k_SurfaceSnappingMaxRayLength; - if (SnapToSurface(pointerRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, maxRayLength) - || TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, 0)) + if (SnapToSurface(pointerRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, maxRayLength)) return true; + + state.surfaceSnapping = false; } if (groundSnappingEnabled) @@ -491,6 +484,9 @@ public bool ManipulatorSnap(Transform rayOrigin, Transform[] transforms, ref Vec if (SnapToGround(pointerRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance)) return true; } + + if (TryBreakSnap(ref position, ref rotation, targetPosition, targetRotation, state, breakScale * k_BreakDistance)) + return true; } break; @@ -565,7 +561,7 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V offset = targetPosition - axisRay.origin; } - if (state.surfaceSnapping || state.groundSnapping) + if (state.snapping) { var breakDistance = raycastDistance; if (Vector3.Dot(targetPosition - position, state.snappingNormal) < 0) @@ -575,12 +571,10 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V return true; } - //if (axisRay.or) - - if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance, constrained: true)) return true; - if (groundSnappingEnabled && SnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, offset)) + if (groundSnappingEnabled && SnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, offset, true)) return true; // Check other direction @@ -591,10 +585,10 @@ bool ManipulatorSnapConstrained(ref Vector3 position, ref Quaternion rotation, V offset = targetPosition - axisRay.origin; } - if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance)) + if (surfaceSnappingEnabled && SnapToSurface(axisRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance, constrained: true)) return true; - if (groundSnappingEnabled && SnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, offset)) + if (groundSnappingEnabled && SnapToGround(axisRay, ref position, ref rotation, targetPosition, targetRotation, state, raycastDistance, offset, true)) return true; if (TryBreakSnap(ref position, ref rotation, targetPosition, startRotation, state, raycastDistance)) @@ -607,11 +601,12 @@ bool LocalSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 t { var bounds = state.identityBounds; var boundsCenter = bounds.center; + var boundsExtents = bounds.extents; var viewerScale = this.GetViewerScale(); var breakDistance = viewerScale * k_BreakDistance; - if (state.surfaceSnapping || state.groundSnapping) + if (state.snapping) { var directionIndex = state.directionIndex; var direction = k_Directions[directionIndex]; @@ -619,7 +614,6 @@ bool LocalSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 t var directionVector = direction.direction; var rotationOffset = direction.rotationOffset; - var boundsExtents = bounds.extents; var projectedExtents = Vector3.Project(boundsExtents, directionVector); var offset = -boundsCenter; if (directionIndex > 2) @@ -671,24 +665,22 @@ bool LocalSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 t var upVector = targetRotation * direction.upVector; var directionVector = direction.direction; var rotationOffset = direction.rotationOffset; - - var boundsExtents = bounds.extents; - var projectedExtents = Vector3.Project(boundsExtents, directionVector); - var offset = -boundsCenter; - if (i > 2) - offset -= projectedExtents; - else - offset += projectedExtents; - - offset = rotation * offset; - - var raycastDistance = breakDistance; + var offset = Vector3.zero; if (!pivotSnappingEnabled) - raycastDistance += projectedExtents.magnitude; + { + var projectedExtents = Vector3.Project(boundsExtents, directionVector); + offset = -boundsCenter; + if (i > 2) + offset -= projectedExtents; + else + offset += projectedExtents; - var boundsRay = new Ray(targetPosition, targetRotation * directionVector); - if (!pivotSnappingEnabled) - boundsRay.origin += targetRotation * boundsCenter; + offset = rotation * offset; + } + + var raycastDistance = breakDistance * 2; + directionVector = targetRotation * directionVector; + var boundsRay = new Ray(targetPosition - offset - directionVector * breakDistance, directionVector); if (surfaceSnappingEnabled && SnapToSurface(boundsRay, ref position, ref rotation, state, offset, targetRotation, rotationOffset, upVector, raycastDistance, k_MaxRayDot)) { @@ -714,7 +706,7 @@ bool LocalSnapToSurface(ref Vector3 position, ref Quaternion rotation, Vector3 t static bool TryBreakSnap(ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float breakDistance) { - if (state.surfaceSnapping || state.groundSnapping) + if (state.snapping) { if (Vector3.Distance(position, targetPosition) > breakDistance) { @@ -722,7 +714,6 @@ static bool TryBreakSnap(ref Vector3 position, ref Quaternion rotation, Vector3 rotation = targetRotation; state.surfaceSnapping = false; state.groundSnapping = false; - state.snappingNormal = Vector3.up; return true; } } @@ -754,7 +745,7 @@ void AddToIgnoreList(Transform[] transforms) } } - bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, SnappingState state, Vector3 boundsOffset, Quaternion targetRotation, Quaternion rotationOffset, Vector3 upVector, float raycastDistance, float maxRayDot = Mathf.Infinity) + bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, SnappingState state, Vector3 boundsOffset, Quaternion targetRotation, Quaternion rotationOffset, Vector3 upVector, float raycastDistance, float maxRayDot = Mathf.Infinity, bool constrained = false) { RaycastHit hit; GameObject go; @@ -777,7 +768,7 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp state.groundSnapping = false; position = snappedPosition; - rotation = rotationSnappingEnabled ? snappedRotation : targetRotation; + rotation = !constrained && rotationSnappingEnabled ? snappedRotation : targetRotation; state.snappingPosition = hitPoint; state.snappingRotation = snappedRotation; @@ -788,7 +779,7 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp return false; } - bool SnapToGround(Ray ray, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, Vector3 boundsOffset = default(Vector3)) + bool SnapToGround(Ray ray, ref Vector3 position, ref Quaternion rotation, Vector3 targetPosition, Quaternion targetRotation, SnappingState state, float raycastDistance, Vector3 boundsOffset = default(Vector3), bool constrained = false) { if (Mathf.Approximately(Vector3.Dot(ray.direction, Vector3.up), 0)) return false; @@ -805,7 +796,7 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp var snappedPosition = pivotSnappingEnabled ? hitPoint : hitPoint + boundsOffset; position = snappedPosition; - if (rotationSnappingEnabled) + if (!constrained && rotationSnappingEnabled) rotation = Quaternion.LookRotation(Vector3.up, targetRotation * Vector3.back) * Quaternion.AngleAxis(90, Vector3.right); else rotation = targetRotation; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 1a4f3aea8..45aac395e 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -72,11 +72,9 @@ public void UpdatePositions(IUsesSnapping usesSnapping) if (usesSnapping.DirectSnap(rayOrigin, grabbedObject, ref position, ref rotation, targetPosition, targetRotation)) { - //var deltaTime = Time.deltaTime; - //grabbedObject.position = Vector3.Lerp(grabbedObject.position, position, k_DirectLazyFollowTranslate * deltaTime); - //grabbedObject.rotation = Quaternion.Lerp(grabbedObject.rotation, rotation, k_DirectLazyFollowRotate * deltaTime); - grabbedObject.position = position; - grabbedObject.rotation = rotation; + var deltaTime = Time.deltaTime; + grabbedObject.position = Vector3.Lerp(grabbedObject.position, position, k_DirectLazyFollowTranslate * deltaTime); + grabbedObject.rotation = Quaternion.Lerp(grabbedObject.rotation, rotation, k_DirectLazyFollowRotate * deltaTime); } else { @@ -552,6 +550,9 @@ void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints) break; default: m_CurrentlySnapping = this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta, constraints, m_PivotMode); + + if (constraints == 0) + m_CurrentlySnapping = false; break; } } From 3b35df5b96f190d720c62afe3f90d43049a3ea00 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 16 Jun 2017 00:59:18 -0700 Subject: [PATCH 441/870] Perform PR architecture changes; some cleaning up still needs to be done before review --- Manipulators/BaseManipulator.cs | 2 +- Manipulators/DirectManipulator.cs | 4 +- Manipulators/StandardManipulator.cs | 12 +--- Menus/MainMenu/MainMenu.cs | 45 +++++++++++-- Menus/MainMenu/MainMenu.cs.meta | 10 ++- Menus/MainMenu/Scripts/MainMenuButton.cs | 29 ++++---- Menus/MainMenu/Scripts/MainMenuUI.cs | 36 ++++++---- ...onPulse.asset => ButtonClickedPulse.asset} | 2 +- ...set.meta => ButtonClickedPulse.asset.meta} | 0 ...ightPulse.asset => ButtonHoverPulse.asset} | 2 +- ...asset.meta => ButtonHoverPulse.asset.meta} | 0 Menus/RadialMenu/RadialMenu.cs | 18 +++++ Menus/RadialMenu/RadialMenu.cs.meta | 6 +- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 11 ++-- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 19 ++++-- Scripts/Core/EditorVR.MiniWorlds.cs | 2 +- .../Interfaces}/IRayToNode.cs | 2 +- .../Interfaces}/IRayToNode.cs.meta | 0 Scripts/Handles/LinearHandle.cs | 4 +- Scripts/Handles/RadialHandle.cs | 2 +- Scripts/Handles/SphereHandle.cs | 2 +- Scripts/Interfaces/Entity/IManipulator.cs | 2 +- .../FunctionalityInjection/IGrabObjects.cs | 2 +- Scripts/UI/KeyboardUI.cs | 2 +- .../TransformTool}/HapticPulses.meta | 0 .../HapticPulses/DragPulse.asset | 0 .../HapticPulses/DragPulse.asset.meta | 0 .../HapticPulses/RotatePulse.asset | 0 .../HapticPulses/RotatePulse.asset.meta | 0 Tools/TransformTool/TransformTool.cs | 17 ++++- Tools/TransformTool/TransformTool.cs.meta | 6 +- Workspaces/{Common => Base}/HapticPulses.meta | 0 .../HapticPulses/FrameHoverPulse.asset | 0 .../HapticPulses/FrameHoverPulse.asset.meta | 0 .../HapticPulses/MovePulse.asset | 0 .../HapticPulses/MovePulse.asset.meta | 0 .../HapticPulses/ResizePulse.asset | 0 .../HapticPulses/ResizePulse.asset.meta | 0 .../HapticPulses/WorkspaceButtonClick.asset | 0 .../WorkspaceButtonClick.asset.meta | 0 .../HapticPulses/WorkspaceButtonHover.asset} | 0 .../WorkspaceButtonHover.asset.meta} | 0 Workspaces/Base/Workspace.cs | 56 ++++++++++++++-- Workspaces/Base/Workspace.cs.meta | 7 +- Workspaces/Base/WorkspaceBase.prefab | 18 +++-- Workspaces/Base/WorkspaceUI.cs | 66 ++++++++++++------- .../Common/Scripts/DraggableListItem.cs | 2 +- Workspaces/Common/Scripts/FilterButtonUI.cs | 36 +++++++++- Workspaces/Common/Scripts/FilterUI.cs | 20 ++++++ Workspaces/Common/Scripts/WorkspaceButton.cs | 23 ++++--- .../ConsoleWorkspace/ConsoleWorkspace.cs.meta | 10 ++- .../HierarchyWorkspace/HierarchyWorkspace.cs | 12 ++++ .../HierarchyWorkspace.cs.meta | 14 +++- .../Scripts/InspectorListViewController.cs | 2 +- .../Scripts/ListItems/InspectorListItem.cs | 2 +- .../LockedObjectsWorkspace.cs.meta | 10 ++- .../MiniWorldWorkspace.cs.meta | 10 ++- .../ProfilerWorkspace.cs.meta | 10 ++- .../ProjectWorkspace/ProjectWorkspace.cs.meta | 10 ++- 59 files changed, 405 insertions(+), 140 deletions(-) rename Menus/RadialMenu/HapticPulses/{SelectionPulse.asset => ButtonClickedPulse.asset} (93%) rename Menus/RadialMenu/HapticPulses/{SelectionPulse.asset.meta => ButtonClickedPulse.asset.meta} (100%) rename Menus/RadialMenu/HapticPulses/{HighlightPulse.asset => ButtonHoverPulse.asset} (93%) rename Menus/RadialMenu/HapticPulses/{HighlightPulse.asset.meta => ButtonHoverPulse.asset.meta} (100%) rename Scripts/{Interfaces/FunctionalityInjection => Core/Interfaces}/IRayToNode.cs (92%) rename Scripts/{Interfaces/FunctionalityInjection => Core/Interfaces}/IRayToNode.cs.meta (100%) rename {Manipulators => Tools/TransformTool}/HapticPulses.meta (100%) rename {Manipulators => Tools/TransformTool}/HapticPulses/DragPulse.asset (100%) rename {Manipulators => Tools/TransformTool}/HapticPulses/DragPulse.asset.meta (100%) rename {Manipulators => Tools/TransformTool}/HapticPulses/RotatePulse.asset (100%) rename {Manipulators => Tools/TransformTool}/HapticPulses/RotatePulse.asset.meta (100%) rename Workspaces/{Common => Base}/HapticPulses.meta (100%) rename Workspaces/{Common => Base}/HapticPulses/FrameHoverPulse.asset (100%) rename Workspaces/{Common => Base}/HapticPulses/FrameHoverPulse.asset.meta (100%) rename Workspaces/{Common => Base}/HapticPulses/MovePulse.asset (100%) rename Workspaces/{Common => Base}/HapticPulses/MovePulse.asset.meta (100%) rename Workspaces/{Common => Base}/HapticPulses/ResizePulse.asset (100%) rename Workspaces/{Common => Base}/HapticPulses/ResizePulse.asset.meta (100%) rename Workspaces/{Common => Base}/HapticPulses/WorkspaceButtonClick.asset (100%) rename Workspaces/{Common => Base}/HapticPulses/WorkspaceButtonClick.asset.meta (100%) rename Workspaces/{Common/HapticPulses/WorkspaceButtonHighlight.asset => Base/HapticPulses/WorkspaceButtonHover.asset} (100%) rename Workspaces/{Common/HapticPulses/WorkspaceButtonHighlight.asset.meta => Base/HapticPulses/WorkspaceButtonHover.asset.meta} (100%) diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index 2a13f7794..e648c4886 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -11,7 +11,7 @@ class BaseManipulator : MonoBehaviour, IManipulator public bool adjustScaleForCamera { get; set; } public Action translate { protected get; set; } - public Action rotate { protected get; set; } + public Action rotate { protected get; set; } public Action scale { protected get; set; } public bool dragging { get; protected set; } diff --git a/Manipulators/DirectManipulator.cs b/Manipulators/DirectManipulator.cs index 13c18670e..78c17fb9c 100644 --- a/Manipulators/DirectManipulator.cs +++ b/Manipulators/DirectManipulator.cs @@ -23,7 +23,7 @@ public Transform target Quaternion m_RotationOffset; public Action translate { private get; set; } - public Action rotate { private get; set; } + public Action rotate { private get; set; } public Action scale { private get; set; } public bool dragging { get; private set; } @@ -75,7 +75,7 @@ void OnHandleDragging(BaseHandle handle, HandleEventData eventData) var rayOrigin = eventData.rayOrigin; translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, false); - rotate(Quaternion.Inverse(target.rotation) * rayOrigin.rotation * m_RotationOffset); + rotate(Quaternion.Inverse(target.rotation) * rayOrigin.rotation * m_RotationOffset, eventData.rayOrigin); } void OnHandleDragEnded(BaseHandle handle, HandleEventData eventData) diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index 665dfb889..c972258d5 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -16,12 +16,6 @@ sealed class StandardManipulator : BaseManipulator, IControlHaptics, IRayToNode [SerializeField] List m_AllHandles; - [SerializeField] - HapticPulse m_DragPulse; - - [SerializeField] - HapticPulse m_RotatePulse; - public Func requestNodeFromRayOrigin { get; set; } protected override void OnEnable() @@ -78,15 +72,11 @@ void Update() void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) { translate(eventData.deltaPosition, eventData.rayOrigin, !(handle is SphereHandle)); - - this.Pulse(requestNodeFromRayOrigin(eventData.rayOrigin), m_DragPulse); } void OnRotateDragging(BaseHandle handle, HandleEventData eventData) { - rotate(eventData.deltaRotation); - - this.Pulse(requestNodeFromRayOrigin(eventData.rayOrigin), m_RotatePulse); + rotate(eventData.deltaRotation, eventData.rayOrigin); } void OnHandleDragStarted(BaseHandle handle, HandleEventData eventData) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 2affa9093..ee23f3a9f 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IControlHaptics, IUsesNode + sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IControlHaptics, IUsesNode, IRayToNode { public ActionMap actionMap { get {return m_MainMenuActionMap; } } [SerializeField] @@ -59,10 +59,23 @@ public bool visible } bool m_Visible; + [SerializeField] + HapticPulse m_FaceRotationPulse; // Not set in inspector, due to instantiation order + + [SerializeField] + HapticPulse m_ShowPulse; + + [SerializeField] + HapticPulse m_HidePulse; + [SerializeField] MainMenuUI m_MainMenuPrefab; - HapticPulse m_FaceRotationPulse; // Not set in inspector, due to instantiation order + [SerializeField] + HapticPulse m_ButtonClickPulse; + + [SerializeField] + HapticPulse m_ButtonHoverPulse; MainMenuUI m_MainMenuUI; float m_LastRotationInput; readonly Dictionary m_ToolButtons = new Dictionary(); @@ -74,6 +87,7 @@ public bool visible public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } public Node? node { get; set; } + public Func requestNodeFromRayOrigin { get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } @@ -85,9 +99,10 @@ void Start() m_MainMenuUI.menuOrigin = menuOrigin; m_MainMenuUI.Setup(); m_MainMenuUI.visible = m_Visible; - - // Pulse reference is set on the UI prefab. Fetching & cacheing for local use. - m_FaceRotationPulse = m_MainMenuUI.faceRotationPulse; + m_MainMenuUI.buttonHovered += OnButtonHovered; + m_MainMenuUI.buttonClicked += OnButtonClicked; + m_MainMenuUI.opening += OnOpening; + m_MainMenuUI.closing += OnClosing; CreateFaceButtons(menuTools); CreateFaceButtons(menuWorkspaces); @@ -207,6 +222,26 @@ void UpdateToolButtons() kvp.Value.selected = this.IsToolActive(targetRayOrigin, kvp.Key); } } + + void OnButtonClicked(Transform rayOrigin) + { + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); + } + + void OnButtonHovered(Transform rayOrigin) + { + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); + } + + void OnOpening() + { + this.Pulse(node, m_ShowPulse); + } + + void OnClosing() + { + this.Pulse(node, m_HidePulse); + } } } #endif diff --git a/Menus/MainMenu/MainMenu.cs.meta b/Menus/MainMenu/MainMenu.cs.meta index 83518ebaf..0607f5317 100644 --- a/Menus/MainMenu/MainMenu.cs.meta +++ b/Menus/MainMenu/MainMenu.cs.meta @@ -1,14 +1,22 @@ fileFormatVersion: 2 guid: 52a6f827905e5da45b04e9ad17c95d45 -timeCreated: 1472080625 +timeCreated: 1497598641 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - m_MainMenuActionMap: {fileID: 11400000, guid: 5b2451b50b5b2ff4fb3c3d8cda77aa65, type: 2} + - m_FaceRotationPulse: {fileID: 11400000, guid: f5f56317312943d4da218b9b2e6ea9d0, + type: 2} + - m_ShowPulse: {fileID: 11400000, guid: 7c69a56582b55ec41b36b49c44a42905, type: 2} + - m_HidePulse: {fileID: 11400000, guid: 29832200cc7e1744b9e98febd6d30db8, type: 2} - m_MainMenuPrefab: {fileID: 114000011808682746, guid: b7d63888e7ed4654ba750593eaa5f75c, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: f66cb0a158f54124aa4158bbad3ed702, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: dd561ccb8162d1040adba0a7ea60eadc, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index acea0f146..3d4771579 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnterHandler, IPointerClickHandler, IRayToNode + sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnterHandler, IPointerClickHandler { public Button button { get { return m_Button; } } [SerializeField] @@ -20,22 +20,15 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnte [SerializeField] private Text m_ButtonTitle; - [SerializeField] - HapticPulse m_ClickPulse; - - [SerializeField] - HapticPulse m_HoverPulse; - Color m_OriginalColor; - Node? m_InputNode; + Transform m_InteractingRayOrigin; public string tooltipText { get; set; } - public Func requestNodeFromRayOrigin { private get; set; } - public void OnPointerClick(PointerEventData eventData) { - this.Pulse(m_InputNode, m_ClickPulse); + if (clicked != null) + clicked(m_InteractingRayOrigin); } public bool selected @@ -55,6 +48,9 @@ public bool selected } } + public event Action hovered; + public event Action clicked; + private void Awake() { m_OriginalColor = m_Button.targetGraphic.color; @@ -62,7 +58,7 @@ private void Awake() void OnDisable() { - m_InputNode = null; + m_InteractingRayOrigin = null; } public void SetData(string name, string description) @@ -73,13 +69,10 @@ public void SetData(string name, string description) public void OnRayEnter(RayEventData eventData) { - m_InputNode = requestNodeFromRayOrigin(eventData.rayOrigin); - this.Pulse(m_InputNode, m_HoverPulse); - } + m_InteractingRayOrigin = eventData.rayOrigin; - public void OnRayExit(RayEventData eventData) - { - m_InputNode = null; + if (hovered != null) + hovered(eventData.rayOrigin); } } } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index e517ad33d..926d77252 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -52,15 +52,6 @@ enum VisibilityState [SerializeField] Transform m_AlternateMenu; - [SerializeField] - HapticPulse m_RotatePulse; - - [SerializeField] - HapticPulse m_ShowPulse; - - [SerializeField] - HapticPulse m_HidePulse; - public int targetFaceIndex { get { return m_TargetFaceIndex; } @@ -138,8 +129,6 @@ public Transform alternateMenuOrigin public int faceCount { get { return m_MenuFaces.Length; } } - public HapticPulse faceRotationPulse { get { return m_RotatePulse; } } - public Node? node { get; set; } public bool visible @@ -185,6 +174,11 @@ float currentRotation get { return m_MenuFaceRotationOrigin.localRotation.eulerAngles.y; } } + public event Action buttonHovered; + public event Action buttonClicked; + public event Action opening; + public event Action closing; + void Awake() { m_MenuFacesMaterial = MaterialUtils.GetMaterialClone(m_MenuFaceRotationOrigin.GetComponent()); @@ -253,6 +247,8 @@ public void CreateFaceButton(ButtonData buttonData, Action butto button.name = buttonData.name; var mainMenuButton = button.GetComponent(); buttonCreationCallback(mainMenuButton); + mainMenuButton.clicked += OnClicked; + mainMenuButton.hovered += OnHover; if (string.IsNullOrEmpty(buttonData.sectionName)) buttonData.sectionName = k_UncategorizedFaceName; @@ -414,7 +410,8 @@ IEnumerator AnimateShow() m_VisibilityState = VisibilityState.TransitioningIn; - this.Pulse(node, m_ShowPulse); + if (opening != null) + opening(); foreach (var face in m_MenuFaces) { @@ -457,7 +454,8 @@ IEnumerator AnimateHide() m_VisibilityState = VisibilityState.TransitioningOut; - this.Pulse(node , m_HidePulse); + if (closing != null) + closing(); foreach (var face in m_MenuFaces) { @@ -588,6 +586,18 @@ IEnumerator AnimateFaceReveal(int faceIndex) faceTransform.localScale = targetScale; faceTransform.localPosition = targetPosition; } + + void OnHover(Transform rayOrigin) + { + if (buttonHovered != null) + buttonHovered(rayOrigin); + } + + void OnClicked(Transform rayOrigin) + { + if (buttonClicked != null) + buttonClicked(rayOrigin); + } } } #endif diff --git a/Menus/RadialMenu/HapticPulses/SelectionPulse.asset b/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset similarity index 93% rename from Menus/RadialMenu/HapticPulses/SelectionPulse.asset rename to Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset index 0649036f1..aeb5b89f6 100644 --- a/Menus/RadialMenu/HapticPulses/SelectionPulse.asset +++ b/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: SelectionOccurred + m_Name: ButtonClickedPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.1 diff --git a/Menus/RadialMenu/HapticPulses/SelectionPulse.asset.meta b/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset.meta similarity index 100% rename from Menus/RadialMenu/HapticPulses/SelectionPulse.asset.meta rename to Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset.meta diff --git a/Menus/RadialMenu/HapticPulses/HighlightPulse.asset b/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset similarity index 93% rename from Menus/RadialMenu/HapticPulses/HighlightPulse.asset rename to Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset index 5ce4698d7..ac3775938 100644 --- a/Menus/RadialMenu/HapticPulses/HighlightPulse.asset +++ b/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: HighlightPulse + m_Name: ButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 m_Intensity: 0.2 diff --git a/Menus/RadialMenu/HapticPulses/HighlightPulse.asset.meta b/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset.meta similarity index 100% rename from Menus/RadialMenu/HapticPulses/HighlightPulse.asset.meta rename to Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset.meta diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index e5995381c..833449242 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -19,6 +19,12 @@ sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMe [SerializeField] HapticPulse m_ReleasePulse; + [SerializeField] + HapticPulse m_ButtonHoverPulse; + + [SerializeField] + HapticPulse m_ButtonClickedPulse; + RadialMenuUI m_RadialMenuUI; public List menuActions @@ -83,6 +89,8 @@ void Start() this.ConnectInterfaces(m_RadialMenuUI); // Connect interfaces before performing setup on the UI m_RadialMenuUI.Setup(); m_RadialMenuUI.visible = m_Visible; + m_RadialMenuUI.buttonHovered += OnButtonHover; + m_RadialMenuUI.buttonClicked += OnButtonClicked; } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -119,6 +127,16 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon consumeControl(radialMenuInput.selectItem); } } + + void OnButtonClicked() + { + this.Pulse(node, m_ButtonClickedPulse); + } + + void OnButtonHover() + { + this.Pulse(node, m_ButtonHoverPulse); + } } } #endif diff --git a/Menus/RadialMenu/RadialMenu.cs.meta b/Menus/RadialMenu/RadialMenu.cs.meta index 4f5cfe043..78f2f6fc1 100644 --- a/Menus/RadialMenu/RadialMenu.cs.meta +++ b/Menus/RadialMenu/RadialMenu.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 11fd46c50e83ee74083fc3e7b3f226d9 -timeCreated: 1497517484 +timeCreated: 1497597956 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -10,6 +10,10 @@ MonoImporter: - m_RadialMenuPrefab: {fileID: 114000010592100496, guid: 7cc49adc1d2485a4e812f2c7d9697c2f, type: 2} - m_ReleasePulse: {fileID: 11400000, guid: a6ee67beed128b24cb4ab7a7399d6584, type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: f4d6d7970557c44408a22ad5f3bce270, + type: 2} + - m_ButtonClickedPulse: {fileID: 11400000, guid: d86223b7a32efef4b89034ed0b2b2a29, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 771a32181..08556a772 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using System.Collections; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; @@ -10,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler, IControlHaptics, IUsesNode + sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler, IControlHaptics { static Color s_FrameOpaqueColor; static readonly Vector3 k_HiddenLocalScale = new Vector3(1f, 0f, 1f); @@ -45,9 +46,6 @@ sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, IT [SerializeField] MeshRenderer m_FrameRenderer; - [SerializeField] - HapticPulse m_HighlightedPulse; - public Transform tooltipTarget { get { return m_TooltipTarget; } } [SerializeField] Transform m_TooltipTarget; @@ -93,7 +91,8 @@ public bool highlighted if (m_HighlightCoroutine == null) m_HighlightCoroutine = StartCoroutine(Highlight()); - this.Pulse(node, m_HighlightedPulse); + if (hovered != null) + hovered(); } else { @@ -212,7 +211,7 @@ public Material borderRendererMaterial public Transform rayOrigin { get; set; } - public Node? node { get; set; } + public event Action hovered; void Awake() { diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index 5c971ad44..f856f644e 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -9,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IControlHaptics, IUsesNode + sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces { const int k_SlotCount = 16; @@ -22,15 +23,13 @@ sealed class RadialMenuUI : MonoBehaviour, IConnectInterfaces, IControlHaptics, [SerializeField] Transform m_SlotContainer; - [SerializeField] - HapticPulse m_SelectionPulse; - List m_RadialMenuSlots; Coroutine m_VisibilityCoroutine; RadialMenuSlot m_HighlightedButton; float m_PhaseOffset; // Correcting the coordinates, based on actions count, so that the menu is centered at the bottom - public Node? node { get; set; } + public event Action buttonHovered; + public event Action buttonClicked; public Transform alternateMenuOrigin { @@ -205,6 +204,7 @@ public void Setup() this.ConnectInterfaces(menuSlot); menuSlot.orderIndex = i; m_RadialMenuSlots.Add(menuSlot); + menuSlot.hovered += OnButtonHovered; if (slotBorderMaterial == null) slotBorderMaterial = menuSlot.borderRendererMaterial; @@ -340,7 +340,14 @@ public void SelectionOccurred() if (m_HighlightedButton != null) m_HighlightedButton.button.onClick.Invoke(); - this.Pulse(node, m_SelectionPulse); + if (buttonClicked != null) + buttonClicked(); + } + + void OnButtonHovered() + { + if (buttonHovered != null) + buttonHovered(); } } } diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index 22a9161eb..54901f9ab 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -388,7 +388,7 @@ internal void UpdateMiniWorlds() } // Transfer objects from miniworld to preview state - // Don't switch to previewing the objects we are dragging if we are still in another mini world + // Don't switch to previewing the objects we are moving if we are still in another mini world if (!containedInOtherMiniWorld) { // Check for player head diff --git a/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs b/Scripts/Core/Interfaces/IRayToNode.cs similarity index 92% rename from Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs rename to Scripts/Core/Interfaces/IRayToNode.cs index fbcb75263..36cbfa817 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs +++ b/Scripts/Core/Interfaces/IRayToNode.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR /// /// Provide the ability to request a corresponding node for a ray origin /// - public interface IRayToNode + interface IRayToNode { /// /// Get the corresponding node for a given ray origin diff --git a/Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs.meta b/Scripts/Core/Interfaces/IRayToNode.cs.meta similarity index 100% rename from Scripts/Interfaces/FunctionalityInjection/IRayToNode.cs.meta rename to Scripts/Core/Interfaces/IRayToNode.cs.meta diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index e1b5fb94a..c5a3a22fc 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -59,7 +59,7 @@ private void UpdateHandleTip(LinearHandleEventData eventData) { m_HandleTip.gameObject.SetActive(m_HoverSources.Count > 0 || m_DragSources.Count > 0); - if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering or dragging + if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering or moving { if (eventData != null) m_HandleTip.position = @@ -73,7 +73,7 @@ void UpdatePlaneOrientation(Transform rayOrigin) { if (m_OrientDragPlaneToRay) { - // Orient a plane for dragging purposes through the axis that rotates to avoid being parallel to the ray, + // Orient a plane for moving purposes through the axis that rotates to avoid being parallel to the ray, // so that you can prevent intersections at infinity var forward = Quaternion.Inverse(transform.rotation) * (rayOrigin.position - transform.position); forward.z = 0; diff --git a/Scripts/Handles/RadialHandle.cs b/Scripts/Handles/RadialHandle.cs index 9d9e402b2..66809dfba 100644 --- a/Scripts/Handles/RadialHandle.cs +++ b/Scripts/Handles/RadialHandle.cs @@ -46,7 +46,7 @@ private void UpdateHandleTip(RadialHandleEventData eventData) { m_HandleTip.gameObject.SetActive(m_HoverSources.Count > 0 || m_DragSources.Count > 0); - if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering (dragging is handled in OnDrag) + if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering (moving is handled in OnDrag) { if (eventData != null) { diff --git a/Scripts/Handles/SphereHandle.cs b/Scripts/Handles/SphereHandle.cs index c8b8404ba..255407bdf 100644 --- a/Scripts/Handles/SphereHandle.cs +++ b/Scripts/Handles/SphereHandle.cs @@ -84,7 +84,7 @@ public void OnScroll(PointerEventData eventData) if (m_DragSources.Count == 0) return; - // Scrolling changes the radius of the sphere while dragging, and accelerates + // Scrolling changes the radius of the sphere while moving, and accelerates if (Mathf.Abs(eventData.scrollDelta.y) > 0.5f) m_ScrollRate += Mathf.Abs(eventData.scrollDelta.y) * k_ScrollAcceleration * Time.deltaTime; else diff --git a/Scripts/Interfaces/Entity/IManipulator.cs b/Scripts/Interfaces/Entity/IManipulator.cs index f2365e87c..224570a97 100644 --- a/Scripts/Interfaces/Entity/IManipulator.cs +++ b/Scripts/Interfaces/Entity/IManipulator.cs @@ -18,7 +18,7 @@ public interface IManipulator /// /// Delegate that processes the rotation, using the quaternion passed in /// - Action rotate { set; } + Action rotate { set; } /// /// Delegate that processes the scale, using the vector3 passed in diff --git a/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs b/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs index 27ef5fa74..d4eba0162 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR public interface IGrabObjects : ICanGrabObject { /// - /// Transfer a held object between rayOrigins (i.e. dragging into the MiniWorld) + /// Transfer a held object between rayOrigins (i.e. moving into the MiniWorld) /// /// rayOrigin of current held object /// Destination rayOrigin diff --git a/Scripts/UI/KeyboardUI.cs b/Scripts/UI/KeyboardUI.cs index c08d1b295..1a5051155 100644 --- a/Scripts/UI/KeyboardUI.cs +++ b/Scripts/UI/KeyboardUI.cs @@ -347,7 +347,7 @@ void Translate(Vector3 deltaPosition, Transform rayOrigin, bool constrained) transform.position += deltaPosition; } - void Rotate(Quaternion deltaRotation) + void Rotate(Quaternion deltaRotation, Transform rayOrigin) { if (m_EligibleForDrag) transform.rotation *= deltaRotation; diff --git a/Manipulators/HapticPulses.meta b/Tools/TransformTool/HapticPulses.meta similarity index 100% rename from Manipulators/HapticPulses.meta rename to Tools/TransformTool/HapticPulses.meta diff --git a/Manipulators/HapticPulses/DragPulse.asset b/Tools/TransformTool/HapticPulses/DragPulse.asset similarity index 100% rename from Manipulators/HapticPulses/DragPulse.asset rename to Tools/TransformTool/HapticPulses/DragPulse.asset diff --git a/Manipulators/HapticPulses/DragPulse.asset.meta b/Tools/TransformTool/HapticPulses/DragPulse.asset.meta similarity index 100% rename from Manipulators/HapticPulses/DragPulse.asset.meta rename to Tools/TransformTool/HapticPulses/DragPulse.asset.meta diff --git a/Manipulators/HapticPulses/RotatePulse.asset b/Tools/TransformTool/HapticPulses/RotatePulse.asset similarity index 100% rename from Manipulators/HapticPulses/RotatePulse.asset rename to Tools/TransformTool/HapticPulses/RotatePulse.asset diff --git a/Manipulators/HapticPulses/RotatePulse.asset.meta b/Tools/TransformTool/HapticPulses/RotatePulse.asset.meta similarity index 100% rename from Manipulators/HapticPulses/RotatePulse.asset.meta rename to Tools/TransformTool/HapticPulses/RotatePulse.asset.meta diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 2c4ad4fda..53c72d011 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Manipulators; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -11,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISetDefaultRayVisibility, IProcessInput, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, - ILinkedObject + ILinkedObject, IRayToNode, IControlHaptics { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -170,6 +171,12 @@ public List actions [SerializeField] GameObject m_ScaleManipulatorPrefab; + [SerializeField] + HapticPulse m_DragPulse; + + [SerializeField] + HapticPulse m_RotatePulse; + BaseManipulator m_CurrentManipulator; BaseManipulator m_StandardManipulator; @@ -208,6 +215,8 @@ public List actions public List linkedObjects { private get; set; } + public Func requestNodeFromRayOrigin { get; set; } + void Start() { if (!this.IsSharedUpdater(this)) @@ -543,11 +552,15 @@ void Translate(Vector3 delta, Transform rayOrigin, bool constrained) m_TargetPosition += delta; else this.ManipulatorSnap(rayOrigin, Selection.transforms, ref m_TargetPosition, ref m_TargetRotation, delta); + + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_DragPulse); } - void Rotate(Quaternion delta) + void Rotate(Quaternion delta, Transform rayOrigin) { m_TargetRotation = delta * m_TargetRotation; + + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_RotatePulse); } void Scale(Vector3 delta) diff --git a/Tools/TransformTool/TransformTool.cs.meta b/Tools/TransformTool/TransformTool.cs.meta index 4cb812343..06539f79e 100644 --- a/Tools/TransformTool/TransformTool.cs.meta +++ b/Tools/TransformTool/TransformTool.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 882053426a5f76d46b5505d9a20be912 -timeCreated: 1480549855 -licenseType: Free +timeCreated: 1497581459 +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: @@ -21,6 +21,8 @@ MonoImporter: type: 2} - m_ScaleManipulatorPrefab: {fileID: 1000011603037920, guid: ac3ea0b5d31a9d84580ef5c806d6862e, type: 2} + - m_DragPulse: {fileID: 11400000, guid: a187e6c970cfc58498747aee6dca2919, type: 2} + - m_RotatePulse: {fileID: 11400000, guid: 2e2c8d33e61b196448657254e78ba15c, type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Workspaces/Common/HapticPulses.meta b/Workspaces/Base/HapticPulses.meta similarity index 100% rename from Workspaces/Common/HapticPulses.meta rename to Workspaces/Base/HapticPulses.meta diff --git a/Workspaces/Common/HapticPulses/FrameHoverPulse.asset b/Workspaces/Base/HapticPulses/FrameHoverPulse.asset similarity index 100% rename from Workspaces/Common/HapticPulses/FrameHoverPulse.asset rename to Workspaces/Base/HapticPulses/FrameHoverPulse.asset diff --git a/Workspaces/Common/HapticPulses/FrameHoverPulse.asset.meta b/Workspaces/Base/HapticPulses/FrameHoverPulse.asset.meta similarity index 100% rename from Workspaces/Common/HapticPulses/FrameHoverPulse.asset.meta rename to Workspaces/Base/HapticPulses/FrameHoverPulse.asset.meta diff --git a/Workspaces/Common/HapticPulses/MovePulse.asset b/Workspaces/Base/HapticPulses/MovePulse.asset similarity index 100% rename from Workspaces/Common/HapticPulses/MovePulse.asset rename to Workspaces/Base/HapticPulses/MovePulse.asset diff --git a/Workspaces/Common/HapticPulses/MovePulse.asset.meta b/Workspaces/Base/HapticPulses/MovePulse.asset.meta similarity index 100% rename from Workspaces/Common/HapticPulses/MovePulse.asset.meta rename to Workspaces/Base/HapticPulses/MovePulse.asset.meta diff --git a/Workspaces/Common/HapticPulses/ResizePulse.asset b/Workspaces/Base/HapticPulses/ResizePulse.asset similarity index 100% rename from Workspaces/Common/HapticPulses/ResizePulse.asset rename to Workspaces/Base/HapticPulses/ResizePulse.asset diff --git a/Workspaces/Common/HapticPulses/ResizePulse.asset.meta b/Workspaces/Base/HapticPulses/ResizePulse.asset.meta similarity index 100% rename from Workspaces/Common/HapticPulses/ResizePulse.asset.meta rename to Workspaces/Base/HapticPulses/ResizePulse.asset.meta diff --git a/Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset b/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset similarity index 100% rename from Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset rename to Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset diff --git a/Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset.meta b/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset.meta similarity index 100% rename from Workspaces/Common/HapticPulses/WorkspaceButtonClick.asset.meta rename to Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset.meta diff --git a/Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset similarity index 100% rename from Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset rename to Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset diff --git a/Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset.meta b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset.meta similarity index 100% rename from Workspaces/Common/HapticPulses/WorkspaceButtonHighlight.asset.meta rename to Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset.meta diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index d20606c4b..8e4d3e647 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -8,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStencilRef, IConnectInterfaces, IUsesViewerScale + abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStencilRef, IConnectInterfaces, IUsesViewerScale, IControlHaptics, IRayToNode { const float k_MaxFrameSize = 100f; // Because BlendShapes cap at 100, our workspace maxes out at 100m wide @@ -27,6 +28,21 @@ abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStenc [SerializeField] ActionMap m_ActionMap; + [SerializeField] + HapticPulse m_ButtonClickPulse; + + [SerializeField] + HapticPulse m_ButtonHoverPulse; + + [SerializeField] + HapticPulse m_ResizePulse; + + [SerializeField] + HapticPulse m_MovePulse; + + [SerializeField] + HapticPulse m_FrameHoverPulse; + Bounds m_ContentBounds; Coroutine m_VisibilityCoroutine; @@ -108,6 +124,7 @@ public float topPanelDividerOffset public Transform leftRayOrigin { protected get; set; } public Transform rightRayOrigin { protected get; set; } + public Func requestNodeFromRayOrigin { get; set; } public virtual void Setup() { @@ -118,6 +135,10 @@ public virtual void Setup() this.ConnectInterfaces(m_WorkspaceUI); m_WorkspaceUI.closeClicked += OnCloseClicked; m_WorkspaceUI.resetSizeClicked += OnResetClicked; + m_WorkspaceUI.buttonHovered += OnButtonHovered; + m_WorkspaceUI.hoveringFrame += HoveringFrame; + m_WorkspaceUI.moving += Moving; + m_WorkspaceUI.resizing += Resizing; m_WorkspaceUI.leftRayOrigin = leftRayOrigin; m_WorkspaceUI.rightRayOrigin = rightRayOrigin; @@ -141,18 +162,25 @@ public void Close() m_VisibilityCoroutine = StartCoroutine(AnimateHide()); } - protected virtual void OnCloseClicked() + protected virtual void OnCloseClicked(Transform rayOrigin) { + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); Close(); } - protected virtual void OnResetClicked() + protected virtual void OnResetClicked(Transform rayOrigin) { - this.StopCoroutine(ref m_ResetSizeCoroutine); + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); + this.StopCoroutine(ref m_ResetSizeCoroutine); m_ResetSizeCoroutine = StartCoroutine(AnimateResetSize()); } + protected void OnButtonHovered(Transform rayOrigin) + { + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); + } + public void SetUIHighlightsVisible(bool value) { m_WorkspaceUI.highlightsVisible = value; @@ -241,6 +269,26 @@ public virtual void ProcessInput(ActionMapInput input, ConsumeControlDelegate co { m_WorkspaceUI.ProcessInput((WorkspaceInput)input, consumeControl); } + + protected void OnButtonClicked(Transform rayOrigin) + { + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); + } + + void Moving(Transform rayOrigin) + { + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_MovePulse); + } + + void Resizing(Transform rayOrigin) + { + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ResizePulse); + } + + void HoveringFrame(Transform rayOrigin) + { + this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ResizePulse); + } } } #endif diff --git a/Workspaces/Base/Workspace.cs.meta b/Workspaces/Base/Workspace.cs.meta index ca1a72d99..f24b1996d 100644 --- a/Workspaces/Base/Workspace.cs.meta +++ b/Workspaces/Base/Workspace.cs.meta @@ -1,11 +1,16 @@ fileFormatVersion: 2 guid: ca55ef2d1b18e264aa30156a24fec94e -timeCreated: 1471990296 +timeCreated: 1497573124 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - m_BasePrefab: {instanceID: 0} + - m_ActionMap: {instanceID: 0} + - m_ButtonClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index d9e1795b8..64dccbeaf 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -1968,8 +1968,8 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 114000014286123538} - m_MethodName: CloseClick + - m_Target: {fileID: 0} + m_MethodName: m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -1978,7 +1978,7 @@ MonoBehaviour: m_FloatArgument: 0 m_StringArgument: m_BoolArgument: 1 - m_CallState: 1 + m_CallState: 0 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null --- !u!114 &114000010128083748 @@ -2231,8 +2231,8 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 114000014286123538} - m_MethodName: ResetSizeClick + - m_Target: {fileID: 0} + m_MethodName: m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -2241,7 +2241,7 @@ MonoBehaviour: m_FloatArgument: 0 m_StringArgument: m_BoolArgument: 1 - m_CallState: 1 + m_CallState: 0 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null --- !u!114 &114000012017480980 @@ -2494,8 +2494,6 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 - m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} - m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000012775033414 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2602,8 +2600,6 @@ MonoBehaviour: m_GrayscaleGradient: 0 m_AnimatedReveal: 0 m_DelayBeforeReveal: 0.5 - m_ClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, type: 2} - m_HighlightPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} --- !u!114 &114000013720459270 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2748,6 +2744,8 @@ MonoBehaviour: m_ResizeHandleMargin: 0.08 m_ResizeCornerSize: 0.03 m_DynamicFaceAdjustment: 1 + m_CloseButton: {fileID: 114000013712785888} + m_ResizeButton: {fileID: 114000012661725366} m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, type: 2} diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index c98952df0..214f70b63 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IControlHaptics, IRayToNode, IUsesNode + sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IControlHaptics, IUsesNode { const int k_AngledFaceBlendShapeIndex = 2; const int k_ThinFrameBlendShapeIndex = 3; @@ -130,13 +130,10 @@ sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGe bool m_DynamicFaceAdjustment = true; [SerializeField] - HapticPulse m_ResizePulse; + WorkspaceButton m_CloseButton; [SerializeField] - HapticPulse m_MovePulse; - - [SerializeField] - HapticPulse m_FrameHoverPulse; + WorkspaceButton m_ResizeButton; Bounds m_Bounds; float? m_TopPanelDividerOffset; @@ -175,7 +172,7 @@ class DragState Vector3 m_BoundsSizeStart; ResizeDirection m_Direction; - public DragState(WorkspaceUI workspaceUI, Transform rayOrigin, Node? node, bool resizing) + public DragState(WorkspaceUI workspaceUI, Transform rayOrigin, bool resizing) { m_WorkspaceUI = workspaceUI; m_Resizing = resizing; @@ -256,12 +253,12 @@ public void OnDragging() + transform.forward * (absForward - (currentExtents.z - extents.z)) * Mathf.Sign(positionOffsetForward); m_WorkspaceUI.transform.parent.position = m_PositionStart + positionOffset * viewerScale; - m_WorkspaceUI.ResizeHapticPulse(node); + m_WorkspaceUI.ResizeHapticPulse(rayOrigin); } else { MathUtilsExt.SetTransformOffset(rayOrigin, m_WorkspaceUI.transform.parent, m_PositionOffset, m_RotationOffset); - m_WorkspaceUI.MoveHapticPulse(node); + m_WorkspaceUI.MoveHapticPulse(rayOrigin); } } } @@ -269,8 +266,12 @@ public void OnDragging() readonly List m_HovereringRayOrigins = new List(); readonly Dictionary m_LastResizeIcons = new Dictionary(); - public event Action closeClicked; - public event Action resetSizeClicked; + public event Action buttonHovered; + public event Action closeClicked; + public event Action resetSizeClicked; + public event Action resizing; + public event Action moving; + public event Action hoveringFrame; public bool highlightsVisible { @@ -349,7 +350,6 @@ public bool preventResize public Transform leftRayOrigin { private get; set; } public Transform rightRayOrigin { private get; set; } public Node? node { get; set; } - public Func requestNodeFromRayOrigin { get; set; } public event Action resize; @@ -425,6 +425,11 @@ void Awake() handle.hoverStarted += OnHandleHoverStarted; handle.hoverEnded += OnHandleHoverEnded; } + + m_CloseButton.clicked += OnCloseClicked; + m_CloseButton.hovered += OnButtonHovered; + m_ResizeButton.clicked += OnResetSizeClicked; + m_ResizeButton.hovered += OnButtonHovered; } IEnumerator Start() @@ -763,7 +768,7 @@ public void ProcessInput(WorkspaceInput input, ConsumeControlDelegate consumeCon if (dragRayOrigin) { - m_DragState = new DragState(this, dragRayOrigin, requestNodeFromRayOrigin(dragRayOrigin), resizing); + m_DragState = new DragState(this, dragRayOrigin, resizing); if (dragResizeIcon != null) dragResizeIcon.CrossFadeAlpha(0f, k_ResizeIconCrossfadeDuration, true); @@ -787,18 +792,29 @@ void OnDestroy() { ObjectUtils.Destroy(m_TopFaceMaterial); ObjectUtils.Destroy(m_FrontFaceMaterial); + + m_CloseButton.clicked -= OnCloseClicked; + m_CloseButton.hovered -= buttonHovered; + m_ResizeButton.clicked -= OnResetSizeClicked; + m_ResizeButton.hovered -= buttonHovered; } - public void CloseClick() + void OnCloseClicked(Transform rayOrigin) { if (closeClicked != null) - closeClicked(); + closeClicked(rayOrigin); } - public void ResetSizeClick() + void OnResetSizeClicked(Transform rayOrigin) { if (resetSizeClicked != null) - resetSizeClicked(); + resetSizeClicked(rayOrigin); + } + + void OnButtonHovered(Transform rayOrigin) + { + if (buttonHovered != null) + buttonHovered(rayOrigin); } void IncreaseFrameThickness(Transform rayOrigin = null) @@ -829,9 +845,9 @@ IEnumerator ChangeFrameThickness(float targetBlendAmount, Transform rayOrigin) yield return null; } - // If hovering the frame, and not dragging, perform haptic feedback - if (m_HovereringRayOrigins.Count > 0 && m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) - this.Pulse(node, m_FrameHoverPulse); + // If hovering the frame, and not moving, perform haptic feedback + if (hoveringFrame != null && m_HovereringRayOrigins.Count > 0 && m_DragState == null && Mathf.Approximately(targetBlendAmount, 0f)) + hoveringFrame(rayOrigin); m_FrameThicknessCoroutine = null; } @@ -874,14 +890,16 @@ IEnumerator HideTopFace() m_TopFaceVisibleCoroutine = null; } - void MoveHapticPulse(Node? node) + void MoveHapticPulse(Transform rayOrigin) { - this.Pulse(node, m_MovePulse); + if (moving != null) + moving(rayOrigin); } - void ResizeHapticPulse(Node? node) + void ResizeHapticPulse(Transform rayOrigin) { - this.Pulse(node, m_ResizePulse); + if (resizing != null) + resizing(rayOrigin); } } } diff --git a/Workspaces/Common/Scripts/DraggableListItem.cs b/Workspaces/Common/Scripts/DraggableListItem.cs index 5fd1bb8ee..69afa86e9 100644 --- a/Workspaces/Common/Scripts/DraggableListItem.cs +++ b/Workspaces/Common/Scripts/DraggableListItem.cs @@ -37,7 +37,7 @@ protected virtual void OnDragStarted(BaseHandle handle, HandleEventData eventDat } else { - // Cache eventData.direct because it is always true while dragging + // Cache eventData.direct because it is always true while moving m_DirectGrab = eventData.direct; m_DragObject = null; m_DragStarts[eventData.rayOrigin] = eventData.rayOrigin.position; diff --git a/Workspaces/Common/Scripts/FilterButtonUI.cs b/Workspaces/Common/Scripts/FilterButtonUI.cs index 92e0ecfdf..65911a667 100644 --- a/Workspaces/Common/Scripts/FilterButtonUI.cs +++ b/Workspaces/Common/Scripts/FilterButtonUI.cs @@ -1,4 +1,6 @@ #if UNITY_EDITOR +using System; +using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; @@ -6,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class FilterButtonUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler + sealed class FilterButtonUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IRayEnterHandler { const float k_HoverAlpha = 1; const float k_NormalAlpha = 0.95f; @@ -16,6 +18,9 @@ public Button button get { return m_Button; } } + [SerializeField] + Button m_WSButton; + [SerializeField] Button m_Button; @@ -28,6 +33,8 @@ public Button button [SerializeField] Image m_TextPanel; + Transform m_InteractingRayOrigin; + public Text text { get { return m_Text; } @@ -45,6 +52,19 @@ public Color color } } + public event Action hovered; + public event Action clicked; + + void Awake() + { + m_Button.onClick.AddListener(OnButtonClicked); + } + + void OnDestroy() + { + m_Button.onClick.RemoveAllListeners(); + } + public void OnPointerEnter(PointerEventData eventData) { var c = m_EyePanel.color; @@ -60,6 +80,20 @@ public void OnPointerExit(PointerEventData eventData) m_EyePanel.color = c; m_TextPanel.color = c; } + + public void OnRayEnter(RayEventData eventData) + { + m_InteractingRayOrigin = eventData.rayOrigin; + + if (hovered != null) + hovered(eventData.rayOrigin); + } + + void OnButtonClicked() + { + if (clicked != null) + clicked(m_InteractingRayOrigin); + } } } #endif diff --git a/Workspaces/Common/Scripts/FilterUI.cs b/Workspaces/Common/Scripts/FilterUI.cs index d13e0b369..09cc534de 100644 --- a/Workspaces/Common/Scripts/FilterUI.cs +++ b/Workspaces/Common/Scripts/FilterUI.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Extensions; @@ -92,6 +93,8 @@ public List filterList OnFilterClick(button); }); + button.clicked += OnClicked; + button.hovered += OnHover; button.text.text = m_FilterTypes[i]; } } @@ -99,6 +102,9 @@ public List filterList public byte stencilRef { get; set; } + public event Action buttonHovered; + public event Action buttonClicked; + void Awake() { m_HiddenButtonListYSpacing = -m_ButtonListGrid.cellSize.y; @@ -132,6 +138,8 @@ public void SetListVisibility(bool show) this.StopCoroutine(ref m_HideButtonListCoroutine); m_HideButtonListCoroutine = StartCoroutine(HideButtonList()); + + OnClicked(null); } } @@ -241,6 +249,18 @@ IEnumerator HideButtonList() m_ButtonList.gameObject.SetActive(false); m_HideButtonListCoroutine = null; } + + void OnClicked(Transform rayOrigin) + { + if (buttonClicked != null) + buttonClicked(rayOrigin); + } + + void OnHover(Transform rayOrigin) + { + if (buttonHovered != null) + buttonHovered(rayOrigin); + } } } #endif diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 7c5587a90..495f53aea 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -18,6 +18,9 @@ sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, const string k_MaterialColorTopProperty = "_ColorTop"; const string k_MaterialColorBottomProperty = "_ColorBottom"; + public event Action clicked; + public event Action hovered; + public bool autoHighlight { get { return m_AutoHighlight; } @@ -136,12 +139,6 @@ public bool alternateIconVisible [Range(0f, 2f)] float m_DelayBeforeReveal = 0.25f; - [SerializeField] - HapticPulse m_ClickPulse; - - [SerializeField] - HapticPulse m_HighlightPulse; - GradientPair m_OriginalGradientPair; GradientPair m_HighlightGradientPair; Vector3 m_IconDirection; @@ -155,7 +152,7 @@ public bool alternateIconVisible Color m_OriginalColor; Sprite m_OriginalIconSprite; float m_VisibleLocalZScale; - Node? m_Node; + Transform m_InteractingRayOrigin; // The initial button reveal coroutines, before highlighting Coroutine m_VisibilityCoroutine; @@ -177,7 +174,7 @@ public void InstantClearState() this.StopCoroutine(ref m_HighlightCoroutine); ResetColors(); - m_Node = null; + m_InteractingRayOrigin = null; } public void SetMaterialColors(GradientPair gradientPair) @@ -328,7 +325,6 @@ IEnumerator ShowContent() IEnumerator BeginHighlight() { - this.Pulse(m_Node, m_HighlightPulse); this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); @@ -458,7 +454,9 @@ IEnumerator IconContainerContentsEndHighlight() public void OnRayEnter(RayEventData eventData) { - m_Node = requestNodeFromRayOrigin(eventData.rayOrigin); + m_InteractingRayOrigin = eventData.rayOrigin; + if (hovered != null) + hovered(m_InteractingRayOrigin); if (autoHighlight) highlighted = true; @@ -466,7 +464,7 @@ public void OnRayEnter(RayEventData eventData) public void OnRayExit(RayEventData eventData) { - m_Node = null; + m_InteractingRayOrigin = null; if (autoHighlight) highlighted = false; @@ -480,7 +478,8 @@ void SwapIconSprite() void OnButtonClicked() { - this.Pulse(m_Node, m_ClickPulse); + if (clicked != null) + clicked(m_InteractingRayOrigin); } } } diff --git a/Workspaces/ConsoleWorkspace/ConsoleWorkspace.cs.meta b/Workspaces/ConsoleWorkspace/ConsoleWorkspace.cs.meta index ce36ef8b6..a588ea5d8 100644 --- a/Workspaces/ConsoleWorkspace/ConsoleWorkspace.cs.meta +++ b/Workspaces/ConsoleWorkspace/ConsoleWorkspace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 846104f2bc29ebd43a3fd7c0476166b3 -timeCreated: 1492477249 +timeCreated: 1497580252 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -8,6 +8,14 @@ MonoImporter: - m_BasePrefab: {fileID: 1000011022840156, guid: 3a2153f70c365c540a3703c4cf22bc45, type: 2} - m_ActionMap: {fileID: 11400000, guid: 0a408a921faf5724492272bab472326f, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} + - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} + - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, + type: 2} - m_CaptureWindowPrefab: {fileID: 1000013116415080, guid: 33b20f56b02e329469990199833f9a4a, type: 2} executionOrder: 0 diff --git a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs index a45d5ade1..5217450ff 100644 --- a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs +++ b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Handles; using UnityEditor.Experimental.EditorVR.Utilities; @@ -124,10 +125,21 @@ public override void Setup() scrollHandleTransform.localScale = new Vector3(1.03f, 0.02f, 1.02f); // Extra space for scrolling scrollHandleTransform.localPosition = new Vector3(0f, -0.015f, 0f); // Offset from content for collision purposes + m_FilterUI.buttonClicked += OnButtonClicked; + m_FilterUI.buttonHovered += OnButtonHovered; + // Propagate initial bounds OnBoundsChanged(); } + protected override void OnDestroy() + { + m_FilterUI.buttonClicked -= OnButtonClicked; + m_FilterUI.buttonHovered -= OnButtonHovered; + + base.OnDestroy(); + } + protected override void OnBoundsChanged() { var size = contentBounds.size; diff --git a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs.meta b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs.meta index 104bfa09f..c466cbca4 100644 --- a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs.meta +++ b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 4791bcc58b44c9a40a87ea33e45e75a8 -timeCreated: 1491107810 +timeCreated: 1497582863 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -8,6 +8,14 @@ MonoImporter: - m_BasePrefab: {fileID: 1000011022840156, guid: 3a2153f70c365c540a3703c4cf22bc45, type: 2} - m_ActionMap: {fileID: 11400000, guid: 0a408a921faf5724492272bab472326f, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} + - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} + - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, + type: 2} - m_ContentPrefab: {fileID: 1000010661511152, guid: f2c0b8f6943094b47b1b5b78b3588658, type: 2} - m_FilterPrefab: {fileID: 1000011003453154, guid: 60513a54db78d77419cd05a175c654db, @@ -16,6 +24,10 @@ MonoImporter: type: 2} - m_CreateEmptyPrefab: {fileID: 1000013010186534, guid: b284aaf96fee22b4495c0ff12419c6d7, type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} + - m_ButtonClickedPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs b/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs index 19c0f8258..a8af7dfb7 100644 --- a/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs +++ b/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs @@ -231,7 +231,7 @@ public void OnBeforeChildrenChanged(ListViewItemNestedData d } } - // Re-use InspectorNumberItem for array Size in case we are dragging the value + // Re-use InspectorNumberItem for array Size in case we are moving the value if (arraySizeItem) { foreach (var child in newData) diff --git a/Workspaces/InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs b/Workspaces/InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs index d02a8b49a..119c28f04 100644 --- a/Workspaces/InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs +++ b/Workspaces/InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs @@ -321,7 +321,7 @@ protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData if (m_DraggedField) m_DraggedField.EndSliderDrag(eventData.rayOrigin); - // Delay call fixes errors when you close the workspace or change data while dragging a field + // Delay call fixes errors when you close the workspace or change data while moving a field EditorApplication.delayCall += () => { if (m_DragClone) diff --git a/Workspaces/LockedObjectsWorkspace/LockedObjectsWorkspace.cs.meta b/Workspaces/LockedObjectsWorkspace/LockedObjectsWorkspace.cs.meta index fe1a8b52d..40af49a29 100644 --- a/Workspaces/LockedObjectsWorkspace/LockedObjectsWorkspace.cs.meta +++ b/Workspaces/LockedObjectsWorkspace/LockedObjectsWorkspace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 73c25ff258c691d4ab00efb98e11dd39 -timeCreated: 1491262240 +timeCreated: 1497580293 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -8,6 +8,14 @@ MonoImporter: - m_BasePrefab: {fileID: 1000011022840156, guid: 3a2153f70c365c540a3703c4cf22bc45, type: 2} - m_ActionMap: {fileID: 11400000, guid: 0a408a921faf5724492272bab472326f, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} + - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} + - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, + type: 2} - m_ContentPrefab: {fileID: 1000010661511152, guid: f2c0b8f6943094b47b1b5b78b3588658, type: 2} - m_FilterPrefab: {fileID: 1000011003453154, guid: 60513a54db78d77419cd05a175c654db, diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs.meta b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs.meta index 10795d969..97f69fe80 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs.meta +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: aab2ab33b5d370b4889c8004fceb7843 -timeCreated: 1491107827 +timeCreated: 1497580319 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -8,6 +8,14 @@ MonoImporter: - m_BasePrefab: {fileID: 1000011022840156, guid: 3a2153f70c365c540a3703c4cf22bc45, type: 2} - m_ActionMap: {fileID: 11400000, guid: 0a408a921faf5724492272bab472326f, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} + - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} + - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, + type: 2} - m_ContentPrefab: {fileID: 1000012496997414, guid: 1c661791d5dcbf640809b4e15a35395d, type: 2} - m_RecenterUIPrefab: {fileID: 1000011166056430, guid: 5a75f0f2ee760e74da2620e87db7cdd5, diff --git a/Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs.meta b/Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs.meta index cbc3435cd..f8c79ba13 100644 --- a/Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs.meta +++ b/Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: abb8ac7663774794da12f7c749f66d2a -timeCreated: 1492477332 +timeCreated: 1497580360 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -8,6 +8,14 @@ MonoImporter: - m_BasePrefab: {fileID: 1000011022840156, guid: 3a2153f70c365c540a3703c4cf22bc45, type: 2} - m_ActionMap: {fileID: 11400000, guid: 0a408a921faf5724492272bab472326f, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} + - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} + - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, + type: 2} - m_CaptureWindowPrefab: {fileID: 1000011330012626, guid: 25ad90ac898d22d48a704e5cfe0d3adb, type: 2} executionOrder: 0 diff --git a/Workspaces/ProjectWorkspace/ProjectWorkspace.cs.meta b/Workspaces/ProjectWorkspace/ProjectWorkspace.cs.meta index 9a022cef0..0e49d92a7 100644 --- a/Workspaces/ProjectWorkspace/ProjectWorkspace.cs.meta +++ b/Workspaces/ProjectWorkspace/ProjectWorkspace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: f1bad83e765e5f9409da4730895abd70 -timeCreated: 1491107843 +timeCreated: 1497580383 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -8,6 +8,14 @@ MonoImporter: - m_BasePrefab: {fileID: 1000011022840156, guid: 3a2153f70c365c540a3703c4cf22bc45, type: 2} - m_ActionMap: {fileID: 11400000, guid: 0a408a921faf5724492272bab472326f, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} + - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} + - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, + type: 2} - m_ContentPrefab: {fileID: 1000010661511152, guid: b20e938d7b22a9f429eb609d2aac8103, type: 2} - m_SliderPrefab: {fileID: 1000011177834630, guid: 41f89a1e8d8d49f4f861f7cb581c1227, From 76a2ee5e3b84f3ede1de270999adf1026d15cf65 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 16 Jun 2017 11:28:40 -0700 Subject: [PATCH 442/870] Revert comment names changes for drag/move --- Scripts/Core/EditorVR.MiniWorlds.cs | 2 +- Scripts/Handles/LinearHandle.cs | 4 ++-- Scripts/Handles/RadialHandle.cs | 2 +- Scripts/Handles/SphereHandle.cs | 2 +- Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs | 2 +- Workspaces/Common/Scripts/DraggableListItem.cs | 2 +- .../InspectorWorkspace/Scripts/InspectorListViewController.cs | 2 +- .../InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index 54901f9ab..22a9161eb 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -388,7 +388,7 @@ internal void UpdateMiniWorlds() } // Transfer objects from miniworld to preview state - // Don't switch to previewing the objects we are moving if we are still in another mini world + // Don't switch to previewing the objects we are dragging if we are still in another mini world if (!containedInOtherMiniWorld) { // Check for player head diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index c5a3a22fc..e1b5fb94a 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -59,7 +59,7 @@ private void UpdateHandleTip(LinearHandleEventData eventData) { m_HandleTip.gameObject.SetActive(m_HoverSources.Count > 0 || m_DragSources.Count > 0); - if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering or moving + if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering or dragging { if (eventData != null) m_HandleTip.position = @@ -73,7 +73,7 @@ void UpdatePlaneOrientation(Transform rayOrigin) { if (m_OrientDragPlaneToRay) { - // Orient a plane for moving purposes through the axis that rotates to avoid being parallel to the ray, + // Orient a plane for dragging purposes through the axis that rotates to avoid being parallel to the ray, // so that you can prevent intersections at infinity var forward = Quaternion.Inverse(transform.rotation) * (rayOrigin.position - transform.position); forward.z = 0; diff --git a/Scripts/Handles/RadialHandle.cs b/Scripts/Handles/RadialHandle.cs index 66809dfba..9d9e402b2 100644 --- a/Scripts/Handles/RadialHandle.cs +++ b/Scripts/Handles/RadialHandle.cs @@ -46,7 +46,7 @@ private void UpdateHandleTip(RadialHandleEventData eventData) { m_HandleTip.gameObject.SetActive(m_HoverSources.Count > 0 || m_DragSources.Count > 0); - if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering (moving is handled in OnDrag) + if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering (dragging is handled in OnDrag) { if (eventData != null) { diff --git a/Scripts/Handles/SphereHandle.cs b/Scripts/Handles/SphereHandle.cs index 255407bdf..c8b8404ba 100644 --- a/Scripts/Handles/SphereHandle.cs +++ b/Scripts/Handles/SphereHandle.cs @@ -84,7 +84,7 @@ public void OnScroll(PointerEventData eventData) if (m_DragSources.Count == 0) return; - // Scrolling changes the radius of the sphere while moving, and accelerates + // Scrolling changes the radius of the sphere while dragging, and accelerates if (Mathf.Abs(eventData.scrollDelta.y) > 0.5f) m_ScrollRate += Mathf.Abs(eventData.scrollDelta.y) * k_ScrollAcceleration * Time.deltaTime; else diff --git a/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs b/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs index d4eba0162..27ef5fa74 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR public interface IGrabObjects : ICanGrabObject { /// - /// Transfer a held object between rayOrigins (i.e. moving into the MiniWorld) + /// Transfer a held object between rayOrigins (i.e. dragging into the MiniWorld) /// /// rayOrigin of current held object /// Destination rayOrigin diff --git a/Workspaces/Common/Scripts/DraggableListItem.cs b/Workspaces/Common/Scripts/DraggableListItem.cs index 69afa86e9..5fd1bb8ee 100644 --- a/Workspaces/Common/Scripts/DraggableListItem.cs +++ b/Workspaces/Common/Scripts/DraggableListItem.cs @@ -37,7 +37,7 @@ protected virtual void OnDragStarted(BaseHandle handle, HandleEventData eventDat } else { - // Cache eventData.direct because it is always true while moving + // Cache eventData.direct because it is always true while dragging m_DirectGrab = eventData.direct; m_DragObject = null; m_DragStarts[eventData.rayOrigin] = eventData.rayOrigin.position; diff --git a/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs b/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs index a8af7dfb7..19c0f8258 100644 --- a/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs +++ b/Workspaces/InspectorWorkspace/Scripts/InspectorListViewController.cs @@ -231,7 +231,7 @@ public void OnBeforeChildrenChanged(ListViewItemNestedData d } } - // Re-use InspectorNumberItem for array Size in case we are moving the value + // Re-use InspectorNumberItem for array Size in case we are dragging the value if (arraySizeItem) { foreach (var child in newData) diff --git a/Workspaces/InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs b/Workspaces/InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs index 119c28f04..d02a8b49a 100644 --- a/Workspaces/InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs +++ b/Workspaces/InspectorWorkspace/Scripts/ListItems/InspectorListItem.cs @@ -321,7 +321,7 @@ protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData if (m_DraggedField) m_DraggedField.EndSliderDrag(eventData.rayOrigin); - // Delay call fixes errors when you close the workspace or change data while moving a field + // Delay call fixes errors when you close the workspace or change data while dragging a field EditorApplication.delayCall += () => { if (m_DragClone) From 1734742d3af5cded4c4f9211976b0271f02e9040 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 16 Jun 2017 11:49:29 -0700 Subject: [PATCH 443/870] Cleanup naming of click & hover events, and their corresponding functions --- Menus/MainMenu/MainMenu.cs | 9 +++++---- Menus/MainMenu/Scripts/MainMenuUI.cs | 8 ++++---- Menus/RadialMenu/RadialMenu.cs | 4 ++-- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 4 ++-- Workspaces/Base/Workspace.cs | 14 +++++++------- Workspaces/Base/WorkspaceUI.cs | 18 +++++++++--------- Workspaces/Common/Scripts/FilterUI.cs | 6 +++--- Workspaces/Common/Scripts/WorkspaceButton.cs | 4 ++-- .../HierarchyWorkspace/HierarchyWorkspace.cs | 8 ++++---- 9 files changed, 38 insertions(+), 37 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index ee23f3a9f..096a9329a 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -76,6 +76,7 @@ public bool visible [SerializeField] HapticPulse m_ButtonHoverPulse; + MainMenuUI m_MainMenuUI; float m_LastRotationInput; readonly Dictionary m_ToolButtons = new Dictionary(); @@ -99,8 +100,8 @@ void Start() m_MainMenuUI.menuOrigin = menuOrigin; m_MainMenuUI.Setup(); m_MainMenuUI.visible = m_Visible; - m_MainMenuUI.buttonHovered += OnButtonHovered; - m_MainMenuUI.buttonClicked += OnButtonClicked; + m_MainMenuUI.buttonHovered += OnButtonHover; + m_MainMenuUI.buttonClicked += OnButtonClick; m_MainMenuUI.opening += OnOpening; m_MainMenuUI.closing += OnClosing; @@ -223,12 +224,12 @@ void UpdateToolButtons() } } - void OnButtonClicked(Transform rayOrigin) + void OnButtonClick(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); } - void OnButtonHovered(Transform rayOrigin) + void OnButtonHover(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 926d77252..885ee4d97 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -247,8 +247,8 @@ public void CreateFaceButton(ButtonData buttonData, Action butto button.name = buttonData.name; var mainMenuButton = button.GetComponent(); buttonCreationCallback(mainMenuButton); - mainMenuButton.clicked += OnClicked; - mainMenuButton.hovered += OnHover; + mainMenuButton.clicked += OnButtonClick; + mainMenuButton.hovered += OnButtonHover; if (string.IsNullOrEmpty(buttonData.sectionName)) buttonData.sectionName = k_UncategorizedFaceName; @@ -587,13 +587,13 @@ IEnumerator AnimateFaceReveal(int faceIndex) faceTransform.localPosition = targetPosition; } - void OnHover(Transform rayOrigin) + void OnButtonHover(Transform rayOrigin) { if (buttonHovered != null) buttonHovered(rayOrigin); } - void OnClicked(Transform rayOrigin) + void OnButtonClick(Transform rayOrigin) { if (buttonClicked != null) buttonClicked(rayOrigin); diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index 833449242..a5a3698a5 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -90,7 +90,7 @@ void Start() m_RadialMenuUI.Setup(); m_RadialMenuUI.visible = m_Visible; m_RadialMenuUI.buttonHovered += OnButtonHover; - m_RadialMenuUI.buttonClicked += OnButtonClicked; + m_RadialMenuUI.buttonClicked += OnButtonClick; } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -128,7 +128,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - void OnButtonClicked() + void OnButtonClick() { this.Pulse(node, m_ButtonClickedPulse); } diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index f856f644e..6b74cd491 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -204,7 +204,7 @@ public void Setup() this.ConnectInterfaces(menuSlot); menuSlot.orderIndex = i; m_RadialMenuSlots.Add(menuSlot); - menuSlot.hovered += OnButtonHovered; + menuSlot.hovered += OnButtonHover; if (slotBorderMaterial == null) slotBorderMaterial = menuSlot.borderRendererMaterial; @@ -344,7 +344,7 @@ public void SelectionOccurred() buttonClicked(); } - void OnButtonHovered() + void OnButtonHover() { if (buttonHovered != null) buttonHovered(); diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 8e4d3e647..370d5fc9e 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -133,9 +133,9 @@ public virtual void Setup() m_WorkspaceUI = baseObject.GetComponent(); this.ConnectInterfaces(m_WorkspaceUI); - m_WorkspaceUI.closeClicked += OnCloseClicked; - m_WorkspaceUI.resetSizeClicked += OnResetClicked; - m_WorkspaceUI.buttonHovered += OnButtonHovered; + m_WorkspaceUI.closeClicked += OnCloseClick; + m_WorkspaceUI.resetSizeClicked += OnResetClick; + m_WorkspaceUI.buttonHovered += OnButtonHover; m_WorkspaceUI.hoveringFrame += HoveringFrame; m_WorkspaceUI.moving += Moving; m_WorkspaceUI.resizing += Resizing; @@ -162,13 +162,13 @@ public void Close() m_VisibilityCoroutine = StartCoroutine(AnimateHide()); } - protected virtual void OnCloseClicked(Transform rayOrigin) + protected virtual void OnCloseClick(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); Close(); } - protected virtual void OnResetClicked(Transform rayOrigin) + protected virtual void OnResetClick(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); @@ -176,7 +176,7 @@ protected virtual void OnResetClicked(Transform rayOrigin) m_ResetSizeCoroutine = StartCoroutine(AnimateResetSize()); } - protected void OnButtonHovered(Transform rayOrigin) + protected void OnButtonHover(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); } @@ -270,7 +270,7 @@ public virtual void ProcessInput(ActionMapInput input, ConsumeControlDelegate co m_WorkspaceUI.ProcessInput((WorkspaceInput)input, consumeControl); } - protected void OnButtonClicked(Transform rayOrigin) + protected void OnButtonClick(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); } diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 214f70b63..b9eb0d3cc 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -426,10 +426,10 @@ void Awake() handle.hoverEnded += OnHandleHoverEnded; } - m_CloseButton.clicked += OnCloseClicked; - m_CloseButton.hovered += OnButtonHovered; - m_ResizeButton.clicked += OnResetSizeClicked; - m_ResizeButton.hovered += OnButtonHovered; + m_CloseButton.clicked += OnCloseClick; + m_CloseButton.hovered += OnButtonHover; + m_ResizeButton.clicked += OnResetSizeClick; + m_ResizeButton.hovered += OnButtonHover; } IEnumerator Start() @@ -793,25 +793,25 @@ void OnDestroy() ObjectUtils.Destroy(m_TopFaceMaterial); ObjectUtils.Destroy(m_FrontFaceMaterial); - m_CloseButton.clicked -= OnCloseClicked; + m_CloseButton.clicked -= OnCloseClick; m_CloseButton.hovered -= buttonHovered; - m_ResizeButton.clicked -= OnResetSizeClicked; + m_ResizeButton.clicked -= OnResetSizeClick; m_ResizeButton.hovered -= buttonHovered; } - void OnCloseClicked(Transform rayOrigin) + void OnCloseClick(Transform rayOrigin) { if (closeClicked != null) closeClicked(rayOrigin); } - void OnResetSizeClicked(Transform rayOrigin) + void OnResetSizeClick(Transform rayOrigin) { if (resetSizeClicked != null) resetSizeClicked(rayOrigin); } - void OnButtonHovered(Transform rayOrigin) + void OnButtonHover(Transform rayOrigin) { if (buttonHovered != null) buttonHovered(rayOrigin); diff --git a/Workspaces/Common/Scripts/FilterUI.cs b/Workspaces/Common/Scripts/FilterUI.cs index 09cc534de..a936caa51 100644 --- a/Workspaces/Common/Scripts/FilterUI.cs +++ b/Workspaces/Common/Scripts/FilterUI.cs @@ -93,7 +93,7 @@ public List filterList OnFilterClick(button); }); - button.clicked += OnClicked; + button.clicked += OnClick; button.hovered += OnHover; button.text.text = m_FilterTypes[i]; } @@ -139,7 +139,7 @@ public void SetListVisibility(bool show) this.StopCoroutine(ref m_HideButtonListCoroutine); m_HideButtonListCoroutine = StartCoroutine(HideButtonList()); - OnClicked(null); + OnClick(null); } } @@ -250,7 +250,7 @@ IEnumerator HideButtonList() m_HideButtonListCoroutine = null; } - void OnClicked(Transform rayOrigin) + void OnClick(Transform rayOrigin) { if (buttonClicked != null) buttonClicked(rayOrigin); diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 495f53aea..1fa0bf51c 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -211,7 +211,7 @@ void Awake() if (m_SwapIconsOnClick && m_AlternateIconSprite) m_Button.onClick.AddListener(SwapIconSprite); - m_Button.onClick.AddListener(OnButtonClicked); + m_Button.onClick.AddListener(OnButtonClick); } void Start() @@ -476,7 +476,7 @@ void SwapIconSprite() alternateIconVisible = !alternateIconVisible; } - void OnButtonClicked() + void OnButtonClick() { if (clicked != null) clicked(m_InteractingRayOrigin); diff --git a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs index 5217450ff..2ee2758b1 100644 --- a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs +++ b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs @@ -125,8 +125,8 @@ public override void Setup() scrollHandleTransform.localScale = new Vector3(1.03f, 0.02f, 1.02f); // Extra space for scrolling scrollHandleTransform.localPosition = new Vector3(0f, -0.015f, 0f); // Offset from content for collision purposes - m_FilterUI.buttonClicked += OnButtonClicked; - m_FilterUI.buttonHovered += OnButtonHovered; + m_FilterUI.buttonClicked += OnButtonClick; + m_FilterUI.buttonHovered += OnButtonHover; // Propagate initial bounds OnBoundsChanged(); @@ -134,8 +134,8 @@ public override void Setup() protected override void OnDestroy() { - m_FilterUI.buttonClicked -= OnButtonClicked; - m_FilterUI.buttonHovered -= OnButtonHovered; + m_FilterUI.buttonClicked -= OnButtonClick; + m_FilterUI.buttonHovered -= OnButtonHover; base.OnDestroy(); } From 94958699254df1ce41c81160df28ed8991d011b3 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 16 Jun 2017 17:12:03 -0700 Subject: [PATCH 444/870] Add serialization for LocomotionTool settings --- Tools/LocomotionTool/LocomotionTool.cs | 63 ++++++++++++++----- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 27 ++++---- .../Scripts/ViewerScaleVisuals.cs | 4 +- 3 files changed, 63 insertions(+), 31 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 72a1ad905..8221cd784 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -1,6 +1,8 @@ #if UNITY_EDITOR +using System; using System.Collections; using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -9,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ISetDefaultRayVisibility, ICustomActionMap, - ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider + ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences { const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 4f; @@ -40,6 +42,17 @@ enum State [SerializeField] GameObject m_SettingsMenuItemPrefab; + [Serializable] + class Preferences + { + [SerializeField] + bool m_BlinkMode; + + public bool blinkMode { get { return m_BlinkMode; } set { m_BlinkMode = value; } } + } + + Preferences m_Preferences = new Preferences(); + ViewerScaleVisuals m_ViewerScaleVisuals; GameObject m_BlinkVisualsGO; @@ -73,6 +86,8 @@ enum State float m_OriginalNearClipPlane; float m_OriginalFarClipPlane; + Toggle m_FlyToggle; + public ActionMap actionMap { get { return m_BlinkActionMap; } } public Transform rayOrigin { private get; set; } @@ -81,21 +96,29 @@ enum State public List linkedObjects { private get; set; } - public bool blinkMode { private get; set; } - public GameObject settingsMenuItemPrefab { get { return m_SettingsMenuItemPrefab; } } public GameObject settingsMenuItemInstance { set { + Debug.Log("set " + this.GetHashCode()); foreach (var toggle in value.GetComponentsInChildren()) { if (toggle.isOn) { + m_FlyToggle = toggle; + Debug.Log(m_FlyToggle); toggle.onValueChanged.AddListener(isOn => { - blinkMode = !isOn; + foreach (LocomotionTool linkedObject in linkedObjects) + { + linkedObject.m_Preferences.blinkMode = !isOn; + + Debug.Log(linkedObject + ", " + linkedObject.m_FlyToggle); + if (linkedObject != this) + linkedObject.m_FlyToggle.isOn = isOn; + } }); } } @@ -107,7 +130,6 @@ void Start() m_BlinkVisualsGO = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin); m_BlinkVisuals = m_BlinkVisualsGO.GetComponentInChildren(); m_BlinkVisuals.enabled = false; - m_BlinkVisuals.showValidTargetIndicator = false; // We don't define valid targets, so always show green m_BlinkVisualsGO.transform.parent = rayOrigin; m_BlinkVisualsGO.transform.localPosition = Vector3.zero; m_BlinkVisualsGO.transform.localRotation = Quaternion.identity; @@ -129,12 +151,6 @@ void OnDestroy() this.SetDefaultRayVisibility(rayOrigin, true); } - void Update() - { - if (UnityEngine.Input.GetKeyUp(KeyCode.Space)) - blinkMode = !blinkMode; - } - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var blinkInput = (Locomotion)input; @@ -161,7 +177,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { DoCrawl(blinkInput); - if (blinkMode) + if (m_Preferences.blinkMode) DoBlink(consumeControl, blinkInput); else DoFlying(consumeControl, blinkInput); @@ -366,8 +382,6 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) m_MainCamera.nearClipPlane = m_OriginalNearClipPlane * currentScale; m_MainCamera.farClipPlane = m_OriginalFarClipPlane * currentScale; - m_ViewerScaleVisuals.viewerScale = currentScale; - m_BlinkVisuals.viewerScale = currentScale; Shader.SetGlobalFloat(k_WorldScaleProperty, 1f / currentScale); } break; @@ -424,6 +438,27 @@ IEnumerator MoveTowardTarget(Vector3 targetPosition) cameraRig.position = targetPosition; m_State = State.Inactive; } + + public object OnSerializePreferences() + { + if (this.IsSharedUpdater(this)) + { + Debug.Log("asdf"); + return m_Preferences; + } + + return null; + } + + public void OnDeserializePreferences(object obj) + { + Debug.Log(this.IsSharedUpdater(this)); + var preferences = obj as Preferences; + if (preferences != null) + m_Preferences = preferences; + + Debug.Log(this.GetHashCode() + ", " + m_FlyToggle); + } } } #endif diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index aab0afca0..90995b2da 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class BlinkVisuals : MonoBehaviour + sealed class BlinkVisuals : MonoBehaviour, IUsesViewerScale { private enum State { @@ -91,9 +91,6 @@ public Transform locatorRoot } public bool validTarget { get; private set; } - public bool showValidTargetIndicator { private get; set; } - - public float viewerScale { private get; set; } private float pointerStrength { @@ -113,7 +110,6 @@ private void OnDestroy() private void Awake() { - viewerScale = 1; m_LineRenderer = GetComponent(); m_LineRendererMeshRenderer = m_LineRenderer.GetComponent(); m_BlinkMaterial = MaterialUtils.GetMaterialClone(m_RoomScaleRenderer); @@ -160,8 +156,6 @@ private void Awake() m_TubeTransformHiddenScale = new Vector3(m_TubeTransform.localScale.x, 0.0001f, m_TubeTransform.localScale.z); ShowLine(false); - - showValidTargetIndicator = true; } void Update() @@ -180,9 +174,9 @@ void Update() DrawMotionSpheres(); m_RoomScaleTransform.position = MathUtilsExt.SmoothDamp(m_RoomScaleLazyPosition, m_LocatorRoot.position, - ref m_MovementVelocityDelta, 0.2625f, 100f * viewerScale, Time.deltaTime); + ref m_MovementVelocityDelta, 0.2625f, 100f * this.GetViewerScale(), Time.deltaTime); - // Since the room scale visuals are parented under the locator root it is necessary to cache the position each frame before the locator root gets updated + // Since the room scale visuals are parented under the locater root it is necessary to cache the position each frame before the locater root gets updated m_RoomScaleLazyPosition = m_RoomScaleTransform.position; m_MovementMagnitudeDelta = (m_RoomScaleTransform.position - m_LocatorRoot.position).magnitude; @@ -238,6 +232,7 @@ private IEnumerator AnimateShowVisuals() const float kSmoothTime = 0.75f; var currentDuration = 0f; + var viewerScale = this.GetViewerScale(); while (m_State == State.TransitioningIn && currentDuration < kSmoothTime) { scale = MathUtilsExt.SmoothDamp(scale, kTargetScale, ref smoothVelocity, kSmoothTime, Mathf.Infinity, Time.deltaTime); @@ -264,12 +259,13 @@ private IEnumerator AnimateHideVisuals() float tubeScale = m_TubeTransform.localScale.x; const float kSmoothTime = 0.75f; var currentDuration = 0f; + var viewerScale = this.GetViewerScale(); while (m_State == State.TransitioningOut && currentDuration < kSmoothTime) { scale = MathUtilsExt.SmoothDamp(scale, kTargetScale, ref smoothVelocity, kSmoothTime, Mathf.Infinity, Time.deltaTime); var adjustedScale = scale * viewerScale; currentDuration += Time.deltaTime; - SetColors(Color.Lerp(!showValidTargetIndicator || validTarget ? m_ValidLocationColor : m_InvalidLocationColor, Color.clear, 1f - scale)); + SetColors(Color.Lerp(validTarget ? m_ValidLocationColor : m_InvalidLocationColor, Color.clear, 1f - scale)); m_TubeTransform.localScale = new Vector3(tubeScale, scale, tubeScale); m_LineRenderer.SetWidth(scale * adjustedScale, scale * adjustedScale); m_RingTransform.localScale = Vector3.Lerp(m_RingTransform.localScale, m_RingTransformOriginalScale, scale); @@ -313,7 +309,7 @@ public void DrawArc() m_BezierControlPoints[0] = m_ToolPoint.position; // first handle -- determines how steep the first part will be - m_BezierControlPoints[1] = m_ToolPoint.position + m_ToolPoint.forward * pointerStrength * m_Range * viewerScale; + m_BezierControlPoints[1] = m_ToolPoint.position + m_ToolPoint.forward * pointerStrength * m_Range * this.GetViewerScale(); const float kArcEndHeight = 0f; m_FinalPosition = new Vector3(m_BezierControlPoints[1].x, kArcEndHeight, m_BezierControlPoints[1].z); @@ -324,7 +320,7 @@ public void DrawArc() // second handle -- determines how steep the intersection with the ground will be m_BezierControlPoints[2] = m_FinalPosition; - // set the position of the locator + // set the position of the locater m_LocatorRoot.position = m_DetachedWorldArcPosition == null ? m_FinalPosition + k_GroundOffset : (Vector3)m_DetachedWorldArcPosition; validTarget = false; @@ -332,7 +328,7 @@ public void DrawArc() var colliders = Physics.OverlapSphere(m_FinalPosition, m_Radius, m_LayerMask.value); validTarget = colliders != null && colliders.Length > 0; - SetColors(!showValidTargetIndicator || validTarget ? m_ValidLocationColor : m_InvalidLocationColor); + SetColors(validTarget ? m_ValidLocationColor : m_InvalidLocationColor); // calculate and send points to the line renderer m_SegmentPositions = new Vector3[m_LineSegmentCount]; @@ -345,13 +341,14 @@ public void DrawArc() } m_LineRenderer.SetPositions(m_SegmentPositions); - // The curve length will be somewhere between a straight line between the points + // The curve length will be somewhere between a straight line between the points // and a path that directly follows the control points. So we estimate this by just averaging the two. m_CurveLengthEstimate = ((m_BezierControlPoints[3] - m_BezierControlPoints[0]).magnitude + ((m_BezierControlPoints[1] - m_BezierControlPoints[0]).magnitude + (m_BezierControlPoints[1] - m_BezierControlPoints[2]).magnitude)) * 0.5f; } public void DrawMotionSpheres() { + var viewerScale = this.GetViewerScale(); // We estimate how much we should correct our curve time by with a guess step for (int i = 0; i < m_MotionSphereCount; ++i) { @@ -404,7 +401,7 @@ void SetColors(Color color) { m_LineRenderer.SetColors(color, color); - // Set the color for all object sharind the blink material + // Set the color for all object sharing the blink material m_BlinkMaterial.SetColor(k_TintColor, color); m_MotionSpheresMaterial.SetColor(k_TintColor, color); } diff --git a/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs b/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs index c8b21aa25..668ed0f74 100644 --- a/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs +++ b/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class ViewerScaleVisuals : MonoBehaviour + sealed class ViewerScaleVisuals : MonoBehaviour, IUsesViewerScale { [SerializeField] float m_IconTranslateCoefficient = -0.16f; @@ -32,7 +32,6 @@ sealed class ViewerScaleVisuals : MonoBehaviour public Transform leftHand { private get; set; } public Transform rightHand { private get; set; } - public float viewerScale { private get; set; } void Start() { @@ -54,6 +53,7 @@ void Update() void SetPosition() { var iconContainerLocal = m_IconsContainer.localPosition; + var viewerScale = this.GetViewerScale(); iconContainerLocal.x = Mathf.Log10(viewerScale) * m_IconTranslateCoefficient + m_IconTranslateOffset; m_IconsContainer.localPosition = iconContainerLocal; From 042ef68a5e45eb7067dd2e200745bc9d6e66f4e3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 16 Jun 2017 18:02:52 -0700 Subject: [PATCH 445/870] Remove IRayToNode logic in StandardManipulator --- Manipulators/StandardManipulator.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index c972258d5..2034728ea 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Manipulators { - sealed class StandardManipulator : BaseManipulator, IControlHaptics, IRayToNode + sealed class StandardManipulator : BaseManipulator, IControlHaptics { [SerializeField] Transform m_PlaneHandlesParent; @@ -16,8 +16,6 @@ sealed class StandardManipulator : BaseManipulator, IControlHaptics, IRayToNode [SerializeField] List m_AllHandles; - public Func requestNodeFromRayOrigin { get; set; } - protected override void OnEnable() { base.OnEnable(); From f7dc3851aa9250ccd8d33f8617ef982e31dedafe Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 16 Jun 2017 18:55:02 -0700 Subject: [PATCH 446/870] Assign haptic default references to workspace and InspectorWorkspace --- Workspaces/Base/Workspace.cs.meta | 6 +++++- .../InspectorWorkspace/InspectorWorkspace.cs.meta | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Workspaces/Base/Workspace.cs.meta b/Workspaces/Base/Workspace.cs.meta index f24b1996d..9a4317c37 100644 --- a/Workspaces/Base/Workspace.cs.meta +++ b/Workspaces/Base/Workspace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: ca55ef2d1b18e264aa30156a24fec94e -timeCreated: 1497573124 +timeCreated: 1497664199 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -11,6 +11,10 @@ MonoImporter: type: 2} - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, type: 2} + - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} + - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Workspaces/InspectorWorkspace/InspectorWorkspace.cs.meta b/Workspaces/InspectorWorkspace/InspectorWorkspace.cs.meta index 4fc24a58b..f9c051cc8 100644 --- a/Workspaces/InspectorWorkspace/InspectorWorkspace.cs.meta +++ b/Workspaces/InspectorWorkspace/InspectorWorkspace.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 80defa433e2f1ba4b8c5cbf97051b13e -timeCreated: 1491107820 +timeCreated: 1497663750 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -8,6 +8,14 @@ MonoImporter: - m_BasePrefab: {fileID: 1000011022840156, guid: 3a2153f70c365c540a3703c4cf22bc45, type: 2} - m_ActionMap: {fileID: 11400000, guid: 0a408a921faf5724492272bab472326f, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: 43f6d76e312f45145bc1ef9af446edfe, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: bf8c18d5dc5c90f4aa0782421bbaaf0e, + type: 2} + - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} + - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} + - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, + type: 2} - m_ContentPrefab: {fileID: 1000012068584196, guid: e86903f7beacec54cbf8e471721954ea, type: 2} - m_LockPrefab: {fileID: 1000011166056430, guid: 839f992336afa204a87a5eb02f659941, From 111b2ff35ac1a2d8b6a458fdbc330b30e201d502 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 16 Jun 2017 19:46:29 -0700 Subject: [PATCH 447/870] Hookup Focus and Create button haptics in HierarchyWorkspace --- Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs index 2ee2758b1..30bb60216 100644 --- a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs +++ b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs @@ -92,7 +92,9 @@ public override void Setup() { this.ConnectInterfaces(mb); } - focusUI.GetComponentInChildren GameObject settingsMenuInstance { set; } + + /// + /// The rayOrigin this provider is associated with. This will determine which menu is used. If null, both menus are used + /// + Transform rayOrigin { get; } } } #endif \ No newline at end of file diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index a699183c2..05d208eff 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -23,12 +23,12 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// /// The types which provide a settings menu /// - Dictionary settingsMenuProviders { set; } + Dictionary, ISettingsMenuProvider> settingsMenuProviders { set; } /// /// The types which provide a settings menu item /// - Dictionary settingsMenuItemProviders { set; } + Dictionary, ISettingsMenuItemProvider> settingsMenuItemProviders { set; } /// /// The ray origin that spawned the menu and will be used for node-specific operations (e.g. selecting a tool) diff --git a/Scripts/Interfaces/FunctionalityInjection/IConnectInterfaces.cs b/Scripts/Interfaces/FunctionalityInjection/IConnectInterfaces.cs index 533dc4374..6eaddda0b 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IConnectInterfaces.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IConnectInterfaces.cs @@ -13,7 +13,7 @@ interface IConnectInterfaces static class IConnectInterfacesMethods { internal delegate void ConnectInterfacesDelegate(object obj, Transform rayOrigin = null); - internal delegate void DisonnectInterfacesDelegate(object obj); + internal delegate void DisonnectInterfacesDelegate(object obj, Transform rayOrigin = null); internal static ConnectInterfacesDelegate connectInterfaces { get; set; } internal static DisonnectInterfacesDelegate disconnectInterfaces { get; set; } @@ -32,9 +32,10 @@ public static void ConnectInterfaces(this IConnectInterfaces ci, object obj, Tra /// Method provided by the system for disconnecting interfaces /// /// Object to disconnect interfaces on - public static void DisonnectInterfaces(this IConnectInterfaces ci, object obj) + /// /// (Optional) ray origin (needed for disconnecting ray-based interfaces) + public static void DisonnectInterfaces(this IConnectInterfaces ci, object obj, Transform rayOrigin = null) { - disconnectInterfaces(obj); + disconnectInterfaces(obj, rayOrigin); } } diff --git a/Scripts/Interfaces/ISettingsMenuItemProvider.cs b/Scripts/Interfaces/ISettingsMenuItemProvider.cs index 18de0e862..08a296451 100644 --- a/Scripts/Interfaces/ISettingsMenuItemProvider.cs +++ b/Scripts/Interfaces/ISettingsMenuItemProvider.cs @@ -17,6 +17,12 @@ public interface ISettingsMenuItemProvider /// An instance of the menu face prefab that was added to the menu /// GameObject settingsMenuItemInstance { set; } + + /// + /// The rayOrigin this provider is associated with + /// This will determine which menu is used. If null, both menus are used + /// + Transform rayOrigin { get; } } } #endif \ No newline at end of file diff --git a/Scripts/Modules/SerializedPreferencesModule.cs b/Scripts/Modules/SerializedPreferencesModule.cs index 8709cf594..22a9378cb 100644 --- a/Scripts/Modules/SerializedPreferencesModule.cs +++ b/Scripts/Modules/SerializedPreferencesModule.cs @@ -43,7 +43,7 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) m_Serializers.Add(serializer); } - public void DisconnectInterface(object obj) + public void DisconnectInterface(object obj, Transform rayOrigin = null) { var serializer = obj as ISerializePreferences; if (serializer != null) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 9963205df..df3b9d9ce 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -364,6 +364,8 @@ public bool directSnappingEnabled } } + public Transform rayOrigin { get { return null; } } + // Local method use only -- created here to reduce garbage collection readonly List m_CombinedIgnoreList = new List(); Transform[] m_SingleTransformArray = new Transform[1]; diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 398b37966..608a34767 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -87,10 +87,12 @@ class Preferences float m_OriginalFarClipPlane; Toggle m_FlyToggle; + Toggle m_BlinkToggle; + bool m_BlockValueChangedListener; public ActionMap actionMap { get { return m_BlinkActionMap; } } - public Transform rayOrigin { private get; set; } + public Transform rayOrigin { get; set; } public Transform cameraRig { private get; set; } @@ -109,15 +111,29 @@ public GameObject settingsMenuItemInstance m_FlyToggle = toggle; toggle.onValueChanged.AddListener(isOn => { + if (m_BlockValueChangedListener) + return; + + // m_Preferences on all instances refer + m_Preferences.blinkMode = !isOn; foreach (LocomotionTool linkedObject in linkedObjects) { - linkedObject.m_Preferences.blinkMode = !isOn; - if (linkedObject != this) + { + linkedObject.m_BlockValueChangedListener = true; + //linkedObject.m_ToggleGroup.NotifyToggleOn(isOn ? m_FlyToggle : m_BlinkToggle); + // HACK: Toggle Group claims these toggles are not a part of the group linkedObject.m_FlyToggle.isOn = isOn; + linkedObject.m_BlinkToggle.isOn = !isOn; + linkedObject.m_BlockValueChangedListener = false; + } } }); } + else + { + m_BlinkToggle = toggle; + } } } } @@ -166,13 +182,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_State == State.Moving) return; - foreach (var linkedObject in linkedObjects) + foreach (LocomotionTool locomotionTool in linkedObjects) { - if (linkedObject == this) + if (locomotionTool == this) continue; - var blinkTool = (LocomotionTool)linkedObject; - if (blinkTool.m_State != State.Inactive) + if (locomotionTool.m_State != State.Inactive) return; } @@ -312,20 +327,19 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) if (m_AllowScaling) { var otherGrip = false; - foreach (var linkedObject in linkedObjects) + foreach (LocomotionTool locomotionTool in linkedObjects) { - if (linkedObject == this) + if (locomotionTool == this) continue; - var blinkTool = (LocomotionTool)linkedObject; - if (blinkTool.m_Grip != null) + if (locomotionTool.m_Grip != null) { otherGrip = true; consumeControl(m_Grip); - consumeControl(blinkTool.m_Grip); + consumeControl(locomotionTool.m_Grip); var thisPosition = cameraRig.InverseTransformPoint(rayOrigin.position); - var otherRayOrigin = blinkTool.rayOrigin; + var otherRayOrigin = locomotionTool.rayOrigin; var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); @@ -345,7 +359,7 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) m_StartDirection = rayToRay; m_StartYaw = cameraRig.rotation.eulerAngles.y; - blinkTool.m_Scaling = true; + locomotionTool.m_Scaling = true; CreateViewerScaleVisuals(rayOrigin, otherRayOrigin); } @@ -355,7 +369,7 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var currentScale = Mathf.Clamp(m_StartScale * (m_StartDistance / distance), k_MinScale, k_MaxScale); // Press both thumb buttons to reset - if (m_Thumb != null && blinkTool.m_Thumb != null) + if (m_Thumb != null && locomotionTool.m_Thumb != null) { m_AllowScaling = false; @@ -370,7 +384,7 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) m_MainCamera.farClipPlane = m_OriginalFarClipPlane; consumeControl(m_Thumb); - consumeControl(blinkTool.m_Thumb); + consumeControl(locomotionTool.m_Thumb); if (m_ViewerScaleVisuals) ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); diff --git a/Tools/SelectionTool/SelectionInput.asset b/Tools/SelectionTool/SelectionInput.asset index 089829308..9c4b88f1b 100644 --- a/Tools/SelectionTool/SelectionInput.asset +++ b/Tools/SelectionTool/SelectionInput.asset @@ -25,7 +25,7 @@ MonoBehaviour: m_ActionMap: {fileID: 11400000} m_Bindings: - sources: - - controlIndex: 3 + - controlIndex: 22 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 90f2794e1..4c0538c87 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -16,7 +16,6 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR ActionMap m_ActionMap; GameObject m_PressedObject; - bool m_DidSelectObjects; readonly Dictionary m_HoverGameObjects = new Dictionary(); @@ -140,17 +139,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { if (m_PressedObject == hoveredObject) { - if (m_PressedObject != null) - { - m_DidSelectObjects = true; - - foreach (SelectionTool linkedObject in linkedObjects) - { - if (linkedObject != this) - linkedObject.m_DidSelectObjects = false; - } - } - this.SelectObject(m_PressedObject, rayOrigin, selectionInput.multiSelect.isHeld, true); if (m_PressedObject != null) From 43cb4954750b7fa55baa21a0383f081355633a47 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 16:05:51 -0700 Subject: [PATCH 456/870] Scale flying speed using primary trigger --- Tools/LocomotionTool/Locomotion.asset | 9 ++++----- Tools/LocomotionTool/Locomotion.cs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Tools/LocomotionTool/Locomotion.asset b/Tools/LocomotionTool/Locomotion.asset index 59810d814..bc769d4f3 100644 --- a/Tools/LocomotionTool/Locomotion.asset +++ b/Tools/LocomotionTool/Locomotion.asset @@ -82,8 +82,7 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 - m_MapTypeName: BlinkLocomotion, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, - PublicKeyToken=null + m_MapTypeName: Locomotion, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: --- !u!114 &114000010166273910 MonoBehaviour: @@ -134,16 +133,16 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Trigger + m_Name: Speed m_EditorClassIdentifier: m_ActionMap: {fileID: 11400000} m_ActionIndex: 3 m_ControlData: componentControlIndices: controlType: - m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - name: Trigger + name: Speed defaultValue: 0 --- !u!114 &114000011708774044 MonoBehaviour: diff --git a/Tools/LocomotionTool/Locomotion.cs b/Tools/LocomotionTool/Locomotion.cs index 6ab91dbeb..0d0af9e89 100644 --- a/Tools/LocomotionTool/Locomotion.cs +++ b/Tools/LocomotionTool/Locomotion.cs @@ -10,7 +10,7 @@ public Locomotion (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @blink { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @grip { get { return (ButtonInputControl)this[1]; } } public ButtonInputControl @thumb { get { return (ButtonInputControl)this[2]; } } - public ButtonInputControl @trigger { get { return (ButtonInputControl)this[3]; } } + public AxisInputControl @speed { get { return (AxisInputControl)this[3]; } } public ButtonInputControl @reverse { get { return (ButtonInputControl)this[4]; } } public ButtonInputControl @forward { get { return (ButtonInputControl)this[5]; } } } From 096d2d89c586ff17611cff0e06e932a539d14d10 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 16:14:39 -0700 Subject: [PATCH 457/870] Add reverse rotation mode --- Tools/LocomotionTool/LocomotionTool.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 608a34767..0aa215726 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -14,7 +14,7 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences { const float k_FastMoveSpeed = 20f; - const float k_SlowMoveSpeed = 4f; + const float k_SlowMoveSpeed = 1f; const float k_RotationDamping = 0.2f; //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 @@ -224,14 +224,18 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) m_Rotating = true; m_RigStartPosition = cameraRig.position; m_RigStartRotation = cameraRig.rotation; - m_RayOriginStartRotation = MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); + m_RayOriginStartRotation = MathUtilsExt.ConstrainYawRotation( + reverse ? Quaternion.Inverse(rayOrigin.rotation) * cameraRig.rotation + : Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); m_CameraStartPosition = CameraUtils.GetMainCamera().transform.position; m_LastRotationDiff = Quaternion.identity; } consumeControl(blinkInput.grip); var startOffset = m_RigStartPosition - m_CameraStartPosition; - var localRayRotation = MathUtilsExt.ConstrainYawRotation(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); + var localRayRotation = MathUtilsExt.ConstrainYawRotation( + reverse ? Quaternion.Inverse(rayOrigin.rotation) * cameraRig.rotation + : Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); var rotation = Quaternion.Inverse(m_RayOriginStartRotation) * localRayRotation; var filteredRotation = Quaternion.Lerp(m_LastRotationDiff, rotation, k_RotationDamping); @@ -243,10 +247,12 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) else { var speed = k_SlowMoveSpeed; - if (blinkInput.trigger.isHeld || blinkInput.trigger.wasJustReleased) // Consume control on release to block selection + var speedControl = blinkInput.speed; + var speedControlValue = speedControl.value; + if (!Mathf.Approximately(speedControlValue, 0)) // Consume control to block selection { - speed = k_FastMoveSpeed; - consumeControl(blinkInput.trigger); + speed = k_SlowMoveSpeed + speedControlValue * (k_FastMoveSpeed - k_SlowMoveSpeed); + consumeControl(speedControl); } speed *= this.GetViewerScale(); From a0618701574b551401ae924b3322931c31951e7d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 16:26:09 -0700 Subject: [PATCH 458/870] Add segmentation to rotation --- Tools/LocomotionTool/LocomotionTool.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 0aa215726..7297d98c4 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -23,6 +23,8 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const string k_WorldScaleProperty = "_WorldScale"; + const int k_RotationSegments = 16; + enum State { Inactive = 0, @@ -239,8 +241,11 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) var rotation = Quaternion.Inverse(m_RayOriginStartRotation) * localRayRotation; var filteredRotation = Quaternion.Lerp(m_LastRotationDiff, rotation, k_RotationDamping); - cameraRig.rotation = m_RigStartRotation * filteredRotation; - cameraRig.position = m_CameraStartPosition + filteredRotation * startOffset; + var segmentSize = 180f / k_RotationSegments; + var segmentedRotation = Quaternion.Euler(0, Mathf.Floor(filteredRotation.eulerAngles.y / segmentSize) * segmentSize, 0); + + cameraRig.rotation = m_RigStartRotation * segmentedRotation; + cameraRig.position = m_CameraStartPosition + segmentedRotation * startOffset; m_LastRotationDiff = filteredRotation; } From 5108b60c2bb36272a81617294060741bf14f009c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 19 Jun 2017 16:32:35 -0700 Subject: [PATCH 459/870] Move PinnedToolButton project contents into PinnedToolMenu folder --- .../HapticPulses.meta | 0 .../HapticPulses/ClickPulse.asset | 0 .../HapticPulses/ClickPulse.asset.meta | 0 .../HapticPulses/HoverPulse.asset | 0 .../HapticPulses/HoverPulse.asset.meta | 0 .../PinnedToolButton.meta | 0 .../PinnedToolButton/Materials.meta | 0 .../Materials/PinnedToolButton.mat | 0 .../Materials/PinnedToolButton.mat.meta | 0 .../Materials/PinnedToolButtonBorder.mat | 0 .../Materials/PinnedToolButtonBorder.mat.meta | 0 .../Materials/PinnedToolButtonFaceMask.mat | 0 .../PinnedToolButtonFaceMask.mat.meta | 0 .../Materials/PinnedToolButtonUIContent.mat | 0 .../PinnedToolButtonUIContent.mat.meta | 0 .../PinnedToolButton/PinnedToolButton.cs | 12 +- .../PinnedToolButton/PinnedToolButton.cs.meta | 0 .../PinnedToolButton/PinnedToolButton.cs.orig | 1240 +++++++++++++++++ .../PinnedToolButton.cs.orig.meta | 8 + .../PinnedToolButton/PinnedToolButton.prefab | 0 .../PinnedToolButton.prefab.meta | 0 21 files changed, 1258 insertions(+), 2 deletions(-) rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses.meta (100%) rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses/ClickPulse.asset (100%) rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses/ClickPulse.asset.meta (100%) rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses/HoverPulse.asset (100%) rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses/HoverPulse.asset.meta (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton.meta (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials.meta (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials/PinnedToolButton.mat (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials/PinnedToolButton.mat.meta (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials/PinnedToolButtonBorder.mat (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/PinnedToolButton.cs (99%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/PinnedToolButton.cs.meta (100%) create mode 100644 Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig create mode 100644 Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig.meta rename Menus/{ => PinnedToolMenu}/PinnedToolButton/PinnedToolButton.prefab (100%) rename Menus/{ => PinnedToolMenu}/PinnedToolButton/PinnedToolButton.prefab.meta (100%) diff --git a/Menus/PinnedToolButton/HapticPulses.meta b/Menus/PinnedToolMenu/HapticPulses.meta similarity index 100% rename from Menus/PinnedToolButton/HapticPulses.meta rename to Menus/PinnedToolMenu/HapticPulses.meta diff --git a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset b/Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset similarity index 100% rename from Menus/PinnedToolButton/HapticPulses/ClickPulse.asset rename to Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset diff --git a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset.meta similarity index 100% rename from Menus/PinnedToolButton/HapticPulses/ClickPulse.asset.meta rename to Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset.meta diff --git a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset b/Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset similarity index 100% rename from Menus/PinnedToolButton/HapticPulses/HoverPulse.asset rename to Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset diff --git a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset.meta similarity index 100% rename from Menus/PinnedToolButton/HapticPulses/HoverPulse.asset.meta rename to Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset.meta diff --git a/Menus/PinnedToolButton.meta b/Menus/PinnedToolMenu/PinnedToolButton.meta similarity index 100% rename from Menus/PinnedToolButton.meta rename to Menus/PinnedToolMenu/PinnedToolButton.meta diff --git a/Menus/PinnedToolButton/Materials.meta b/Menus/PinnedToolMenu/PinnedToolButton/Materials.meta similarity index 100% rename from Menus/PinnedToolButton/Materials.meta rename to Menus/PinnedToolMenu/PinnedToolButton/Materials.meta diff --git a/Menus/PinnedToolButton/Materials/PinnedToolButton.mat b/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButton.mat similarity index 100% rename from Menus/PinnedToolButton/Materials/PinnedToolButton.mat rename to Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButton.mat diff --git a/Menus/PinnedToolButton/Materials/PinnedToolButton.mat.meta b/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButton.mat.meta similarity index 100% rename from Menus/PinnedToolButton/Materials/PinnedToolButton.mat.meta rename to Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButton.mat.meta diff --git a/Menus/PinnedToolButton/Materials/PinnedToolButtonBorder.mat b/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonBorder.mat similarity index 100% rename from Menus/PinnedToolButton/Materials/PinnedToolButtonBorder.mat rename to Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonBorder.mat diff --git a/Menus/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta b/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta similarity index 100% rename from Menus/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta rename to Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta diff --git a/Menus/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat b/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat similarity index 100% rename from Menus/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat rename to Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat diff --git a/Menus/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta b/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta similarity index 100% rename from Menus/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta rename to Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta diff --git a/Menus/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat b/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat similarity index 100% rename from Menus/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat rename to Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat diff --git a/Menus/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta b/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta similarity index 100% rename from Menus/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta rename to Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta diff --git a/Menus/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs similarity index 99% rename from Menus/PinnedToolButton/PinnedToolButton.cs rename to Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 52785a16e..2a1f1c3fb 100644 --- a/Menus/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IControlHaptics + public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor { static Color s_FrameOpaqueColor; static Color s_SemiTransparentFrameColor; @@ -314,6 +314,7 @@ public Transform alternateMenuOrigin //public Action revealAllToolButtons { get; set; } //public Action revealAllToolButtons { get; set; } //public Action hideAllToolButtons { get; set; } + public Action OpenMenu { get; set; } public Action selectTool { get; set; } public Func closeButton { get; set; } @@ -327,6 +328,10 @@ public Transform alternateMenuOrigin public Action showAllButtons { get; set; } public Action hoverExit { get; set; } + public event Action hovered; + //public event Action hovered; + //public event Action clicked; + //public event Action hoverEnter; //public event Action hoverExit; public event Action selected; @@ -668,6 +673,9 @@ void OnBackgroundHoverEnter () this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } + if (hovered != null) // Raised in order to trigger the haptic in the PinnedToolsMenu + hovered(); + //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) //{ //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); @@ -681,8 +689,8 @@ void OnBackgroundHoverEnter () showAllButtons(this); //HoverButton(); //m_ButtonCollider.enabled = false; + //} - } /* diff --git a/Menus/PinnedToolButton/PinnedToolButton.cs.meta b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.meta similarity index 100% rename from Menus/PinnedToolButton/PinnedToolButton.cs.meta rename to Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig new file mode 100644 index 000000000..2f08edcb5 --- /dev/null +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig @@ -0,0 +1,1240 @@ +#if UNITY_EDITOR +using System; +using System.Collections; +using System.Text; +<<<<<<< HEAD:Scripts/UI/PinnedToolButton.cs +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Helpers; +======= +using UnityEditor.Experimental.EditorVR.Core; +>>>>>>> improvements/dylanu/haptics:Menus/PinnedToolButton/PinnedToolButton.cs +using UnityEditor.Experimental.EditorVR.UI; +using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; +using UnityEngine.InputNew; +using UnityEngine.UI; +using UnityEngine.EventSystems; + +namespace UnityEditor.Experimental.EditorVR.Menus +{ +<<<<<<< HEAD:Scripts/UI/PinnedToolButton.cs + public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IPerformHaptics +======= + sealed class PinnedToolButton : MonoBehaviour, ISelectTool, IPointerEnterHandler, IControlHaptics, IUsesNode +>>>>>>> improvements/dylanu/haptics:Menus/PinnedToolButton/PinnedToolButton.cs + { + static Color s_FrameOpaqueColor; + static Color s_SemiTransparentFrameColor; + static bool s_Hovered; + + const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation + const float k_alternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu + const string k_MaterialColorProperty = "_Color"; + const string k_MaterialAlphaProperty = "_Alpha"; + const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; + const string k_MainMenuTipText = "Main Menu (cannot be closed)"; + readonly Vector3 k_ToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); + readonly Vector3 k_SemiTransparentIconContainerScale = new Vector3(1.375f, 1.375f, 1f); + + public Type toolType + { + get + { + return m_ToolType; + } + + set + { + m_ToolType = value; + + m_GradientButton.gameObject.SetActive(true); + + if (m_ToolType != null) + { + Debug.LogError("Setting up button type : " + m_ToolType.ToString()); + if (isSelectionTool || isMainMenu) + { + //order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; + tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; + gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair + secondaryButtonCollidersEnabled = false; + } + else + { + tooltipText = toolType.Name; + + // Tools other than select fetch a random gradientPair; also used by the device when revealed + gradientPair = UnityBrandColorScheme.GetRandomCuratedLightGradient(); + } + + activeTool = activeTool; + m_GradientButton.visible = true; + //m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); + + //var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + //var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; + //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateInitialReveal(targetPosition, targetScale)); + } + else + { + m_GradientButton.visible = false; + gradientPair = UnityBrandColorScheme.grayscaleSessionGradient; + } + } + } + + public int order + { + get { return m_Order; } + set + { + //if (m_Order == value) + //return; + + m_Order = value; // Position of this button in relation to other pinned tool buttons + + //Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order + " - current button count : " + visibileButtonCount); + + highlighted = false; + //m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive + //activeTool = activeTool; + //const float kSmoothingMax = 50f; + //const int kSmoothingIncreaseFactor = 10; + //var smoothingFactor = Mathf.Clamp(kSmoothingMax- m_Order * kSmoothingIncreaseFactor, 0f, kSmoothingMax); + //m_SmoothMotion.SetPositionSmoothing(smoothingFactor); + //m_SmoothMotion.SetRotationSmoothing(smoothingFactor); + //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); + //m_LeftPinnedToolActionButton.visible = false; + //m_RightPinnedToolActionButton.visible = false; + + // We move in counter-clockwise direction + // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered + //const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice + //const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time + //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; + //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); + + //var mainMenuAndActiveButtonCount = 2; + //var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order)); + + if(m_Order == -1) + this.HideTooltip(this); + + /* + if (aboluteMenuButtonCount > mainMenuAndActiveButtonCount) + this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); + else + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); + */ + } + } + + /// + /// GradientPair should be set with new random gradientPair each time a new Tool is associated with this Button + /// This gradientPair is also used to highlight the input device when appropriate + /// + public GradientPair gradientPair + { + get { return m_GradientPair; } + set + { + m_GradientPair = value; + customToolTipHighlightColor = value; + } + } + + /// + /// Type, that if not null, denotes that preview-mode is enabled + /// This is enabled when highlighting a tool on the main menu + /// + public Type previewToolType + { + get { return m_previewToolType; } + set + { + m_previewToolType = value; + + if (m_previewToolType != null) // Show the highlight if the preview type is valid; hide otherwise + { + var tempToolGo = ObjectUtils.AddComponent(m_previewToolType, gameObject); + var tempTool = tempToolGo as ITool; + if (tempTool != null) + { + var iMenuIcon = tempTool as IMenuIcon; + if (iMenuIcon != null) + previewIcon = iMenuIcon.icon; + + ObjectUtils.Destroy(tempToolGo); + } + + // Show the grayscale highlight when previewing a tool on this button + m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; + + if (!previewIcon) + m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); + + //tooltipText = "Assign " + m_previewToolType.Name; + //customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; + //this.ShowTooltip(this); + } + else + { + activeTool = activeTool; // Set active tool back to pre-preview state + icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button + m_GradientButton.highlightGradientPair = gradientPair; + //customToolTipHighlightColor = gradientPair; + //this.HideTooltip(this); + //tooltipText = (isSelectionTool || isMainMenu) ? (isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText) : toolType.Name; + } + + m_GradientButton.highlighted = m_previewToolType != null; + //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); + } + } + + /* + public Transform alternateMenuOrigin + { + get { return m_AlternateMenuOrigin; } + set + { + if (m_AlternateMenuOrigin == value) + return; + + m_AlternateMenuOrigin = value; + transform.SetParent(m_AlternateMenuOrigin); + transform.localPosition = Vector3.zero; + transform.localRotation = Quaternion.identity; + } + } +*/ + + [SerializeField] + GradientButton m_GradientButton; + + [SerializeField] +<<<<<<< HEAD:Scripts/UI/PinnedToolButton.cs + SmoothMotion m_SmoothMotion; + + //[SerializeField] + //PinnedToolActionButton m_LeftPinnedToolActionButton; + + //[SerializeField] + //PinnedToolActionButton m_RightPinnedToolActionButton; + + [SerializeField] + Transform m_IconContainer; + + [SerializeField] + CanvasGroup m_IconContainerCanvasGroup; + + //[SerializeField] + //Collider m_RootCollider; + + [SerializeField] + SkinnedMeshRenderer m_FrameRenderer; + + [SerializeField] + SkinnedMeshRenderer m_InsetMeshRenderer; + + [SerializeField] + Collider[] m_PrimaryButtonColliders; + + [SerializeField] + GradientButton m_SecondaryGradientButton; + + [SerializeField] + CanvasGroup m_SecondaryButtonContainerCanvasGroup; + + [SerializeField] + SkinnedMeshRenderer m_SecondaryInsetMeshRenderer; + + [SerializeField] + SkinnedMeshRenderer m_SecondaryInsetMaskMeshRenderer; + + [SerializeField] + Collider[] m_SecondaryButtonColliders; // disable for the main menu button & solitary active tool button + + [SerializeField] + Transform m_TooltipTarget; + + [SerializeField] + Transform m_TooltipSource; + + [SerializeField] + Vector3 m_AlternateLocalPosition; + + [SerializeField] + Transform m_Inset; + + [SerializeField] + Transform m_InsetMask; + + [SerializeField] + Image m_ButtonIcon; + + [SerializeField] + AudioClip m_HighlightedHapticClip; + + Coroutine m_PositionCoroutine; + Coroutine m_VisibilityCoroutine; + Coroutine m_HighlightCoroutine; + Coroutine m_ActivatorMoveCoroutine; + Coroutine m_HoverCheckCoroutine; + Coroutine m_SecondaryButtonVisibilityCoroutine; + + string m_TooltipText; + bool m_Revealed; + bool m_MoveToAlternatePosition; + int m_Order = -1; + Type m_previewToolType; + Type m_ToolType; + GradientPair m_GradientPair; + //Transform m_AlternateMenuOrigin; + Material m_FrameMaterial; + Material m_InsetMaterial; + //Vector3 m_InactivePosition; // Inactive button offset from the main menu activator + Vector3 m_OriginalLocalPosition; + Vector3 m_OriginalLocalScale; + Material m_IconMaterial; + Vector3 m_OriginalIconContainerLocalScale; + Sprite m_Icon; + Sprite m_PreviewIcon; + bool m_Highlighted; + bool m_ActiveTool; + bool m_Visible; + + public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } + public Transform tooltipTarget { get { return m_TooltipTarget; } } + public Transform tooltipSource { get { return m_TooltipSource; } } + public TextAlignment tooltipAlignment { get; private set; } +======= + HapticPulse m_HoverPulse; + + [SerializeField] + HapticPulse m_ClickPulse; + +>>>>>>> improvements/dylanu/haptics:Menus/PinnedToolButton/PinnedToolButton.cs + public Transform rayOrigin { get; set; } + public Node node { get; set; } + public ITooltip tooltip { private get; set; } // Overrides text + public Action showTooltip { private get; set; } + public Action hideTooltip { private get; set; } + public GradientPair customToolTipHighlightColor { get; set; } + public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } + public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } + public int activeButtonCount { get; set; } + public int maxButtonCount { get; set; } + public Transform menuOrigin { get; set; } + //public Action revealAllToolButtons { get; set; } + //public Action revealAllToolButtons { get; set; } + //public Action hideAllToolButtons { get; set; } + public Action OpenMenu { get; set; } + public Action selectTool { get; set; } + public Func closeButton { get; set; } + public Action highlightSingleButton { get; set; } + //public Action deleteHighlightedButton { get; set; } + public Action selectHighlightedButton { get; set; } + public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu + public Func visibileButtonCount { get; set; } + public bool implementsSecondaryButton { get; set; } + public Action destroy { get { return DestroyButton; } } + public Action showAllButtons { get; set; } + public Action hoverExit { get; set; } + + //public event Action hoverEnter; + //public event Action hoverExit; + public event Action selected; + + public bool activeTool + { + get { return m_ActiveTool; } + set + { + //if (m_ActiveTool == value) + //return; + + m_ActiveTool = value; + + m_GradientButton.normalGradientPair = !m_ActiveTool ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; + m_GradientButton.highlightGradientPair = !m_ActiveTool ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; + + //if (activeTool) // TODO REMOVE IF NOT NEEDED + //m_GradientButton.invertHighlightScale = value; + + m_GradientButton.highlighted = true; + m_GradientButton.highlighted = false; + } + } + + public bool visible + { + //get { return m_Highlighted; } + set + { + if (m_Visible == value) + return; + + gameObject.SetActive(value); + } + } + + public bool highlighted + { + get { return m_Highlighted; } + set + { + if (m_Highlighted == value) + return; + + m_Highlighted = value; + m_GradientButton.highlighted = m_Highlighted; + + if (!m_Highlighted) + this.HideTooltip(this); + else + this.Pulse(rayOrigin, 0.005f, 0.2f); // Used for spatial selection highlighting only + + if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) + { + if (m_Highlighted) + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); + else + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + } + } + } + + public bool secondaryButtonHighlighted { get { return m_SecondaryGradientButton.highlighted; } } + + public bool toolTipVisible + { + set + { + if (!value) + this.HideTooltip(this); + } + } + + bool primaryButtonCollidersEnabled + { + set + { + foreach (var collider in m_PrimaryButtonColliders) + { + collider.enabled = value; + } + } + } + + bool secondaryButtonCollidersEnabled + { + set + { + foreach (var collider in m_SecondaryButtonColliders) + { + collider.enabled = value; + } + } + } + + public bool revealed + { + get { return m_Revealed; } + set + { + if (m_Revealed == value || !gameObject.activeSelf || activeButtonCount <= k_ActiveToolOrderPosition + 1) + return; + + m_Revealed = value; + + if (isMainMenu) + { + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor * (value ? 0f : 1f)); + m_GradientButton.visible = !value; + primaryButtonCollidersEnabled = !m_Revealed; + return; + } + else + { + primaryButtonCollidersEnabled = m_Revealed; + } + + //Debug.LogError(Time.frameCount + " : Highlighting : " + toolType); + + var newOrderPosition = order; + var buttonCount = 2; // MainMenu + ActiveTool button count + var targetRotation = Quaternion.identity; + if (m_Revealed) + { + buttonCount = activeButtonCount - 1; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + newOrderPosition -= 1; + order = order; + secondaryButtonCollidersEnabled = true; + } + else + { + // Set all buttons back to the center + // Tools with orders greater than that of the active tool should hide themseleves when the pinned tools arent being hovered + newOrderPosition = isMainMenu ? 0 : k_ActiveToolOrderPosition; + secondaryButtonCollidersEnabled = false; + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + } + + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newOrderPosition)); + //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value && order < 1)); + } + + //get { return m_Revealed; } + } + + public Sprite icon + { + get { return m_Icon; } + set + { + m_PreviewIcon = null; // clear any cached preview icons + m_Icon = value; + + if (m_Icon) + m_GradientButton.SetContent(m_Icon); + else + m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); // Set backup tool abbreviation if no icon is set + } + } + + public Sprite previewIcon + { + get { return m_PreviewIcon; } + set + { + m_PreviewIcon = value; + m_GradientButton.SetContent(m_PreviewIcon); + } + } + + public bool moveToAlternatePosition + { + get { return m_MoveToAlternatePosition; } + set + { + if (m_MoveToAlternatePosition == value) + return; + + m_MoveToAlternatePosition = value; + + this.StopCoroutine(ref m_ActivatorMoveCoroutine); + + m_ActivatorMoveCoroutine = StartCoroutine(AnimateMoveActivatorButton(m_MoveToAlternatePosition)); + } + } + + void Awake() + { + m_OriginalLocalPosition = transform.localPosition; + m_OriginalLocalScale = transform.localScale; + + m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); + var frameMaterialColor = m_FrameMaterial.color; + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); + s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); + s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); + + m_IconMaterial = MaterialUtils.GetMaterialClone(m_ButtonIcon); + m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); + m_OriginalIconContainerLocalScale = m_IconContainer.localScale; + //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); + } + + public Node? node { get; set; } + + void Start() + { + //m_GradientButton.onClick += ButtonClicked; // TODO remove after action button refactor + + Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); + + //transform.parent = alternateMenuOrigin; + + if (m_ToolType == null) + { + //transform.localPosition = m_InactivePosition; + m_GradientButton.gameObject.SetActive(false); + } + else + { + //transform.localPosition = activePosition; + } + + var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); + var tooltipXOffset = node == Node.LeftHand ? -0.15f : 0.15f; + tooltipSource.localPosition = tooltipSourcePosition; + tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; + m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); + + m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions + m_GradientButton.hoverExit += OnActionButtonHoverExit; + m_GradientButton.click += OnBackgroundButtonClick; + m_GradientButton.containerContentsAnimationSpeedMultiplier = 2.5f; + + m_FrameRenderer.SetBlendShapeWeight(1, 0f); + m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, 100f); + m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, 100f); + + m_SecondaryGradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions + m_SecondaryGradientButton.hoverExit += OnActionButtonHoverExit; + m_SecondaryGradientButton.click += OnSecondaryButtonClicked; + m_SecondaryButtonContainerCanvasGroup.alpha = 0f; + //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; + //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; + //m_LeftPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; + //m_RightPinnedToolActionButton.clicked = ActionButtonClicked; + //m_RightPinnedToolActionButton.hoverEnter = HoverButton; + //m_RightPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; + + // Assign the select action button to the side closest to the opposite hand, that allows the arrow to also point in the direction the + //var leftHand = node == Node.LeftHand; + //m_RightPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.SelectTool : PinnedToolActionButton.ButtonType.Close; + //m_LeftPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.Close : PinnedToolActionButton.ButtonType.SelectTool; + + //m_RightPinnedToolActionButton.rotateIcon = leftHand ? false : true; + //m_LeftPinnedToolActionButton.rotateIcon = leftHand ? false : true; + + //m_LeftPinnedToolActionButton.visible = false; + //m_RightPinnedToolActionButton.visible = false; + + //m_LeftPinnedToolActionButton.mainButtonCollider = m_RootCollider; + //m_RightPinnedToolActionButton.mainButtonCollider = m_RootCollider; + + //m_ButtonCollider.enabled = true; + //m_GradientButton.click += OnClick; + //m_GradientButton.gameObject.SetActive(false); + } + + void OnDestroy() + { +<<<<<<< HEAD:Scripts/UI/PinnedToolButton.cs + ObjectUtils.Destroy(m_InsetMaterial); + ObjectUtils.Destroy(m_IconMaterial); + ObjectUtils.Destroy(m_FrameMaterial); + + this.StopCoroutine(ref m_PositionCoroutine); + this.StopCoroutine(ref m_VisibilityCoroutine); + this.StopCoroutine(ref m_HighlightCoroutine); + this.StopCoroutine(ref m_ActivatorMoveCoroutine); + this.StopCoroutine(ref m_HoverCheckCoroutine); + this.StopCoroutine(ref m_SecondaryButtonVisibilityCoroutine); + this.Pulse(rayOrigin, 0.5f, 0.2f, true, true); +======= + SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); + this.Pulse(node, m_ClickPulse); +>>>>>>> improvements/dylanu/haptics:Menus/PinnedToolButton/PinnedToolButton.cs + } + + void DestroyButton() + { + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); + } + + public void OnPointerEnter(PointerEventData eventData) + { + this.Pulse(node, m_HoverPulse); + } + + // Create periodic table-style names for types + string GetTypeAbbreviation(Type type) + { + var abbreviation = new StringBuilder(); + foreach (var ch in type.Name.ToCharArray()) + { + if (char.IsUpper(ch)) + abbreviation.Append(abbreviation.Length > 0 ? char.ToLower(ch) : ch); + + if (abbreviation.Length >= 2) + break; + } + + return abbreviation.ToString(); + } + + bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) + { + return buttonType == PinnedToolActionButton.ButtonType.SelectTool; + } + + void OnBackgroundHoverEnter () + { + //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); + //if (m_PositionCoroutine != null || m_SecondaryGradientButton.highlighted) + //return; + + s_Hovered = true; + + this.Pulse(rayOrigin, 0.005f, 0.175f); + + if (isMainMenu) + { + m_GradientButton.highlighted = true; + return; + } + else if (implementsSecondaryButton) + { + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); + } + + //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) + //{ + //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); + //m_RootCollider.enabled = false; + m_GradientButton.highlighted = true; + //m_GradientButton.visible = false; + + //Debug.LogWarning("Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); + + //revealAllToolButtons(rayOrigin, true); + showAllButtons(this); + //HoverButton(); + //m_ButtonCollider.enabled = false; + //} + + } + + /* + void HoverButton() + { + if (order < 2 && (isSelectionTool || isMainMenu)) // The main menu and the active tool occupy orders 0 and 1; don't show any action buttons for buttons in either position + { + //m_RightPinnedToolActionButton.visible = false; + //m_LeftPinnedToolActionButton.visible = false; + //m_RootCollider.enabled = true; + //StartCoroutine(DelayedCollderEnable()); + } + else if (isSelectionTool) + { + + if (activeTool) + { + m_RightPinnedToolActionButton.visible = false; + m_LeftPinnedToolActionButton.visible = false; + StartCoroutine(DelayedCollderEnable()); + } + else + + { + //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? true : false; + //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; + } + } else + { + // Hide the select action button if this tool button is already the selected tool, else show the close button for inactive tools + //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? !activeTool : true; + //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; + } + + revealAllToolButtons(rayOrigin, true); + } + */ + + void OnActionButtonHoverExit() + { + ActionButtonHoverExit(); + } + + void ActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) + { + if (m_PositionCoroutine != null) + return; + + if (isMainMenu) + { + m_GradientButton.highlighted = false; + return; + } + + //this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); + + if (!m_SecondaryGradientButton.highlighted) + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + + hoverExit(); + + return; + Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); + // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons + + // Hide both action buttons if the user is no longer hovering over the button + //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) + //{ + //Debug.LogWarning("!!!"); + //m_ButtonCollider.enabled = true; + //m_LeftPinnedToolActionButton.visible = false; + //m_RightPinnedToolActionButton.visible = false; + //m_GradientButton.visible = true; + m_GradientButton.highlighted = false; + //revealAllToolButtons(rayOrigin, false); + //} + + m_GradientButton.UpdateMaterialColors(); + } + + /* + void ActionButtonClicked(PinnedToolActionButton button) + { + Debug.LogError("Action Button selectTool!"); + if (order > menuButtonOrderPosition) + { + // TODO: SELECT ACTION BUTTONS should be able to be interacted with due to their being hidden, so no need to handle for that case + // Buttons in the activeToolOrderPosition cannot be selected when selectTool + if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool && order > activeToolOrderPosition) + { + selectTool(rayOrigin, m_ToolType); // ButtonClicked will set button order to 0 + activeTool = activeTool; + //SetButtonGradients(this.ButtonClicked(rayOrigin, m_ToolType)); + } + else // Handle action buttons assigned Close-Tool functionality + { + //if (!isSelectionTool) + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); + //else + //Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); + + deletePinnedToolButton(rayOrigin, this); + } + + OnActionButtonHoverExit(false); + //m_LeftPinnedToolActionButton.revealed = false; + //m_RightPinnedToolActionButton.revealed = false; + } + } + */ + + void OnBackgroundButtonClick() + { + Debug.LogWarning("OnBackgroundButtonClick : " + name + " : " + toolType); + // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons + + // Hide both action buttons if the user is no longer hovering over the button + //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) + //{ + //} + + selectTool(toolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons + + if (!isMainMenu) + { + ActionButtonHoverExit(false); + //revealAllToolButtons(rayOrigin, true); + } + + m_GradientButton.UpdateMaterialColors(); + } + + void OnSecondaryButtonClicked() + { + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); + closeButton(); + this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); + //deleteHighlightedButton(rayOrigin); + //deletePinnedToolButton(rayOrigin, this); + ActionButtonHoverExit(false); + } + + IEnumerator AnimateInitialReveal(Vector3 targetPosition, Vector3 targetScale) + { + m_IconContainerCanvasGroup.alpha = 1f; + var duration = 0f; + while (duration < 2) + { + duration += Time.unscaledDeltaTime * 3f; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); + m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, k_SemiTransparentIconContainerScale, durationShaped * 2f); + transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); + transform.localScale = Vector3.Lerp(Vector3.zero, targetScale, durationShaped); + yield return null; + } + + m_IconContainer.localScale = k_SemiTransparentIconContainerScale; + transform.localPosition = targetPosition; + transform.localScale = targetScale; + m_VisibilityCoroutine = null; + } + + IEnumerator AnimateHideAndDestroy() + { + this.StopCoroutine(ref m_PositionCoroutine); + this.StopCoroutine(ref m_HighlightCoroutine); + this.StopCoroutine(ref m_ActivatorMoveCoroutine); + this.StopCoroutine(ref m_HoverCheckCoroutine); + this.StopCoroutine(ref m_SecondaryButtonVisibilityCoroutine); + + this.HideTooltip(this); + var duration = 0f; + var currentScale = transform.localScale; + var targetScale = Vector3.zero; + while (duration < 1) + { + duration += Time.unscaledDeltaTime * 3f; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); + transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + yield return null; + } + + transform.localScale = targetScale; + m_VisibilityCoroutine = null; + ObjectUtils.Destroy(gameObject, 0.1f); + } + + IEnumerator AnimateHide() + { + //primaryButtonCollidersEnabled = false; + //secondaryButtonCollidersEnabled = false; + var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + var targetPosition = Vector3.zero; + var currentPosition = transform.localPosition; + + var currentFrameColor = m_FrameMaterial.color; + var targetFrameColor = Color.clear; + var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); + var targetInsetAlpha = 0f; + var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); + var targetIconColor = Color.clear; + //var currentInsetScale = m_Inset.localScale; + //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; + //var currentInsetMaskScale = m_InsetMask.localScale; + //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; + var currentIconScale = m_IconContainer.localScale; + var targetIconContainerScale = Vector3.zero; + var transitionAmount = 0f; + var currentScale = transform.localScale; + while (transitionAmount < 1) + { + transitionAmount += Time.unscaledDeltaTime * 8; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + /* + m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); + //m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); + //m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); + m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); + //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; + */ + //CorrectIconRotation(); + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); + transform.localScale = Vector3.Lerp(currentScale, Vector3.zero, shapedAmount); + yield return null; + } + + /* + m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); + //m_Inset.localScale = targetInsetScale; + //m_InsetMask.localScale = targetInsetMaskScale; + m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + */ + m_IconContainer.localScale = targetIconContainerScale; + transform.localPosition = targetPosition; + m_VisibilityCoroutine = null; + } + + IEnumerator AnimateShow() + { + //primaryButtonCollidersEnabled = false; + //secondaryButtonCollidersEnabled = false; + + var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; + + var currentFrameColor = m_FrameMaterial.color; + var targetFrameColor = Color.clear; + var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); + var targetInsetAlpha = 0f; + var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); + var targetIconColor = Color.clear; + //var currentInsetScale = m_Inset.localScale; + //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; + //var currentInsetMaskScale = m_InsetMask.localScale; + //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; + var currentIconScale = m_IconContainer.localScale; + var targetIconContainerScale = m_OriginalIconContainerLocalScale; + var transitionAmount = 0f; + var currentScale = transform.localScale; + var currentPosition = transform.localPosition; + while (transitionAmount < 1) + { + transitionAmount += Time.unscaledDeltaTime * 8; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + /* + m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); + //m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); + //m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); + m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); + //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; + transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); + */ + //CorrectIconRotation(); + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); + transform.localScale = Vector3.Lerp(currentScale, targetScale, shapedAmount); + yield return null; + } + + /* + m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); + //m_Inset.localScale = targetInsetScale; + //m_InsetMask.localScale = targetInsetMaskScale; + m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + */ + transform.localPosition = targetPosition; + transform.localScale = targetScale; + m_IconContainer.localScale = targetIconContainerScale; + m_VisibilityCoroutine = null; + } + + //IEnumerator AnimatePosition(int orderPosition, int buttonCount) + IEnumerator AnimatePosition(int orderPosition) + { + //Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition + " - BUTTON COUNT: " + visibileButtonCount); + primaryButtonCollidersEnabled = false; + secondaryButtonCollidersEnabled = false; + //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed + //gameObject.SetActive(true); + + //if (order != activeToolOrderPosition) + //m_RootCollider.enabled = false; + + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); + + if (orderPosition == -1) + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); + else + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + + var rotationSpacing = 360f / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time + var phaseOffset = orderPosition > -1 ? rotationSpacing * 0.5f - (visibileButtonCount() * 0.5f) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; + + var duration = 0f; + //var currentPosition = transform.localPosition; + //var targetPosition = activeTool ? activePosition : m_InactivePosition; + var currentCanvasAlpha = m_IconContainerCanvasGroup.alpha; + var targetCanvasAlpha = orderPosition > -1 ? 1f : 0f; + var currentRotation = transform.localRotation; + var positionWait = 1f;// (order + 5) * 0.1f; + while (duration < 1) + { + duration += Time.unscaledDeltaTime * 6f * positionWait; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); + transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); + m_IconContainerCanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, targetCanvasAlpha, durationShaped); + CorrectIconRotation(); + //transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); + yield return null; + } + + //if (!m_Revealed && orderPosition == 0 && buttonCount == 1 && !activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed + //gameObject.SetActive(false); + + //transform.localPosition = targetPosition; + transform.localRotation = targetRotation; + CorrectIconRotation(); + primaryButtonCollidersEnabled = orderPosition > -1 ? true : false; + secondaryButtonCollidersEnabled = orderPosition > -1 ? true : false; + m_PositionCoroutine = null; + + if (implementsSecondaryButton && orderPosition > -1 && m_GradientButton.highlighted) + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); + } + + /* + IEnumerator AnimateSemiTransparentX(bool makeSemiTransparent) + { + //if (!makeSemiTransparent) + //yield return new WaitForSeconds(1f); // Pause before making opaque + + if (makeSemiTransparent && activeTool) + yield break; + + //Debug.LogWarning("AnimateSemiTransparent : " + makeSemiTransparent); + //const float kFasterMotionMultiplier = 2f; + var transitionAmount = 0f; + //var positionWait = (order + 1) * 0.25f; // pad the order index for a faster start to the transition + //var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); + //var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); + var currentFrameColor = m_FrameMaterial.color; + var targetFrameColor = makeSemiTransparent ? s_SemiTransparentFrameColor : s_FrameOpaqueColor; + var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); + var targetInsetAlpha = makeSemiTransparent ? 0.25f : 1f; + var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); + var targetIconColor = makeSemiTransparent ? s_SemiTransparentFrameColor : Color.white; + var currentInsetScale = m_Inset.localScale; + var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; + var currentInsetMaskScale = m_InsetMask.localScale; + var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; + var currentIconScale = m_IconContainer.localScale; + var targetIconContainerScale = makeSemiTransparent ? k_SemiTransparentIconContainerScale : Vector3.one; + var speedMultiplier = makeSemiTransparent ? 4f : 6.5f; // Slower transparent fade; faster opaque fade + while (transitionAmount < 1) + { + transitionAmount += Time.unscaledDeltaTime * speedMultiplier; + var shapedAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(transitionAmount), 3); + m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); + m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); + m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); + m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); + //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; + m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); + CorrectIconRotation(); + yield return null; + } + + m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); + m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); + m_Inset.localScale = targetInsetScale; + m_InsetMask.localScale = targetInsetMaskScale; + m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); + m_IconContainer.localScale = targetIconContainerScale; + } + */ + + IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) + { + var amount = 0f; + var currentPosition = transform.localPosition; + var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; + var currentLocalScale = transform.localScale; + var targetLocalScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + var speed = moveToAlternatePosition ? 5f : 4.5f; // perform faster is returning to original position + speed += (order + 1) * 0.275f; + while (amount < 1f) + { + amount += Time.unscaledDeltaTime * speed; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); + transform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedAmount); + yield return null; + } + + transform.localPosition = targetPosition; + transform.localScale = targetLocalScale; + m_ActivatorMoveCoroutine = null; + } + +/* + IEnumerator DelayedCollderEnable() + { + yield return new WaitForSeconds(0.5f); + //m_RootCollider.enabled = true; + } +*/ + + IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) + { + s_Hovered = false; + + if (waitBeforeClosingAllButtons) + { + var duration = Time.unscaledDeltaTime; + while (duration < 0.25f) + { + duration += Time.unscaledDeltaTime; + yield return null; + + if ((s_Hovered || m_PositionCoroutine != null) || m_SecondaryGradientButton.highlighted) + { + m_HoverCheckCoroutine = null; + yield break; + } + } + } + + // Only proceed if no other button is being hovered + m_GradientButton.highlighted = false; + hoverExit(); + m_GradientButton.UpdateMaterialColors(); + m_HoverCheckCoroutine = null; + } + + void CorrectIconRotation() + { + const float kIconLookForwardOffset = 0.5f; + var iconLookDirection = m_IconContainer.transform.position + transform.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation + m_IconContainer.LookAt(iconLookDirection); + m_IconContainer.localEulerAngles = new Vector3(0f, 0f, m_IconContainer.localEulerAngles.z); + var angle = m_IconContainer.localEulerAngles.z; + m_TooltipTarget.localEulerAngles = new Vector3(90f, 0f, angle); + + var yaw = transform.localRotation.eulerAngles.y; + //tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; + } + + IEnumerator ShowSecondaryButton() + { + //Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); + const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; + const float kSecondaryButtonVisibleBlendShapeWeight = 46f; + + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); + var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; + var amount = 0f; + while (amount < 0.25f) + { + amount += Time.unscaledDeltaTime; + yield return null; + } + + //Debug.LogError("SHOWING SECONDARY BUTTON"); + this.ShowTooltip(this); + + amount = 0f; + while (amount < 1f) + { + amount += Time.unscaledDeltaTime * 10f; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kFrameSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); + m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); + m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); + m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 1f, shapedAmount); + yield return null; + } + + m_SecondaryButtonVisibilityCoroutine = null; + } + + IEnumerator HideSecondaryButton() + { + const float kSecondaryButtonHiddenBlendShapeWeight = 100f; + + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); + var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; + var amount = 0f; + while (amount < 1f) + { + yield return null; + + if (m_SecondaryGradientButton.highlighted) + { + m_SecondaryButtonVisibilityCoroutine = null; + yield break; + } + + amount += Time.unscaledDeltaTime * 8f; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); + m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); + m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); + m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 0f, shapedAmount); + } + + m_SecondaryButtonVisibilityCoroutine = null; + } + } +} +#endif diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig.meta b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig.meta new file mode 100644 index 000000000..89e8b4c17 --- /dev/null +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6142a178a6ef6404dbc449b542128a2d +timeCreated: 1497907343 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab similarity index 100% rename from Menus/PinnedToolButton/PinnedToolButton.prefab rename to Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab diff --git a/Menus/PinnedToolButton/PinnedToolButton.prefab.meta b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab.meta similarity index 100% rename from Menus/PinnedToolButton/PinnedToolButton.prefab.meta rename to Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab.meta From 51053d6a789e61be18ca8511dde0c19a1b13d29d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 19 Jun 2017 16:34:25 -0700 Subject: [PATCH 460/870] Move hover haptics logic up from the PinnedToolButton into the PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 24 +++++++++++++++---- Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta | 6 ++++- .../Scripts/PinnedToolsMenuUI.cs | 20 ++++++++++++---- Scripts/UI/Interfaces/IPinnedToolButton.cs | 1 + 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 7096038b3..138925bcc 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.UI; @@ -15,7 +16,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI + sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics { const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation @@ -30,6 +31,12 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac [SerializeField] PinnedToolButton m_PinnedToolButtonTemplate; + [SerializeField] + HapticPulse m_ButtonClickPulse; + + [SerializeField] + HapticPulse m_ButtonHoverPulse; + PinnedToolsMenuUI m_PinnedToolsMenuUI; //public int menuButtonOrderPosition { get { return k_MenuButtonOrderPosition; } } @@ -83,8 +90,6 @@ public Transform alternateMenuOrigin return; m_AlternateMenuOrigin = value; - - } } @@ -114,6 +119,7 @@ void CreatePinnedToolsUI() m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; m_PinnedToolsMenuUI.mainMenuActivatorSelected = mainMenuActivatorSelected; m_PinnedToolsMenuUI.rayOrigin = rayOrigin; + m_PinnedToolsMenuUI.buttonHovered += OnButtonHover; // Alternate menu origin isnt set when awake or start run var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; @@ -135,7 +141,7 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) if (buttons.Any( (x) => x.toolType == toolType)) { - m_PinnedToolsMenuUI.SelectExistingType(toolType); + m_PinnedToolsMenuUI.SelectExistingToolType(toolType); return; } @@ -337,6 +343,16 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, return normalizedLoopingPosition; } + + void OnButtonClick() + { + //this.Pulse(node, m_ButtonClickedPulse); + } + + void OnButtonHover() + { + this.Pulse(null, m_ButtonHoverPulse); + } } } #endif \ No newline at end of file diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta index 934380a96..178a09f22 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 800ff7c94496eac41ab0b6df27863704 -timeCreated: 1493960032 +timeCreated: 1497914753 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -11,6 +11,10 @@ MonoImporter: type: 2} - m_PinnedToolButtonTemplate: {fileID: 114000011260412956, guid: 7221a75a049ac3949a505c7c2f06bd8e, type: 2} + - m_ButtonClickPulse: {fileID: 11400000, guid: 90be55fd9292d1e4eb8af66c479333b6, + type: 2} + - m_ButtonHoverPulse: {fileID: 11400000, guid: 53f100a1dd0839141bcace2ecd8cc6b1, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index ecf00b3ea..b5f9e09df 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -3,16 +3,15 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Security.Permissions; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IControlHaptics + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -82,6 +81,10 @@ public bool moveToAlternatePosition private bool aboveMinimumButtonCount { get { return m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1; } } + public event Action buttonHovered; + public event Action buttonClicked; + + void Awake() { m_OriginalLocalScale = transform.localScale; @@ -94,9 +97,10 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) button.showAllButtons = ShowAllButtons; button.hoverExit = ButtonHoverExitPerformed; button.maxButtonCount = maxButtonCount; - button.selectTool = SelectExistingType; + button.selectTool = SelectExistingToolType; button.closeButton = DeleteHighlightedButton; button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount + button.hovered += OnButtonHover; bool allowSecondaryButton = false; // Secondary button is the close button var insertPosition = k_InactiveButtonInitialOrderPosition; @@ -276,7 +280,7 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) /// Utilized by PinnedToolsMenu to select an existing button by type, without created a new button /// /// Button ToolType to compare against existing button types - public void SelectExistingType(Type type) + public void SelectExistingToolType(Type type) { foreach (var button in m_OrderedButtons) { @@ -418,6 +422,12 @@ IEnumerator DelayedHoverExitCheck() allButtonsVisible = false; m_ButtonHoverExitDelayCoroutine = null; } + + void OnButtonHover() + { + if (buttonHovered != null) + buttonHovered(); + } } } #endif diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index f55abb6c9..476083004 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -25,6 +25,7 @@ public interface IPinnedToolButton bool implementsSecondaryButton { get; set; } Action showAllButtons { get; set; } Action hoverExit { get; set; } + event Action hovered; /* int menuButtonOrderPosition { get; } From abd7b79d9a379f99afabedce43b8990f2ba396a9 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 16:38:33 -0700 Subject: [PATCH 461/870] Add wasRotating property to disable crawl between rotations --- Tools/LocomotionTool/LocomotionTool.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 7297d98c4..3917cdb2c 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -72,7 +72,8 @@ class Preferences float m_StartYaw; bool m_Rotating; - bool m_GrabMoving; + bool m_WasRotating; + bool m_Crawling; Vector3 m_RayOriginStartPosition; Quaternion m_RayOriginStartRotation; Quaternion m_RigStartRotation; @@ -200,7 +201,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!m_Scaling) { - DoCrawl(blinkInput); + if (!m_WasRotating) + DoCrawl(blinkInput); if (m_Preferences.blinkMode) DoBlink(consumeControl, blinkInput); @@ -209,7 +211,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else { - m_GrabMoving = false; + m_Crawling = false; } } @@ -224,6 +226,7 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) if (!m_Rotating) { m_Rotating = true; + m_WasRotating = true; m_RigStartPosition = cameraRig.position; m_RigStartRotation = cameraRig.rotation; m_RayOriginStartRotation = MathUtilsExt.ConstrainYawRotation( @@ -272,6 +275,9 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) } else { + if (!blinkInput.grip.isHeld) + m_WasRotating = false; + m_Rotating = false; } } @@ -280,9 +286,9 @@ void DoCrawl(Locomotion blinkInput) { if (!blinkInput.forward.isHeld && !blinkInput.blink.isHeld && blinkInput.grip.isHeld) { - if (!m_GrabMoving) + if (!m_Crawling) { - m_GrabMoving = true; + m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; } @@ -294,7 +300,7 @@ void DoCrawl(Locomotion blinkInput) } else { - m_GrabMoving = false; + m_Crawling = false; } } From dc3138c4996fab72490521fd5c2ef8796cc8ae61 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 17:07:07 -0700 Subject: [PATCH 462/870] Reset position/rotation to origin when pulling both triggers while two-handed scaling --- Scripts/Core/EditorVR.Viewer.cs | 4 --- Scripts/Core/VRView.cs | 4 +-- Tools/LocomotionTool/Locomotion.asset | 30 +++++++++++++++++++ Tools/LocomotionTool/Locomotion.cs | 1 + Tools/LocomotionTool/LocomotionTool.cs | 40 ++++++++++++++++++++++---- 5 files changed, 67 insertions(+), 12 deletions(-) diff --git a/Scripts/Core/EditorVR.Viewer.cs b/Scripts/Core/EditorVR.Viewer.cs index 4213c47f1..0f2af9a4a 100644 --- a/Scripts/Core/EditorVR.Viewer.cs +++ b/Scripts/Core/EditorVR.Viewer.cs @@ -78,10 +78,6 @@ internal override void OnDestroy() public void ConnectInterface(object obj, Transform rayOrigin = null) { - var locomotion = obj as ILocomotor; - if (locomotion != null) - locomotion.cameraRig = VRView.cameraRig; - var usesCameraRig = obj as IUsesCameraRig; if (usesCameraRig != null) usesCameraRig.cameraRig = CameraUtils.GetCameraRig(); diff --git a/Scripts/Core/VRView.cs b/Scripts/Core/VRView.cs index 8a9c9a03f..c44d617d1 100644 --- a/Scripts/Core/VRView.cs +++ b/Scripts/Core/VRView.cs @@ -15,6 +15,7 @@ namespace UnityEditor.Experimental.EditorVR.Core { sealed class VRView : EditorWindow { + public const float HeadHeight = 1.7f; const string k_ShowDeviceView = "VRView.ShowDeviceView"; const string k_UseCustomPreviewCamera = "VRView.UseCustomPreviewCamera"; @@ -132,9 +133,8 @@ public void OnEnable() m_Camera.farClipPlane = 1000f; // Generally, we want to be at a standing height, so default to that - const float kHeadHeight = 1.7f; Vector3 position = m_CameraRig.position; - position.y = kHeadHeight; + position.y = HeadHeight; m_CameraRig.position = position; m_CameraRig.rotation = Quaternion.identity; diff --git a/Tools/LocomotionTool/Locomotion.asset b/Tools/LocomotionTool/Locomotion.asset index bc769d4f3..408b2033b 100644 --- a/Tools/LocomotionTool/Locomotion.asset +++ b/Tools/LocomotionTool/Locomotion.asset @@ -18,6 +18,7 @@ MonoBehaviour: - {fileID: 114000011230901436} - {fileID: 114000010166273910} - {fileID: 114000013424161920} + - {fileID: 114022299328106344} m_ControlSchemes: - m_Name: BlinkLocomotion m_DeviceSlots: @@ -82,6 +83,15 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 + - sources: + - controlIndex: 2 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 m_MapTypeName: Locomotion, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: --- !u!114 &114000010166273910 @@ -204,3 +214,23 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Grip defaultValue: 0 +--- !u!114 &114022299328106344 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Trigger + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 6 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Trigger + defaultValue: 0 diff --git a/Tools/LocomotionTool/Locomotion.cs b/Tools/LocomotionTool/Locomotion.cs index 0d0af9e89..7370d6623 100644 --- a/Tools/LocomotionTool/Locomotion.cs +++ b/Tools/LocomotionTool/Locomotion.cs @@ -13,5 +13,6 @@ public Locomotion (ActionMap actionMap) : base (actionMap) { } public AxisInputControl @speed { get { return (AxisInputControl)this[3]; } } public ButtonInputControl @reverse { get { return (ButtonInputControl)this[4]; } } public ButtonInputControl @forward { get { return (ButtonInputControl)this[5]; } } + public ButtonInputControl @trigger { get { return (ButtonInputControl)this[6]; } } } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 3917cdb2c..5a71ef6bf 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -84,6 +84,7 @@ class Preferences // Allow shared updater to consume these controls for another linked instance InputControl m_Grip; InputControl m_Thumb; + InputControl m_Trigger; Camera m_MainCamera; float m_OriginalNearClipPlane; @@ -196,6 +197,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_Grip = blinkInput.grip.isHeld ? blinkInput.grip : null; m_Thumb = blinkInput.thumb.isHeld ? blinkInput.thumb : null; + m_Trigger = blinkInput.trigger.isHeld ? blinkInput.trigger : null; DoTwoHandedScaling(consumeControl); @@ -385,7 +387,13 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var currentScale = Mathf.Clamp(m_StartScale * (m_StartDistance / distance), k_MinScale, k_MaxScale); - // Press both thumb buttons to reset + if (m_Thumb != null) + consumeControl(m_Thumb); + + if (locomotionTool.m_Thumb != null) + consumeControl(locomotionTool.m_Thumb); + + // Press both thumb buttons to reset scale if (m_Thumb != null && locomotionTool.m_Thumb != null) { m_AllowScaling = false; @@ -393,18 +401,28 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) rayToRay = otherRayOrigin.position - rayOrigin.position; midPoint = rayOrigin.position + rayToRay * 0.5f; var currOffset = midPoint - cameraRig.position; - cameraRig.localScale = Vector3.one; + cameraRig.position = midPoint - currOffset / currentScale; cameraRig.rotation = Quaternion.AngleAxis(m_StartYaw, Vector3.up); - m_MainCamera.nearClipPlane = m_OriginalNearClipPlane; - m_MainCamera.farClipPlane = m_OriginalFarClipPlane; + ResetViewerScale(); + } + if (m_Thumb != null) consumeControl(m_Thumb); + + if (locomotionTool.m_Thumb != null) consumeControl(locomotionTool.m_Thumb); - if (m_ViewerScaleVisuals) - ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); + // Press both triggers to reset to origin + if (m_Trigger != null && locomotionTool.m_Trigger != null) + { + m_AllowScaling = false; + + cameraRig.position = Vector3.up * VRView.HeadHeight; + cameraRig.rotation = Quaternion.identity; + + ResetViewerScale(); } if (m_AllowScaling) @@ -438,6 +456,16 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) } } + void ResetViewerScale() + { + cameraRig.localScale = Vector3.one; + m_MainCamera.nearClipPlane = m_OriginalNearClipPlane; + m_MainCamera.farClipPlane = m_OriginalFarClipPlane; + + if (m_ViewerScaleVisuals) + ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); + } + void CreateViewerScaleVisuals(Transform leftHand, Transform rightHand) { m_ViewerScaleVisuals = ObjectUtils.Instantiate(m_ViewerScaleVisualsPrefab, cameraRig, false).GetComponent(); From 0e61b733c4843dcedee8b724dfdd9ddbe478f82f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 17:41:19 -0700 Subject: [PATCH 463/870] Save Project --- Scripts/Modules/SnappingModule/Materials/Widget.mat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Modules/SnappingModule/Materials/Widget.mat b/Scripts/Modules/SnappingModule/Materials/Widget.mat index 8cb3e609a..5b871a13e 100644 --- a/Scripts/Modules/SnappingModule/Materials/Widget.mat +++ b/Scripts/Modules/SnappingModule/Materials/Widget.mat @@ -6,7 +6,7 @@ Material: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_Name: WidgetCenter + m_Name: Widget m_Shader: {fileID: 4800000, guid: 17d79fd9a3d634a40ae219ffcf9befd4, type: 3} m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF m_LightmapFlags: 0 From 43ece45cbea21bd19569f65a49f08273037d61bd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 19 Jun 2017 18:31:52 -0700 Subject: [PATCH 464/870] Add node-specific haptics to ToolFlow --- .../HapticPulses/ActivationPulse.asset | 17 +++++++++++ .../HapticPulses/ActivationPulse.asset.meta | 9 ++++++ .../HapticPulses/HidingPulse.asset | 17 +++++++++++ .../HapticPulses/HidingPulse.asset.meta | 9 ++++++ .../HapticPulses/ScrollingPulse.asset | 17 +++++++++++ .../HapticPulses/ScrollingPulse.asset.meta | 9 ++++++ Menus/PinnedToolMenu/PinnedToolsMenu.cs | 29 ++++++++++++++----- Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta | 6 +++- .../Scripts/PinnedToolsMenuUI.cs | 18 ++++++++++-- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 3 +- 10 files changed, 122 insertions(+), 12 deletions(-) create mode 100644 Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset create mode 100644 Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset.meta create mode 100644 Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset create mode 100644 Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset.meta create mode 100644 Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset create mode 100644 Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset.meta diff --git a/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset b/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset new file mode 100644 index 000000000..db8d312dd --- /dev/null +++ b/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: ActivationPulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 0.075 + m_FadeIn: 0 + m_FadeOut: 1 diff --git a/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset.meta new file mode 100644 index 000000000..1bdcd4c32 --- /dev/null +++ b/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c3a3fe0d1f5495c4db58b5282c37a962 +timeCreated: 1496975334 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset b/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset new file mode 100644 index 000000000..122122560 --- /dev/null +++ b/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: HidingPulse + m_EditorClassIdentifier: + m_Duration: 0.5 + m_Intensity: 0.35 + m_FadeIn: 0 + m_FadeOut: 1 diff --git a/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset.meta new file mode 100644 index 000000000..78b9a98fe --- /dev/null +++ b/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2e01cf9fae741534eaf75d6f0910be3a +timeCreated: 1497398079 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset b/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset new file mode 100644 index 000000000..1c29c2592 --- /dev/null +++ b/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: ScrollingPulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 0.35 + m_FadeIn: 1 + m_FadeOut: 1 diff --git a/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset.meta new file mode 100644 index 000000000..21d80c15c --- /dev/null +++ b/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e3b61c818f641ce4fb27eb9d16770364 +timeCreated: 1497398079 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 138925bcc..8c4a949ee 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -37,12 +37,22 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac [SerializeField] HapticPulse m_ButtonHoverPulse; + [SerializeField] + HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection, but not passing the trigger threshold + + [SerializeField] + HapticPulse m_ScrollingPulse; // The pulse performed when spatially scrolling + + [SerializeField] + HapticPulse m_HidingPulse; // The pulse performed when ending a spatial selection + PinnedToolsMenuUI m_PinnedToolsMenuUI; //public int menuButtonOrderPosition { get { return k_MenuButtonOrderPosition; } } //public int activeToolOrderPosition { get { return k_ActiveToolOrderPosition; } } Transform m_RayOrigin; + Transform m_AlternateMenuOrigin; public Transform menuOrigin { get; set; } List buttons { get { return m_PinnedToolsMenuUI.buttons; } } @@ -52,7 +62,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public bool moveToAlternatePosition { set { m_PinnedToolsMenuUI.moveToAlternatePosition = value; } } public Type previewToolType { get; set; } public Vector3 alternateMenuItem { get; private set; } - public Node node { set { m_PinnedToolsMenuUI.node = value; } } + public Action HighlightSingleButton { get; set; } public Action SelectHighlightedButton { get; set; } public Action deleteHighlightedButton { get; set; } @@ -61,8 +71,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Action highlightDevice { get; set; } public Action createPinnedToolButton { get; set; } public Action mainMenuActivatorSelected { get; set; } - - Transform m_AlternateMenuOrigin; + public Node? node { get; set; } public Action selectTool { get; set; } @@ -120,6 +129,7 @@ void CreatePinnedToolsUI() m_PinnedToolsMenuUI.mainMenuActivatorSelected = mainMenuActivatorSelected; m_PinnedToolsMenuUI.rayOrigin = rayOrigin; m_PinnedToolsMenuUI.buttonHovered += OnButtonHover; + m_PinnedToolsMenuUI.buttonClicked += OnButtonClick; // Alternate menu origin isnt set when awake or start run var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; @@ -270,7 +280,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon consumeControl(pinnedToolInput.show); consumeControl(pinnedToolInput.select); } - + else // User hasn't dragged beyond the trigger magnitude; spatial scrolling hasn't been activated yet + { + this.Pulse(node, m_ActivationPulse); + } } else if (pinnedToolInput.show.wasJustReleased) { @@ -285,11 +298,13 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PinnedToolsMenuUI.SelectHighlightedButton(); spatialDirection = null; consumeControl(pinnedToolInput.select); + this.Pulse(node, m_HidingPulse); } else if (Time.realtimeSinceStartup < allowToolToggleBeforeThisTime) { // Allow for single press+release to cycle through tools m_PinnedToolsMenuUI.SelectNextExistingToolButton(); + OnButtonClick(); } } @@ -299,7 +314,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // TODO ADD SUPPORT FOR VIEWERSCALE SIZE CHANGES // TODO refact into ISpatialScrolling interface; allow axis locking/selection/isolation - float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange,bool velocitySensitive) + float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, bool velocitySensitive) { var normalizedLoopingPosition = 0f; var directionVector = currentPosition - startingPosition; @@ -346,12 +361,12 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, void OnButtonClick() { - //this.Pulse(node, m_ButtonClickedPulse); + this.Pulse(node, m_ButtonClickPulse); } void OnButtonHover() { - this.Pulse(null, m_ButtonHoverPulse); + this.Pulse(node, m_ButtonHoverPulse); } } } diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta index 178a09f22..bd354c42b 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 800ff7c94496eac41ab0b6df27863704 -timeCreated: 1497914753 +timeCreated: 1497920492 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -15,6 +15,10 @@ MonoImporter: type: 2} - m_ButtonHoverPulse: {fileID: 11400000, guid: 53f100a1dd0839141bcace2ecd8cc6b1, type: 2} + - m_ActivationPulse: {fileID: 11400000, guid: c3a3fe0d1f5495c4db58b5282c37a962, + type: 2} + - m_ScrollingPulse: {fileID: 11400000, guid: e3b61c818f641ce4fb27eb9d16770364, type: 2} + - m_HidingPulse: {fileID: 11400000, guid: 2e01cf9fae741534eaf75d6f0910be3a, type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index b5f9e09df..cf8c252f7 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -37,7 +37,6 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool Vector3 m_OriginalLocalScale; bool m_RayHovered; - public Node node { get; set; } public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } public Transform rayOrigin { get; set; } @@ -301,10 +300,22 @@ public void SelectNextExistingToolButton() public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) { + //Debug.LogError("Highlighting SINGLE BUTTON at position : "+ buttonOrderPosition); for (int i = 1; i < m_OrderedButtons.Count; ++i) { - m_OrderedButtons[i].highlighted = i == buttonOrderPosition; + var button = m_OrderedButtons[i]; + if (i == buttonOrderPosition) + { + if (!button.highlighted && buttonHovered != null) // Process haptic pulse if button was not already highlighted + buttonHovered(); + + button.highlighted = true; + } + else + { + button.highlighted = false; + } } } @@ -319,6 +330,9 @@ public void SelectHighlightedButton() Debug.LogError("Selecting highlighted button : "+ button.toolType); // Force the selection of the button regardless of it previously existing via a call to EVR that triggers a call to SelectExistingType() this.SelectTool(rayOrigin, button.toolType); + if (buttonClicked != null) + buttonClicked(); + return; } } diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 55ac01611..56692f5f6 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR /// /// Gives decorated class Pinned Tools Menu functionality /// - public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap + public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode { Dictionary icons { set; } int activeToolOrderPosition { get; } @@ -19,7 +19,6 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap Transform rayOrigin { get; set; } Type previewToolType { set; } Vector3 alternateMenuItem { get; } // Shared active button offset from the alternate menu - Node node { set; } // Used for button and tooltip alignment event Action hoverEnter; event Action hoverExit; From 5d89bbc33cb58080d79be9efee80035523b03570 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 19:11:20 -0700 Subject: [PATCH 465/870] Fix gimbal lock issue on rotation; Add activation threshold for radial menu (mostly for Vive) --- Menus/RadialMenu/RadialMenu.cs | 7 ++++-- Tools/LocomotionTool/LocomotionTool.cs | 33 +++++++++++++++++--------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index 506c5a418..5363fce4a 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -8,6 +8,8 @@ namespace UnityEditor.Experimental.EditorVR.Menus { sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap { + const float k_ActivationThreshold = 0.5f; + public ActionMap actionMap { get {return m_RadialMenuActionMap; } } [SerializeField] ActionMap m_RadialMenuActionMap; @@ -85,16 +87,17 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; var inputDirection = radialMenuInput.navigate.vector2; - m_RadialMenuUI.buttonInputDirection = inputDirection; - if (inputDirection != Vector2.zero) + if (inputDirection.magnitude > k_ActivationThreshold) { // Composite controls need to be consumed separately consumeControl(radialMenuInput.navigateX); consumeControl(radialMenuInput.navigateY); + m_RadialMenuUI.buttonInputDirection = inputDirection; } else { + m_RadialMenuUI.buttonInputDirection = Vector3.zero; return; } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 5a71ef6bf..c3b9c4a9e 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -23,7 +23,7 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const string k_WorldScaleProperty = "_WorldScale"; - const int k_RotationSegments = 16; + const int k_RotationSegments = 32; enum State { @@ -75,7 +75,8 @@ class Preferences bool m_WasRotating; bool m_Crawling; Vector3 m_RayOriginStartPosition; - Quaternion m_RayOriginStartRotation; + Vector3 m_RayOriginStartForward; + Vector3 m_RayOriginStartRight; Quaternion m_RigStartRotation; Vector3 m_RigStartPosition; Vector3 m_CameraStartPosition; @@ -225,29 +226,39 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) { if (blinkInput.grip.isHeld) { + var localRayRotation = Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation; if (!m_Rotating) { m_Rotating = true; m_WasRotating = true; m_RigStartPosition = cameraRig.position; m_RigStartRotation = cameraRig.rotation; - m_RayOriginStartRotation = MathUtilsExt.ConstrainYawRotation( - reverse ? Quaternion.Inverse(rayOrigin.rotation) * cameraRig.rotation - : Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); + + m_RayOriginStartForward = localRayRotation * Vector3.forward; + m_RayOriginStartForward.y = 0; + m_RayOriginStartForward.Normalize(); + m_RayOriginStartRight = localRayRotation * (reverse ? Vector3.left : Vector3.right); + m_RayOriginStartRight.y = 0; + m_RayOriginStartRight.Normalize(); + m_CameraStartPosition = CameraUtils.GetMainCamera().transform.position; m_LastRotationDiff = Quaternion.identity; } consumeControl(blinkInput.grip); var startOffset = m_RigStartPosition - m_CameraStartPosition; - var localRayRotation = MathUtilsExt.ConstrainYawRotation( - reverse ? Quaternion.Inverse(rayOrigin.rotation) * cameraRig.rotation - : Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation); - var rotation = Quaternion.Inverse(m_RayOriginStartRotation) * localRayRotation; + + var localRayForward = localRayRotation * Vector3.forward; + localRayForward.y = 0; + localRayForward.Normalize(); + + var angle = Vector3.Angle(m_RayOriginStartForward, localRayForward); + var dot = Vector3.Dot(m_RayOriginStartRight, localRayForward); + var rotation = Quaternion.Euler(0, angle * Mathf.Sign(dot), 0); var filteredRotation = Quaternion.Lerp(m_LastRotationDiff, rotation, k_RotationDamping); - var segmentSize = 180f / k_RotationSegments; - var segmentedRotation = Quaternion.Euler(0, Mathf.Floor(filteredRotation.eulerAngles.y / segmentSize) * segmentSize, 0); + const float segmentSize = 360f / k_RotationSegments; + var segmentedRotation = Quaternion.Euler(0, Mathf.Round(filteredRotation.eulerAngles.y / segmentSize) * segmentSize, 0); cameraRig.rotation = m_RigStartRotation * segmentedRotation; cameraRig.position = m_CameraStartPosition + segmentedRotation * startOffset; From 9bae3c11485e2e86991ee046984af0454fc51f7a Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 19:20:15 -0700 Subject: [PATCH 466/870] Add maximum upward angle threshold for rotation --- Tools/LocomotionTool/LocomotionTool.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index c3b9c4a9e..787bdbe1c 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -16,6 +16,7 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 1f; const float k_RotationDamping = 0.2f; + const float k_RotationThreshold = 0.75f; //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; @@ -227,6 +228,12 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) if (blinkInput.grip.isHeld) { var localRayRotation = Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation; + var localRayForward = localRayRotation * Vector3.forward; + if (Mathf.Abs(Vector3.Dot(localRayForward, Vector3.up)) > k_RotationThreshold) + return; + + localRayForward.y = 0; + localRayForward.Normalize(); if (!m_Rotating) { m_Rotating = true; @@ -234,9 +241,7 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) m_RigStartPosition = cameraRig.position; m_RigStartRotation = cameraRig.rotation; - m_RayOriginStartForward = localRayRotation * Vector3.forward; - m_RayOriginStartForward.y = 0; - m_RayOriginStartForward.Normalize(); + m_RayOriginStartForward = localRayForward; m_RayOriginStartRight = localRayRotation * (reverse ? Vector3.left : Vector3.right); m_RayOriginStartRight.y = 0; m_RayOriginStartRight.Normalize(); @@ -247,10 +252,6 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) consumeControl(blinkInput.grip); var startOffset = m_RigStartPosition - m_CameraStartPosition; - - var localRayForward = localRayRotation * Vector3.forward; - localRayForward.y = 0; - localRayForward.Normalize(); var angle = Vector3.Angle(m_RayOriginStartForward, localRayForward); var dot = Vector3.Dot(m_RayOriginStartRight, localRayForward); From 8e5f558b612788a4654e45658be755192dff8b92 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 20:35:05 -0700 Subject: [PATCH 467/870] Hide menus when inside of workspaces; Add check for rayorigin position for drags in WorkspaceUI; Fix UI blocking for direct selections; Fix manipulator hiding when direct hover any object; Send hover exit events when ray becomes invalid --- Scripts/Core/EditorVR.Menus.cs | 22 ++++++++- Scripts/Core/EditorVR.Rays.cs | 2 +- .../MultipleRayInputModule.cs | 45 +++++++++++-------- Tools/TransformTool/TransformTool.cs | 2 +- Workspaces/Base/WorkspaceUI.cs | 10 +++-- 5 files changed, 55 insertions(+), 26 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 1bdd594fc..adb488749 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -24,7 +24,8 @@ class Menus : Nested, IInterfaceConnector, ILateBindInterfaceMethods internal enum MenuHideFlags { Hidden = 1 << 0, - OverUI = 1 << 1 + OverUI = 1 << 1, + OverWorkspace = 1 << 2 } const float k_MenuHideMargin = 0.8f; @@ -120,6 +121,23 @@ internal void UpdateMenuVisibilities() { menuHideFlags[customMenu] |= MenuHideFlags.Hidden; } + + // Check workspaces + var hoveringWorkspace = false; + foreach (var workspace in evr.GetModule().workspaces) + { + if (workspace.outerBounds.Contains(workspace.transform.InverseTransformPoint(deviceData.rayOrigin.position))) + hoveringWorkspace = true; + } + + var menus = deviceData.menuHideFlags.Keys.ToList(); + foreach (var menu in menus) + { + if (hoveringWorkspace) + deviceData.menuHideFlags[menu] |= MenuHideFlags.OverWorkspace; + else + deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverWorkspace; + } } // Apply state to UI visibility @@ -165,7 +183,7 @@ internal static void OnHover(GameObject go, RayEventData rayEventData, bool ende { var scaledPointerDistance = rayEventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); var isManipulator = go.GetComponentInParent() != null; - var menus = new List(deviceData.menuHideFlags.Keys); + var menus = deviceData.menuHideFlags.Keys.ToList(); foreach (var menu in menus) { if (ended || isManipulator || scaledPointerDistance > menu.hideDistance + k_MenuHideMargin) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 52fd85d66..682717855 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -203,7 +203,7 @@ void OnProxyActiveChanged(IProxy proxy) // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => { - if (evr.GetNestedModule().IsHovering(source.rayOrigin)) + if (!source.draggedObject && evr.GetNestedModule().IsHovering(source.rayOrigin)) return false; if (deviceData.mainMenu.visible && source.hoveredObject) diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index dce4b13b0..76b0f3deb 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -133,7 +133,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon eventData.pointerLength = this.GetPointerLength(eventData.rayOrigin); if (source.isValid != null && !source.isValid(source)) + { + HandlePointerExitAndEnter(eventData, hoveredObject, true); // Send only exit events continue; + } HandlePointerExitAndEnter(eventData, hoveredObject); // Send enter and exit events @@ -229,7 +232,7 @@ RayEventData GetTempEventDataClone(RayEventData eventData) return clone; } - void HandlePointerExitAndEnter(RayEventData eventData, GameObject newEnterTarget) + void HandlePointerExitAndEnter(RayEventData eventData, GameObject newEnterTarget, bool exitOnly = false) { // Cache properties before executing base method, so we can complete additional ray events later var cachedEventData = GetTempEventDataClone(eventData); @@ -254,19 +257,22 @@ void HandlePointerExitAndEnter(RayEventData eventData, GameObject newEnterTarget Transform t = null; - // if we have not changed hover target - if (cachedEventData.pointerEnter == newEnterTarget && newEnterTarget) + if (!exitOnly) { - t = newEnterTarget.transform; - while (t != null) + // if we have not changed hover target + if (cachedEventData.pointerEnter == newEnterTarget && newEnterTarget) { - ExecuteEvents.Execute(t.gameObject, cachedEventData, ExecuteRayEvents.rayHoverHandler); - if (rayHovering != null) - rayHovering(t.gameObject, cachedEventData); + t = newEnterTarget.transform; + while (t != null) + { + ExecuteEvents.Execute(t.gameObject, cachedEventData, ExecuteRayEvents.rayHoverHandler); + if (rayHovering != null) + rayHovering(t.gameObject, cachedEventData); - t = t.parent; + t = t.parent; + } + return; } - return; } GameObject commonRoot = FindCommonRoot(cachedEventData.pointerEnter, newEnterTarget); @@ -292,16 +298,19 @@ void HandlePointerExitAndEnter(RayEventData eventData, GameObject newEnterTarget } } - // now issue the enter call up to but not including the common root - cachedEventData.pointerEnter = newEnterTarget; - t = newEnterTarget.transform; - while (t != null && t.gameObject != commonRoot) + if (!exitOnly) { - ExecuteEvents.Execute(t.gameObject, cachedEventData, ExecuteRayEvents.rayEnterHandler); - if (rayEntered != null) - rayEntered(t.gameObject, cachedEventData); + // now issue the enter call up to but not including the common root + cachedEventData.pointerEnter = newEnterTarget; + t = newEnterTarget.transform; + while (t != null && t.gameObject != commonRoot) + { + ExecuteEvents.Execute(t.gameObject, cachedEventData, ExecuteRayEvents.rayEnterHandler); + if (rayEntered != null) + rayEntered(t.gameObject, cachedEventData); - t = t.parent; + t = t.parent; + } } } diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 2c4ad4fda..5367f4ed0 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -271,7 +271,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } // Disable manipulator on direct hover or drag - if (manipulatorGameObject.activeSelf && (hoveringSelection || hasObject)) + if (manipulatorGameObject.activeSelf && (hoveringSelection || hasLeft || hasRight)) manipulatorGameObject.SetActive(false); foreach (var kvp in directSelection) diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index ebff87477..0edbb32d6 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -728,16 +728,18 @@ public void ProcessInput(WorkspaceInput input, ConsumeControlDelegate consumeCon if (!dragRayOrigin) { - var leftPosition = transform.InverseTransformPoint(GetPointerPositionForRayOrigin(leftRayOrigin)); - if (moveResizeLeft.wasJustPressed && adjustedBounds.Contains(leftPosition)) + var leftPosition = transform.InverseTransformPoint(leftRayOrigin.position); + var leftPointerPosition = transform.InverseTransformPoint(GetPointerPositionForRayOrigin(leftRayOrigin)); + if (moveResizeLeft.wasJustPressed && (adjustedBounds.Contains(leftPosition) || adjustedBounds.Contains(leftPointerPosition))) { dragRayOrigin = leftRayOrigin; m_LastResizeIcons.TryGetValue(dragRayOrigin, out dragResizeIcon); consumeControl(moveResizeLeft); } - var rightPosition = transform.InverseTransformPoint(GetPointerPositionForRayOrigin(rightRayOrigin)); - if (moveResizeRight.wasJustPressed && adjustedBounds.Contains(rightPosition)) + var rightPosition = transform.InverseTransformPoint(rightRayOrigin.position); + var rightPointerPosition = transform.InverseTransformPoint(GetPointerPositionForRayOrigin(rightRayOrigin)); + if (moveResizeRight.wasJustPressed && (adjustedBounds.Contains(rightPosition) || adjustedBounds.Contains(rightPointerPosition))) { dragRayOrigin = rightRayOrigin; m_LastResizeIcons.TryGetValue(dragRayOrigin, out dragResizeIcon); From 48b52619f5b30aef58d05034d175b6f8f0df8b42 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 21:01:53 -0700 Subject: [PATCH 468/870] Update RadialMenuSlot.prefab so buttons overlap and menu does not show when hovering between slots --- Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab b/Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab index 09b1c2a43..256facc25 100644 --- a/Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab +++ b/Menus/RadialMenu/Prefabs/RadialMenuSlot.prefab @@ -627,7 +627,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012936658430} m_LocalRotation: {x: 0.7037111, y: -0.06803011, z: 0.06800755, w: 0.7039444} - m_LocalPosition: {x: 0, y: 0, z: -0.11830006} + m_LocalPosition: {x: 0, y: 0, z: -0.1172} m_LocalScale: {x: 0.0005000003, y: 0.0005000038, z: 0.0005000038} m_Children: [] m_Father: {fileID: 4000013058335840} @@ -635,12 +635,12 @@ RectTransform: m_LocalEulerAnglesHint: {x: 89.981, y: -11.04, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0.023300521, y: -0.00020026293} - m_SizeDelta: {x: 69.8589, y: 146.8315} + m_AnchoredPosition: {x: 0.0237, y: -0.0002} + m_SizeDelta: {x: 127.5705, y: 167.1394} m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000011303517996 CanvasGroup: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013100143890} From c767d171e15709085bc729acfd3636915c1ce381 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 23:14:06 -0700 Subject: [PATCH 469/870] Refactor DirectSelectInput into TransformInput; Reset m_DirectSelected on select.wasJustReleased --- Scripts/Core/EditorVR.DirectSelection.cs | 9 +-- Scripts/Core/EditorVR.MiniWorlds.cs | 6 +- Scripts/Core/EditorVR.Rays.cs | 1 - Scripts/Core/EditorVR.Tools.cs | 1 - Scripts/Core/EditorVR.cs | 1 - Scripts/Data/DirectSelectionData.cs | 5 -- Scripts/Modules/DeviceInputModule.cs | 4 -- Tools/SelectionTool/SelectionTool.cs | 25 +++++-- .../TransformTool/TransformInput.asset | 4 +- .../TransformTool/TransformInput.asset.meta | 0 .../TransformTool/TransformInput.cs | 4 +- .../TransformTool/TransformInput.cs.meta | 6 +- Tools/TransformTool/TransformTool.cs | 71 +++++++++++++------ Tools/TransformTool/TransformTool.cs.meta | 3 +- 14 files changed, 81 insertions(+), 59 deletions(-) rename Action Maps/DirectSelectInput.asset => Tools/TransformTool/TransformInput.asset (96%) rename Action Maps/DirectSelectInput.asset.meta => Tools/TransformTool/TransformInput.asset.meta (100%) rename Action Maps/DirectSelectInput.cs => Tools/TransformTool/TransformInput.cs (75%) rename Action Maps/DirectSelectInput.cs.meta => Tools/TransformTool/TransformInput.cs.meta (69%) diff --git a/Scripts/Core/EditorVR.DirectSelection.cs b/Scripts/Core/EditorVR.DirectSelection.cs index 2a8486b8e..500cbf274 100644 --- a/Scripts/Core/EditorVR.DirectSelection.cs +++ b/Scripts/Core/EditorVR.DirectSelection.cs @@ -96,15 +96,13 @@ internal void UpdateDirectSelection() Rays.ForEachProxyDevice(deviceData => { var rayOrigin = deviceData.rayOrigin; - var input = deviceData.directSelectInput; var obj = GetDirectSelectionForRayOrigin(rayOrigin); if (obj && !obj.CompareTag(k_VRPlayerTag)) { m_DirectSelections[rayOrigin] = new DirectSelectionData { gameObject = obj, - node = deviceData.node, - input = input + node = deviceData.node }; } }); @@ -112,16 +110,13 @@ internal void UpdateDirectSelection() foreach (var ray in evr.GetNestedModule().rays) { var rayOrigin = ray.Key; - var miniWorldRay = ray.Value; - var input = miniWorldRay.directSelectInput; var go = GetDirectSelectionForRayOrigin(rayOrigin); if (go != null) { m_DirectSelections[rayOrigin] = new DirectSelectionData { gameObject = go, - node = ray.Value.node, - input = input + node = ray.Value.node }; } } diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index 22a9161eb..28c600797 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -23,7 +23,6 @@ internal class MiniWorldRay public IMiniWorld miniWorld { get; private set; } public IProxy proxy { get; private set; } public Node node { get; private set; } - public ActionMapInput directSelectInput { get; private set; } public IntersectionTester tester { get; private set; } public bool hasPreview { get; private set; } @@ -81,13 +80,12 @@ public void Update(Transform parent) } } - public MiniWorldRay(Transform originalRayOrigin, IMiniWorld miniWorld, IProxy proxy, Node node, ActionMapInput directSelectInput, IntersectionTester tester) + public MiniWorldRay(Transform originalRayOrigin, IMiniWorld miniWorld, IProxy proxy, Node node, IntersectionTester tester) { this.originalRayOrigin = originalRayOrigin; this.miniWorld = miniWorld; this.proxy = proxy; this.node = node; - this.directSelectInput = directSelectInput; this.tester = tester; } @@ -503,7 +501,7 @@ internal void OnWorkspaceCreated(IWorkspace workspace) var tester = miniWorldRayOrigin.GetComponentInChildren(); tester.active = false; - m_Rays[miniWorldRayOrigin] = new MiniWorldRay(rayOrigin, miniWorld, proxy, node, deviceData.directSelectInput, tester); + m_Rays[miniWorldRayOrigin] = new MiniWorldRay(rayOrigin, miniWorld, proxy, node, tester); intersectionModule.AddTester(tester); diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 682717855..b58f4c0b2 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -198,7 +198,6 @@ void OnProxyActiveChanged(IProxy proxy) deviceData.rayOrigin = rayOrigin; deviceData.inputDevice = device; deviceData.uiInput = deviceInputModule.CreateActionMapInput(actionMap, device); - deviceData.directSelectInput = deviceInputModule.CreateActionMapInput(deviceInputModule.directSelectActionMap, device); // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 7f41782f9..cc53543aa 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -349,7 +349,6 @@ internal static void UpdatePlayerHandleMaps(List maps) maps.Add(alternateMenuInput); } - maps.Add(deviceData.directSelectInput); maps.Add(deviceData.uiInput); } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index a185623e9..e709febbb 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -68,7 +68,6 @@ class DeviceData public readonly Stack toolData = new Stack(); public ActionMapInput uiInput; public MainMenuActivator mainMenuActivator; - public ActionMapInput directSelectInput; public IMainMenu mainMenu; public ActionMapInput mainMenuInput; public IAlternateMenu alternateMenu; diff --git a/Scripts/Data/DirectSelectionData.cs b/Scripts/Data/DirectSelectionData.cs index f32d19f29..2792f610d 100644 --- a/Scripts/Data/DirectSelectionData.cs +++ b/Scripts/Data/DirectSelectionData.cs @@ -18,11 +18,6 @@ public sealed class DirectSelectionData /// The object which is selected /// public GameObject gameObject { get; set; } - - /// - /// The input which is associated with the rayOrigin - /// - public ActionMapInput input { get; set; } } } #endif diff --git a/Scripts/Modules/DeviceInputModule.cs b/Scripts/Modules/DeviceInputModule.cs index c0effd0bd..2676f8989 100644 --- a/Scripts/Modules/DeviceInputModule.cs +++ b/Scripts/Modules/DeviceInputModule.cs @@ -16,10 +16,6 @@ sealed class DeviceInputModule : MonoBehaviour [SerializeField] ActionMap m_StandardToolActionMap; - public ActionMap directSelectActionMap { get { return m_DirectSelectActionMap; } } - [SerializeField] - ActionMap m_DirectSelectActionMap; - PlayerHandle m_PlayerHandle; readonly HashSet m_LockedControls = new HashSet(); diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index f1e018d57..2407f40f8 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -9,19 +9,23 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject + ICanGrabObject, IUsesNode { - GameObject m_PressedObject; - - public ActionMap actionMap { get { return m_ActionMap; } } [SerializeField] ActionMap m_ActionMap; + GameObject m_PressedObject; + + SelectionInput m_Input; + readonly Dictionary m_HoverGameObjects = new Dictionary(); readonly Dictionary m_SelectionHoverGameObjects = new Dictionary(); + public ActionMap actionMap { get { return m_ActionMap; } } + public Transform rayOrigin { private get; set; } + public Node? node { private get; set; } public Func isRayActive; public event Action hovered; @@ -30,6 +34,8 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { + m_Input = (SelectionInput)input; + if (this.IsSharedUpdater(this)) { var directSelection = this.GetDirectSelection(); @@ -93,12 +99,17 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; - var directSelectInput = (DirectSelectInput)directSelectionData.input; + var grabbingNode = directSelectionData.node; + var selectionTool = linkedObjects.Cast().FirstOrDefault(linkedObject => linkedObject.node == grabbingNode); + if (selectionTool == null) + continue; + + var selectionToolInput = selectionTool.m_Input; // Only overwrite an existing selection if it does not contain the hovered object // In the case of multi-select, only add, do not remove - if (directSelectInput.select.wasJustPressed && !Selection.objects.Contains(directHoveredObject)) - this.SelectObject(directHoveredObject, rayOrigin, directSelectInput.multiSelect.isHeld); + if (selectionToolInput.select.wasJustPressed && !Selection.objects.Contains(directHoveredObject)) + this.SelectObject(directHoveredObject, rayOrigin, selectionToolInput.multiSelect.isHeld); GameObject lastHover; if (m_HoverGameObjects.TryGetValue(directRayOrigin, out lastHover) && lastHover != directHoveredObject) diff --git a/Action Maps/DirectSelectInput.asset b/Tools/TransformTool/TransformInput.asset similarity index 96% rename from Action Maps/DirectSelectInput.asset rename to Tools/TransformTool/TransformInput.asset index 1e847e0df..8629e64ed 100644 --- a/Action Maps/DirectSelectInput.asset +++ b/Tools/TransformTool/TransformInput.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} - m_Name: DirectSelectInput + m_Name: TransformInput m_EditorClassIdentifier: m_Actions: - {fileID: 114000012349872818} @@ -52,7 +52,7 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 - m_MapTypeName: DirectSelectInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + m_MapTypeName: TransformInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: --- !u!114 &114000011926715790 diff --git a/Action Maps/DirectSelectInput.asset.meta b/Tools/TransformTool/TransformInput.asset.meta similarity index 100% rename from Action Maps/DirectSelectInput.asset.meta rename to Tools/TransformTool/TransformInput.asset.meta diff --git a/Action Maps/DirectSelectInput.cs b/Tools/TransformTool/TransformInput.cs similarity index 75% rename from Action Maps/DirectSelectInput.cs rename to Tools/TransformTool/TransformInput.cs index 1d24e3d57..68caa93f0 100644 --- a/Action Maps/DirectSelectInput.cs +++ b/Tools/TransformTool/TransformInput.cs @@ -4,8 +4,8 @@ // GENERATED FILE - DO NOT EDIT MANUALLY namespace UnityEngine.InputNew { - public class DirectSelectInput : ActionMapInput { - public DirectSelectInput (ActionMap actionMap) : base (actionMap) { } + public class TransformInput : ActionMapInput { + public TransformInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @select { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @multiSelect { get { return (ButtonInputControl)this[1]; } } diff --git a/Action Maps/DirectSelectInput.cs.meta b/Tools/TransformTool/TransformInput.cs.meta similarity index 69% rename from Action Maps/DirectSelectInput.cs.meta rename to Tools/TransformTool/TransformInput.cs.meta index dbac7e338..c0a687212 100644 --- a/Action Maps/DirectSelectInput.cs.meta +++ b/Tools/TransformTool/TransformInput.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 544f3ef0a587eff4e972455d21b08d8d -timeCreated: 1476745902 -licenseType: Pro +guid: b56446351a683ff45bdfddd27e10cb08 +timeCreated: 1497932392 +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 5367f4ed0..6fe521986 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -10,8 +10,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, - IGrabObjects, ISetDefaultRayVisibility, IProcessInput, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, - ILinkedObject + IGrabObjects, ISetDefaultRayVisibility, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, + ILinkedObject, IUsesNode, ICustomActionMap { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -25,12 +25,12 @@ class GrabData Vector3[] m_InitialScales; public Transform[] grabbedObjects { get; private set; } - public DirectSelectInput input { get; private set; } + public TransformInput input { get; private set; } public Transform rayOrigin { get; private set; } public bool suspended { private get; set; } - public GrabData(Transform rayOrigin, DirectSelectInput input, Transform[] grabbedObjects) + public GrabData(Transform rayOrigin, TransformInput input, Transform[] grabbedObjects) { this.rayOrigin = rayOrigin; this.input = input; @@ -170,6 +170,9 @@ public List actions [SerializeField] GameObject m_ScaleManipulatorPrefab; + [SerializeField] + ActionMap m_ActionMap; + BaseManipulator m_CurrentManipulator; BaseManipulator m_StandardManipulator; @@ -191,11 +194,14 @@ public List actions readonly Dictionary m_GrabData = new Dictionary(); bool m_DirectSelected; + bool m_WasDirectSelected; // Hold directSelected state for a frame float m_ScaleStartDistance; Node m_ScaleFirstNode; float m_ScaleFactor; bool m_Scaling; + TransformInput m_Input; + readonly TransformAction m_PivotModeToggleAction = new TransformAction(); readonly TransformAction m_PivotRotationToggleAction = new TransformAction(); readonly TransformAction m_ManipulatorToggleAction = new TransformAction(); @@ -208,6 +214,10 @@ public List actions public List linkedObjects { private get; set; } + public Node? node { private get; set; } + + public ActionMap actionMap { get { return m_ActionMap; } } + void Start() { if (!this.IsSharedUpdater(this)) @@ -235,9 +245,6 @@ public void OnSelectionChanged() if (!this.IsSharedUpdater(this)) return; - // Reset direct selection state in case of a ray selection - m_DirectSelected = false; - if (Selection.gameObjects.Length == 0) m_CurrentManipulator.gameObject.SetActive(false); else @@ -246,11 +253,12 @@ public void OnSelectionChanged() public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { + m_Input = (TransformInput)input; + if (!this.IsSharedUpdater(this)) return; var hasObject = false; - var manipulatorGameObject = m_CurrentManipulator.gameObject; if (!m_CurrentManipulator.dragging) { @@ -292,14 +300,18 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; - var directSelectInput = (DirectSelectInput)directSelectionData.input; - if (directSelectInput.select.wasJustPressed) + var grabbingNode = directSelectionData.node; + var transformTool = linkedObjects.Cast().FirstOrDefault(linkedObject => linkedObject.node == grabbingNode); + if (transformTool == null) + continue; + + var transformInput = transformTool.m_Input; + + if (transformInput.select.wasJustPressed) { this.ClearSnappingState(directRayOrigin); - consumeControl(directSelectInput.select); - - var grabbingNode = directSelectionData.node; + consumeControl(transformInput.select); // Check if the other hand is already grabbing for two-handed scale foreach (var grabData in m_GrabData) @@ -323,20 +335,19 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (objectsGrabbed != null && !m_Scaling) objectsGrabbed(directRayOrigin, grabbedObjects); - m_GrabData[grabbingNode] = new GrabData(directRayOrigin, directSelectInput, grabbedObjects.ToArray()); + m_GrabData[grabbingNode] = new GrabData(directRayOrigin, transformInput, grabbedObjects.ToArray()); this.SetDefaultRayVisibility(directRayOrigin, false, true); // This will also unhighlight the object this.LockRay(directRayOrigin, this); - // Wait a frame since OnSelectionChanged is called at the end of the frame, and will set m_DirectSelected to false - EditorApplication.delayCall += () => - { - // A direct selection has been made. Hide the manipulator until the selection changes - m_DirectSelected = true; - }; + // A direct selection has been made. Hide the manipulator until the selection changes + m_DirectSelected = true; Undo.IncrementCurrentGroup(); } + + if (transformInput.select.wasJustReleased) + m_DirectSelected = true; } GrabData leftData; @@ -436,9 +447,27 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } + if (!hasObject) + { + // Reset direct selection state in case of a ray selection + foreach (TransformTool transformTool in linkedObjects) + { + if (transformTool.m_Input != null && transformTool.m_Input.select.wasJustReleased) + { + m_DirectSelected = false; + break; + } + } + } + // Manipulator is disabled while direct manipulation is happening - if (hasObject || m_DirectSelected) + if (hasObject || m_DirectSelected || m_WasDirectSelected) + { + m_WasDirectSelected = m_DirectSelected; return; + } + + m_WasDirectSelected = m_DirectSelected; if (Selection.gameObjects.Length > 0) { diff --git a/Tools/TransformTool/TransformTool.cs.meta b/Tools/TransformTool/TransformTool.cs.meta index 4cb812343..c4701a232 100644 --- a/Tools/TransformTool/TransformTool.cs.meta +++ b/Tools/TransformTool/TransformTool.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 882053426a5f76d46b5505d9a20be912 -timeCreated: 1480549855 +timeCreated: 1497934140 licenseType: Free MonoImporter: serializedVersion: 2 @@ -21,6 +21,7 @@ MonoImporter: type: 2} - m_ScaleManipulatorPrefab: {fileID: 1000011603037920, guid: ac3ea0b5d31a9d84580ef5c806d6862e, type: 2} + - m_ActionMap: {fileID: 11400000, guid: dc1ccafeffffc62419a3265a080a94a3, type: 2} executionOrder: 0 icon: {instanceID: 0} userData: From a83c0d48de9fc066c678ef803a5383274f42b624 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 19 Jun 2017 23:55:00 -0700 Subject: [PATCH 470/870] Hide ray when grabbing items from project view; Hide ray when CreatePrimitiveTool is active, except when hovering UI --- Menus/MainMenu/Prefabs/MenuFace.prefab | 15 ++++++++++++++- Scripts/Core/EditorVR.Menus.cs | 3 +++ .../CreatePrimitiveFace.prefab | 13 +++++++++++++ Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs | 15 ++++++++++++++- Tools/TransformTool/TransformTool.cs | 16 +++++++++++----- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 13 +++++++++++-- 6 files changed, 66 insertions(+), 9 deletions(-) diff --git a/Menus/MainMenu/Prefabs/MenuFace.prefab b/Menus/MainMenu/Prefabs/MenuFace.prefab index 6b5f3850b..eceadd8d9 100644 --- a/Menus/MainMenu/Prefabs/MenuFace.prefab +++ b/Menus/MainMenu/Prefabs/MenuFace.prefab @@ -75,7 +75,8 @@ GameObject: - component: {fileID: 4000010544386176} - component: {fileID: 33000014220048304} - component: {fileID: 23000012074004932} - m_Layer: 0 + - component: {fileID: 65890992969317448} + m_Layer: 5 m_Name: BorderOutline m_TagString: Untagged m_Icon: {fileID: 0} @@ -207,6 +208,18 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012912631164} m_Mesh: {fileID: 4300040, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!65 &65890992969317448 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012912631164} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.15000007, y: 0.25273103, z: 0.001} + m_Center: {x: 0, y: 0.0002848129, z: 0.073} --- !u!114 &114000010693038044 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index adb488749..d4aa18ec7 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -181,6 +181,9 @@ internal static void OnHover(GameObject go, RayEventData rayEventData, bool ende var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) { + if (go.transform.IsChildOf(deviceData.rayOrigin)) + return; + var scaledPointerDistance = rayEventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); var isManipulator = go.GetComponentInParent() != null; var menus = deviceData.menuHideFlags.Keys.ToList(); diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveFace.prefab b/Tools/CreatePrimitiveTool/CreatePrimitiveFace.prefab index 272c59508..fda3f1835 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveFace.prefab +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveFace.prefab @@ -346,6 +346,7 @@ GameObject: - component: {fileID: 4000013417422256} - component: {fileID: 33000013622279140} - component: {fileID: 23000011901827168} + - component: {fileID: 65314964497435104} m_Layer: 5 m_Name: MainMenuFaceModel-NoBlendShapes m_TagString: Untagged @@ -1603,6 +1604,18 @@ MeshCollider: m_InflateMesh: 0 m_SkinWidth: 0.01 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &65314964497435104 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011517943824} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.17, y: 0.2677734, z: 0.001} + m_Center: {x: 0, y: 0.1233885, z: 0} --- !u!114 &114000010109055550 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index 2c4ab961e..8e25f5344 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Primitive", "Create", "Create primitives in the scene")] sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, IConnectInterfaces, IInstantiateMenuUI, - IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool + IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, ISetDefaultRayVisibility, IIsHoveringOverUI { [SerializeField] CreatePrimitiveMenu m_MenuPrefab; @@ -70,6 +70,17 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon break; } } + + if (this.IsHoveringOverUI(rayOrigin)) + { + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true, true); + } + else + { + this.SetDefaultRayVisibility(rayOrigin, false, true); + this.LockRay(rayOrigin, this); + } } void SetSelectedPrimitive(PrimitiveType type, bool isFreeform) @@ -142,6 +153,8 @@ void Close() void OnDestroy() { + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true, true); ObjectUtils.Destroy(m_ToolMenu); } } diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 6fe521986..f89f359bb 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISetDefaultRayVisibility, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, - ILinkedObject, IUsesNode, ICustomActionMap + ILinkedObject, IUsesRayOrigin, IUsesNode, ICustomActionMap { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -214,6 +214,7 @@ public List actions public List linkedObjects { private get; set; } + public Transform rayOrigin { private get; set; } public Node? node { private get; set; } public ActionMap actionMap { get { return m_ActionMap; } } @@ -307,6 +308,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var transformInput = transformTool.m_Input; + this.SetDefaultRayVisibility(directRayOrigin, false, true); // This will also unhighlight the object + this.LockRay(directRayOrigin, this); + if (transformInput.select.wasJustPressed) { this.ClearSnappingState(directRayOrigin); @@ -337,9 +341,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_GrabData[grabbingNode] = new GrabData(directRayOrigin, transformInput, grabbedObjects.ToArray()); - this.SetDefaultRayVisibility(directRayOrigin, false, true); // This will also unhighlight the object - this.LockRay(directRayOrigin, this); - // A direct selection has been made. Hide the manipulator until the selection changes m_DirectSelected = true; @@ -452,7 +453,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // Reset direct selection state in case of a ray selection foreach (TransformTool transformTool in linkedObjects) { - if (transformTool.m_Input != null && transformTool.m_Input.select.wasJustReleased) + var rayOrigin = transformTool.rayOrigin; + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true, true); + + var transformInput = transformTool.m_Input; + if (transformInput != null && transformInput.select.wasJustReleased) { m_DirectSelected = false; break; diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index 6e32867bf..a12e2ce89 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -11,7 +11,8 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class AssetGridItem : DraggableListItem, IPlaceSceneObject, IUsesSpatialHash, IUsesViewerBody + sealed class AssetGridItem : DraggableListItem, IPlaceSceneObject, IUsesSpatialHash, + IUsesViewerBody, ISetDefaultRayVisibility { const float k_PreviewDuration = 0.1f; const float k_MaxPreviewScale = 0.2f; @@ -280,7 +281,11 @@ protected override void OnDragStarted(BaseHandle handle, HandleEventData eventDa { base.OnDragStarted(handle, eventData); - var clone = (GameObject)Instantiate(gameObject, transform.position, transform.rotation, transform.parent); + var rayOrigin = eventData.rayOrigin; + this.SetDefaultRayVisibility(rayOrigin, false); + this.LockRay(rayOrigin, this); + + var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); if (cloneItem.m_PreviewObjectTransform) @@ -327,6 +332,10 @@ protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData { var gridItem = m_DragObject.GetComponent(); + var rayOrigin = eventData.rayOrigin; + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true); + if (!this.IsOverShoulder(eventData.rayOrigin)) { if (gridItem.m_PreviewObjectTransform) From 1de49d8b387ee59c1d9c9152ec6586a67834959b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 20 Jun 2017 11:35:03 -0700 Subject: [PATCH 471/870] Perform PR cleanup of naming; remove unnecessary interface implementations --- Manipulators/DirectManipulator.cs | 2 +- Manipulators/StandardManipulator.cs | 2 +- Menus/MainMenu/MainMenu.cs | 8 +++--- Menus/MainMenu/Scripts/MainMenuButton.cs | 2 +- Menus/RadialMenu/RadialMenu.cs | 8 +++--- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 4 +-- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 4 +-- Scripts/Core/Interfaces/IRayToNode.cs | 2 +- Workspaces/Base/Workspace.cs | 22 +++++++-------- Workspaces/Base/WorkspaceUI.cs | 28 +++++++++---------- Workspaces/Common/Scripts/FilterUI.cs | 22 +++++++-------- Workspaces/Common/Scripts/WorkspaceButton.cs | 7 +++-- .../HierarchyWorkspace/HierarchyWorkspace.cs | 16 +++++------ .../InspectorWorkspace/InspectorWorkspace.cs | 8 +++--- .../ProjectWorkspace/ProjectWorkspace.cs | 4 +-- 15 files changed, 69 insertions(+), 70 deletions(-) diff --git a/Manipulators/DirectManipulator.cs b/Manipulators/DirectManipulator.cs index 78c17fb9c..dcd8e1f09 100644 --- a/Manipulators/DirectManipulator.cs +++ b/Manipulators/DirectManipulator.cs @@ -75,7 +75,7 @@ void OnHandleDragging(BaseHandle handle, HandleEventData eventData) var rayOrigin = eventData.rayOrigin; translate(rayOrigin.position + rayOrigin.rotation * m_PositionOffset - target.position, rayOrigin, false); - rotate(Quaternion.Inverse(target.rotation) * rayOrigin.rotation * m_RotationOffset, eventData.rayOrigin); + rotate(Quaternion.Inverse(target.rotation) * rayOrigin.rotation * m_RotationOffset, rayOrigin); } void OnHandleDragEnded(BaseHandle handle, HandleEventData eventData) diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index 2034728ea..fbefd67b3 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Manipulators { - sealed class StandardManipulator : BaseManipulator, IControlHaptics + sealed class StandardManipulator : BaseManipulator { [SerializeField] Transform m_PlaneHandlesParent; diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index dbdc84913..ce49066cd 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -100,8 +100,8 @@ void Start() m_MainMenuUI.menuOrigin = menuOrigin; m_MainMenuUI.Setup(); m_MainMenuUI.visible = m_Visible; - m_MainMenuUI.buttonHovered += OnButtonHover; - m_MainMenuUI.buttonClicked += OnButtonClick; + m_MainMenuUI.buttonHovered += OnButtonHovered; + m_MainMenuUI.buttonClicked += OnButtonClicked; m_MainMenuUI.opening += OnOpening; m_MainMenuUI.closing += OnClosing; @@ -224,12 +224,12 @@ void UpdateToolButtons() } } - void OnButtonClick(Transform rayOrigin) + void OnButtonClicked(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); } - void OnButtonHover(Transform rayOrigin) + void OnButtonHovered(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); } diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index fd65242e8..670270fa4 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuButton : MonoBehaviour, ITooltip, IControlHaptics, IRayEnterHandler, IPointerClickHandler + sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IPointerClickHandler { public Button button { get { return m_Button; } } [SerializeField] diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index a5a3698a5..d502d9189 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -89,8 +89,8 @@ void Start() this.ConnectInterfaces(m_RadialMenuUI); // Connect interfaces before performing setup on the UI m_RadialMenuUI.Setup(); m_RadialMenuUI.visible = m_Visible; - m_RadialMenuUI.buttonHovered += OnButtonHover; - m_RadialMenuUI.buttonClicked += OnButtonClick; + m_RadialMenuUI.buttonHovered += OnButtonHovered; + m_RadialMenuUI.buttonClicked += OnButtonClicked; } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -128,12 +128,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - void OnButtonClick() + void OnButtonClicked() { this.Pulse(node, m_ButtonClickedPulse); } - void OnButtonHover() + void OnButtonHovered() { this.Pulse(node, m_ButtonHoverPulse); } diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 353b2d2b5..e2d99219a 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler, IControlHaptics + sealed class RadialMenuSlot : MonoBehaviour, ISetTooltipVisibility, ITooltip, ITooltipPlacement, IRayEnterHandler, IRayExitHandler { static Color s_FrameOpaqueColor; static readonly Vector3 k_HiddenLocalScale = new Vector3(1f, 0f, 1f); @@ -208,8 +208,6 @@ public Material borderRendererMaterial // For overriding text (i.e. TransformActions) public ITooltip tooltip { private get; set; } - public Transform rayOrigin { get; set; } - public event Action hovered; void Awake() diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index d3a0618ad..a53300971 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -203,7 +203,7 @@ public void Setup() this.ConnectInterfaces(menuSlot); menuSlot.orderIndex = i; m_RadialMenuSlots.Add(menuSlot); - menuSlot.hovered += OnButtonHover; + menuSlot.hovered += OnButtonHovered; if (slotBorderMaterial == null) slotBorderMaterial = menuSlot.borderRendererMaterial; @@ -343,7 +343,7 @@ public void SelectionOccurred() buttonClicked(); } - void OnButtonHover() + void OnButtonHovered() { if (buttonHovered != null) buttonHovered(); diff --git a/Scripts/Core/Interfaces/IRayToNode.cs b/Scripts/Core/Interfaces/IRayToNode.cs index 36cbfa817..8c6eb9c4a 100644 --- a/Scripts/Core/Interfaces/IRayToNode.cs +++ b/Scripts/Core/Interfaces/IRayToNode.cs @@ -2,7 +2,7 @@ using System; using UnityEngine; -namespace UnityEditor.Experimental.EditorVR +namespace UnityEditor.Experimental.EditorVR.Core { /// /// Provide the ability to request a corresponding node for a ray origin diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 370d5fc9e..7e9817a57 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -133,12 +133,12 @@ public virtual void Setup() m_WorkspaceUI = baseObject.GetComponent(); this.ConnectInterfaces(m_WorkspaceUI); - m_WorkspaceUI.closeClicked += OnCloseClick; + m_WorkspaceUI.closeClicked += OnCloseClicked; m_WorkspaceUI.resetSizeClicked += OnResetClick; - m_WorkspaceUI.buttonHovered += OnButtonHover; - m_WorkspaceUI.hoveringFrame += HoveringFrame; - m_WorkspaceUI.moving += Moving; - m_WorkspaceUI.resizing += Resizing; + m_WorkspaceUI.buttonHovered += OnButtonHovered; + m_WorkspaceUI.hoveringFrame += OnHoveringFrame; + m_WorkspaceUI.moving += OnMoving; + m_WorkspaceUI.resizing += OnResizing; m_WorkspaceUI.leftRayOrigin = leftRayOrigin; m_WorkspaceUI.rightRayOrigin = rightRayOrigin; @@ -162,7 +162,7 @@ public void Close() m_VisibilityCoroutine = StartCoroutine(AnimateHide()); } - protected virtual void OnCloseClick(Transform rayOrigin) + protected virtual void OnCloseClicked(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); Close(); @@ -176,7 +176,7 @@ protected virtual void OnResetClick(Transform rayOrigin) m_ResetSizeCoroutine = StartCoroutine(AnimateResetSize()); } - protected void OnButtonHover(Transform rayOrigin) + protected void OnButtonHovered(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); } @@ -270,22 +270,22 @@ public virtual void ProcessInput(ActionMapInput input, ConsumeControlDelegate co m_WorkspaceUI.ProcessInput((WorkspaceInput)input, consumeControl); } - protected void OnButtonClick(Transform rayOrigin) + protected void OnButtonClicked(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); } - void Moving(Transform rayOrigin) + void OnMoving(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_MovePulse); } - void Resizing(Transform rayOrigin) + void OnResizing(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ResizePulse); } - void HoveringFrame(Transform rayOrigin) + void OnHoveringFrame(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ResizePulse); } diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 5b257f7a0..71e8c7dcb 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IControlHaptics, IUsesNode + sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGetPointerLength, IUsesNode { const int k_AngledFaceBlendShapeIndex = 2; const int k_ThinFrameBlendShapeIndex = 3; @@ -252,12 +252,12 @@ public void OnDragging() + transform.forward * (absForward - (currentExtents.z - extents.z)) * Mathf.Sign(positionOffsetForward); m_WorkspaceUI.transform.parent.position = m_PositionStart + positionOffset * viewerScale; - m_WorkspaceUI.ResizeHapticPulse(rayOrigin); + m_WorkspaceUI.OnResizing(rayOrigin); } else { MathUtilsExt.SetTransformOffset(rayOrigin, m_WorkspaceUI.transform.parent, m_PositionOffset, m_RotationOffset); - m_WorkspaceUI.MoveHapticPulse(rayOrigin); + m_WorkspaceUI.OnMoving(rayOrigin); } } } @@ -425,10 +425,10 @@ void Awake() handle.hoverEnded += OnHandleHoverEnded; } - m_CloseButton.clicked += OnCloseClick; - m_CloseButton.hovered += OnButtonHover; - m_ResizeButton.clicked += OnResetSizeClick; - m_ResizeButton.hovered += OnButtonHover; + m_CloseButton.clicked += OnCloseClicked; + m_CloseButton.hovered += OnButtonHovered; + m_ResizeButton.clicked += OnResetSizeClicked; + m_ResizeButton.hovered += OnButtonHovered; } IEnumerator Start() @@ -792,25 +792,25 @@ void OnDestroy() ObjectUtils.Destroy(m_TopFaceMaterial); ObjectUtils.Destroy(m_FrontFaceMaterial); - m_CloseButton.clicked -= OnCloseClick; + m_CloseButton.clicked -= OnCloseClicked; m_CloseButton.hovered -= buttonHovered; - m_ResizeButton.clicked -= OnResetSizeClick; + m_ResizeButton.clicked -= OnResetSizeClicked; m_ResizeButton.hovered -= buttonHovered; } - void OnCloseClick(Transform rayOrigin) + void OnCloseClicked(Transform rayOrigin) { if (closeClicked != null) closeClicked(rayOrigin); } - void OnResetSizeClick(Transform rayOrigin) + void OnResetSizeClicked(Transform rayOrigin) { if (resetSizeClicked != null) resetSizeClicked(rayOrigin); } - void OnButtonHover(Transform rayOrigin) + void OnButtonHovered(Transform rayOrigin) { if (buttonHovered != null) buttonHovered(rayOrigin); @@ -889,13 +889,13 @@ IEnumerator HideTopFace() m_TopFaceVisibleCoroutine = null; } - void MoveHapticPulse(Transform rayOrigin) + void OnMoving(Transform rayOrigin) { if (moving != null) moving(rayOrigin); } - void ResizeHapticPulse(Transform rayOrigin) + void OnResizing(Transform rayOrigin) { if (resizing != null) resizing(rayOrigin); diff --git a/Workspaces/Common/Scripts/FilterUI.cs b/Workspaces/Common/Scripts/FilterUI.cs index b079ec9c6..9741d3cbf 100644 --- a/Workspaces/Common/Scripts/FilterUI.cs +++ b/Workspaces/Common/Scripts/FilterUI.cs @@ -99,8 +99,8 @@ public List filterList OnFilterClick(button); }); - button.clicked += OnClick; - button.hovered += OnHover; + button.clicked += OnClicked; + button.hovered += OnHovered; button.text.text = m_FilterTypes[i]; } } @@ -121,10 +121,10 @@ void Start() m_BackgroundMaterial = MaterialUtils.GetMaterialClone(m_Background); m_BackgroundMaterial.SetInt("_StencilRef", stencilRef); - m_VisibilityButton.clicked += OnVisibilityButtonClick; - m_VisibilityButton.hovered += OnHover; - m_SummaryButton.clicked += OnVisibilityButtonClick; - m_SummaryButton.hovered += OnHover; + m_VisibilityButton.clicked += OnVisibilityButtonClicked; + m_VisibilityButton.hovered += OnHovered; + m_SummaryButton.clicked += OnVisibilityButtonClicked; + m_SummaryButton.hovered += OnHovered; } void OnDestroy() @@ -150,7 +150,7 @@ public void SetListVisibility(bool show) this.StopCoroutine(ref m_HideButtonListCoroutine); m_HideButtonListCoroutine = StartCoroutine(HideButtonList()); - OnClick(null); + OnClicked(null); } } @@ -261,19 +261,19 @@ IEnumerator HideButtonList() m_HideButtonListCoroutine = null; } - void OnVisibilityButtonClick(Transform rayOrigin) + void OnVisibilityButtonClicked(Transform rayOrigin) { SetListVisibility(true); - OnClick(rayOrigin); + OnClicked(rayOrigin); } - void OnClick(Transform rayOrigin) + void OnClicked(Transform rayOrigin) { if (buttonClicked != null) buttonClicked(rayOrigin); } - void OnHover(Transform rayOrigin) + void OnHovered(Transform rayOrigin) { if (buttonHovered != null) buttonHovered(rayOrigin); diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index a659303f3..dde29b223 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Modules; @@ -10,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, IUsesStencilRef, IControlHaptics, IRayToNode + sealed class WorkspaceButton : MonoBehaviour, IRayEnterHandler, IRayExitHandler, IUsesStencilRef { const float k_IconHighlightedLocalZOffset = -0.0015f; const string k_MaterialAlphaProperty = "_Alpha"; @@ -210,7 +211,7 @@ void Awake() if (m_SwapIconsOnClick && m_AlternateIconSprite) m_Button.onClick.AddListener(SwapIconSprite); - m_Button.onClick.AddListener(OnButtonClick); + m_Button.onClick.AddListener(OnButtonClicked); } void Start() @@ -475,7 +476,7 @@ void SwapIconSprite() alternateIconVisible = !alternateIconVisible; } - void OnButtonClick() + void OnButtonClicked() { if (clicked != null) clicked(m_InteractingRayOrigin); diff --git a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs index 2883fdd83..57452b80a 100644 --- a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs +++ b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs @@ -92,7 +92,7 @@ public override void Setup() } var button = focusUI.GetComponentInChildren(true); button.clicked += FocusSelection; - button.hovered += OnButtonHover; + button.hovered += OnButtonHovered; } if (m_CreateEmptyPrefab) @@ -104,8 +104,8 @@ public override void Setup() } var button = createEmptyUI.GetComponentInChildren(true); button.clicked += CreateEmptyGameObject; - button.clicked += OnButtonClick; - button.hovered += OnButtonHover; + button.clicked += OnButtonClicked; + button.hovered += OnButtonHovered; } var listView = m_HierarchyUI.listView; @@ -128,8 +128,8 @@ public override void Setup() scrollHandleTransform.localScale = new Vector3(1.03f, 0.02f, 1.02f); // Extra space for scrolling scrollHandleTransform.localPosition = new Vector3(0f, -0.015f, 0f); // Offset from content for collision purposes - m_FilterUI.buttonClicked += OnButtonClick; - m_FilterUI.buttonHovered += OnButtonHover; + m_FilterUI.buttonClicked += OnButtonClicked; + m_FilterUI.buttonHovered += OnButtonHovered; // Propagate initial bounds OnBoundsChanged(); @@ -137,8 +137,8 @@ public override void Setup() protected override void OnDestroy() { - m_FilterUI.buttonClicked -= OnButtonClick; - m_FilterUI.buttonHovered -= OnButtonHover; + m_FilterUI.buttonClicked -= OnButtonClicked; + m_FilterUI.buttonHovered -= OnButtonHovered; base.OnDestroy(); } @@ -233,7 +233,7 @@ void FocusSelection(Transform rayOrigin) this.MoveCameraRig(bounds.center - cameraDiff - viewDirection * maxSize); - OnButtonClick(rayOrigin); // Trigger haptics + OnButtonClicked(rayOrigin); // Trigger haptics } static void CreateEmptyGameObject(Transform rayOrigin) diff --git a/Workspaces/InspectorWorkspace/InspectorWorkspace.cs b/Workspaces/InspectorWorkspace/InspectorWorkspace.cs index 05b608c6f..ee59b9731 100644 --- a/Workspaces/InspectorWorkspace/InspectorWorkspace.cs +++ b/Workspaces/InspectorWorkspace/InspectorWorkspace.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { [MainMenuItem("Inspector", "Workspaces", "View and edit GameObject properties")] - sealed class InspectorWorkspace : Workspace, ISelectionChanged, IControlHaptics + sealed class InspectorWorkspace : Workspace, ISelectionChanged { public new static readonly Vector3 DefaultBounds = new Vector3(0.3f, 0.1f, 0.5f); @@ -39,7 +39,7 @@ public override void Setup() m_LockUI = ObjectUtils.Instantiate(m_LockPrefab, m_WorkspaceUI.frontPanel, false).GetComponentInChildren(); this.ConnectInterfaces(m_LockUI); m_LockUI.clicked += OnLockButtonClicked; - m_LockUI.hovered += OnButtonHover; + m_LockUI.hovered += OnButtonHovered; EditorApplication.delayCall += m_LockUI.Setup; // Need to write stencilRef after WorkspaceButton does it var listView = m_InspectorUI.listView; @@ -348,7 +348,7 @@ void SetIsLocked() if (!m_IsLocked) OnSelectionChanged(); - OnButtonClick(null); + OnButtonClicked(null); } protected override void OnDestroy() @@ -361,7 +361,7 @@ protected override void OnDestroy() void OnLockButtonClicked(Transform rayOrigin) { SetIsLocked(); - OnButtonClick(rayOrigin); + OnButtonClicked(rayOrigin); } } } diff --git a/Workspaces/ProjectWorkspace/ProjectWorkspace.cs b/Workspaces/ProjectWorkspace/ProjectWorkspace.cs index 4b7f569c2..f9e3fac37 100644 --- a/Workspaces/ProjectWorkspace/ProjectWorkspace.cs +++ b/Workspaces/ProjectWorkspace/ProjectWorkspace.cs @@ -111,8 +111,8 @@ public override void Setup() foreach (var button in m_FilterUI.GetComponentsInChildren()) { - button.clicked += OnButtonClick; - button.hovered += OnButtonHover; + button.clicked += OnButtonClicked; + button.hovered += OnButtonHovered; } var sliderObject = ObjectUtils.Instantiate(m_SliderPrefab, m_WorkspaceUI.frontPanel, false); From 62bc7aa2cab0396cdb4c72fd2bf5aa5c3a225f9f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 13:17:24 -0700 Subject: [PATCH 472/870] Fix an issue where trigger on non-shared-updater locomotion hand wasn't being blocked. --- Tools/LocomotionTool/LocomotionTool.cs | 91 ++++++++++++++------------ 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 787bdbe1c..207cfd5ea 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -83,10 +83,8 @@ class Preferences Vector3 m_CameraStartPosition; Quaternion m_LastRotationDiff; - // Allow shared updater to consume these controls for another linked instance - InputControl m_Grip; - InputControl m_Thumb; - InputControl m_Trigger; + // Allow shared updater to check input values and consume controls + Locomotion m_LocomotionInput; Camera m_MainCamera; float m_OriginalNearClipPlane; @@ -183,7 +181,7 @@ void OnDestroy() public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var blinkInput = (Locomotion)input; + m_LocomotionInput = (Locomotion)input; if (m_State == State.Moving) return; @@ -197,21 +195,17 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; } - m_Grip = blinkInput.grip.isHeld ? blinkInput.grip : null; - m_Thumb = blinkInput.thumb.isHeld ? blinkInput.thumb : null; - m_Trigger = blinkInput.trigger.isHeld ? blinkInput.trigger : null; - DoTwoHandedScaling(consumeControl); if (!m_Scaling) { if (!m_WasRotating) - DoCrawl(blinkInput); + DoCrawl(m_LocomotionInput); if (m_Preferences.blinkMode) - DoBlink(consumeControl, blinkInput); + DoBlink(consumeControl, m_LocomotionInput); else - DoFlying(consumeControl, blinkInput); + DoFlying(consumeControl, m_LocomotionInput); } else { @@ -219,13 +213,13 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) + void DoFlying(ConsumeControlDelegate consumeControl, Locomotion locomotionInput) { - var reverse = blinkInput.reverse.isHeld; - var moving = blinkInput.forward.isHeld || reverse; + var reverse = locomotionInput.reverse.isHeld; + var moving = locomotionInput.forward.isHeld || reverse; if (moving) { - if (blinkInput.grip.isHeld) + if (locomotionInput.grip.isHeld) { var localRayRotation = Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation; var localRayForward = localRayRotation * Vector3.forward; @@ -250,7 +244,7 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) m_LastRotationDiff = Quaternion.identity; } - consumeControl(blinkInput.grip); + consumeControl(locomotionInput.grip); var startOffset = m_RigStartPosition - m_CameraStartPosition; var angle = Vector3.Angle(m_RayOriginStartForward, localRayForward); @@ -269,7 +263,7 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) else { var speed = k_SlowMoveSpeed; - var speedControl = blinkInput.speed; + var speedControl = locomotionInput.speed; var speedControlValue = speedControl.value; if (!Mathf.Approximately(speedControlValue, 0)) // Consume control to block selection { @@ -285,20 +279,20 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion blinkInput) cameraRig.Translate(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.forward * speed * Time.unscaledDeltaTime); } - consumeControl(blinkInput.forward); + consumeControl(locomotionInput.forward); } else { - if (!blinkInput.grip.isHeld) + if (!locomotionInput.grip.isHeld) m_WasRotating = false; m_Rotating = false; } } - void DoCrawl(Locomotion blinkInput) + void DoCrawl(Locomotion locomotionInput) { - if (!blinkInput.forward.isHeld && !blinkInput.blink.isHeld && blinkInput.grip.isHeld) + if (!locomotionInput.forward.isHeld && !locomotionInput.blink.isHeld && locomotionInput.grip.isHeld) { if (!m_Crawling) { @@ -318,10 +312,10 @@ void DoCrawl(Locomotion blinkInput) } } - void DoBlink(ConsumeControlDelegate consumeControl, Locomotion blinkInput) + void DoBlink(ConsumeControlDelegate consumeControl, Locomotion locomotionInput) { m_Rotating = false; - if (blinkInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) + if (locomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; this.SetDefaultRayVisibility(rayOrigin, false); @@ -329,9 +323,9 @@ void DoBlink(ConsumeControlDelegate consumeControl, Locomotion blinkInput) m_BlinkVisuals.ShowVisuals(); - consumeControl(blinkInput.blink); + consumeControl(locomotionInput.blink); } - else if (m_State == State.Aiming && blinkInput.blink.wasJustReleased) + else if (m_State == State.Aiming && locomotionInput.blink.wasJustReleased) { this.UnlockRay(rayOrigin, this); this.SetDefaultRayVisibility(rayOrigin, true); @@ -353,21 +347,24 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) { if (this.IsSharedUpdater(this)) { - if (m_Grip != null) + var grip = m_LocomotionInput.grip; + if (grip.isHeld) { if (m_AllowScaling) { - var otherGrip = false; + var otherGripHeld = false; foreach (LocomotionTool locomotionTool in linkedObjects) { if (locomotionTool == this) continue; - if (locomotionTool.m_Grip != null) + var otherLocomotionInput = locomotionTool.m_LocomotionInput; + var otherGrip = otherLocomotionInput.grip; + if (otherGrip.isHeld) { - otherGrip = true; - consumeControl(m_Grip); - consumeControl(locomotionTool.m_Grip); + otherGripHeld = true; + consumeControl(grip); + consumeControl(otherGrip); var thisPosition = cameraRig.InverseTransformPoint(rayOrigin.position); var otherRayOrigin = locomotionTool.rayOrigin; @@ -399,14 +396,18 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var currentScale = Mathf.Clamp(m_StartScale * (m_StartDistance / distance), k_MinScale, k_MaxScale); - if (m_Thumb != null) - consumeControl(m_Thumb); + var thumb = m_LocomotionInput.thumb; + var thumbHeld = thumb.isHeld; + if (thumbHeld) + consumeControl(thumb); - if (locomotionTool.m_Thumb != null) - consumeControl(locomotionTool.m_Thumb); + var otherThumb = otherLocomotionInput.thumb; + var otherThumbHeld = otherThumb.isHeld; + if (otherThumbHeld) + consumeControl(otherThumb); // Press both thumb buttons to reset scale - if (m_Thumb != null && locomotionTool.m_Thumb != null) + if (thumbHeld && otherThumbHeld) { m_AllowScaling = false; @@ -420,14 +421,18 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) ResetViewerScale(); } - if (m_Thumb != null) - consumeControl(m_Thumb); + var trigger = m_LocomotionInput.trigger; + var triggerHeld = trigger.isHeld; + if (triggerHeld) + consumeControl(trigger); - if (locomotionTool.m_Thumb != null) - consumeControl(locomotionTool.m_Thumb); + var otherTrigger = otherLocomotionInput.trigger; + var otherTriggerHeld = otherTrigger.isHeld; + if (otherTriggerHeld) + consumeControl(otherTrigger); // Press both triggers to reset to origin - if (m_Trigger != null && locomotionTool.m_Trigger != null) + if (triggerHeld && otherTriggerHeld) { m_AllowScaling = false; @@ -457,7 +462,7 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) } } - if (!otherGrip) + if (!otherGripHeld) CancelScale(); } } From 037ac0837aba73d2729dd9bf30c68d180604cbd2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 20 Jun 2017 13:24:39 -0700 Subject: [PATCH 473/870] Perform additional event/function naming corrections --- Menus/MainMenu/Scripts/MainMenuUI.cs | 2 +- Workspaces/Base/Workspace.cs | 4 ++-- Workspaces/Base/WorkspaceUI.cs | 4 ++-- Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs | 2 +- Workspaces/InspectorWorkspace/Scripts/LockUI.cs | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 41976759e..0be3eae38 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IControlHaptics, IUsesNode, IConnectInterfaces + sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IConnectInterfaces { public class ButtonData { diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 7e9817a57..1aad787c9 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -134,7 +134,7 @@ public virtual void Setup() m_WorkspaceUI = baseObject.GetComponent(); this.ConnectInterfaces(m_WorkspaceUI); m_WorkspaceUI.closeClicked += OnCloseClicked; - m_WorkspaceUI.resetSizeClicked += OnResetClick; + m_WorkspaceUI.resetSizeClicked += OnResetClicked; m_WorkspaceUI.buttonHovered += OnButtonHovered; m_WorkspaceUI.hoveringFrame += OnHoveringFrame; m_WorkspaceUI.moving += OnMoving; @@ -168,7 +168,7 @@ protected virtual void OnCloseClicked(Transform rayOrigin) Close(); } - protected virtual void OnResetClick(Transform rayOrigin) + protected virtual void OnResetClicked(Transform rayOrigin) { this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 71e8c7dcb..9d073f3c7 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -793,9 +793,9 @@ void OnDestroy() ObjectUtils.Destroy(m_FrontFaceMaterial); m_CloseButton.clicked -= OnCloseClicked; - m_CloseButton.hovered -= buttonHovered; + m_CloseButton.hovered -= OnButtonHovered; m_ResizeButton.clicked -= OnResetSizeClicked; - m_ResizeButton.hovered -= buttonHovered; + m_ResizeButton.hovered -= OnButtonHovered; } void OnCloseClicked(Transform rayOrigin) diff --git a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs index 57452b80a..8c00436ae 100644 --- a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs +++ b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs @@ -233,7 +233,7 @@ void FocusSelection(Transform rayOrigin) this.MoveCameraRig(bounds.center - cameraDiff - viewDirection * maxSize); - OnButtonClicked(rayOrigin); // Trigger haptics + OnButtonClicked(rayOrigin); } static void CreateEmptyGameObject(Transform rayOrigin) diff --git a/Workspaces/InspectorWorkspace/Scripts/LockUI.cs b/Workspaces/InspectorWorkspace/Scripts/LockUI.cs index eba4ac68e..1be6e4af2 100644 --- a/Workspaces/InspectorWorkspace/Scripts/LockUI.cs +++ b/Workspaces/InspectorWorkspace/Scripts/LockUI.cs @@ -32,17 +32,17 @@ public void Setup() sm.SetInt("_StencilRef", stencilRef); } - m_Button.clicked += OnClick; - m_Button.hovered += OnHover; + m_Button.clicked += OnClicked; + m_Button.hovered += OnHovered; } - void OnClick(Transform rayOrigin) + void OnClicked(Transform rayOrigin) { if (clicked != null) clicked(rayOrigin); } - void OnHover(Transform rayOrigin) + void OnHovered(Transform rayOrigin) { if (hovered != null) hovered(rayOrigin); From f54f73191fe1b84dd2fd11c3c351cd55851fd7d3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 20 Jun 2017 13:50:01 -0700 Subject: [PATCH 474/870] Increase master intensity of haptics --- Scripts/Modules/HapticsModule/HapticsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index 979a0dd0e..beddcacd2 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules sealed class HapticsModule : MonoBehaviour { [SerializeField] - float m_MasterIntensity = 1f; + float m_MasterIntensity = 4f; /// /// Overall intensity of haptics. From 4b4ec0e4e69ee157dbc230ab7712beeada602b66 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 13:57:14 -0700 Subject: [PATCH 475/870] Make it so both multi-select buttons apply to either hand --- Menus/RadialMenu/RadialMenu.cs | 11 +++++------ Tools/SelectionTool/SelectionTool.cs | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index 5363fce4a..32db8dce3 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -101,20 +101,19 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; } - m_RadialMenuUI.pressedDown = radialMenuInput.selectItem.wasJustPressed; + var selectControl = radialMenuInput.selectItem; + m_RadialMenuUI.pressedDown = selectControl.wasJustPressed; if (m_RadialMenuUI.pressedDown) - { - consumeControl(radialMenuInput.selectItem); - } + consumeControl(selectControl); - if (radialMenuInput.selectItem.wasJustReleased) + if (selectControl.wasJustReleased) { m_RadialMenuUI.SelectionOccurred(); if (itemWasSelected != null) itemWasSelected(rayOrigin); - consumeControl(radialMenuInput.selectItem); + consumeControl(selectControl); } } } diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 4c0538c87..6b31314bb 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -17,6 +17,8 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR GameObject m_PressedObject; + SelectionInput m_SelectionInput; + readonly Dictionary m_HoverGameObjects = new Dictionary(); readonly Dictionary m_SelectionHoverGameObjects = new Dictionary(); @@ -30,6 +32,8 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { + m_SelectionInput = (SelectionInput)input; + if (this.IsSharedUpdater(this)) { var directSelection = this.GetDirectSelection(); @@ -114,10 +118,20 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } + var selectionInput = (SelectionInput)input; + var multiSelectControl = selectionInput.multiSelect; + this.SetManipulatorsVisible(this, !multiSelectControl.isHeld); + if (!IsActive()) return; - var selectionInput = (SelectionInput)input; + var multiSelect = false; + foreach (SelectionTool selectionTool in linkedObjects) + { + var toolInput = selectionTool.m_SelectionInput; + if (toolInput != null && toolInput.multiSelect.isHeld) + multiSelect = true; + } // Need to call GetFirstGameObject a second time because we do not guarantee shared updater executes first var hoveredObject = this.GetFirstGameObject(rayOrigin); @@ -128,8 +142,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!GetSelectionCandidate(ref hoveredObject)) return; - this.SetManipulatorsVisible(this, !selectionInput.multiSelect.isHeld); - // Capture object on press if (selectionInput.select.wasJustPressed) m_PressedObject = hoveredObject; @@ -139,7 +151,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { if (m_PressedObject == hoveredObject) { - this.SelectObject(m_PressedObject, rayOrigin, selectionInput.multiSelect.isHeld, true); + this.SelectObject(m_PressedObject, rayOrigin, multiSelect, true); if (m_PressedObject != null) this.SetHighlight(m_PressedObject, false, rayOrigin); @@ -151,8 +163,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PressedObject = null; } - if (selectionInput.multiSelect.wasJustPressed) - consumeControl(selectionInput.multiSelect); + if (multiSelectControl.wasJustPressed) + consumeControl(multiSelectControl); } bool GetSelectionCandidate(ref GameObject hoveredObject) From 8c14cbad26100678c25a631ac272be05c4db92ad Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 15:34:08 -0700 Subject: [PATCH 476/870] Fix issue where menus would unhide for a frame on hover end, even if something else is hovered; Disable CreatePrimitiveTool when menu is visible on same hand --- Scripts/Core/EditorVR.Menus.cs | 46 +++++++++++++------ Scripts/Core/EditorVR.Rays.cs | 3 +- Scripts/Core/EditorVR.Tools.cs | 4 -- Scripts/Core/EditorVR.cs | 3 +- .../IIsMainMenuVisible.cs | 28 +++++++++++ .../IIsMainMenuVisible.cs.meta | 12 +++++ .../FunctionalityInjection/IIsRayActive.cs | 28 +++++++++++ .../IIsRayActive.cs.meta | 12 +++++ .../CreatePrimitiveTool.cs | 14 +++++- Tools/SelectionTool/SelectionTool.cs | 5 +- 10 files changed, 130 insertions(+), 25 deletions(-) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs.meta create mode 100644 Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs.meta diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index d4aa18ec7..b10d7527f 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -39,6 +39,7 @@ internal enum MenuHideFlags public Menus() { IInstantiateMenuUIMethods.instantiateMenuUI = InstantiateMenuUI; + IIsMainMenuVisibleMethods.isMainMenuVisible = IsMainMenuVisible; } public void ConnectInterface(object obj, Transform rayOrigin = null) @@ -87,10 +88,8 @@ internal void UpdateMenuVisibilities() m_ActiveDeviceData.Add(deviceData); }); - // Reconcile conflicts because menus on the same device can visually overlay each other - for (int i = 0; i < m_ActiveDeviceData.Count; i++) + foreach (var deviceData in m_ActiveDeviceData) { - var deviceData = m_ActiveDeviceData[i]; var alternateMenu = deviceData.alternateMenu; var mainMenu = deviceData.mainMenu; var customMenu = deviceData.customMenu; @@ -99,9 +98,8 @@ internal void UpdateMenuVisibilities() // Move alternate menu to another device if it conflicts with main or custom menu if (alternateMenu != null && (menuHideFlags[mainMenu] == 0 || (customMenu != null && menuHideFlags[customMenu] == 0)) && menuHideFlags[alternateMenu] == 0) { - for (int j = 0; j < m_ActiveDeviceData.Count; j++) + foreach (var otherDeviceData in m_ActiveDeviceData) { - var otherDeviceData = m_ActiveDeviceData[j]; if (otherDeviceData == deviceData) continue; @@ -141,7 +139,7 @@ internal void UpdateMenuVisibilities() } // Apply state to UI visibility - Rays.ForEachProxyDevice(deviceData => + foreach (var deviceData in m_ActiveDeviceData) { var mainMenu = deviceData.mainMenu; mainMenu.visible = deviceData.menuHideFlags[mainMenu] == 0; @@ -152,27 +150,37 @@ internal void UpdateMenuVisibilities() UpdateAlternateMenuForDevice(deviceData); Rays.UpdateRayForDevice(deviceData, deviceData.rayOrigin); - }); + } + + // Reset OverUI state + foreach (var deviceData in m_ActiveDeviceData) + { + var menus = deviceData.menuHideFlags.Keys.ToList(); + foreach (var menu in menus) + { + deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverUI; + } + } evr.GetModule().UpdatePlayerHandleMaps(); } internal static void OnUIHoverStarted(GameObject go, RayEventData rayEventData) { - OnHover(go, rayEventData, false); + OnHover(go, rayEventData); } internal static void OnUIHovering(GameObject go, RayEventData rayEventData) { - OnHover(go, rayEventData, false); + OnHover(go, rayEventData); } internal static void OnUIHoverEnded(GameObject go, RayEventData rayEventData) { - OnHover(go, rayEventData, true); + OnHover(go, rayEventData); } - internal static void OnHover(GameObject go, RayEventData rayEventData, bool ended) + internal static void OnHover(GameObject go, RayEventData rayEventData) { if (go == evr.gameObject) return; @@ -189,9 +197,8 @@ internal static void OnHover(GameObject go, RayEventData rayEventData, bool ende var menus = deviceData.menuHideFlags.Keys.ToList(); foreach (var menu in menus) { - if (ended || isManipulator || scaledPointerDistance > menu.hideDistance + k_MenuHideMargin) - deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverUI; - else + // Only set if hidden--value is reset every frame + if (!(isManipulator || scaledPointerDistance > menu.hideDistance + k_MenuHideMargin)) deviceData.menuHideFlags[menu] |= MenuHideFlags.OverUI; } } @@ -325,6 +332,17 @@ internal static void UpdateAlternateMenuActions() altMenu.menuActions = actionsModule.menuActions; } } + + static bool IsMainMenuVisible(Transform rayOrigin) + { + foreach (var deviceData in evr.m_DeviceData) + { + if (deviceData.rayOrigin == rayOrigin) + return deviceData.mainMenu.visible; + } + + return false; + } } } } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index b58f4c0b2..9ad166ae2 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -45,6 +45,7 @@ public Rays() IGetFieldGrabOriginMethods.getFieldGrabOriginForRayOrigin = GetFieldGrabOriginForRayOrigin; IGetPreviewOriginMethods.getPreviewOriginForRayOrigin = GetPreviewOriginForRayOrigin; IUsesRaycastResultsMethods.getFirstGameObject = GetFirstGameObject; + IIsRayActiveMethods.isRayActive = IsRayActive; } internal override void OnDestroy() @@ -207,7 +208,7 @@ void OnProxyActiveChanged(IProxy proxy) if (deviceData.mainMenu.visible && source.hoveredObject) { - Menus.OnHover(source.hoveredObject, source.eventData, false); + Menus.OnHover(source.hoveredObject, source.eventData); return false; } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index cc53543aa..96a69d3e7 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -69,7 +69,6 @@ internal static bool IsDefaultTool(Type type) internal static void SpawnDefaultTools(IProxy proxy) { - Func isRayActive = Rays.IsRayActive; var vacuumables = evr.GetNestedModule(); var lockModule = evr.GetModule(); var defaultTools = evr.m_DefaultTools; @@ -90,10 +89,7 @@ internal static void SpawnDefaultTools(IProxy proxy) var tool = toolData.tool; var selectionTool = tool as SelectionTool; if (selectionTool) - { selectionTool.hovered += lockModule.OnHovered; - selectionTool.isRayActive = isRayActive; - } var vacuumTool = tool as VacuumTool; if (vacuumTool) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index e709febbb..e344f6cd7 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -315,8 +315,7 @@ void Update() GetModule().ProcessInput(); - var menus = GetNestedModule(); - menus.UpdateMenuVisibilities(); + GetNestedModule().UpdateMenuVisibilities(); GetNestedModule().UpdateManipulatorVisibilites(); } diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs b/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs new file mode 100644 index 000000000..8f130ee15 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs @@ -0,0 +1,28 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provides access to checks that can test whether the main menu is visible on a given ray origin + /// + public interface IIsMainMenuVisible + { + } + + public static class IIsMainMenuVisibleMethods + { + internal static Func isMainMenuVisible { get; set; } + + /// + /// Returns whether the main menu is visible on the specified ray origin + /// + /// The rayOrigin that is being checked + public static bool IsMainMenuVisible(this IIsMainMenuVisible obj, Transform rayOrigin) + { + return isMainMenuVisible(rayOrigin); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs.meta new file mode 100644 index 000000000..216b2af6a --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e46a2554bcdda8845b931a60985f742e +timeCreated: 1489789739 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs b/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs new file mode 100644 index 000000000..885be5f0a --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs @@ -0,0 +1,28 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provides access to checks that can test whether a ray is active + /// + public interface IIsRayActive + { + } + + public static class IIsRayActiveMethods + { + internal static Func isRayActive { get; set; } + + /// + /// Returns whether the specified ray is active + /// + /// The rayOrigin that is being checked + public static bool IsRayActive(this IIsRayActive obj, Transform rayOrigin) + { + return isRayActive(rayOrigin); + } + } +} +#endif \ No newline at end of file diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs.meta new file mode 100644 index 000000000..9fdb6ea40 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f460221d2114d114aaa78f1e6df00e51 +timeCreated: 1489789739 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index 8e25f5344..fe55659b6 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -7,7 +7,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Primitive", "Create", "Create primitives in the scene")] sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, IConnectInterfaces, IInstantiateMenuUI, - IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, ISetDefaultRayVisibility, IIsHoveringOverUI + IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, ISetDefaultRayVisibility, IIsHoveringOverUI, + IIsMainMenuVisible { [SerializeField] CreatePrimitiveMenu m_MenuPrefab; @@ -46,6 +47,9 @@ void Start() public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { + if (!IsActive()) + return; + var standardInput = (Standard)input; switch (m_State) @@ -146,6 +150,14 @@ void CheckForTriggerRelease(Standard standardInput, ConsumeControlDelegate consu } } + bool IsActive() + { + if (this.IsMainMenuVisible(rayOrigin)) + return false; + + return true; + } + void Close() { this.SelectTool(rayOrigin, GetType()); diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 2407f40f8..053e7a15a 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject, IUsesNode + ICanGrabObject, IUsesNode, IIsRayActive { [SerializeField] ActionMap m_ActionMap; @@ -27,7 +27,6 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR public Transform rayOrigin { private get; set; } public Node? node { private get; set; } - public Func isRayActive; public event Action hovered; public List linkedObjects { get; set; } @@ -188,7 +187,7 @@ bool IsActive() if (this.IsHoveringOverUI(rayOrigin)) return false; - if (!isRayActive(rayOrigin)) + if (!this.IsRayActive(rayOrigin)) return false; return true; From e200115c5de0ba6b2d5c5527e47a5da04430e90f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 16:19:50 -0700 Subject: [PATCH 477/870] Fix an issue where CreatePrimitiveMenu would be unintentionally hidden --- Scripts/Core/EditorVR.Menus.cs | 51 +++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index b10d7527f..4abd5395d 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -25,7 +25,8 @@ internal enum MenuHideFlags { Hidden = 1 << 0, OverUI = 1 << 1, - OverWorkspace = 1 << 2 + OverWorkspace = 1 << 2, + Overridden = 1 << 3 } const float k_MenuHideMargin = 0.8f; @@ -109,15 +110,16 @@ internal void UpdateMenuVisibilities() otherHideFlags[otherDeviceData.mainMenu] |= MenuHideFlags.Hidden; if (otherCustomMenu != null) - otherHideFlags[otherCustomMenu] |= MenuHideFlags.Hidden; + otherHideFlags[otherCustomMenu] |= MenuHideFlags.Overridden; } menuHideFlags[alternateMenu] |= MenuHideFlags.Hidden; } + // Hide custom menu if main menu opened on same hand if (customMenu != null && menuHideFlags[mainMenu] == 0 && menuHideFlags[customMenu] == 0) { - menuHideFlags[customMenu] |= MenuHideFlags.Hidden; + menuHideFlags[customMenu] |= MenuHideFlags.Overridden; } // Check workspaces @@ -189,7 +191,7 @@ internal static void OnHover(GameObject go, RayEventData rayEventData) var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) { - if (go.transform.IsChildOf(deviceData.rayOrigin)) + if (go.transform.IsChildOf(deviceData.rayOrigin)) // Don't let UI on this hand block the menu return; var scaledPointerDistance = rayEventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); @@ -216,8 +218,15 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl var alternateMenu = deviceData.alternateMenu; if (alternateMenu != null) { + var menuHideFlags = deviceData.menuHideFlags; var flags = deviceData.menuHideFlags[alternateMenu]; deviceData.menuHideFlags[alternateMenu] = (deviceData.rayOrigin == rayOrigin) && visible ? flags & ~MenuHideFlags.Hidden : flags | MenuHideFlags.Hidden; + + var customMenu = deviceData.customMenu; + // Show custom menu if overridden + if (customMenu != null && menuHideFlags[customMenu] == MenuHideFlags.Overridden + && menuHideFlags[deviceData.mainMenu] != 0 && menuHideFlags[alternateMenu] != 0) + menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; } }); } @@ -227,23 +236,45 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform foreach (var deviceData in evr.m_DeviceData) { var mainMenu = deviceData.mainMenu; - var menuHideFlags = deviceData.menuHideFlags; if (mainMenu != null) { + var customMenu = deviceData.customMenu; + var alternateMenu = deviceData.alternateMenu; + var menuHideFlags = deviceData.menuHideFlags; if (deviceData.rayOrigin == rayOrigin) { menuHideFlags[mainMenu] ^= MenuHideFlags.Hidden; - - var customMenu = deviceData.customMenu; - if (customMenu != null) - menuHideFlags[customMenu] &= ~MenuHideFlags.Hidden; - mainMenu.targetRayOrigin = targetRayOrigin; } else { menuHideFlags[mainMenu] |= MenuHideFlags.Hidden; + + // Move alternate menu if overriding custom menu + if (customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) != 0 + && alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0) + { + foreach (var otherDeviceData in evr.m_DeviceData) + { + if (deviceData == otherDeviceData) + continue; + + var otherAlternateMenu = otherDeviceData.alternateMenu; + var otherHideFlags = otherDeviceData.menuHideFlags; + if (otherAlternateMenu != null) + { + menuHideFlags[alternateMenu] |= MenuHideFlags.Hidden; + otherHideFlags[otherAlternateMenu] = 0; + } + + } + } } + + // Show custom menu if overridden + if (customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) != 0 + && menuHideFlags[mainMenu] != 0 && alternateMenu != null && menuHideFlags[alternateMenu] != 0) + menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; } } } From f4cd4cf77e1d8c3a7c7075f398b6444c82f86c4f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 20 Jun 2017 19:32:01 -0700 Subject: [PATCH 478/870] Add initial spatial hinting visuals to PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 14 +- .../Prefabs/PinnedToolsMenu.prefab | 544 +++++++++++++++++- .../Scripts/PinnedToolsMenuUI.cs | 93 ++- 3 files changed, 636 insertions(+), 15 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 8c4a949ee..ceda1b31f 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Security.Cryptography.X509Certificates; using System.Text; using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Core; @@ -238,6 +239,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon spatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; allowSpatialScrollBeforeThisTime = Time.realtimeSinceStartup + kAutoHideDuration; allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; + m_PinnedToolsMenuUI.spatialDragDistance = 0f; // Triggers the display of the directional hint arrows + //Dont show if the user hasnt passed the threshold in the given duration } else if (pinnedToolInput.show.isHeld && !pinnedToolInput.select.isHeld && !pinnedToolInput.select.wasJustPressed) @@ -257,7 +260,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //return; //allowSpatialScrollBeforeThisTime = null; - //spatialDirection = null; + //spatialDirection = null; } if (buttonCount <= k_ActiveToolOrderPosition + 1) @@ -279,6 +282,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int) (buttonCount * normalizedRepeatingPosition) + 1); consumeControl(pinnedToolInput.show); consumeControl(pinnedToolInput.select); + } else // User hasn't dragged beyond the trigger magnitude; spatial scrolling hasn't been activated yet { @@ -323,9 +327,13 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, if (spatialDirection == null) { const float kNewDirectionVectorThreshold = 0.0175f; // Initial magnitude beyond which spatial scrolling will be evaluated - directionVector = currentPosition - startingPosition; - if (Vector3.Magnitude(directionVector) > kNewDirectionVectorThreshold) + var dragAmount = Vector3.Magnitude(directionVector); + m_PinnedToolsMenuUI.spatialDragDistance = dragAmount > 0 ? dragAmount / kNewDirectionVectorThreshold : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred + if (dragAmount > kNewDirectionVectorThreshold) + { spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton + m_PinnedToolsMenuUI.spatialDirectionVector = spatialDirection; + } } else { diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index d3b4f3f1f..079ed96e2 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -16,10 +16,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012301197336} - - 114: {fileID: 114000011597863712} + - component: {fileID: 4000012301197336} + - component: {fileID: 114000011597863712} m_Layer: 5 m_Name: ButtonContainer m_TagString: Untagged @@ -32,10 +32,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000011260103804} - - 114: {fileID: 114000010527895234} + - component: {fileID: 4000011260103804} + - component: {fileID: 114000010527895234} m_Layer: 0 m_Name: PinnedToolsMenu m_TagString: Untagged @@ -43,6 +43,129 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1010111456622354 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4886523625983604} + - component: {fileID: 33107560542711044} + - component: {fileID: 65983018325267314} + - component: {fileID: 23633161707023522} + m_Layer: 5 + m_Name: FrontArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1076216916843686 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4546751647995990} + - component: {fileID: 33222025853848168} + - component: {fileID: 65797927434860724} + - component: {fileID: 23590276871445402} + m_Layer: 5 + m_Name: BackArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1113548126640048 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4490327083081870} + m_Layer: 5 + m_Name: ArrowsContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1236151594399662 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4386844247658442} + - component: {fileID: 33685955442159952} + - component: {fileID: 65551516500730168} + - component: {fileID: 23542172210224264} + m_Layer: 5 + m_Name: TopArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1267413807553356 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4982260476637878} + - component: {fileID: 33130744985660702} + - component: {fileID: 65418261072157146} + - component: {fileID: 23020214490570890} + m_Layer: 5 + m_Name: LeftArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1539960486036454 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4947664076386474} + - component: {fileID: 33836873376687798} + - component: {fileID: 65639477567371392} + - component: {fileID: 23343159395137930} + m_Layer: 5 + m_Name: RightArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1869225334479398 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4254294315888650} + - component: {fileID: 33152143725165046} + - component: {fileID: 65764590748995170} + - component: {fileID: 23251901085109124} + m_Layer: 5 + m_Name: BottomArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4000011260103804 Transform: m_ObjectHideFlags: 1 @@ -52,11 +175,12 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: + - {fileID: 4490327083081870} - {fileID: 4000012301197336} m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012301197336 Transform: m_ObjectHideFlags: 1 @@ -66,10 +190,413 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000011260103804} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4254294315888650 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1869225334479398} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.35624993, z: 0} + m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} + m_Children: [] + m_Father: {fileID: 4490327083081870} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4386844247658442 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1236151594399662} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.3574999, z: 0} + m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} m_Children: [] + m_Father: {fileID: 4490327083081870} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4490327083081870 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1113548126640048} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4386844247658442} + - {fileID: 4254294315888650} + - {fileID: 4982260476637878} + - {fileID: 4947664076386474} + - {fileID: 4886523625983604} + - {fileID: 4546751647995990} m_Father: {fileID: 4000011260103804} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4546751647995990 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1076216916843686} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.0012499999, y: 0.0012499999, z: -0.35624993} + m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} + m_Children: [] + m_Father: {fileID: 4490327083081870} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4886523625983604 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1010111456622354} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.0012499999, y: 0.0012499999, z: 0.3574999} + m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} + m_Children: [] + m_Father: {fileID: 4490327083081870} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4947664076386474 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1539960486036454} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.35624993, y: 0.0012499999, z: 0} + m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} + m_Children: [] + m_Father: {fileID: 4490327083081870} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4982260476637878 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1267413807553356} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.3574999, y: 0.0012499999, z: 0} + m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} + m_Children: [] + m_Father: {fileID: 4490327083081870} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23020214490570890 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1267413807553356} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23251901085109124 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1869225334479398} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23343159395137930 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1539960486036454} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23542172210224264 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1236151594399662} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23590276871445402 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1076216916843686} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23633161707023522 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1010111456622354} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33107560542711044 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1010111456622354} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33130744985660702 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1267413807553356} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33152143725165046 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1869225334479398} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33222025853848168 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1076216916843686} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33685955442159952 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1236151594399662} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33836873376687798 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1539960486036454} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!65 &65418261072157146 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1267413807553356} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65551516500730168 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1236151594399662} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65639477567371392 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1539960486036454} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65764590748995170 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1869225334479398} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65797927434860724 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1076216916843686} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65983018325267314 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1010111456622354} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114000010527895234 MonoBehaviour: m_ObjectHideFlags: 1 @@ -81,10 +608,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cfe80f5c8b040574dbe8502d4830bf4b, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_ButtonContainer: {fileID: 4000012301197336} m_AlternatePosition: {x: 0, y: 0, z: -0.0136} m_AlternateLocalScale: {x: 0.54, y: 0.54, z: 0.54} + m_HintContentContainer: {fileID: 4490327083081870} --- !u!114 &114000011597863712 MonoBehaviour: m_ObjectHideFlags: 1 @@ -96,7 +623,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_SmoothRotation: 1 m_TightenRotation: 30 m_SmoothPosition: 1 diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index cf8c252f7..2c0c34018 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Security.Cryptography.X509Certificates; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Tools; @@ -11,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -27,15 +28,24 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool [SerializeField] Vector3 m_AlternateLocalScale; + [SerializeField] + Transform m_HintContentContainer; + bool m_AllButtonsVisible; List m_OrderedButtons; Coroutine m_ShowHideAllButtonsCoroutine; Coroutine m_MoveCoroutine; Coroutine m_ButtonHoverExitDelayCoroutine; + Coroutine m_HintContentVisibilityCoroutine; int m_VisibleButtonCount; bool m_MoveToAlternatePosition; Vector3 m_OriginalLocalScale; bool m_RayHovered; + float m_SpatialDragDistance; + float m_SmoothedSpatialDragDistance; + Quaternion m_HintContentContainerRotation; + Vector3 m_HintContentWorldPosition; + Quaternion m_SpatialScrollOrientation; public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } @@ -60,6 +70,7 @@ public bool allButtonsVisible Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); //this.Pulse(rayOrigin, 0.5f, 0.065f, false, true); ShowOnlyMenuAndActiveToolButtons(); + this.RestartCoroutine(ref m_HintContentVisibilityCoroutine, HideHintContent()); } } } @@ -80,10 +91,39 @@ public bool moveToAlternatePosition private bool aboveMinimumButtonCount { get { return m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1; } } + public float spatialDragDistance + { + set + { + if (Mathf.Approximately(value, 0f)) + { + m_SpatialDragDistance = 0f; + m_SmoothedSpatialDragDistance = 0f; + m_SpatialScrollOrientation = Quaternion.identity; + m_HintContentWorldPosition = transform.position; + m_HintContentContainerRotation = Quaternion.identity; + this.RestartCoroutine(ref m_HintContentVisibilityCoroutine, ShowHintContent()); + } + + m_SpatialDragDistance = value; + //m_SpatialScrollOrientation = transform.rotation; + } + } + + public Vector3? spatialDirectionVector + { + set + { + var orig = m_HintContentContainer.rotation; + m_HintContentContainer.LookAt(value.Value); + m_SpatialScrollOrientation = m_HintContentContainer.rotation; + m_HintContentContainer.rotation = orig; + } + } + public event Action buttonHovered; public event Action buttonClicked; - void Awake() { m_OriginalLocalScale = transform.localScale; @@ -91,6 +131,20 @@ void Awake() Debug.LogError("PinnedToolsMenuUI initialized"); } + void Update() + { + if (m_SpatialDragDistance > 1f && m_SmoothedSpatialDragDistance < 1) + { + Debug.LogError("INSIDE rotation update loop"); + m_SmoothedSpatialDragDistance = Mathf.Clamp01(m_SmoothedSpatialDragDistance += Time.unscaledDeltaTime * 1.5f); + var shapedDragAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(m_SmoothedSpatialDragDistance), 6); + m_HintContentContainerRotation = Quaternion.Lerp(Quaternion.identity, m_SpatialScrollOrientation, shapedDragAmount); + } + + m_HintContentContainer.rotation = m_HintContentContainerRotation; + m_HintContentContainer.position = m_HintContentWorldPosition; + } + public void AddButton(IPinnedToolButton button, Transform buttonTransform) { button.showAllButtons = ShowAllButtons; @@ -300,7 +354,6 @@ public void SelectNextExistingToolButton() public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) { - //Debug.LogError("Highlighting SINGLE BUTTON at position : "+ buttonOrderPosition); for (int i = 1; i < m_OrderedButtons.Count; ++i) { @@ -442,6 +495,40 @@ void OnButtonHover() if (buttonHovered != null) buttonHovered(); } + + IEnumerator ShowHintContent() + { + var currentScale = m_HintContentContainer.localScale; + var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals + var targetScale = Vector3.one; + while (timeElapsed < 1f) + { + timeElapsed += Time.unscaledDeltaTime * 5f; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(timeElapsed), 2); + m_HintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + yield return null; + } + + m_HintContentContainer.localScale = targetScale; + m_HintContentVisibilityCoroutine = null; + } + + IEnumerator HideHintContent() + { + var currentScale = m_HintContentContainer.localScale; + var timeElapsed = 1 - currentScale.x; + var targetScale = Vector3.zero; + while (timeElapsed < 1f) + { + timeElapsed += Time.unscaledDeltaTime * 2f; + var durationShaped = MathUtilsExt.SmoothInOutLerpFloat(timeElapsed); + m_HintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + yield return null; + } + + m_HintContentContainer.localScale = targetScale; + m_HintContentVisibilityCoroutine = null; + } } } #endif From 106a94b2490e648e3dc53a82c89cbfedf806c865 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 20:04:34 -0700 Subject: [PATCH 479/870] Rename Locomotion to LocomotionInput --- .../{Locomotion.asset => LocomotionInput.asset} | 0 ...ocomotion.asset.meta => LocomotionInput.asset.meta} | 0 .../{Locomotion.cs => LocomotionInput.cs} | 4 ++-- .../{Locomotion.cs.meta => LocomotionInput.cs.meta} | 0 Tools/LocomotionTool/LocomotionTool.cs | 10 +++++----- 5 files changed, 7 insertions(+), 7 deletions(-) rename Tools/LocomotionTool/{Locomotion.asset => LocomotionInput.asset} (100%) rename Tools/LocomotionTool/{Locomotion.asset.meta => LocomotionInput.asset.meta} (100%) rename Tools/LocomotionTool/{Locomotion.cs => LocomotionInput.cs} (85%) rename Tools/LocomotionTool/{Locomotion.cs.meta => LocomotionInput.cs.meta} (100%) diff --git a/Tools/LocomotionTool/Locomotion.asset b/Tools/LocomotionTool/LocomotionInput.asset similarity index 100% rename from Tools/LocomotionTool/Locomotion.asset rename to Tools/LocomotionTool/LocomotionInput.asset diff --git a/Tools/LocomotionTool/Locomotion.asset.meta b/Tools/LocomotionTool/LocomotionInput.asset.meta similarity index 100% rename from Tools/LocomotionTool/Locomotion.asset.meta rename to Tools/LocomotionTool/LocomotionInput.asset.meta diff --git a/Tools/LocomotionTool/Locomotion.cs b/Tools/LocomotionTool/LocomotionInput.cs similarity index 85% rename from Tools/LocomotionTool/Locomotion.cs rename to Tools/LocomotionTool/LocomotionInput.cs index 7370d6623..f46342105 100644 --- a/Tools/LocomotionTool/Locomotion.cs +++ b/Tools/LocomotionTool/LocomotionInput.cs @@ -4,8 +4,8 @@ // GENERATED FILE - DO NOT EDIT MANUALLY namespace UnityEngine.InputNew { - public class Locomotion : ActionMapInput { - public Locomotion (ActionMap actionMap) : base (actionMap) { } + public class LocomotionInput : ActionMapInput { + public LocomotionInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @blink { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @grip { get { return (ButtonInputControl)this[1]; } } diff --git a/Tools/LocomotionTool/Locomotion.cs.meta b/Tools/LocomotionTool/LocomotionInput.cs.meta similarity index 100% rename from Tools/LocomotionTool/Locomotion.cs.meta rename to Tools/LocomotionTool/LocomotionInput.cs.meta diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 207cfd5ea..8938eeceb 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -84,7 +84,7 @@ class Preferences Quaternion m_LastRotationDiff; // Allow shared updater to check input values and consume controls - Locomotion m_LocomotionInput; + LocomotionInput m_LocomotionInput; Camera m_MainCamera; float m_OriginalNearClipPlane; @@ -181,7 +181,7 @@ void OnDestroy() public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - m_LocomotionInput = (Locomotion)input; + m_LocomotionInput = (LocomotionInput)input; if (m_State == State.Moving) return; @@ -213,7 +213,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - void DoFlying(ConsumeControlDelegate consumeControl, Locomotion locomotionInput) + void DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionInput) { var reverse = locomotionInput.reverse.isHeld; var moving = locomotionInput.forward.isHeld || reverse; @@ -290,7 +290,7 @@ void DoFlying(ConsumeControlDelegate consumeControl, Locomotion locomotionInput) } } - void DoCrawl(Locomotion locomotionInput) + void DoCrawl(LocomotionInput locomotionInput) { if (!locomotionInput.forward.isHeld && !locomotionInput.blink.isHeld && locomotionInput.grip.isHeld) { @@ -312,7 +312,7 @@ void DoCrawl(Locomotion locomotionInput) } } - void DoBlink(ConsumeControlDelegate consumeControl, Locomotion locomotionInput) + void DoBlink(ConsumeControlDelegate consumeControl, LocomotionInput locomotionInput) { m_Rotating = false; if (locomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) From 853c1eb84c0da12ab568bddf79ee45a08006fa78 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 21:19:30 -0700 Subject: [PATCH 480/870] Fix SettingsMenuItemProviders; Fix LocomotionInput.asset --- Menus/MainMenu/MainMenu.cs | 2 +- Tools/LocomotionTool/LocomotionInput.asset.meta | 7 ++++--- Tools/LocomotionTool/LocomotionInput.cs.meta | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 95ca49108..85d0aa043 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, - ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IControlHaptics, IUsesNode, IRayToNode + ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IControlHaptics, IUsesNode, IRayToNode, IUsesRayOrigin { public ActionMap actionMap { get {return m_MainMenuActionMap; } } [SerializeField] diff --git a/Tools/LocomotionTool/LocomotionInput.asset.meta b/Tools/LocomotionTool/LocomotionInput.asset.meta index cec9208db..79b573fb9 100644 --- a/Tools/LocomotionTool/LocomotionInput.asset.meta +++ b/Tools/LocomotionTool/LocomotionInput.asset.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 233e21336472f454bb9de757639a9ec0 -timeCreated: 1468286869 -licenseType: Pro +guid: 9729abfd6d2540f4db055be042af7175 +timeCreated: 1498018684 +licenseType: Free NativeFormatImporter: + mainObjectFileID: -1 userData: assetBundleName: assetBundleVariant: diff --git a/Tools/LocomotionTool/LocomotionInput.cs.meta b/Tools/LocomotionTool/LocomotionInput.cs.meta index 80cae3f74..45d944f42 100644 --- a/Tools/LocomotionTool/LocomotionInput.cs.meta +++ b/Tools/LocomotionTool/LocomotionInput.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 7701565cecf69864ca148b577c901910 -timeCreated: 1491440597 -licenseType: Pro +timeCreated: 1498018701 +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] From e977763984f9dc3baf67fe9a8d941c51b717a1b3 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 21:23:55 -0700 Subject: [PATCH 481/870] Fix MainMenu --- Menus/MainMenu/MainMenu.cs | 2 +- Tools/LocomotionTool/LocomotionInput.asset | 7 ++++--- Tools/LocomotionTool/LocomotionTool.cs.meta | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 85d0aa043..411bd8140 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -158,7 +158,7 @@ void CreateFaceButtons(List types) foreach (var type in types) { var customMenuAttribute = (MainMenuItemAttribute)type.GetCustomAttributes(typeof(MainMenuItemAttribute), false).FirstOrDefault(); - var isTool = typeof(ITool).IsAssignableFrom(type); + var isTool = typeof(ITool).IsAssignableFrom(type) && menuTools.Contains(type); var isWorkspace = typeof(Workspace).IsAssignableFrom(type); var isSettingsProvider = typeof(ISettingsMenuProvider).IsAssignableFrom(type); var isSettingsItemProvider = typeof(ISettingsMenuItemProvider).IsAssignableFrom(type); diff --git a/Tools/LocomotionTool/LocomotionInput.asset b/Tools/LocomotionTool/LocomotionInput.asset index 408b2033b..a370f8565 100644 --- a/Tools/LocomotionTool/LocomotionInput.asset +++ b/Tools/LocomotionTool/LocomotionInput.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} - m_Name: Locomotion + m_Name: LocomotionInput m_EditorClassIdentifier: m_Actions: - {fileID: 114000011114386886} @@ -20,7 +20,7 @@ MonoBehaviour: - {fileID: 114000013424161920} - {fileID: 114022299328106344} m_ControlSchemes: - - m_Name: BlinkLocomotion + - m_Name: LocomotionInput m_DeviceSlots: - m_Key: 1 m_Type: @@ -92,7 +92,8 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 - m_MapTypeName: Locomotion, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_MapTypeName: LocomotionInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null m_CustomNamespace: --- !u!114 &114000010166273910 MonoBehaviour: diff --git a/Tools/LocomotionTool/LocomotionTool.cs.meta b/Tools/LocomotionTool/LocomotionTool.cs.meta index 69c540d99..986831910 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs.meta +++ b/Tools/LocomotionTool/LocomotionTool.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 403957a6dcd8bfe4a905881513f309b0 -timeCreated: 1491439928 -licenseType: Pro +timeCreated: 1498018808 +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: @@ -9,7 +9,7 @@ MonoImporter: type: 2} - m_ViewerScaleVisualsPrefab: {fileID: 1000012817627458, guid: 60a4bda9bfa0dcc4e9ccab99d39c295f, type: 2} - - m_BlinkActionMap: {fileID: 11400000, guid: 233e21336472f454bb9de757639a9ec0, type: 2} + - m_BlinkActionMap: {fileID: 11400000, guid: 9729abfd6d2540f4db055be042af7175, type: 2} - m_SettingsMenuItemPrefab: {fileID: 1000013404610172, guid: f1141ca24ceb64f49a6e988175713e3d, type: 2} executionOrder: 0 From e274ba1543c31924490c5c4b3a0f027c36e44d72 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 21:34:43 -0700 Subject: [PATCH 482/870] Revert changes to target indicator in BlinkVisuals --- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index 90995b2da..ae25c035b 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -91,6 +91,7 @@ public Transform locatorRoot } public bool validTarget { get; private set; } + public bool showValidTargetIndicator { private get; set; } private float pointerStrength { @@ -265,7 +266,7 @@ private IEnumerator AnimateHideVisuals() scale = MathUtilsExt.SmoothDamp(scale, kTargetScale, ref smoothVelocity, kSmoothTime, Mathf.Infinity, Time.deltaTime); var adjustedScale = scale * viewerScale; currentDuration += Time.deltaTime; - SetColors(Color.Lerp(validTarget ? m_ValidLocationColor : m_InvalidLocationColor, Color.clear, 1f - scale)); + SetColors(Color.Lerp(!showValidTargetIndicator || validTarget ? m_ValidLocationColor : m_InvalidLocationColor, Color.clear, 1f - scale)); m_TubeTransform.localScale = new Vector3(tubeScale, scale, tubeScale); m_LineRenderer.SetWidth(scale * adjustedScale, scale * adjustedScale); m_RingTransform.localScale = Vector3.Lerp(m_RingTransform.localScale, m_RingTransformOriginalScale, scale); @@ -328,7 +329,7 @@ public void DrawArc() var colliders = Physics.OverlapSphere(m_FinalPosition, m_Radius, m_LayerMask.value); validTarget = colliders != null && colliders.Length > 0; - SetColors(validTarget ? m_ValidLocationColor : m_InvalidLocationColor); + SetColors(!showValidTargetIndicator || validTarget ? m_ValidLocationColor : m_InvalidLocationColor); // calculate and send points to the line renderer m_SegmentPositions = new Vector3[m_LineSegmentCount]; From 6dd995aac55a8889347a01365f17d1c39f81bac4 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 20 Jun 2017 22:53:55 -0700 Subject: [PATCH 483/870] Clean up OnMainMenuActivatorSelected; Fix exception in CreatePrimitiveTool OnDestroy --- Scripts/Core/EditorVR.Menus.cs | 19 ++++--------------- .../CreatePrimitiveTool.cs | 6 +++++- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 4abd5395d..171734d03 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -224,8 +224,8 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl var customMenu = deviceData.customMenu; // Show custom menu if overridden - if (customMenu != null && menuHideFlags[customMenu] == MenuHideFlags.Overridden - && menuHideFlags[deviceData.mainMenu] != 0 && menuHideFlags[alternateMenu] != 0) + if (customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) != 0 + && menuHideFlags[deviceData.mainMenu] != 0 && alternateMenu != null && menuHideFlags[alternateMenu] != 0) menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; } }); @@ -259,22 +259,11 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform if (deviceData == otherDeviceData) continue; - var otherAlternateMenu = otherDeviceData.alternateMenu; - var otherHideFlags = otherDeviceData.menuHideFlags; - if (otherAlternateMenu != null) - { - menuHideFlags[alternateMenu] |= MenuHideFlags.Hidden; - otherHideFlags[otherAlternateMenu] = 0; - } - + if (otherDeviceData.alternateMenu != null) + SetAlternateMenuVisibility(rayOrigin, true); } } } - - // Show custom menu if overridden - if (customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) != 0 - && menuHideFlags[mainMenu] != 0 && alternateMenu != null && menuHideFlags[alternateMenu] != 0) - menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; } } } diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index fe55659b6..bb8fc3cbd 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -165,9 +165,13 @@ void Close() void OnDestroy() { + ObjectUtils.Destroy(m_ToolMenu); + + if (rayOrigin == null) + return; + this.UnlockRay(rayOrigin, this); this.SetDefaultRayVisibility(rayOrigin, true, true); - ObjectUtils.Destroy(m_ToolMenu); } } } From 75be3c718c6c467c26e4d35e5d6b0b2594de90a2 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 00:15:23 -0700 Subject: [PATCH 484/870] Expand click region on PinnedToolButton; Re-work menu visibility logic --- .../PinnedToolButton/PinnedToolButton.prefab | 26 ++++---- Scripts/Core/EditorVR.Menus.cs | 61 +++++++++++-------- 2 files changed, 48 insertions(+), 39 deletions(-) diff --git a/Menus/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolButton/PinnedToolButton.prefab index 2b3155f6c..590145d02 100644 --- a/Menus/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolButton/PinnedToolButton.prefab @@ -71,7 +71,7 @@ GameObject: - component: {fileID: 33000013208543088} - component: {fileID: 23000013566874788} - component: {fileID: 114000010373680160} - - component: {fileID: 135000012241492716} + - component: {fileID: 65353114627912982} m_Layer: 5 m_Name: Base m_TagString: Untagged @@ -325,6 +325,18 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011266792292} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!65 &65353114627912982 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011266792292} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.08, y: 0.0028786354, z: 0.08} + m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114000010373680160 MonoBehaviour: m_ObjectHideFlags: 1 @@ -445,18 +457,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!135 &135000012241492716 -SphereCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011266792292} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.03 - m_Center: {x: 0, y: 0, z: 0} --- !u!222 &222000011018194712 CanvasRenderer: m_ObjectHideFlags: 1 diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 171734d03..0adf07961 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -89,6 +89,8 @@ internal void UpdateMenuVisibilities() m_ActiveDeviceData.Add(deviceData); }); + var directSelection = evr.GetNestedModule(); + foreach (var deviceData in m_ActiveDeviceData) { var alternateMenu = deviceData.alternateMenu; @@ -96,33 +98,26 @@ internal void UpdateMenuVisibilities() var customMenu = deviceData.customMenu; var menuHideFlags = deviceData.menuHideFlags; - // Move alternate menu to another device if it conflicts with main or custom menu - if (alternateMenu != null && (menuHideFlags[mainMenu] == 0 || (customMenu != null && menuHideFlags[customMenu] == 0)) && menuHideFlags[alternateMenu] == 0) + var mainMenuVisible = mainMenu != null && (menuHideFlags[mainMenu] & MenuHideFlags.Hidden) == 0; + var customMenuVisible = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Hidden) == 0 && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) == 0; + var alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; + var hasDirectSelection = directSelection != null && directSelection.GetHeldObjects(deviceData.rayOrigin) != null; + + if (alternateMenuVisible && (mainMenuVisible || customMenuVisible || hasDirectSelection)) { foreach (var otherDeviceData in m_ActiveDeviceData) { if (otherDeviceData == deviceData) continue; - var otherCustomMenu = otherDeviceData.customMenu; - var otherHideFlags = otherDeviceData.menuHideFlags; - otherHideFlags[otherDeviceData.alternateMenu] &= ~MenuHideFlags.Hidden; - otherHideFlags[otherDeviceData.mainMenu] |= MenuHideFlags.Hidden; - - if (otherCustomMenu != null) - otherHideFlags[otherCustomMenu] |= MenuHideFlags.Overridden; + SetAlternateMenuVisibility(otherDeviceData.rayOrigin, true); + break; } - - menuHideFlags[alternateMenu] |= MenuHideFlags.Hidden; } - // Hide custom menu if main menu opened on same hand - if (customMenu != null && menuHideFlags[mainMenu] == 0 && menuHideFlags[customMenu] == 0) - { + if (customMenuVisible && (mainMenuVisible || alternateMenuVisible)) menuHideFlags[customMenu] |= MenuHideFlags.Overridden; - } - // Check workspaces var hoveringWorkspace = false; foreach (var workspace in evr.GetModule().workspaces) { @@ -208,6 +203,9 @@ internal static void OnHover(GameObject go, RayEventData rayEventData) internal static void UpdateAlternateMenuOnSelectionChanged(Transform rayOrigin) { + if (rayOrigin == null) + return; + SetAlternateMenuVisibility(rayOrigin, Selection.gameObjects.Length > 0); } @@ -215,18 +213,22 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl { Rays.ForEachProxyDevice(deviceData => { + var menuHideFlags = deviceData.menuHideFlags; var alternateMenu = deviceData.alternateMenu; if (alternateMenu != null) { - var menuHideFlags = deviceData.menuHideFlags; - var flags = deviceData.menuHideFlags[alternateMenu]; - deviceData.menuHideFlags[alternateMenu] = (deviceData.rayOrigin == rayOrigin) && visible ? flags & ~MenuHideFlags.Hidden : flags | MenuHideFlags.Hidden; + var alternateMenuFlags = menuHideFlags[alternateMenu]; + menuHideFlags[alternateMenu] = (deviceData.rayOrigin == rayOrigin) && visible ? alternateMenuFlags & ~MenuHideFlags.Hidden : alternateMenuFlags | MenuHideFlags.Hidden; - var customMenu = deviceData.customMenu; - // Show custom menu if overridden - if (customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) != 0 - && menuHideFlags[deviceData.mainMenu] != 0 && alternateMenu != null && menuHideFlags[alternateMenu] != 0) - menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; + if ((menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) != 0) + { + var customMenu = deviceData.customMenu; + + if (customMenu != null && (menuHideFlags[deviceData.mainMenu] & MenuHideFlags.Hidden) != 0) + { + menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; + } + } } }); } @@ -241,6 +243,8 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform var customMenu = deviceData.customMenu; var alternateMenu = deviceData.alternateMenu; var menuHideFlags = deviceData.menuHideFlags; + var alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; + if (deviceData.rayOrigin == rayOrigin) { menuHideFlags[mainMenu] ^= MenuHideFlags.Hidden; @@ -250,9 +254,9 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform { menuHideFlags[mainMenu] |= MenuHideFlags.Hidden; + var customMenuOverridden = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) != 0; // Move alternate menu if overriding custom menu - if (customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) != 0 - && alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0) + if (customMenuOverridden && alternateMenuVisible) { foreach (var otherDeviceData in evr.m_DeviceData) { @@ -264,6 +268,11 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform } } } + + alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; + var mainMenuVisible = (menuHideFlags[mainMenu] & MenuHideFlags.Hidden) == 0; + if (customMenu != null && !alternateMenuVisible && !mainMenuVisible) + menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; } } } From 0b7f2591f47cdf2de02dc92276d3b1f4451f1c4b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 00:40:09 -0700 Subject: [PATCH 485/870] Hide menus when ray is involved in direct selection --- Scripts/Core/EditorVR.Menus.cs | 41 +++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 0adf07961..8b746fa53 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -26,10 +26,12 @@ internal enum MenuHideFlags Hidden = 1 << 0, OverUI = 1 << 1, OverWorkspace = 1 << 2, - Overridden = 1 << 3 + Overridden = 1 << 3, + HasDirectSelection = 1 << 4 } const float k_MenuHideMargin = 0.8f; + const float k_TwoHandHideDistance = 0.25f; readonly Dictionary m_SettingsMenuProviders = new Dictionary(); List m_MainMenuTools; @@ -101,9 +103,8 @@ internal void UpdateMenuVisibilities() var mainMenuVisible = mainMenu != null && (menuHideFlags[mainMenu] & MenuHideFlags.Hidden) == 0; var customMenuVisible = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Hidden) == 0 && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) == 0; var alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; - var hasDirectSelection = directSelection != null && directSelection.GetHeldObjects(deviceData.rayOrigin) != null; - if (alternateMenuVisible && (mainMenuVisible || customMenuVisible || hasDirectSelection)) + if (alternateMenuVisible && (mainMenuVisible || customMenuVisible)) { foreach (var otherDeviceData in m_ActiveDeviceData) { @@ -119,9 +120,11 @@ internal void UpdateMenuVisibilities() menuHideFlags[customMenu] |= MenuHideFlags.Overridden; var hoveringWorkspace = false; + var rayOrigin = deviceData.rayOrigin; + var rayOriginPosition = rayOrigin.position; foreach (var workspace in evr.GetModule().workspaces) { - if (workspace.outerBounds.Contains(workspace.transform.InverseTransformPoint(deviceData.rayOrigin.position))) + if (workspace.outerBounds.Contains(workspace.transform.InverseTransformPoint(rayOriginPosition))) hoveringWorkspace = true; } @@ -133,6 +136,33 @@ internal void UpdateMenuVisibilities() else deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverWorkspace; } + + var heldObjects = directSelection.GetHeldObjects(rayOrigin); + var hasDirectSelection = directSelection != null && heldObjects != null; + if (hasDirectSelection) + { + foreach (var menu in menus) + { + deviceData.menuHideFlags[menu] |= MenuHideFlags.HasDirectSelection; + } + + foreach (var otherDeviceData in m_ActiveDeviceData) + { + if (otherDeviceData == deviceData) + continue; + + var otherRayOrigin = otherDeviceData.rayOrigin; + if (directSelection.IsHovering(otherRayOrigin) || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * Viewer.GetViewerScale()) + { + var otherMenus = otherDeviceData.menuHideFlags.Keys.ToList(); + foreach (var menu in otherMenus) + { + otherDeviceData.menuHideFlags[menu] |= MenuHideFlags.HasDirectSelection; + } + break; + } + } + } } // Apply state to UI visibility @@ -149,13 +179,14 @@ internal void UpdateMenuVisibilities() Rays.UpdateRayForDevice(deviceData, deviceData.rayOrigin); } - // Reset OverUI state + // Reset Temporary states foreach (var deviceData in m_ActiveDeviceData) { var menus = deviceData.menuHideFlags.Keys.ToList(); foreach (var menu in menus) { deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverUI; + deviceData.menuHideFlags[menu] &= ~MenuHideFlags.HasDirectSelection; } } From 2bc864fb2e7aa7c8a01e1a66e0f3e4196c3e949b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 10:18:25 -0700 Subject: [PATCH 486/870] Check if m_Button is null in WorkspaceButton Some uses of this script (Workspace ZoomSlider) are set up without a button reference --- Workspaces/Common/Scripts/WorkspaceButton.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index dde29b223..7600ccabc 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -211,7 +211,8 @@ void Awake() if (m_SwapIconsOnClick && m_AlternateIconSprite) m_Button.onClick.AddListener(SwapIconSprite); - m_Button.onClick.AddListener(OnButtonClicked); + if (m_Button) + m_Button.onClick.AddListener(OnButtonClicked); } void Start() @@ -235,7 +236,8 @@ void OnDestroy() ObjectUtils.Destroy(m_ButtonMaterial); ObjectUtils.Destroy(m_ButtonMaskMaterial); - m_Button.onClick.RemoveAllListeners(); + if (m_Button) + m_Button.onClick.RemoveAllListeners(); } void OnDisable() From 9df6ccd9a750d86e490ca75e0f5956297de9484f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 10:38:02 -0700 Subject: [PATCH 487/870] Refactor IRayToNode to use extension methods --- Menus/MainMenu/MainMenu.cs | 5 ++--- Scripts/Core/EditorVR.Rays.cs | 5 +---- Scripts/Core/Interfaces/IRayToNode.cs | 12 +++++++++++- .../FunctionalityInjection/IControlHaptics.cs | 1 - Scripts/ListView/ListViewControllerBase.cs | 4 ++++ .../Modules/SelectionModule/SelectionModule.cs | 3 +-- Tools/TransformTool/TransformTool.cs | 6 ++---- Workspaces/Base/Workspace.cs | 15 +++++++-------- Workspaces/Common/Scripts/WorkspaceButton.cs | 3 --- 9 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index ce49066cd..ce78cd5fa 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -88,7 +88,6 @@ public bool visible public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } public Node? node { get; set; } - public Func requestNodeFromRayOrigin { get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } @@ -226,12 +225,12 @@ void UpdateToolButtons() void OnButtonClicked(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); } void OnButtonHovered(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); } void OnOpening() diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index a50a0cebb..6e65c2906 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -45,6 +45,7 @@ public Rays() IGetFieldGrabOriginMethods.getFieldGrabOriginForRayOrigin = GetFieldGrabOriginForRayOrigin; IGetPreviewOriginMethods.getPreviewOriginForRayOrigin = GetPreviewOriginForRayOrigin; IUsesRaycastResultsMethods.getFirstGameObject = GetFirstGameObject; + IRayToNodeMethods.requestNodeFromRayOrigin = RequestNodeFromRayOrigin; } internal override void OnDestroy() @@ -88,10 +89,6 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) } } - var rayToNode = obj as IRayToNode; - if (rayToNode != null) - rayToNode.requestNodeFromRayOrigin = RequestNodeFromRayOrigin; - var selectionModule = obj as SelectionModule; if (selectionModule) { diff --git a/Scripts/Core/Interfaces/IRayToNode.cs b/Scripts/Core/Interfaces/IRayToNode.cs index 8c6eb9c4a..4e6bbdec0 100644 --- a/Scripts/Core/Interfaces/IRayToNode.cs +++ b/Scripts/Core/Interfaces/IRayToNode.cs @@ -9,10 +9,20 @@ namespace UnityEditor.Experimental.EditorVR.Core /// interface IRayToNode { + } + + static class IRayToNodeMethods + { + internal static Func requestNodeFromRayOrigin { private get; set; } + /// /// Get the corresponding node for a given ray origin /// - Func requestNodeFromRayOrigin { set; } + /// The ray origin to request a node for + internal static Node? RequestNodeFromRayOrigin(this IRayToNode obj, Transform rayOrigin) + { + return requestNodeFromRayOrigin(rayOrigin); + } } } #endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs index 467ce4006..edc27648e 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs @@ -1,6 +1,5 @@ #if UNITY_EDITOR using UnityEditor.Experimental.EditorVR.Core; -using UnityEngine; namespace UnityEditor.Experimental.EditorVR { diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index 7fbef27b5..c0a4bd988 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -87,7 +87,11 @@ void Update() UpdateView(); if (m_Scrolling) + { + if (!m_ScrollPulse) + Debug.Log(this, this); this.Pulse(null, m_ScrollPulse); + } } protected abstract void Setup(); diff --git a/Scripts/Modules/SelectionModule/SelectionModule.cs b/Scripts/Modules/SelectionModule/SelectionModule.cs index 9207277ea..e3663c832 100644 --- a/Scripts/Modules/SelectionModule/SelectionModule.cs +++ b/Scripts/Modules/SelectionModule/SelectionModule.cs @@ -17,7 +17,6 @@ sealed class SelectionModule : MonoBehaviour, IUsesGameObjectLocking, ISelection public Func getGroupRoot { private get; set; } public Func overrideSelectObject { private get; set; } - public Func requestNodeFromRayOrigin { get; set; } public event Action selected; @@ -70,7 +69,7 @@ public void SelectObject(GameObject hoveredObject, Transform rayOrigin, bool mul m_SelectedObjects.Clear(); if (hoveredObject) - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_HoverPulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_HoverPulse); // Multi-Select if (multiSelect) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index fd10a571b..9239f6ff8 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -216,8 +216,6 @@ public List actions public List linkedObjects { private get; set; } - public Func requestNodeFromRayOrigin { get; set; } - void Start() { if (!this.IsSharedUpdater(this)) @@ -565,14 +563,14 @@ void Translate(Vector3 delta, Transform rayOrigin, ConstrainedAxis constraints) break; } - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_DragPulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_DragPulse); } void Rotate(Quaternion delta, Transform rayOrigin) { m_TargetRotation = delta * m_TargetRotation; - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_RotatePulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_RotatePulse); } void Scale(Vector3 delta) diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 1aad787c9..abb999218 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -124,7 +124,6 @@ public float topPanelDividerOffset public Transform leftRayOrigin { protected get; set; } public Transform rightRayOrigin { protected get; set; } - public Func requestNodeFromRayOrigin { get; set; } public virtual void Setup() { @@ -164,13 +163,13 @@ public void Close() protected virtual void OnCloseClicked(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); Close(); } protected virtual void OnResetClicked(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); this.StopCoroutine(ref m_ResetSizeCoroutine); m_ResetSizeCoroutine = StartCoroutine(AnimateResetSize()); @@ -178,7 +177,7 @@ protected virtual void OnResetClicked(Transform rayOrigin) protected void OnButtonHovered(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); } public void SetUIHighlightsVisible(bool value) @@ -272,22 +271,22 @@ public virtual void ProcessInput(ActionMapInput input, ConsumeControlDelegate co protected void OnButtonClicked(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); } void OnMoving(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_MovePulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_MovePulse); } void OnResizing(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ResizePulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ResizePulse); } void OnHoveringFrame(Transform rayOrigin) { - this.Pulse(requestNodeFromRayOrigin(rayOrigin), m_ResizePulse); + this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ResizePulse); } } } diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index 7600ccabc..eea98a826 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -1,7 +1,6 @@ #if UNITY_EDITOR using System; using System.Collections; -using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Modules; @@ -166,8 +165,6 @@ public bool alternateIconVisible public byte stencilRef { get; set; } - public Func requestNodeFromRayOrigin { get; set; } - public void InstantClearState() { this.StopCoroutine(ref m_IconHighlightCoroutine); From 496785d75db96b1f6610fd39757ba6b32e34bfd6 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 10:38:20 -0700 Subject: [PATCH 488/870] Add scroll pulse to Project workspace --- Scripts/ListView/HapticPulses/ScrollPulse.asset | 2 +- Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset | 2 +- Workspaces/ProjectWorkspace/Project.prefab | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Scripts/ListView/HapticPulses/ScrollPulse.asset b/Scripts/ListView/HapticPulses/ScrollPulse.asset index 73499bfa1..b34ee7969 100644 --- a/Scripts/ListView/HapticPulses/ScrollPulse.asset +++ b/Scripts/ListView/HapticPulses/ScrollPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: NewHapticPulse + m_Name: ScrollPulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 1 diff --git a/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset index 62bb59fde..1c0c837c0 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: WorkspaceButtonHighlight + m_Name: WorkspaceButtonHover m_EditorClassIdentifier: m_Duration: 0.005 m_Intensity: 0.175 diff --git a/Workspaces/ProjectWorkspace/Project.prefab b/Workspaces/ProjectWorkspace/Project.prefab index a5e85c0ca..642f3dce2 100644 --- a/Workspaces/ProjectWorkspace/Project.prefab +++ b/Workspaces/ProjectWorkspace/Project.prefab @@ -383,6 +383,7 @@ MonoBehaviour: m_MaxMomentum: 2 m_Templates: - {fileID: 1000014066556564, guid: 918c55469b1324d46b0c41586835ce87, type: 2} + m_ScrollPulse: {fileID: 11400000, guid: 77319cd620700db49a9223c7305480f9, type: 2} m_SettleSpeed: 0.3 m_ScrollSpeed: 0.3 m_TextMaterial: {fileID: 2100000, guid: 2569ce4f009c407448c0df4aa8d7db55, type: 2} @@ -402,6 +403,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 0} m_OrientDragPlaneToRay: 0 + m_Constraints: 0 --- !u!114 &114000011829900818 MonoBehaviour: m_ObjectHideFlags: 1 @@ -436,6 +438,7 @@ MonoBehaviour: m_MaxMomentum: 2 m_Templates: - {fileID: 1000014066556564, guid: 94a0fcdece43c184c88738ce9401f3d0, type: 2} + m_ScrollPulse: {fileID: 11400000, guid: 77319cd620700db49a9223c7305480f9, type: 2} m_SettleSpeed: 0.3 m_ScrollSpeed: 0.3 m_ScaleFactor: 0.056 @@ -471,6 +474,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 0} m_OrientDragPlaneToRay: 0 + m_Constraints: 0 --- !u!114 &114000013337603310 MonoBehaviour: m_ObjectHideFlags: 1 From 03782a8dd244c158d24f19c3b9eec2126ebe9da8 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 10:59:54 -0700 Subject: [PATCH 489/870] Make WorkspaceBase front panel a raycast target (to hide menu on hover) --- Workspaces/Base/WorkspaceBase.prefab | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index 64dccbeaf..17a811a9f 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -2455,7 +2455,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 0} - m_RaycastTarget: 0 + m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2746,9 +2746,6 @@ MonoBehaviour: m_DynamicFaceAdjustment: 1 m_CloseButton: {fileID: 114000013712785888} m_ResizeButton: {fileID: 114000012661725366} - m_ResizePulse: {fileID: 11400000, guid: daa1fd8c3e222aa4db108e0a2b0f7a7d, type: 2} - m_MovePulse: {fileID: 11400000, guid: 83427d10dc20237408e0246b4b672682, type: 2} - m_FrameHoverPulse: {fileID: 11400000, guid: 7eda595fb79c2124fb4ea55f6253a847, type: 2} --- !u!137 &137000012547310740 SkinnedMeshRenderer: m_ObjectHideFlags: 1 From 17deb1a90a048cb49c093d6ae7b319de6889e2cc Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 11:38:16 -0700 Subject: [PATCH 490/870] Keep menu hidden while both hands are scaling --- Scripts/Core/EditorVR.DirectSelection.cs | 11 +++++++++++ Scripts/Core/EditorVR.Menus.cs | 3 ++- .../IGrabObjects.cs | 0 .../IGrabObjects.cs.meta | 0 .../Interfaces/Capability/ITwoHandedScaler.cs | 19 +++++++++++++++++++ .../Capability/ITwoHandedScaler.cs.meta | 12 ++++++++++++ Tools/TransformTool/TransformTool.cs | 7 ++++++- 7 files changed, 50 insertions(+), 2 deletions(-) rename Scripts/Interfaces/{FunctionalityInjection => Capability}/IGrabObjects.cs (100%) rename Scripts/Interfaces/{FunctionalityInjection => Capability}/IGrabObjects.cs.meta (100%) create mode 100644 Scripts/Interfaces/Capability/ITwoHandedScaler.cs create mode 100644 Scripts/Interfaces/Capability/ITwoHandedScaler.cs.meta diff --git a/Scripts/Core/EditorVR.DirectSelection.cs b/Scripts/Core/EditorVR.DirectSelection.cs index 500cbf274..91168c6ac 100644 --- a/Scripts/Core/EditorVR.DirectSelection.cs +++ b/Scripts/Core/EditorVR.DirectSelection.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR && UNITY_EDITORVR using System; using System.Collections.Generic; +using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Proxies; @@ -15,6 +16,7 @@ class DirectSelection : Nested, IInterfaceConnector readonly Dictionary m_DirectSelections = new Dictionary(); readonly Dictionary> m_GrabbedObjects = new Dictionary>(); readonly List m_ObjectGrabbers = new List(); + readonly List m_TwoHandedScalers = new List(); IntersectionModule m_IntersectionModule; @@ -41,6 +43,10 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) grabObjects.objectsDropped += OnObjectsDropped; grabObjects.objectsTransferred += OnObjectsTransferred; } + + var twoHandedScaler = obj as ITwoHandedScaler; + if (twoHandedScaler != null) + m_TwoHandedScalers.Add(twoHandedScaler); } public void DisconnectInterface(object obj) @@ -89,6 +95,11 @@ internal bool IsHovering(Transform rayOrigin) return m_DirectSelections.ContainsKey(rayOrigin); } + internal bool IsScaling(Transform rayOrigin) + { + return m_TwoHandedScalers.Any(twoHandedScaler => twoHandedScaler.IsTwoHandedScaling(rayOrigin)); + } + internal void UpdateDirectSelection() { m_DirectSelections.Clear(); diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 8b746fa53..3c01613f7 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -152,7 +152,8 @@ internal void UpdateMenuVisibilities() continue; var otherRayOrigin = otherDeviceData.rayOrigin; - if (directSelection.IsHovering(otherRayOrigin) || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * Viewer.GetViewerScale()) + if (directSelection.IsHovering(otherRayOrigin) || directSelection.IsScaling(otherRayOrigin) + || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * Viewer.GetViewerScale()) { var otherMenus = otherDeviceData.menuHideFlags.Keys.ToList(); foreach (var menu in otherMenus) diff --git a/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs b/Scripts/Interfaces/Capability/IGrabObjects.cs similarity index 100% rename from Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs rename to Scripts/Interfaces/Capability/IGrabObjects.cs diff --git a/Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs.meta b/Scripts/Interfaces/Capability/IGrabObjects.cs.meta similarity index 100% rename from Scripts/Interfaces/FunctionalityInjection/IGrabObjects.cs.meta rename to Scripts/Interfaces/Capability/IGrabObjects.cs.meta diff --git a/Scripts/Interfaces/Capability/ITwoHandedScaler.cs b/Scripts/Interfaces/Capability/ITwoHandedScaler.cs new file mode 100644 index 000000000..6f8a7d014 --- /dev/null +++ b/Scripts/Interfaces/Capability/ITwoHandedScaler.cs @@ -0,0 +1,19 @@ +#if UNITY_EDITOR +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provides methods and delegates used to directly select and grab scene objects + /// + public interface ITwoHandedScaler + { + /// + /// Returns whether the given ray origin is involved in two-handed scaling + /// + /// The ray origin to check + /// + bool IsTwoHandedScaling(Transform rayOrigin); + } +} +#endif diff --git a/Scripts/Interfaces/Capability/ITwoHandedScaler.cs.meta b/Scripts/Interfaces/Capability/ITwoHandedScaler.cs.meta new file mode 100644 index 000000000..63c150589 --- /dev/null +++ b/Scripts/Interfaces/Capability/ITwoHandedScaler.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 08e37edd7c3265d4b8910fdc80844681 +timeCreated: 1477355295 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index d28239c54..d7bd85447 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISetDefaultRayVisibility, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, - ILinkedObject, IRayToNode, IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap + ILinkedObject, IRayToNode, IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -720,6 +720,11 @@ void UpdateManipulatorAction() m_ManipulatorToggleAction.tooltipText = isStandard ? "Switch to Scale Manipulator" : "Switch to Standard Manipulator"; m_ManipulatorToggleAction.icon = isStandard ? m_ScaleManipulatorIcon : m_StandardManipulatorIcon; } + + public bool IsTwoHandedScaling(Transform rayOrigin) + { + return m_Scaling && m_GrabData.Any(kvp => kvp.Value.rayOrigin == rayOrigin); + } } } #endif From aa06c021c511c4cbc82e1bf13c18147fd976d1eb Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 14:41:30 -0700 Subject: [PATCH 491/870] Remove log code; Expand coverage of m_Button null check --- Scripts/ListView/ListViewControllerBase.cs | 4 ---- Workspaces/Common/Scripts/WorkspaceButton.cs | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index c0a4bd988..7fbef27b5 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -87,11 +87,7 @@ void Update() UpdateView(); if (m_Scrolling) - { - if (!m_ScrollPulse) - Debug.Log(this, this); this.Pulse(null, m_ScrollPulse); - } } protected abstract void Setup(); diff --git a/Workspaces/Common/Scripts/WorkspaceButton.cs b/Workspaces/Common/Scripts/WorkspaceButton.cs index eea98a826..9d710c166 100644 --- a/Workspaces/Common/Scripts/WorkspaceButton.cs +++ b/Workspaces/Common/Scripts/WorkspaceButton.cs @@ -204,12 +204,14 @@ void Awake() m_OriginalIconSprite = m_Icon.sprite; - // Hookup button OnClick event if there is an alternate icon sprite set - if (m_SwapIconsOnClick && m_AlternateIconSprite) - m_Button.onClick.AddListener(SwapIconSprite); - if (m_Button) + { + // Hookup button OnClick event if there is an alternate icon sprite set + if (m_SwapIconsOnClick && m_AlternateIconSprite) + m_Button.onClick.AddListener(SwapIconSprite); + m_Button.onClick.AddListener(OnButtonClicked); + } } void Start() From c0d467b2e4102d9f4b57fb19f152c44d373ea190 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 21 Jun 2017 17:02:07 -0700 Subject: [PATCH 492/870] Only send haptic pulse for menu visibility when using activator --- Menus/MainMenu/MainMenu.cs | 11 ++--------- Menus/MainMenu/Scripts/MainMenuUI.cs | 8 -------- Scripts/Core/EditorVR.Menus.cs | 1 + Scripts/Interfaces/Entity/IMainMenu.cs | 5 +++++ 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 254f36a10..1451cd56e 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -103,8 +103,6 @@ void Start() m_MainMenuUI.visible = m_Visible; m_MainMenuUI.buttonHovered += OnButtonHovered; m_MainMenuUI.buttonClicked += OnButtonClicked; - m_MainMenuUI.opening += OnOpening; - m_MainMenuUI.closing += OnClosing; CreateFaceButtons(menuTools); CreateFaceButtons(menuWorkspaces); @@ -235,14 +233,9 @@ void OnButtonHovered(Transform rayOrigin) this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); } - void OnOpening() + public void SendVisibilityPulse() { - this.Pulse(node, m_ShowPulse); - } - - void OnClosing() - { - this.Pulse(node, m_HidePulse); + this.Pulse(node, visible ? m_HidePulse : m_ShowPulse); } } } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index f8db524a8..851abeb2d 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -177,8 +177,6 @@ float currentRotation public event Action buttonHovered; public event Action buttonClicked; - public event Action opening; - public event Action closing; void Awake() { @@ -414,9 +412,6 @@ IEnumerator AnimateShow() m_VisibilityState = VisibilityState.TransitioningIn; - if (opening != null) - opening(); - foreach (var face in m_MenuFaces) { face.Show(); @@ -458,9 +453,6 @@ IEnumerator AnimateHide() m_VisibilityState = VisibilityState.TransitioningOut; - if (closing != null) - closing(); - foreach (var face in m_MenuFaces) { face.Hide(); diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 3c01613f7..1e7887d83 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -281,6 +281,7 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform { menuHideFlags[mainMenu] ^= MenuHideFlags.Hidden; mainMenu.targetRayOrigin = targetRayOrigin; + mainMenu.SendVisibilityPulse(); } else { diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 5291fa7e9..b3de4f1f8 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -29,6 +29,11 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// The ray origin that spawned the menu and will be used for node-specific operations (e.g. selecting a tool) /// Transform targetRayOrigin { set; } + + /// + /// Send a haptic pulse indicating the menu visibility has changed + /// + void SendVisibilityPulse(); } } #endif From df71d98b3e8a1c2d121441de5eaa9abdd02d45e8 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 21 Jun 2017 17:35:25 -0700 Subject: [PATCH 493/870] Add support for intended pre-scroll HintContainer rotation & positioning --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 11 ++- .../Prefabs/PinnedToolsMenu.prefab | 78 ------------------- .../Scripts/PinnedToolsMenuUI.cs | 26 +++++-- 3 files changed, 28 insertions(+), 87 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index ceda1b31f..6499f41c4 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -194,7 +194,7 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) } float? continuedInputConsumptionStartTime; - Vector3 spatialScrollStartPosition; + Vector3 m_SpatialScrollStartPosition; Vector3? spatialDirection = null; Vector3 previousWorldPosition; float? allowSpatialScrollBeforeThisTime = null; // use to hide menu if input is consumed externally and no spatialDirection is define within a given duration @@ -236,7 +236,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { //consumeControl(pinnedToolInput.show); //m_PinnedToolsMenuUI.allButtonsVisible = true; - spatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; + m_SpatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; + Debug.LogError("Start position : " + m_SpatialScrollStartPosition + ""); allowSpatialScrollBeforeThisTime = Time.realtimeSinceStartup + kAutoHideDuration; allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; m_PinnedToolsMenuUI.spatialDragDistance = 0f; // Triggers the display of the directional hint arrows @@ -273,7 +274,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - var normalizedRepeatingPosition = processSpatialScrolling(spatialScrollStartPosition, m_PinnedToolsMenuUI.transform.position, 0.15f, true); + var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_PinnedToolsMenuUI.transform.position, 0.15f, true); if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { if (!m_PinnedToolsMenuUI.allButtonsVisible) @@ -284,7 +285,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon consumeControl(pinnedToolInput.select); } - else // User hasn't dragged beyond the trigger magnitude; spatial scrolling hasn't been activated yet + else if (allowSpatialScrollBeforeThisTime != null) // User hasn't dragged beyond the trigger magnitude; spatial scrolling hasn't been activated yet { this.Pulse(node, m_ActivationPulse); } @@ -320,6 +321,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // TODO refact into ISpatialScrolling interface; allow axis locking/selection/isolation float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, bool velocitySensitive) { + Debug.LogError("Start position : " + startingPosition + " - Current Position : " + currentPosition); var normalizedLoopingPosition = 0f; var directionVector = currentPosition - startingPosition; const float kMaxFineTuneVelocity = 0.0005f; @@ -332,6 +334,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, if (dragAmount > kNewDirectionVectorThreshold) { spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton + Debug.LogError("" + spatialDirection + ""); m_PinnedToolsMenuUI.spatialDirectionVector = spatialDirection; } } diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 079ed96e2..71e9215e9 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -52,7 +52,6 @@ GameObject: m_Component: - component: {fileID: 4886523625983604} - component: {fileID: 33107560542711044} - - component: {fileID: 65983018325267314} - component: {fileID: 23633161707023522} m_Layer: 5 m_Name: FrontArrow @@ -70,7 +69,6 @@ GameObject: m_Component: - component: {fileID: 4546751647995990} - component: {fileID: 33222025853848168} - - component: {fileID: 65797927434860724} - component: {fileID: 23590276871445402} m_Layer: 5 m_Name: BackArrow @@ -103,7 +101,6 @@ GameObject: m_Component: - component: {fileID: 4386844247658442} - component: {fileID: 33685955442159952} - - component: {fileID: 65551516500730168} - component: {fileID: 23542172210224264} m_Layer: 5 m_Name: TopArrow @@ -121,7 +118,6 @@ GameObject: m_Component: - component: {fileID: 4982260476637878} - component: {fileID: 33130744985660702} - - component: {fileID: 65418261072157146} - component: {fileID: 23020214490570890} m_Layer: 5 m_Name: LeftArrow @@ -139,7 +135,6 @@ GameObject: m_Component: - component: {fileID: 4947664076386474} - component: {fileID: 33836873376687798} - - component: {fileID: 65639477567371392} - component: {fileID: 23343159395137930} m_Layer: 5 m_Name: RightArrow @@ -157,7 +152,6 @@ GameObject: m_Component: - component: {fileID: 4254294315888650} - component: {fileID: 33152143725165046} - - component: {fileID: 65764590748995170} - component: {fileID: 23251901085109124} m_Layer: 5 m_Name: BottomArrow @@ -525,78 +519,6 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1539960486036454} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!65 &65418261072157146 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1267413807553356} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!65 &65551516500730168 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1236151594399662} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!65 &65639477567371392 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1539960486036454} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!65 &65764590748995170 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1869225334479398} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!65 &65797927434860724 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1076216916843686} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} ---- !u!65 &65983018325267314 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1010111456622354} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} - m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114000010527895234 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 2c0c34018..aed7ad96d 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -43,7 +43,8 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale bool m_RayHovered; float m_SpatialDragDistance; float m_SmoothedSpatialDragDistance; - Quaternion m_HintContentContainerRotation; + Quaternion m_HintContentContainerInitialRotation; + Quaternion m_HintContentContainerCurrentRotation; Vector3 m_HintContentWorldPosition; Quaternion m_SpatialScrollOrientation; @@ -100,9 +101,11 @@ public float spatialDragDistance m_SpatialDragDistance = 0f; m_SmoothedSpatialDragDistance = 0f; m_SpatialScrollOrientation = Quaternion.identity; - m_HintContentWorldPosition = transform.position; - m_HintContentContainerRotation = Quaternion.identity; + var currentRotation = transform.rotation.eulerAngles; + m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); this.RestartCoroutine(ref m_HintContentVisibilityCoroutine, ShowHintContent()); + m_HintContentWorldPosition = transform.position; + m_HintContentContainer.position = m_HintContentWorldPosition; } m_SpatialDragDistance = value; @@ -116,6 +119,7 @@ public Vector3? spatialDirectionVector { var orig = m_HintContentContainer.rotation; m_HintContentContainer.LookAt(value.Value); + Debug.LogError(value); m_SpatialScrollOrientation = m_HintContentContainer.rotation; m_HintContentContainer.rotation = orig; } @@ -133,15 +137,25 @@ void Awake() void Update() { + var newHintContainerRotation = m_HintContentContainerInitialRotation; if (m_SpatialDragDistance > 1f && m_SmoothedSpatialDragDistance < 1) { + // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold Debug.LogError("INSIDE rotation update loop"); m_SmoothedSpatialDragDistance = Mathf.Clamp01(m_SmoothedSpatialDragDistance += Time.unscaledDeltaTime * 1.5f); var shapedDragAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(m_SmoothedSpatialDragDistance), 6); - m_HintContentContainerRotation = Quaternion.Lerp(Quaternion.identity, m_SpatialScrollOrientation, shapedDragAmount); + m_HintContentContainerCurrentRotation = Quaternion.Lerp(m_HintContentContainerInitialRotation, m_SpatialScrollOrientation, shapedDragAmount); + newHintContainerRotation = m_HintContentContainerCurrentRotation; } + else if (Mathf.Approximately(m_SmoothedSpatialDragDistance, 1f)) + newHintContainerRotation = m_HintContentContainerCurrentRotation; + else + m_HintContentWorldPosition = Vector3.Lerp(m_HintContentWorldPosition, transform.position, Time.unscaledDeltaTime * 6); + + //Debug.LogError("Hint Container" + m_HintContentContainerInitialRotation); + //Debug.LogError("UI" + transform.rotation); - m_HintContentContainer.rotation = m_HintContentContainerRotation; + m_HintContentContainer.rotation = newHintContainerRotation; m_HintContentContainer.position = m_HintContentWorldPosition; } @@ -498,6 +512,7 @@ void OnButtonHover() IEnumerator ShowHintContent() { + m_HintContentContainer.gameObject.SetActive(true); var currentScale = m_HintContentContainer.localScale; var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals var targetScale = Vector3.one; @@ -528,6 +543,7 @@ IEnumerator HideHintContent() m_HintContentContainer.localScale = targetScale; m_HintContentVisibilityCoroutine = null; + m_HintContentContainer.gameObject.SetActive(false); } } } From 0c1ffd0f091ac3bb76713adcf9cb57d2770c5c0d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 21 Jun 2017 19:09:55 -0700 Subject: [PATCH 494/870] Set AlternateMenuOrigin as source for world position vector projection changes --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 9 +++++---- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 6499f41c4..a9723b983 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Text; +using NUnit.Framework.Internal.Filters; using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; @@ -236,7 +237,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { //consumeControl(pinnedToolInput.show); //m_PinnedToolsMenuUI.allButtonsVisible = true; - m_SpatialScrollStartPosition = m_PinnedToolsMenuUI.transform.position; + m_SpatialScrollStartPosition = m_AlternateMenuOrigin.position; Debug.LogError("Start position : " + m_SpatialScrollStartPosition + ""); allowSpatialScrollBeforeThisTime = Time.realtimeSinceStartup + kAutoHideDuration; allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; @@ -274,7 +275,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_PinnedToolsMenuUI.transform.position, 0.15f, true); + var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.15f, true); if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { if (!m_PinnedToolsMenuUI.allButtonsVisible) @@ -321,7 +322,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // TODO refact into ISpatialScrolling interface; allow axis locking/selection/isolation float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, bool velocitySensitive) { - Debug.LogError("Start position : " + startingPosition + " - Current Position : " + currentPosition); + //Debug.LogError("Start position : " + startingPosition + " - Current Position : " + currentPosition); var normalizedLoopingPosition = 0f; var directionVector = currentPosition - startingPosition; const float kMaxFineTuneVelocity = 0.0005f; @@ -334,7 +335,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, if (dragAmount > kNewDirectionVectorThreshold) { spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton - Debug.LogError("" + spatialDirection + ""); + Debug.LogError("" + spatialDirection.Value.ToString("F4") + ""); m_PinnedToolsMenuUI.spatialDirectionVector = spatialDirection; } } diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index aed7ad96d..30c607606 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -9,6 +9,7 @@ using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using System.Text; namespace UnityEditor.Experimental.EditorVR.Menus { @@ -119,8 +120,8 @@ public Vector3? spatialDirectionVector { var orig = m_HintContentContainer.rotation; m_HintContentContainer.LookAt(value.Value); - Debug.LogError(value); - m_SpatialScrollOrientation = m_HintContentContainer.rotation; + Debug.LogError(value.Value.ToString("F4")); + m_SpatialScrollOrientation = Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); m_HintContentContainer.rotation = orig; } } @@ -141,7 +142,7 @@ void Update() if (m_SpatialDragDistance > 1f && m_SmoothedSpatialDragDistance < 1) { // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold - Debug.LogError("INSIDE rotation update loop"); + //Debug.LogError("INSIDE rotation update loop"); m_SmoothedSpatialDragDistance = Mathf.Clamp01(m_SmoothedSpatialDragDistance += Time.unscaledDeltaTime * 1.5f); var shapedDragAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(m_SmoothedSpatialDragDistance), 6); m_HintContentContainerCurrentRotation = Quaternion.Lerp(m_HintContentContainerInitialRotation, m_SpatialScrollOrientation, shapedDragAmount); From 80e06ed1c45b4c21c40ca3f6d2cbfc7c49b9670c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 00:27:22 -0700 Subject: [PATCH 495/870] Fix more edge cases --- Menus/MainMenu/MainMenu.cs | 3 ++- Scripts/Core/EditorVR.Menus.cs | 23 +++++++-------------- Scripts/Core/EditorVR.Rays.cs | 14 ++++++++----- Scripts/Core/EditorVR.cs | 3 --- Scripts/Proxies/DefaultProxyRay.cs | 10 ++++++++- Tools/SelectionTool/SelectionTool.cs | 8 ++++++- Tools/TransformTool/TransformTool.cs | 7 ++++++- Workspaces/Base/Workspace.cs | 31 ++++++++++++++++++---------- 8 files changed, 61 insertions(+), 38 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 1451cd56e..e11fcee57 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -11,7 +11,8 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IControlHaptics, IUsesNode, IRayToNode + sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, + ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IControlHaptics, IUsesNode, IRayToNode { public ActionMap actionMap { get {return m_MainMenuActionMap; } } [SerializeField] diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 1e7887d83..74d58c454 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -124,7 +124,10 @@ internal void UpdateMenuVisibilities() var rayOriginPosition = rayOrigin.position; foreach (var workspace in evr.GetModule().workspaces) { - if (workspace.outerBounds.Contains(workspace.transform.InverseTransformPoint(rayOriginPosition))) + var workspaceTransform = workspace.transform; + var localPosition = workspaceTransform.InverseTransformPoint(rayOriginPosition); + var localPointerPosition = workspaceTransform.InverseTransformPoint(GetPointerPositionForRayOrigin(rayOrigin)); + if (workspace.outerBounds.Contains(localPosition) || workspace.outerBounds.Contains(localPointerPosition)) hoveringWorkspace = true; } @@ -138,7 +141,7 @@ internal void UpdateMenuVisibilities() } var heldObjects = directSelection.GetHeldObjects(rayOrigin); - var hasDirectSelection = directSelection != null && heldObjects != null; + var hasDirectSelection = directSelection != null && heldObjects != null && heldObjects.Count > 0; if (hasDirectSelection) { foreach (var menu in menus) @@ -194,19 +197,9 @@ internal void UpdateMenuVisibilities() evr.GetModule().UpdatePlayerHandleMaps(); } - internal static void OnUIHoverStarted(GameObject go, RayEventData rayEventData) + static Vector3 GetPointerPositionForRayOrigin(Transform rayOrigin) { - OnHover(go, rayEventData); - } - - internal static void OnUIHovering(GameObject go, RayEventData rayEventData) - { - OnHover(go, rayEventData); - } - - internal static void OnUIHoverEnded(GameObject go, RayEventData rayEventData) - { - OnHover(go, rayEventData); + return rayOrigin.position + rayOrigin.forward * DirectSelection.GetPointerLength(rayOrigin); } internal static void OnHover(GameObject go, RayEventData rayEventData) @@ -400,7 +393,7 @@ static bool IsMainMenuVisible(Transform rayOrigin) foreach (var deviceData in evr.m_DeviceData) { if (deviceData.rayOrigin == rayOrigin) - return deviceData.mainMenu.visible; + return (deviceData.menuHideFlags[deviceData.mainMenu] & MenuHideFlags.Hidden) == 0; } return false; diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index fe1366326..238155088 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -204,16 +204,20 @@ void OnProxyActiveChanged(IProxy proxy) // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => { - if (!source.draggedObject && evr.GetNestedModule().IsHovering(source.rayOrigin)) - return false; - - if (deviceData.mainMenu.visible && source.hoveredObject) + if ((deviceData.menuHideFlags[deviceData.mainMenu] & Menus.MenuHideFlags.Hidden) == 0) { - Menus.OnHover(source.hoveredObject, source.eventData); + if (source.hoveredObject) + { + Menus.OnHover(source.hoveredObject, source.eventData); + return true; + } return false; } + if (!source.draggedObject && evr.GetNestedModule().IsHovering(source.rayOrigin)) + return false; + return true; }); } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index a93c4956f..29935ac12 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -127,9 +127,6 @@ void Awake() AddModule(); var multipleRayInputModule = GetModule(); - multipleRayInputModule.rayEntered += Menus.OnUIHoverStarted; - multipleRayInputModule.rayHovering += Menus.OnUIHovering; - multipleRayInputModule.rayExited += Menus.OnUIHoverEnded; var dragAndDropModule = AddModule(); multipleRayInputModule.rayEntered += dragAndDropModule.OnRayEntered; diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 61ec6c550..32ff63efc 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -27,6 +27,7 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale Coroutine m_RayVisibilityCoroutine; Coroutine m_ConeVisibilityCoroutine; Material m_RayMaterial; + float m_LastPointerLength; /// /// The object that is set when LockRay is called while the ray is unlocked. @@ -67,7 +68,14 @@ public bool UnlockRay(object unlockCaller) /// public float pointerLength { - get { return (m_Cone.transform.TransformPoint(m_Cone.sharedMesh.bounds.size.z * Vector3.forward) - m_Cone.transform.position).magnitude; } + get + { + if (!coneVisible || m_ConeVisibilityCoroutine != null) + return m_LastPointerLength; + + m_LastPointerLength = (m_Cone.transform.TransformPoint(m_Cone.sharedMesh.bounds.size.z * Vector3.forward) - m_Cone.transform.position).magnitude; + return m_LastPointerLength; + } } public bool rayVisible { get; private set; } diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 053e7a15a..1e5542c0d 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject, IUsesNode, IIsRayActive + ICanGrabObject, IUsesNode, IIsRayActive, IIsMainMenuVisible { [SerializeField] ActionMap m_ActionMap; @@ -103,6 +103,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (selectionTool == null) continue; + if (!selectionTool.IsActive()) + continue; + var selectionToolInput = selectionTool.m_Input; // Only overwrite an existing selection if it does not contain the hovered object @@ -190,6 +193,9 @@ bool IsActive() if (!this.IsRayActive(rayOrigin)) return false; + if (this.IsMainMenuVisible(rayOrigin)) + return false; + return true; } diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index d7bd85447..9055ebce4 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -12,7 +12,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISetDefaultRayVisibility, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, - ILinkedObject, IRayToNode, IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler + ILinkedObject, IRayToNode, IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, + IIsMainMenuVisible { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -294,6 +295,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon foreach (var kvp in directSelection) { var directRayOrigin = kvp.Key; + + if (m_GrabData.Count == 0 && this.IsMainMenuVisible(directRayOrigin)) + continue; + var directSelectionData = kvp.Value; var directHoveredObject = directSelectionData.gameObject; diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index abb999218..bf9bc88de 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -9,7 +9,8 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStencilRef, IConnectInterfaces, IUsesViewerScale, IControlHaptics, IRayToNode + abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStencilRef, IConnectInterfaces, + IUsesViewerScale, IControlHaptics, IRayToNode { const float k_MaxFrameSize = 100f; // Because BlendShapes cap at 100, our workspace maxes out at 100m wide @@ -40,9 +41,6 @@ abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStenc [SerializeField] HapticPulse m_MovePulse; - [SerializeField] - HapticPulse m_FrameHoverPulse; - Bounds m_ContentBounds; Coroutine m_VisibilityCoroutine; @@ -61,12 +59,13 @@ public Bounds contentBounds { if (!value.Equals(contentBounds)) { - Vector3 size = value.size; + m_ContentBounds = value; + var size = value.size; size.x = Mathf.Clamp(Mathf.Max(size.x, minBounds.x), 0, k_MaxFrameSize); size.y = Mathf.Max(size.y, minBounds.y); size.z = Mathf.Clamp(Mathf.Max(size.z, minBounds.z), 0, k_MaxFrameSize); + m_ContentBounds.size = size; - m_ContentBounds.size = size; //Only set size, ignore center. UpdateBounds(); OnBoundsChanged(); } @@ -77,11 +76,11 @@ public Bounds outerBounds { get { - const float kOuterBoundsCenterOffset = 0.225f; //Amount to lower the center of the outerBounds for better interaction with menus - return new Bounds(contentBounds.center + Vector3.down * kOuterBoundsCenterOffset, + const float kOuterBoundsCenterOffset = 0.09275f; //Amount to extend the bounds to include frame + return new Bounds(contentBounds.center + Vector3.down * kOuterBoundsCenterOffset * 0.5f, new Vector3( contentBounds.size.x, - contentBounds.size.y, + contentBounds.size.y + kOuterBoundsCenterOffset, contentBounds.size.z )); } @@ -142,12 +141,22 @@ public virtual void Setup() m_WorkspaceUI.leftRayOrigin = leftRayOrigin; m_WorkspaceUI.rightRayOrigin = rightRayOrigin; - m_WorkspaceUI.resize += bounds => { contentBounds = bounds; }; + m_WorkspaceUI.resize += bounds => + { + var size = contentBounds.size; + var boundsSize = bounds.size; + size.x = boundsSize.x; + size.z = boundsSize.z; + var content = contentBounds; + content.size = size; + contentBounds = content; + }; m_WorkspaceUI.sceneContainer.transform.localPosition = Vector3.zero; + var startingBounds = m_CustomStartingBounds ?? DefaultBounds; //Do not set bounds directly, in case OnBoundsChanged requires Setup override to complete - m_ContentBounds = new Bounds(Vector3.up * DefaultBounds.y * 0.5f, m_CustomStartingBounds ?? DefaultBounds); // If custom bounds have been set, use them as the initial bounds + m_ContentBounds = new Bounds(Vector3.up * startingBounds.y * 0.5f, startingBounds); // If custom bounds have been set, use them as the initial bounds UpdateBounds(); this.StopCoroutine(ref m_VisibilityCoroutine); From 3ff4575eb7a7537f835bca87b224c9267c25f5a6 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 12:52:56 -0700 Subject: [PATCH 496/870] Bring back object selection in direct selection --- Scripts/Core/EditorVR.MiniWorlds.cs | 16 +++++++++- .../FunctionalityInjection/IIsInMiniWorld.cs | 28 +++++++++++++++++ .../IIsInMiniWorld.cs.meta | 12 +++++++ Tools/SelectionTool/SelectionTool.cs | 31 ++++++++++++++----- 4 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs.meta diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index 28c600797..21bb783a9 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -13,7 +13,8 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - class MiniWorlds : Nested, ILateBindInterfaceMethods, IPlaceSceneObjects, IUsesViewerScale, IUsesSpatialHash + class MiniWorlds : Nested, ILateBindInterfaceMethods, IPlaceSceneObjects, IUsesViewerScale, + IUsesSpatialHash { internal class MiniWorldRay { @@ -181,6 +182,19 @@ public void UpdatePreview() public MiniWorlds() { EditorApplication.hierarchyWindowChanged += OnHierarchyChanged; + IIsInMiniWorldMethods.isInMiniWorld = IsInMiniWorld; + } + + bool IsInMiniWorld(Transform rayOrigin) + { + foreach (var miniWorld in m_Worlds) + { + var rayOriginPosition = rayOrigin.position; + var pointerPosition = rayOriginPosition + rayOrigin.forward * DirectSelection.GetPointerLength(rayOrigin); + if (miniWorld.Contains(rayOrigin.position) || miniWorld.Contains(pointerPosition)) + return true; + } + return false; } internal override void OnDestroy() diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs b/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs new file mode 100644 index 000000000..58bcbd990 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs @@ -0,0 +1,28 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provides access to checks that can test whether a ray is active + /// + public interface IIsInMiniWorld + { + } + + public static class IIsInMiniWorldMethods + { + internal static Func isInMiniWorld { get; set; } + + /// + /// Returns whether the specified ray is contained in a miniworld + /// + /// The rayOrigin that is being checked + public static bool IsInMiniWorld(this IIsInMiniWorld obj, Transform rayOrigin) + { + return isInMiniWorld(rayOrigin); + } + } +} +#endif \ No newline at end of file diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs.meta new file mode 100644 index 000000000..350817e1a --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f2daa5c29544fca4eab8543643094eb7 +timeCreated: 1489789739 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 1e5542c0d..7c9a014e9 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject, IUsesNode, IIsRayActive, IIsMainMenuVisible + ICanGrabObject, IUsesNode, IIsRayActive, IIsMainMenuVisible, IIsInMiniWorld { [SerializeField] ActionMap m_ActionMap; @@ -45,7 +45,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var selectionTool = (SelectionTool)linkedObject; var selectionRayOrigin = selectionTool.rayOrigin; - if (!selectionTool.IsActive()) + if (!selectionTool.IsRayActive()) continue; var hover = this.GetFirstGameObject(selectionRayOrigin); @@ -103,7 +103,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (selectionTool == null) continue; - if (!selectionTool.IsActive()) + if (!selectionTool.IsDirectActive()) continue; var selectionToolInput = selectionTool.m_Input; @@ -127,7 +127,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - if (!IsActive()) + if (!IsRayActive()) return; var selectionInput = (SelectionInput)input; @@ -182,20 +182,37 @@ bool GetSelectionCandidate(ref GameObject hoveredObject) return true; } - bool IsActive() + bool IsDirectActive() { if (rayOrigin == null) return false; - if (this.IsHoveringOverUI(rayOrigin)) + if (this.IsInMiniWorld(rayOrigin)) + return true; + + if (this.IsMainMenuVisible(rayOrigin)) return false; - if (!this.IsRayActive(rayOrigin)) + return true; + } + + bool IsRayActive() + { + if (rayOrigin == null) + return false; + + if (this.IsHoveringOverUI(rayOrigin)) return false; if (this.IsMainMenuVisible(rayOrigin)) return false; + if (this.IsInMiniWorld(rayOrigin)) + return false; + + if (!this.IsRayActive(rayOrigin)) + return false; + return true; } From 8108c29d9ee38ce95e9f29db0efc04309e77edf1 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 13:27:38 -0700 Subject: [PATCH 497/870] Set ray and highlight color to SelectionOutline from editor Preferences; Remove rule about highlighting selected objects on hover --- .../HighlightModule/HighlightModule.cs | 25 ++++++++++++----- Scripts/Proxies/DefaultProxyRay.cs | 1 + Scripts/Utilities/MaterialUtils.cs | 27 +++++++++++++++++++ 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs b/Scripts/Modules/HighlightModule/HighlightModule.cs index e39ba1978..531546e2c 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -2,12 +2,15 @@ using System; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Modules { sealed class HighlightModule : MonoBehaviour, IUsesGameObjectLocking { + const string k_SelectionOutlinePrefsKey = "Scene/Selected Outline"; + [SerializeField] Material m_DefaultHighlightMaterial; @@ -29,12 +32,26 @@ public event Func customHighlight public Color leftColor { - get { return m_LeftHighlightMaterial.color; } + get { return m_LeftHighlightMaterial.GetVector("_Color"); } } public Color rightColor { - get { return m_RightHighlightMaterial.color; } + get { return m_RightHighlightMaterial.GetVector("_Color"); } + } + + void Awake() + { + if (EditorPrefs.HasKey(k_SelectionOutlinePrefsKey)) + { + var selectionColor = MaterialUtils.PrefToColor(EditorPrefs.GetString(k_SelectionOutlinePrefsKey)); + selectionColor.a = 1; + + m_LeftHighlightMaterial = Instantiate(m_LeftHighlightMaterial); + m_LeftHighlightMaterial.color = selectionColor.gamma; + m_RightHighlightMaterial = Instantiate(m_RightHighlightMaterial); + m_RightHighlightMaterial.color = selectionColor.gamma; + } } void LateUpdate() @@ -118,10 +135,6 @@ public void SetHighlight(GameObject go, bool active, Transform rayOrigin = null, if (active) // Highlight { - // Do not highlight if the selection contains this object or any of its parents - if (!force && Selection.transforms.Any(selection => go.transform == selection || go.transform.IsChildOf(selection))) - return; - HashSet gameObjects; if (!m_Highlights.TryGetValue(material, out gameObjects)) { diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 32ff63efc..174b46c2b 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -145,6 +145,7 @@ public void SetLength(float length) public void SetColor(Color c) { + m_LineRenderer.SetColors(c, c); m_RayMaterial.color = c; } diff --git a/Scripts/Utilities/MaterialUtils.cs b/Scripts/Utilities/MaterialUtils.cs index c8d8903a3..dd469cc21 100644 --- a/Scripts/Utilities/MaterialUtils.cs +++ b/Scripts/Utilities/MaterialUtils.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System.Globalization; using UnityEngine; using UnityEngine.UI; using Random = UnityEngine.Random; @@ -69,6 +70,32 @@ public static Color HexToColor(string hex) return new Color32(r, g, b, a); } + public static Color PrefToColor(string pref) + { + string[] split = pref.Split(';'); + if (split.Length != 5) + { + Debug.LogError("Parsing PrefColor failed"); + return default(Color); + } + + split[1] = split[1].Replace(',', '.'); + split[2] = split[2].Replace(',', '.'); + split[3] = split[3].Replace(',', '.'); + split[4] = split[4].Replace(',', '.'); + float r, g, b, a; + bool success = float.TryParse(split[1], NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat, out r); + success &= float.TryParse(split[2], NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat, out g); + success &= float.TryParse(split[3], NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat, out b); + success &= float.TryParse(split[4], NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat, out a); + + if (success) + return new Color(r, g, b, a); + + Debug.LogError("Parsing PrefColor failed"); + return default(Color); + } + public static Color RandomColor() { var r = Random.value; From 7d6449addcee76490b75a359cd3a7951383e7a41 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 15:13:43 -0700 Subject: [PATCH 498/870] Refactor ButtonData class to use a constructor which filters name strings; Fix documentation on ISettingsMenuItemProvider --- Menus/MainMenu/MainMenu.cs | 27 ++++--------------- Menus/MainMenu/Scripts/MainMenuUI.cs | 8 +++++- .../Interfaces/ISettingsMenuItemProvider.cs | 2 +- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 411bd8140..f6050f4ab 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -171,9 +171,8 @@ void CreateFaceButtons(List types) { tooltip = customMenuAttribute.tooltip; - buttonData = new MainMenuUI.ButtonData + buttonData = new MainMenuUI.ButtonData(customMenuAttribute.name) { - name = customMenuAttribute.name, sectionName = customMenuAttribute.sectionName, description = customMenuAttribute.description }; @@ -182,7 +181,7 @@ void CreateFaceButtons(List types) if (isTool) { if (buttonData == null) - buttonData = new MainMenuUI.ButtonData { name = type.Name.Replace("Tool", string.Empty) }; + buttonData = new MainMenuUI.ButtonData(type.Name); CreateFaceButton(buttonData, tooltip, () => { @@ -198,13 +197,7 @@ void CreateFaceButtons(List types) { // For workspaces that haven't specified a custom attribute, do some menu categorization automatically if (buttonData == null) - { - buttonData = new MainMenuUI.ButtonData - { - name = type.Name.Replace("Workspace", string.Empty), - sectionName = "Workspaces" - }; - } + buttonData = new MainMenuUI.ButtonData(type.Name) { sectionName = "Workspaces" }; CreateFaceButton(buttonData, tooltip, () => { @@ -221,12 +214,7 @@ void CreateFaceButtons(List types) { var menuProvider = providerPair.Value; if (buttonData == null) - { - buttonData = new MainMenuUI.ButtonData - { - name = type.Name.Replace("Tool", string.Empty).Replace("Module", string.Empty) - }; - } + buttonData = new MainMenuUI.ButtonData(type.Name); buttonData.sectionName = "Settings"; @@ -247,12 +235,7 @@ void CreateFaceButtons(List types) { var itemProvider = providerPair.Value; if (buttonData == null) - { - buttonData = new MainMenuUI.ButtonData - { - name = type.Name.Replace("Tool", string.Empty).Replace("Module", string.Empty) - }; - } + buttonData = new MainMenuUI.ButtonData(type.Name); buttonData.sectionName = "Settings"; diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 0dd6ae4da..2758545ed 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -14,9 +14,15 @@ sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IConnectInterfaces { public class ButtonData { - public string name { get; set; } + public string name { get; private set; } public string sectionName { get; set; } public string description { get; set; } + + public ButtonData(string name) + { + this.name = name.Replace("Tool", string.Empty).Replace("Module", string.Empty) + .Replace("Workspace", string.Empty); + } } enum RotationState diff --git a/Scripts/Interfaces/ISettingsMenuItemProvider.cs b/Scripts/Interfaces/ISettingsMenuItemProvider.cs index 08a296451..34941d999 100644 --- a/Scripts/Interfaces/ISettingsMenuItemProvider.cs +++ b/Scripts/Interfaces/ISettingsMenuItemProvider.cs @@ -4,7 +4,7 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Decorates types that can provide a sub-menu on the Settings menu. The class should also use a MainMenuItemAttribute + /// Decorates types that can provide an item on the Settings menu /// public interface ISettingsMenuItemProvider { From ff85871e089c8543b0ff045b30ba78cbd860c738 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 16:17:47 -0700 Subject: [PATCH 499/870] Refactor MainMenu button creation; Refactor types list to use Linq for SettingsMenuProviders --- Menus/MainMenu/MainMenu.cs | 35 ++++++++-------------------- Menus/MainMenu/Scripts/MainMenuUI.cs | 10 ++++---- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index f6050f4ab..28a47ce27 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -112,15 +112,8 @@ void Start() var types = new HashSet(); types.UnionWith(menuTools); types.UnionWith(menuWorkspaces); - foreach (var provider in settingsMenuProviders.Keys) - { - types.Add(provider.Key); - } - - foreach (var provider in settingsMenuItemProviders.Keys) - { - types.Add(provider.Key); - } + types.UnionWith(settingsMenuProviders.Keys.Select(provider => provider.Key)); + types.UnionWith(settingsMenuItemProviders.Keys.Select(provider => provider.Key)); CreateFaceButtons(types.ToList()); m_MainMenuUI.SetupMenuFaces(); @@ -239,13 +232,7 @@ void CreateFaceButtons(List types) buttonData.sectionName = "Settings"; - m_MainMenuUI.CreateCustomButton(itemProvider.settingsMenuItemPrefab, buttonData, b => - { - itemProvider.settingsMenuItemInstance = b; - var mainMenuButton = b.GetComponent(); - if (mainMenuButton) - mainMenuButton.tooltip = tooltip; - }); + itemProvider.settingsMenuItemInstance = m_MainMenuUI.CreateCustomButton(itemProvider.settingsMenuItemPrefab, buttonData); } } } @@ -254,17 +241,15 @@ void CreateFaceButtons(List types) void CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action buttonClickCallback) { - m_MainMenuUI.CreateFaceButton(buttonData, b => + var mainMenuButton = m_MainMenuUI.CreateFaceButton(buttonData); + mainMenuButton.button.onClick.RemoveAllListeners(); + mainMenuButton.button.onClick.AddListener(() => { - b.button.onClick.RemoveAllListeners(); - b.button.onClick.AddListener(() => - { - if (visible) - buttonClickCallback(); - }); - - b.tooltip = tooltip; + if (visible) + buttonClickCallback(); }); + + mainMenuButton.tooltip = tooltip; } void UpdateToolButtons() diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 2758545ed..c03a317c3 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -246,12 +246,11 @@ void OnDestroy() ObjectUtils.Destroy(face.gameObject); } - public void CreateFaceButton(ButtonData buttonData, Action buttonCreationCallback) + public MainMenuButton CreateFaceButton(ButtonData buttonData) { var button = ObjectUtils.Instantiate(m_ButtonTemplatePrefab.gameObject); button.name = buttonData.name; var mainMenuButton = button.GetComponent(); - buttonCreationCallback(mainMenuButton); mainMenuButton.clicked += OnButtonClick; mainMenuButton.hovered += OnButtonHover; @@ -271,13 +270,14 @@ public void CreateFaceButton(ButtonData buttonData, Action butto { m_FaceButtons.Add(buttonData.sectionName, new List { button.transform }); } + + return mainMenuButton; } - public void CreateCustomButton(GameObject prefab, ButtonData buttonData, Action buttonCreationCallback) + public GameObject CreateCustomButton(GameObject prefab, ButtonData buttonData) { var button = ObjectUtils.Instantiate(prefab); button.name = buttonData.name; - buttonCreationCallback(button); if (string.IsNullOrEmpty(buttonData.sectionName)) buttonData.sectionName = k_UncategorizedFaceName; @@ -292,6 +292,8 @@ public void CreateCustomButton(GameObject prefab, ButtonData buttonData, Action< { m_FaceButtons.Add(buttonData.sectionName, new List { button.transform }); } + + return button; } public void SetupMenuFaces() From ba03b000706774813940af98fbc80c4ba1597425 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 17:04:11 -0700 Subject: [PATCH 500/870] Address PR comments --- Menus/MainMenu/MainMenu.cs | 6 +- Menus/MainMenu/Scripts/MainMenuUI.cs | 3 +- Menus/RadialMenu/RadialMenu.cs | 2 +- .../ListView/HapticPulses/ScrollPulse.asset | 2 +- Scripts/UI/DefaultToggleGroup.cs | 13 ++ Scripts/UI/DefaultToggleGroup.cs.meta | 12 ++ Tools/LocomotionTool/LocomotionTool.cs | 35 ++--- .../LocomotionTool/Prefabs/SettingsUI.prefab | 121 +++++++++--------- Tools/SelectionTool/SelectionTool.cs | 12 +- .../HapticPulses/WorkspaceButtonHover.asset | 2 +- 10 files changed, 122 insertions(+), 86 deletions(-) create mode 100644 Scripts/UI/DefaultToggleGroup.cs create mode 100644 Scripts/UI/DefaultToggleGroup.cs.meta diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 28a47ce27..80f7d09b5 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -14,6 +14,8 @@ namespace UnityEditor.Experimental.EditorVR.Menus sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantiateUI, ICreateWorkspace, ICustomActionMap, IUsesMenuOrigins, IUsesProxyType, IControlHaptics, IUsesNode, IRayToNode, IUsesRayOrigin { + const string k_SettingsMenuSectionName = "Settings"; + public ActionMap actionMap { get {return m_MainMenuActionMap; } } [SerializeField] ActionMap m_MainMenuActionMap; @@ -209,11 +211,11 @@ void CreateFaceButtons(List types) if (buttonData == null) buttonData = new MainMenuUI.ButtonData(type.Name); - buttonData.sectionName = "Settings"; + buttonData.sectionName = k_SettingsMenuSectionName; CreateFaceButton(buttonData, tooltip, () => { - menuProvider.settingsMenuInstance = m_MainMenuUI.AddSubmenu(buttonData.sectionName, menuProvider.settingsMenuPrefab); + menuProvider.settingsMenuInstance = m_MainMenuUI.AddSubmenu(k_SettingsMenuSectionName, menuProvider.settingsMenuPrefab); }); } } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index c03a317c3..4e1bb7d07 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -282,8 +282,7 @@ public GameObject CreateCustomButton(GameObject prefab, ButtonData buttonData) if (string.IsNullOrEmpty(buttonData.sectionName)) buttonData.sectionName = k_UncategorizedFaceName; - var found = m_FaceButtons.Any(x => x.Key == buttonData.sectionName); - if (found) + if (m_FaceButtons.Any(x => x.Key == buttonData.sectionName)) { var kvp = m_FaceButtons.First(x => x.Key == buttonData.sectionName); kvp.Value.Add(button.transform); diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index 951c5939f..387e293f2 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap, IControlHaptics, IUsesNode, IConnectInterfaces { - const float k_ActivationThreshold = 0.5f; + const float k_ActivationThreshold = 0.5f; // Do not consume thumbstick or activate menu if the control vector's magnitude is below this threshold public ActionMap actionMap { get {return m_RadialMenuActionMap; } } [SerializeField] diff --git a/Scripts/ListView/HapticPulses/ScrollPulse.asset b/Scripts/ListView/HapticPulses/ScrollPulse.asset index 73499bfa1..b34ee7969 100644 --- a/Scripts/ListView/HapticPulses/ScrollPulse.asset +++ b/Scripts/ListView/HapticPulses/ScrollPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: NewHapticPulse + m_Name: ScrollPulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 1 diff --git a/Scripts/UI/DefaultToggleGroup.cs b/Scripts/UI/DefaultToggleGroup.cs new file mode 100644 index 000000000..ebc0d4a73 --- /dev/null +++ b/Scripts/UI/DefaultToggleGroup.cs @@ -0,0 +1,13 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace UnityEditor.Experimental.EditorVR.UI +{ + sealed class DefaultToggleGroup : MonoBehaviour + { + [SerializeField] + Toggle m_DefaultToggle; + + public Toggle defaultToggle { get { return m_DefaultToggle; } } + } +} diff --git a/Scripts/UI/DefaultToggleGroup.cs.meta b/Scripts/UI/DefaultToggleGroup.cs.meta new file mode 100644 index 000000000..c00a03c9f --- /dev/null +++ b/Scripts/UI/DefaultToggleGroup.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e93c342d881ae654d8d190dda4e84c44 +timeCreated: 1498173868 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 8938eeceb..93cbde014 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; +using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -108,9 +109,10 @@ public GameObject settingsMenuItemInstance { set { + var defaultToggleGroup = value.GetComponentInChildren(); foreach (var toggle in value.GetComponentsInChildren()) { - if (toggle.isOn) + if (toggle == defaultToggleGroup.defaultToggle) { m_FlyToggle = toggle; toggle.onValueChanged.AddListener(isOn => @@ -120,16 +122,17 @@ public GameObject settingsMenuItemInstance // m_Preferences on all instances refer m_Preferences.blinkMode = !isOn; - foreach (LocomotionTool linkedObject in linkedObjects) + foreach (var linkedObject in linkedObjects) { - if (linkedObject != this) + var locomotionTool = (LocomotionTool)linkedObject; + if (locomotionTool != this) { - linkedObject.m_BlockValueChangedListener = true; + locomotionTool.m_BlockValueChangedListener = true; //linkedObject.m_ToggleGroup.NotifyToggleOn(isOn ? m_FlyToggle : m_BlinkToggle); // HACK: Toggle Group claims these toggles are not a part of the group - linkedObject.m_FlyToggle.isOn = isOn; - linkedObject.m_BlinkToggle.isOn = !isOn; - linkedObject.m_BlockValueChangedListener = false; + locomotionTool.m_FlyToggle.isOn = isOn; + locomotionTool.m_BlinkToggle.isOn = !isOn; + locomotionTool.m_BlockValueChangedListener = false; } } }); @@ -149,9 +152,9 @@ void Start() m_Preferences = new Preferences(); // Share one preferences object across all instances - foreach (LocomotionTool locomotionTool in linkedObjects) + foreach (var linkedObject in linkedObjects) { - locomotionTool.m_Preferences = m_Preferences; + ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; } } @@ -186,8 +189,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_State == State.Moving) return; - foreach (LocomotionTool locomotionTool in linkedObjects) + foreach (var linkedObject in linkedObjects) { + var locomotionTool = (LocomotionTool)linkedObject; if (locomotionTool == this) continue; @@ -353,8 +357,9 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) if (m_AllowScaling) { var otherGripHeld = false; - foreach (LocomotionTool locomotionTool in linkedObjects) + foreach (var linkedObject in linkedObjects) { + var locomotionTool = (LocomotionTool)linkedObject; if (locomotionTool == this) continue; @@ -528,9 +533,9 @@ public object OnSerializePreferences() if (this.IsSharedUpdater(this)) { // Share one preferences object across all instances - foreach (LocomotionTool locomotionTool in linkedObjects) + foreach (var linkedObject in linkedObjects) { - locomotionTool.m_Preferences = m_Preferences; + ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; } return m_Preferences; @@ -548,9 +553,9 @@ public void OnDeserializePreferences(object obj) m_Preferences = preferences; // Share one preferences object across all instances - foreach (LocomotionTool locomotionTool in linkedObjects) + foreach (var linkedObject in linkedObjects) { - locomotionTool.m_Preferences = m_Preferences; + ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; } } } diff --git a/Tools/LocomotionTool/Prefabs/SettingsUI.prefab b/Tools/LocomotionTool/Prefabs/SettingsUI.prefab index 8fc64baaf..1ab3df846 100644 --- a/Tools/LocomotionTool/Prefabs/SettingsUI.prefab +++ b/Tools/LocomotionTool/Prefabs/SettingsUI.prefab @@ -16,11 +16,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012653929454} - - 222: {fileID: 222000012891014098} - - 114: {fileID: 114000012025195674} + - component: {fileID: 224000012653929454} + - component: {fileID: 222000012891014098} + - component: {fileID: 114000012025195674} m_Layer: 5 m_Name: Label m_TagString: Untagged @@ -33,11 +33,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012493860698} - - 222: {fileID: 222000012612170110} - - 114: {fileID: 114000010706236210} + - component: {fileID: 224000012493860698} + - component: {fileID: 222000012612170110} + - component: {fileID: 114000010706236210} m_Layer: 5 m_Name: Foreground m_TagString: Untagged @@ -50,11 +50,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011405639814} - - 222: {fileID: 222000011416400564} - - 114: {fileID: 114000011583981380} + - component: {fileID: 224000011405639814} + - component: {fileID: 222000011416400564} + - component: {fileID: 114000011583981380} m_Layer: 5 m_Name: Label m_TagString: Untagged @@ -67,10 +67,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010858218954} - - 114: {fileID: 114000011920048442} + - component: {fileID: 224000010858218954} + - component: {fileID: 114000011920048442} m_Layer: 5 m_Name: Blink m_TagString: Untagged @@ -83,11 +83,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010616025136} - - 222: {fileID: 222000010570603678} - - 114: {fileID: 114000011835530144} + - component: {fileID: 224000010616025136} + - component: {fileID: 222000010570603678} + - component: {fileID: 114000011835530144} m_Layer: 5 m_Name: Foreground m_TagString: Untagged @@ -100,10 +100,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011487074538} - - 222: {fileID: 222000012862005820} + - component: {fileID: 224000011487074538} + - component: {fileID: 222000012862005820} m_Layer: 5 m_Name: SettingsUI m_TagString: Untagged @@ -116,10 +116,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011444372664} - - 114: {fileID: 114000013714903302} + - component: {fileID: 224000011444372664} + - component: {fileID: 114000013714903302} m_Layer: 5 m_Name: Fly m_TagString: Untagged @@ -132,11 +132,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013724969698} - - 222: {fileID: 222000011524760356} - - 114: {fileID: 114000011422230102} + - component: {fileID: 224000013724969698} + - component: {fileID: 222000011524760356} + - component: {fileID: 114000011422230102} m_Layer: 5 m_Name: Border m_TagString: Untagged @@ -149,12 +149,13 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011778163486} - - 222: {fileID: 222000011646980040} - - 114: {fileID: 114000013593928534} - - 114: {fileID: 114000012940195592} + - component: {fileID: 224000011778163486} + - component: {fileID: 222000011646980040} + - component: {fileID: 114000013593928534} + - component: {fileID: 114000012940195592} + - component: {fileID: 114261882201029984} m_Layer: 5 m_Name: LocomotionMode m_TagString: Untagged @@ -167,11 +168,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013716393632} - - 222: {fileID: 222000012522696328} - - 114: {fileID: 114000013077659776} + - component: {fileID: 224000013716393632} + - component: {fileID: 222000012522696328} + - component: {fileID: 114000013077659776} m_Layer: 5 m_Name: Border m_TagString: Untagged @@ -190,7 +191,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 1 @@ -218,7 +218,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: db3c88ad8f7fe11479d2d3e48c08e6f0, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -246,7 +245,6 @@ MonoBehaviour: m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -280,7 +278,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 0.10196079, g: 0.10196079, b: 0.10196079, a: 1} m_RaycastTarget: 1 @@ -308,7 +305,6 @@ MonoBehaviour: m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Navigation: m_Mode: 3 m_SelectOnUp: {fileID: 0} @@ -354,7 +350,6 @@ MonoBehaviour: m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -388,7 +383,6 @@ MonoBehaviour: m_Script: {fileID: -1184210157, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_AllowSwitchOff: 0 --- !u!114 &114000013077659776 MonoBehaviour: @@ -401,7 +395,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: db3c88ad8f7fe11479d2d3e48c08e6f0, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -429,7 +422,6 @@ MonoBehaviour: m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Padding: m_Left: 0 m_Right: 0 @@ -439,6 +431,8 @@ MonoBehaviour: m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!114 &114000013714903302 MonoBehaviour: m_ObjectHideFlags: 1 @@ -450,7 +444,6 @@ MonoBehaviour: m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Navigation: m_Mode: 3 m_SelectOnUp: {fileID: 0} @@ -485,6 +478,18 @@ MonoBehaviour: m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_IsOn: 1 +--- !u!114 &114261882201029984 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e93c342d881ae654d8d190dda4e84c44, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DefaultToggle: {fileID: 114000013714903302} --- !u!222 &222000010570603678 CanvasRenderer: m_ObjectHideFlags: 1 @@ -542,10 +547,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000010858218954} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: -0.25, y: 0} @@ -560,13 +565,13 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013716393632} - {fileID: 224000010616025136} - {fileID: 224000011405639814} m_Father: {fileID: 224000011778163486} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -581,10 +586,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000010858218954} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: -0.25, y: 0} @@ -599,13 +604,13 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013724969698} - {fileID: 224000012493860698} - {fileID: 224000012653929454} m_Father: {fileID: 224000011778163486} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -620,11 +625,11 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000011778163486} m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -639,12 +644,12 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000010858218954} - {fileID: 224000011444372664} m_Father: {fileID: 224000011487074538} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -659,10 +664,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011444372664} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0.25, y: 0} @@ -677,10 +682,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011444372664} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0.25, y: 0} @@ -695,10 +700,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000010858218954} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -713,10 +718,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011444372664} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 6b31314bb..fe2605eb3 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -118,16 +118,16 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - var selectionInput = (SelectionInput)input; - var multiSelectControl = selectionInput.multiSelect; + var multiSelectControl = m_SelectionInput.multiSelect; this.SetManipulatorsVisible(this, !multiSelectControl.isHeld); if (!IsActive()) return; var multiSelect = false; - foreach (SelectionTool selectionTool in linkedObjects) + foreach (var linkedObject in linkedObjects) { + var selectionTool = (SelectionTool)linkedObject; var toolInput = selectionTool.m_SelectionInput; if (toolInput != null && toolInput.multiSelect.isHeld) multiSelect = true; @@ -143,11 +143,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; // Capture object on press - if (selectionInput.select.wasJustPressed) + if (m_SelectionInput.select.wasJustPressed) m_PressedObject = hoveredObject; // Select button on release - if (selectionInput.select.wasJustReleased) + if (m_SelectionInput.select.wasJustReleased) { if (m_PressedObject == hoveredObject) { @@ -158,7 +158,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } if (m_PressedObject) - consumeControl(selectionInput.select); + consumeControl(m_SelectionInput.select); m_PressedObject = null; } diff --git a/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset index 62bb59fde..1c0c837c0 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: WorkspaceButtonHighlight + m_Name: WorkspaceButtonHover m_EditorClassIdentifier: m_Duration: 0.005 m_Intensity: 0.175 From 23b755b5dff467cde8bb9ffee117a5f705c70571 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 18:30:50 -0700 Subject: [PATCH 501/870] Fix serialization bug; Refactor LocomotionTool ProcessInput --- .../Modules/SerializedPreferencesModule.cs | 36 +++++---- Tools/LocomotionTool/LocomotionInput.cs | 2 +- Tools/LocomotionTool/LocomotionTool.cs | 77 +++++++++++-------- 3 files changed, 64 insertions(+), 51 deletions(-) diff --git a/Scripts/Modules/SerializedPreferencesModule.cs b/Scripts/Modules/SerializedPreferencesModule.cs index 22a9378cb..05abc25e1 100644 --- a/Scripts/Modules/SerializedPreferencesModule.cs +++ b/Scripts/Modules/SerializedPreferencesModule.cs @@ -73,29 +73,31 @@ internal string SerializePreferences() { var preferences = new SerializedPreferences(); var payloads = new Dictionary(); + + // Use the previously saved preferences as defaults + if (m_Preferences != null) + { + foreach (var serializer in m_Serializers) + { + var type = serializer.GetType(); + payloads[type] = m_Preferences.items.SingleOrDefault(pi => pi.name == type.FullName); + } + } + foreach (var serializer in m_Serializers) { var payload = serializer.OnSerializePreferences(); - SerializedPreferenceItem item = null; if (payload == null) - { - if (m_Preferences != null) - { - // Use the previously saved preferences for this serializer - item = m_Preferences.items.SingleOrDefault(pi => pi.name == serializer.GetType().FullName); - } - } - else - { - item = new SerializedPreferenceItem(); - item.name = serializer.GetType().FullName; - item.payloadType = payload.GetType().FullName; - item.payload = JsonUtility.ToJson(payload); - } + continue; - if (item != null) - payloads[serializer.GetType()] = item; + var type = serializer.GetType(); + payloads[type] = new SerializedPreferenceItem + { + name = type.FullName, + payloadType = payload.GetType().FullName, + payload = JsonUtility.ToJson(payload) + }; } preferences.items.AddRange(payloads.Values); diff --git a/Tools/LocomotionTool/LocomotionInput.cs b/Tools/LocomotionTool/LocomotionInput.cs index f46342105..2a0d9ae03 100644 --- a/Tools/LocomotionTool/LocomotionInput.cs +++ b/Tools/LocomotionTool/LocomotionInput.cs @@ -8,7 +8,7 @@ public class LocomotionInput : ActionMapInput { public LocomotionInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @blink { get { return (ButtonInputControl)this[0]; } } - public ButtonInputControl @grip { get { return (ButtonInputControl)this[1]; } } + public ButtonInputControl @crawl { get { return (ButtonInputControl)this[1]; } } public ButtonInputControl @thumb { get { return (ButtonInputControl)this[2]; } } public AxisInputControl @speed { get { return (AxisInputControl)this[3]; } } public ButtonInputControl @reverse { get { return (ButtonInputControl)this[4]; } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 93cbde014..30f8223a7 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -199,36 +199,35 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; } - DoTwoHandedScaling(consumeControl); + if (DoTwoHandedScaling(consumeControl)) + return; - if (!m_Scaling) + if (m_Preferences.blinkMode) { - if (!m_WasRotating) - DoCrawl(m_LocomotionInput); - - if (m_Preferences.blinkMode) - DoBlink(consumeControl, m_LocomotionInput); - else - DoFlying(consumeControl, m_LocomotionInput); + if (DoBlink(consumeControl, m_LocomotionInput)) + return; } else { - m_Crawling = false; + if (DoFlying(consumeControl, m_LocomotionInput)) + return; } + + DoCrawl(m_LocomotionInput); } - void DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionInput) + bool DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionInput) { var reverse = locomotionInput.reverse.isHeld; var moving = locomotionInput.forward.isHeld || reverse; if (moving) { - if (locomotionInput.grip.isHeld) + if (locomotionInput.crawl.isHeld) { var localRayRotation = Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation; var localRayForward = localRayRotation * Vector3.forward; if (Mathf.Abs(Vector3.Dot(localRayForward, Vector3.up)) > k_RotationThreshold) - return; + return true; localRayForward.y = 0; localRayForward.Normalize(); @@ -248,7 +247,7 @@ void DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionI m_LastRotationDiff = Quaternion.identity; } - consumeControl(locomotionInput.grip); + consumeControl(locomotionInput.crawl); var startOffset = m_RigStartPosition - m_CameraStartPosition; var angle = Vector3.Angle(m_RayOriginStartForward, localRayForward); @@ -284,19 +283,19 @@ void DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionI } consumeControl(locomotionInput.forward); + return true; } - else - { - if (!locomotionInput.grip.isHeld) - m_WasRotating = false; - m_Rotating = false; - } + if (!locomotionInput.crawl.isHeld) + m_WasRotating = false; + + m_Rotating = false; + return false; } - void DoCrawl(LocomotionInput locomotionInput) + bool DoCrawl(LocomotionInput locomotionInput) { - if (!locomotionInput.forward.isHeld && !locomotionInput.blink.isHeld && locomotionInput.grip.isHeld) + if (!locomotionInput.forward.isHeld && !locomotionInput.blink.isHeld && locomotionInput.crawl.isHeld) { if (!m_Crawling) { @@ -308,17 +307,15 @@ void DoCrawl(LocomotionInput locomotionInput) var localRayPosition = cameraRig.position - rayOrigin.position; cameraRig.position = m_RigStartPosition + (localRayPosition - m_RayOriginStartPosition); - // Do not consume grip control to allow passing through for multi-select - } - else - { - m_Crawling = false; + return true; } + + m_Crawling = false; + return false; } - void DoBlink(ConsumeControlDelegate consumeControl, LocomotionInput locomotionInput) + bool DoBlink(ConsumeControlDelegate consumeControl, LocomotionInput locomotionInput) { - m_Rotating = false; if (locomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; @@ -328,8 +325,10 @@ void DoBlink(ConsumeControlDelegate consumeControl, LocomotionInput locomotionIn m_BlinkVisuals.ShowVisuals(); consumeControl(locomotionInput.blink); + return true; } - else if (m_State == State.Aiming && locomotionInput.blink.wasJustReleased) + + if (m_State == State.Aiming && locomotionInput.blink.wasJustReleased) { this.UnlockRay(rayOrigin, this); this.SetDefaultRayVisibility(rayOrigin, true); @@ -345,13 +344,17 @@ void DoBlink(ConsumeControlDelegate consumeControl, LocomotionInput locomotionIn m_State = State.Inactive; } } + + return false; } - void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) + bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) { + var result = false; + if (this.IsSharedUpdater(this)) { - var grip = m_LocomotionInput.grip; + var grip = m_LocomotionInput.crawl; if (grip.isHeld) { if (m_AllowScaling) @@ -364,7 +367,7 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) continue; var otherLocomotionInput = locomotionTool.m_LocomotionInput; - var otherGrip = otherLocomotionInput.grip; + var otherGrip = otherLocomotionInput.crawl; if (otherGrip.isHeld) { otherGripHeld = true; @@ -393,11 +396,13 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) m_StartYaw = cameraRig.rotation.eulerAngles.y; locomotionTool.m_Scaling = true; + locomotionTool.m_Crawling = false; CreateViewerScaleVisuals(rayOrigin, otherRayOrigin); } m_Scaling = true; + m_Crawling = false; var currentScale = Mathf.Clamp(m_StartScale * (m_StartDistance / distance), k_MinScale, k_MaxScale); @@ -463,6 +468,8 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) Shader.SetGlobalFloat(k_WorldScaleProperty, 1f / currentScale); } + + result = true; break; } } @@ -476,6 +483,8 @@ void DoTwoHandedScaling(ConsumeControlDelegate consumeControl) CancelScale(); } } + + return result; } void ResetViewerScale() @@ -556,6 +565,8 @@ public void OnDeserializePreferences(object obj) foreach (var linkedObject in linkedObjects) { ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; + m_BlinkToggle.isOn = m_Preferences.blinkMode; + m_FlyToggle.isOn = !m_Preferences.blinkMode; } } } From 33c674b445aa9136dd426c506ac8f30f90ed2ac5 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 19:02:27 -0700 Subject: [PATCH 502/870] Cache ViewerScaleVisuals object --- Tools/LocomotionTool/LocomotionTool.cs | 25 +++++++++---------- .../Scripts/ViewerScaleVisuals.cs | 11 +++++--- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 30f8223a7..0dd5e3204 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -170,6 +170,10 @@ void Start() m_OriginalFarClipPlane = m_MainCamera.farClipPlane; Shader.SetGlobalFloat(k_WorldScaleProperty, 1); + + var viewerScaleObject = ObjectUtils.Instantiate(m_ViewerScaleVisualsPrefab, cameraRig, false); + m_ViewerScaleVisuals = viewerScaleObject.GetComponent(); + viewerScaleObject.SetActive(false); } void OnDisable() @@ -180,6 +184,9 @@ void OnDisable() void OnDestroy() { this.SetDefaultRayVisibility(rayOrigin, true); + + if (m_ViewerScaleVisuals) + ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -398,7 +405,9 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) locomotionTool.m_Scaling = true; locomotionTool.m_Crawling = false; - CreateViewerScaleVisuals(rayOrigin, otherRayOrigin); + m_ViewerScaleVisuals.leftHand = rayOrigin; + m_ViewerScaleVisuals.rightHand = otherRayOrigin; + m_ViewerScaleVisuals.gameObject.SetActive(true); } m_Scaling = true; @@ -492,16 +501,7 @@ void ResetViewerScale() cameraRig.localScale = Vector3.one; m_MainCamera.nearClipPlane = m_OriginalNearClipPlane; m_MainCamera.farClipPlane = m_OriginalFarClipPlane; - - if (m_ViewerScaleVisuals) - ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); - } - - void CreateViewerScaleVisuals(Transform leftHand, Transform rightHand) - { - m_ViewerScaleVisuals = ObjectUtils.Instantiate(m_ViewerScaleVisualsPrefab, cameraRig, false).GetComponent(); - m_ViewerScaleVisuals.leftHand = leftHand; - m_ViewerScaleVisuals.rightHand = rightHand; + m_ViewerScaleVisuals.gameObject.SetActive(false); } void CancelScale() @@ -514,8 +514,7 @@ void CancelScale() ((LocomotionTool)linkedObject).m_Scaling = false; } - if (m_ViewerScaleVisuals) - ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); + m_ViewerScaleVisuals.gameObject.SetActive(false); } IEnumerator MoveTowardTarget(Vector3 targetPosition) diff --git a/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs b/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs index 668ed0f74..7cdeba8df 100644 --- a/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs +++ b/Tools/LocomotionTool/Scripts/ViewerScaleVisuals.cs @@ -33,16 +33,21 @@ sealed class ViewerScaleVisuals : MonoBehaviour, IUsesViewerScale public Transform leftHand { private get; set; } public Transform rightHand { private get; set; } - void Start() + void Awake() { foreach (var icon in m_Icons) { - var image = ((GameObject)Instantiate(m_IconPrefab, m_IconsContainer, false)).GetComponent(); + var image = Instantiate(m_IconPrefab, m_IconsContainer, false).GetComponent(); image.sprite = icon; } m_LineWidth = m_Line.widthStart; - SetPosition(); + } + + void OnEnable() + { + if (leftHand && rightHand) + SetPosition(); } void Update() From dcbd16fbefe33253ea3ceaf4d961d5debf7080fe Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 20:09:28 -0700 Subject: [PATCH 503/870] Switch multi-select back to grip; Re-name action map controls to their actions --- Action Maps/DirectSelectInput.asset | 32 +------------------ Action Maps/DirectSelectInput.cs | 3 +- Tools/LocomotionTool/LocomotionInput.asset | 16 +++++----- Tools/LocomotionTool/LocomotionInput.cs | 4 +-- Tools/LocomotionTool/LocomotionTool.cs | 36 +++++++++++----------- Tools/SelectionTool/SelectionInput.asset | 4 +-- Tools/SelectionTool/SelectionTool.cs | 20 ++++++------ 7 files changed, 42 insertions(+), 73 deletions(-) diff --git a/Action Maps/DirectSelectInput.asset b/Action Maps/DirectSelectInput.asset index 1e847e0df..d1825c4c7 100644 --- a/Action Maps/DirectSelectInput.asset +++ b/Action Maps/DirectSelectInput.asset @@ -13,7 +13,6 @@ MonoBehaviour: m_EditorClassIdentifier: m_Actions: - {fileID: 114000012349872818} - - {fileID: 114000013014554554} - {fileID: 114000011926715790} m_ControlSchemes: - m_Name: VRInputDevice @@ -34,15 +33,6 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 - - sources: - - controlIndex: 3 - deviceKey: 1 - deadZone: 0.3 - buttonAxisSources: [] - gravity: 1000 - sensitivity: 1000 - snap: 1 - primaryIsButtonAxis: 0 - sources: - controlIndex: 18 deviceKey: 1 @@ -67,7 +57,7 @@ MonoBehaviour: m_Name: Cancel m_EditorClassIdentifier: m_ActionMap: {fileID: 11400000} - m_ActionIndex: 2 + m_ActionIndex: 1 m_ControlData: componentControlIndices: controlType: @@ -95,23 +85,3 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Select defaultValue: 0 ---- !u!114 &114000013014554554 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Multi Select - m_EditorClassIdentifier: - m_ActionMap: {fileID: 11400000} - m_ActionIndex: 1 - m_ControlData: - componentControlIndices: - controlType: - m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - name: Multi Select - defaultValue: 0 diff --git a/Action Maps/DirectSelectInput.cs b/Action Maps/DirectSelectInput.cs index 1d24e3d57..47c4a0171 100644 --- a/Action Maps/DirectSelectInput.cs +++ b/Action Maps/DirectSelectInput.cs @@ -8,7 +8,6 @@ public class DirectSelectInput : ActionMapInput { public DirectSelectInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @select { get { return (ButtonInputControl)this[0]; } } - public ButtonInputControl @multiSelect { get { return (ButtonInputControl)this[1]; } } - public ButtonInputControl @cancel { get { return (ButtonInputControl)this[2]; } } + public ButtonInputControl @cancel { get { return (ButtonInputControl)this[1]; } } } } diff --git a/Tools/LocomotionTool/LocomotionInput.asset b/Tools/LocomotionTool/LocomotionInput.asset index a370f8565..05d92178a 100644 --- a/Tools/LocomotionTool/LocomotionInput.asset +++ b/Tools/LocomotionTool/LocomotionInput.asset @@ -39,7 +39,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 3 + - controlIndex: 22 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -48,7 +48,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 22 + - controlIndex: 3 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -164,7 +164,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Thumb + m_Name: ScaleReset m_EditorClassIdentifier: m_ActionMap: {fileID: 11400000} m_ActionIndex: 2 @@ -173,7 +173,7 @@ MonoBehaviour: controlType: m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - name: Thumb + name: ScaleReset defaultValue: 0 --- !u!114 &114000013424161920 MonoBehaviour: @@ -204,7 +204,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Grip + m_Name: Crawl m_EditorClassIdentifier: m_ActionMap: {fileID: 11400000} m_ActionIndex: 1 @@ -213,7 +213,7 @@ MonoBehaviour: controlType: m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - name: Grip + name: Crawl defaultValue: 0 --- !u!114 &114022299328106344 MonoBehaviour: @@ -224,7 +224,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Trigger + m_Name: WorldReset m_EditorClassIdentifier: m_ActionMap: {fileID: 11400000} m_ActionIndex: 6 @@ -233,5 +233,5 @@ MonoBehaviour: controlType: m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - name: Trigger + name: WorldReset defaultValue: 0 diff --git a/Tools/LocomotionTool/LocomotionInput.cs b/Tools/LocomotionTool/LocomotionInput.cs index 2a0d9ae03..459acebf8 100644 --- a/Tools/LocomotionTool/LocomotionInput.cs +++ b/Tools/LocomotionTool/LocomotionInput.cs @@ -9,10 +9,10 @@ public LocomotionInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @blink { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @crawl { get { return (ButtonInputControl)this[1]; } } - public ButtonInputControl @thumb { get { return (ButtonInputControl)this[2]; } } + public ButtonInputControl @scaleReset { get { return (ButtonInputControl)this[2]; } } public AxisInputControl @speed { get { return (AxisInputControl)this[3]; } } public ButtonInputControl @reverse { get { return (ButtonInputControl)this[4]; } } public ButtonInputControl @forward { get { return (ButtonInputControl)this[5]; } } - public ButtonInputControl @trigger { get { return (ButtonInputControl)this[6]; } } + public ButtonInputControl @worldReset { get { return (ButtonInputControl)this[6]; } } } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 0dd5e3204..e6c7f7a30 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -415,18 +415,18 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var currentScale = Mathf.Clamp(m_StartScale * (m_StartDistance / distance), k_MinScale, k_MaxScale); - var thumb = m_LocomotionInput.thumb; - var thumbHeld = thumb.isHeld; - if (thumbHeld) - consumeControl(thumb); + var scaleReset = m_LocomotionInput.scaleReset; + var scaleResetHeld = scaleReset.isHeld; + if (scaleResetHeld) + consumeControl(scaleReset); - var otherThumb = otherLocomotionInput.thumb; - var otherThumbHeld = otherThumb.isHeld; - if (otherThumbHeld) - consumeControl(otherThumb); + var otherScaleReset = otherLocomotionInput.scaleReset; + var otherScaleResetHeld = otherScaleReset.isHeld; + if (otherScaleResetHeld) + consumeControl(otherScaleReset); // Press both thumb buttons to reset scale - if (thumbHeld && otherThumbHeld) + if (scaleResetHeld && otherScaleResetHeld) { m_AllowScaling = false; @@ -440,18 +440,18 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) ResetViewerScale(); } - var trigger = m_LocomotionInput.trigger; - var triggerHeld = trigger.isHeld; - if (triggerHeld) - consumeControl(trigger); + var worldReset = m_LocomotionInput.worldReset; + var worldResetHeld = worldReset.isHeld; + if (worldResetHeld) + consumeControl(worldReset); - var otherTrigger = otherLocomotionInput.trigger; - var otherTriggerHeld = otherTrigger.isHeld; - if (otherTriggerHeld) - consumeControl(otherTrigger); + var otherWorldReset = otherLocomotionInput.worldReset; + var otherWorldResetHeld = otherWorldReset.isHeld; + if (otherWorldResetHeld) + consumeControl(otherWorldReset); // Press both triggers to reset to origin - if (triggerHeld && otherTriggerHeld) + if (worldResetHeld && otherWorldResetHeld) { m_AllowScaling = false; diff --git a/Tools/SelectionTool/SelectionInput.asset b/Tools/SelectionTool/SelectionInput.asset index 9c4b88f1b..4e9283803 100644 --- a/Tools/SelectionTool/SelectionInput.asset +++ b/Tools/SelectionTool/SelectionInput.asset @@ -15,7 +15,7 @@ MonoBehaviour: - {fileID: 114000010095369560} - {fileID: 114000010106806814} m_ControlSchemes: - - m_Name: Sixense + - m_Name: SelectionInput m_DeviceSlots: - m_Key: 1 m_Type: @@ -25,7 +25,7 @@ MonoBehaviour: m_ActionMap: {fileID: 11400000} m_Bindings: - sources: - - controlIndex: 22 + - controlIndex: 3 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index fe2605eb3..b7520c100 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -34,6 +34,15 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { m_SelectionInput = (SelectionInput)input; + var multiSelect = false; + foreach (var linkedObject in linkedObjects) + { + var selectionTool = (SelectionTool)linkedObject; + var toolInput = selectionTool.m_SelectionInput; + if (toolInput != null && toolInput.multiSelect.isHeld) + multiSelect = true; + } + if (this.IsSharedUpdater(this)) { var directSelection = this.GetDirectSelection(); @@ -102,7 +111,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // Only overwrite an existing selection if it does not contain the hovered object // In the case of multi-select, only add, do not remove if (directSelectInput.select.wasJustPressed && !Selection.objects.Contains(directHoveredObject)) - this.SelectObject(directHoveredObject, rayOrigin, directSelectInput.multiSelect.isHeld); + this.SelectObject(directHoveredObject, rayOrigin, multiSelect); GameObject lastHover; if (m_HoverGameObjects.TryGetValue(directRayOrigin, out lastHover) && lastHover != directHoveredObject) @@ -124,15 +133,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!IsActive()) return; - var multiSelect = false; - foreach (var linkedObject in linkedObjects) - { - var selectionTool = (SelectionTool)linkedObject; - var toolInput = selectionTool.m_SelectionInput; - if (toolInput != null && toolInput.multiSelect.isHeld) - multiSelect = true; - } - // Need to call GetFirstGameObject a second time because we do not guarantee shared updater executes first var hoveredObject = this.GetFirstGameObject(rayOrigin); From cfe696effc02f86d22b6bc7ce865a8601a1b7223 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 22 Jun 2017 21:27:26 -0700 Subject: [PATCH 504/870] Add HapticPulsesEditor; Adjust pulse settings --- Editor/HapticPulsesEditor.cs | 84 +++++++++++++++++++ Editor/HapticPulsesEditor.cs.meta | 12 +++ .../HapticPulses/FaceRotationPulse.asset | 2 +- .../MainMenu/HapticPulses/HideMenuPulse.asset | 2 +- .../MainMenuActivatorHoverPulse.asset | 2 +- .../MainMenuButtonClickPulse.asset | 2 +- .../MainMenuButtonHoverPulse.asset | 2 +- .../MainMenu/HapticPulses/ShowMenuPulse.asset | 2 +- .../HapticPulses/ClickPulse.asset | 2 +- .../HapticPulses/HoverPulse.asset | 2 +- .../HapticPulses/ButtonClickedPulse.asset | 2 +- .../HapticPulses/ButtonHoverPulse.asset | 2 +- .../HapticPulses/ReleasePulse.asset | 2 +- .../ListView/HapticPulses/ScrollPulse.asset | 4 +- Scripts/Modules/HapticsModule/HapticPulse.cs | 4 +- .../Modules/HapticsModule/HapticsModule.cs | 2 +- .../HapticPulses/HoverPulse.asset | 2 +- .../HapticPulses/DragPulse.asset | 2 +- .../HapticPulses/RotatePulse.asset | 2 +- .../Base/HapticPulses/FrameHoverPulse.asset | 4 +- Workspaces/Base/HapticPulses/MovePulse.asset | 2 +- .../Base/HapticPulses/ResizePulse.asset | 2 +- .../HapticPulses/WorkspaceButtonClick.asset | 4 +- .../HapticPulses/WorkspaceButtonHover.asset | 2 +- 24 files changed, 122 insertions(+), 26 deletions(-) create mode 100644 Editor/HapticPulsesEditor.cs create mode 100644 Editor/HapticPulsesEditor.cs.meta diff --git a/Editor/HapticPulsesEditor.cs b/Editor/HapticPulsesEditor.cs new file mode 100644 index 000000000..68274defb --- /dev/null +++ b/Editor/HapticPulsesEditor.cs @@ -0,0 +1,84 @@ +using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Core; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.UI +{ + sealed class HapticPulseEditor : EditorWindow + { + readonly List m_HapticPulses = new List(); + + Vector2 m_Scroll; + float m_Multiplier = 1; + + [MenuItem("Edit/Project Settings/EditorVR/Haptic Pulses")] + static void Init() + { + GetWindow("Haptic Pulse Editor").Show(); + } + + void OnEnable() + { + m_HapticPulses.Clear(); + var pulses = AssetDatabase.FindAssets("t:HapticPulse"); + foreach (var pulse in pulses) + { + var asset = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(pulse)); + if (asset) + m_HapticPulses.Add(asset); + } + } + + void OnGUI() + { + const float nameColumnWidth = 250f; + const float durationColumnWidth = 60f; + + m_Scroll = GUILayout.BeginScrollView(m_Scroll); + + GUILayout.BeginHorizontal(); + m_Multiplier = EditorGUILayout.FloatField("Multiplier", m_Multiplier); + if (GUILayout.Button("Multiply Intensity")) + { + foreach (var pulse in m_HapticPulses) + { + pulse.intensity *= m_Multiplier; + EditorUtility.SetDirty(pulse); + } + } + + if (GUILayout.Button("Multiply Duration")) + { + foreach (var pulse in m_HapticPulses) + { + pulse.duration *= m_Multiplier; + EditorUtility.SetDirty(pulse); + } + } + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Haptic Pulses", EditorStyles.boldLabel, GUILayout.Width(nameColumnWidth)); + GUILayout.Label("Duration", GUILayout.Width(durationColumnWidth)); + GUILayout.Label("Intensity"); + GUILayout.EndHorizontal(); + + foreach (var pulse in m_HapticPulses) + { + GUILayout.BeginHorizontal(); + EditorGUILayout.ObjectField(pulse, typeof(HapticPulse), GUILayout.Width(nameColumnWidth)); + EditorGUI.BeginChangeCheck(); + pulse.duration = EditorGUILayout.FloatField(pulse.duration, GUILayout.Width(durationColumnWidth)); + pulse.intensity = GUILayout.HorizontalSlider(pulse.intensity, 0, 1); + pulse.intensity = EditorGUILayout.FloatField(pulse.intensity, GUILayout.Width(durationColumnWidth)); + if (EditorGUI.EndChangeCheck()) + { + EditorUtility.SetDirty(pulse); + } + GUILayout.EndHorizontal(); + } + + GUILayout.EndScrollView(); + } + } +} diff --git a/Editor/HapticPulsesEditor.cs.meta b/Editor/HapticPulsesEditor.cs.meta new file mode 100644 index 000000000..324c8b899 --- /dev/null +++ b/Editor/HapticPulsesEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 29b662520f19dc94792648a80927ebaa +timeCreated: 1486770624 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset b/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset index 7b73cbb01..271a57e73 100644 --- a/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset +++ b/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: FaceRotationPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.055 + m_Intensity: 0.22 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/HideMenuPulse.asset b/Menus/MainMenu/HapticPulses/HideMenuPulse.asset index 6caa84382..1eec78985 100644 --- a/Menus/MainMenu/HapticPulses/HideMenuPulse.asset +++ b/Menus/MainMenu/HapticPulses/HideMenuPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: HideMenuPulse m_EditorClassIdentifier: m_Duration: 0.75 - m_Intensity: 0.075 + m_Intensity: 0.2 m_FadeIn: 0 m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset index cdda7adc7..6840a650d 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: MainMenuActivatorHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.2 + m_Intensity: 0.4 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset index 082a7d134..0ff2c87db 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: MainMenuButtonClickPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.095 + m_Intensity: 0.38 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset index 7050b9cfe..c3394f615 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: MainMenuButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.175 + m_Intensity: 0.6 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset b/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset index 1e28033cc..f6800cc77 100644 --- a/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset +++ b/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ShowMenuPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.1 + m_Intensity: 0.3 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset b/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset index 472e131ad..e63620e33 100644 --- a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset +++ b/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ClickPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.2 + m_Intensity: 0.6 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset b/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset index 2bafd1c7d..a691b68a8 100644 --- a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset +++ b/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: HoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.2 + m_Intensity: 0.6 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset b/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset index aeb5b89f6..33591d18a 100644 --- a/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset +++ b/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ButtonClickedPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.1 + m_Intensity: 0.4 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset b/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset index ac3775938..ab9b2cfae 100644 --- a/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset +++ b/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.2 + m_Intensity: 0.8 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/RadialMenu/HapticPulses/ReleasePulse.asset b/Menus/RadialMenu/HapticPulses/ReleasePulse.asset index 0c337d8c5..927294cc3 100644 --- a/Menus/RadialMenu/HapticPulses/ReleasePulse.asset +++ b/Menus/RadialMenu/HapticPulses/ReleasePulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ReleasePulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.1 + m_Intensity: 0.4 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Scripts/ListView/HapticPulses/ScrollPulse.asset b/Scripts/ListView/HapticPulses/ScrollPulse.asset index b34ee7969..b4bc52ee4 100644 --- a/Scripts/ListView/HapticPulses/ScrollPulse.asset +++ b/Scripts/ListView/HapticPulses/ScrollPulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: ScrollPulse m_EditorClassIdentifier: - m_Duration: 0.25 - m_Intensity: 1 + m_Duration: 0.15 + m_Intensity: 0.15 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Scripts/Modules/HapticsModule/HapticPulse.cs b/Scripts/Modules/HapticsModule/HapticPulse.cs index 2b82e6842..ae9cfa01a 100644 --- a/Scripts/Modules/HapticsModule/HapticPulse.cs +++ b/Scripts/Modules/HapticsModule/HapticPulse.cs @@ -21,8 +21,8 @@ public class HapticPulse : ScriptableObject bool m_FadeOut = false; // Don't allow public setting of value; use inspector-set values - public float duration { get { return m_Duration; } } - public float intensity { get { return m_Intensity; } } + public float duration { get { return m_Duration; } internal set { m_Duration = value; } } + public float intensity { get { return m_Intensity; } internal set { m_Intensity = value; } } public bool fadeIn { get { return m_FadeIn; } } public bool fadeOut { get { return m_FadeOut; } } } diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index beddcacd2..fa8e49a60 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules sealed class HapticsModule : MonoBehaviour { [SerializeField] - float m_MasterIntensity = 4f; + float m_MasterIntensity = 0.8f; /// /// Overall intensity of haptics. diff --git a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset index 93ac16b02..3a0c639ac 100644 --- a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset +++ b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: HoverPulse m_EditorClassIdentifier: m_Duration: 0.45 - m_Intensity: 0.075 + m_Intensity: 0.3 m_FadeIn: 0 m_FadeOut: 1 diff --git a/Tools/TransformTool/HapticPulses/DragPulse.asset b/Tools/TransformTool/HapticPulses/DragPulse.asset index 3663a437f..81c9f1f70 100644 --- a/Tools/TransformTool/HapticPulses/DragPulse.asset +++ b/Tools/TransformTool/HapticPulses/DragPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: DragPulse m_EditorClassIdentifier: m_Duration: 0.2 - m_Intensity: 0.175 + m_Intensity: 0.4 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Tools/TransformTool/HapticPulses/RotatePulse.asset b/Tools/TransformTool/HapticPulses/RotatePulse.asset index 4e4e94ae7..977027c45 100644 --- a/Tools/TransformTool/HapticPulses/RotatePulse.asset +++ b/Tools/TransformTool/HapticPulses/RotatePulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: RotatePulse m_EditorClassIdentifier: m_Duration: 0.25 - m_Intensity: 0.25 + m_Intensity: 0.6 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/FrameHoverPulse.asset b/Workspaces/Base/HapticPulses/FrameHoverPulse.asset index 89960b6cf..61e4ee0f6 100644 --- a/Workspaces/Base/HapticPulses/FrameHoverPulse.asset +++ b/Workspaces/Base/HapticPulses/FrameHoverPulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: FrameHoverPulse m_EditorClassIdentifier: - m_Duration: 0.8 - m_Intensity: 0.065 + m_Duration: 0.5 + m_Intensity: 0.6 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/MovePulse.asset b/Workspaces/Base/HapticPulses/MovePulse.asset index 7a58c99d1..a34bdca20 100644 --- a/Workspaces/Base/HapticPulses/MovePulse.asset +++ b/Workspaces/Base/HapticPulses/MovePulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: MovePulse m_EditorClassIdentifier: m_Duration: 0.25 - m_Intensity: 0.075 + m_Intensity: 0.15 m_FadeIn: 0 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/ResizePulse.asset b/Workspaces/Base/HapticPulses/ResizePulse.asset index c284cb1c9..ac028edcf 100644 --- a/Workspaces/Base/HapticPulses/ResizePulse.asset +++ b/Workspaces/Base/HapticPulses/ResizePulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: ResizePulse m_EditorClassIdentifier: - m_Duration: 0.25 + m_Duration: 0.2 m_Intensity: 0.35 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset b/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset index 304ae3747..7c269c62b 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: WorkspaceButtonClick m_EditorClassIdentifier: - m_Duration: 0.25 - m_Intensity: 0.15 + m_Duration: 0.15 + m_Intensity: 0.35 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset index 1c0c837c0..910898653 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: WorkspaceButtonHover m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.175 + m_Intensity: 0.7 m_FadeIn: 0 m_FadeOut: 0 From bedea7e94d027e6c8c628e68f4366a7bf84987c6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 22 Jun 2017 23:37:48 -0700 Subject: [PATCH 505/870] Add HintArrow controller and visuals --- .../Prefabs/PinnedToolsMenu.prefab | 2971 +++++++++++++++-- Menus/PinnedToolMenu/Scripts/HintArrow.cs | 82 + .../PinnedToolMenu/Scripts/HintArrow.cs.meta | 12 + .../Scripts/PinnedToolsMenuUI.cs | 18 +- Menus/PinnedToolMenu/Textures.meta | 9 + Menus/PinnedToolMenu/Textures/HintArrow.png | 3 + .../Textures/HintArrow.png.meta | 84 + .../Textures/SecondaryHintArrow.png | 3 + .../Textures/SecondaryHintArrow.png.meta | 84 + 9 files changed, 2903 insertions(+), 363 deletions(-) create mode 100644 Menus/PinnedToolMenu/Scripts/HintArrow.cs create mode 100644 Menus/PinnedToolMenu/Scripts/HintArrow.cs.meta create mode 100644 Menus/PinnedToolMenu/Textures.meta create mode 100644 Menus/PinnedToolMenu/Textures/HintArrow.png create mode 100644 Menus/PinnedToolMenu/Textures/HintArrow.png.meta create mode 100644 Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png create mode 100644 Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png.meta diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 71e9215e9..4e09e8c43 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -43,510 +43,2759 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1010111456622354 +--- !u!1 &1031849814866140 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4886523625983604} - - component: {fileID: 33107560542711044} - - component: {fileID: 23633161707023522} + - component: {fileID: 4883774153867170} + - component: {fileID: 114966871140878844} m_Layer: 5 - m_Name: FrontArrow + m_Name: TopArrow (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1076216916843686 +--- !u!1 &1052082992177756 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4546751647995990} - - component: {fileID: 33222025853848168} - - component: {fileID: 23590276871445402} + - component: {fileID: 4627373214459226} + - component: {fileID: 114156664202657108} m_Layer: 5 - m_Name: BackArrow + m_Name: RightArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1113548126640048 +--- !u!1 &1058196337944694 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4490327083081870} + - component: {fileID: 224921899845820908} + - component: {fileID: 222467063938135354} + - component: {fileID: 114880350798214428} m_Layer: 5 - m_Name: ArrowsContainer + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1236151594399662 +--- !u!1 &1063523385287442 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4386844247658442} - - component: {fileID: 33685955442159952} - - component: {fileID: 23542172210224264} + - component: {fileID: 4348701280787806} + - component: {fileID: 114039844972246400} m_Layer: 5 - m_Name: TopArrow + m_Name: BottomArrow (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1267413807553356 +--- !u!1 &1077445558168692 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4982260476637878} - - component: {fileID: 33130744985660702} - - component: {fileID: 23020214490570890} + - component: {fileID: 4000874305746072} + - component: {fileID: 114343363037367066} m_Layer: 5 - m_Name: LeftArrow + m_Name: LeftArrow (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1539960486036454 +--- !u!1 &1083125012091370 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4947664076386474} - - component: {fileID: 33836873376687798} - - component: {fileID: 23343159395137930} + - component: {fileID: 224106935460784972} + - component: {fileID: 222766034547299188} + - component: {fileID: 114508260567943020} m_Layer: 5 - m_Name: RightArrow + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1869225334479398 +--- !u!1 &1086640583229492 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4254294315888650} - - component: {fileID: 33152143725165046} - - component: {fileID: 23251901085109124} + - component: {fileID: 224563120333433268} + - component: {fileID: 222609766870474766} + - component: {fileID: 114724739900522476} m_Layer: 5 - m_Name: BottomArrow + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4000011260103804 -Transform: +--- !u!1 &1104408707865476 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014083153210} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} - m_Children: - - {fileID: 4490327083081870} - - {fileID: 4000012301197336} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012301197336 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 224832882527011820} + - component: {fileID: 222093030019584422} + - component: {fileID: 114581339146061258} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1113548126640048 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224926333701432290} + - component: {fileID: 223228058598912900} + - component: {fileID: 225918572929103210} + - component: {fileID: 114705618050563776} + m_Layer: 5 + m_Name: ArrowsContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1133158312748406 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010819337252} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4000011260103804} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4254294315888650 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 4648779473311770} + m_Layer: 5 + m_Name: FrontArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1162277860306230 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1869225334479398} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -0.35624993, z: 0} - m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} - m_Children: [] - m_Father: {fileID: 4490327083081870} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4386844247658442 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 4575203095433520} + - component: {fileID: 114265858466807592} + m_Layer: 5 + m_Name: LeftArrow (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1215691977135838 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1236151594399662} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0.3574999, z: 0} - m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} - m_Children: [] - m_Father: {fileID: 4490327083081870} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4490327083081870 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 224523839693825596} + - component: {fileID: 222502552576947544} + - component: {fileID: 114269893187404902} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1236151594399662 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1113548126640048} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4386844247658442} - - {fileID: 4254294315888650} - - {fileID: 4982260476637878} - - {fileID: 4947664076386474} - - {fileID: 4886523625983604} - - {fileID: 4546751647995990} - m_Father: {fileID: 4000011260103804} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4546751647995990 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 4386844247658442} + - component: {fileID: 114451923332080912} + m_Layer: 5 + m_Name: RightArrow (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1243100648521718 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1076216916843686} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.0012499999, y: 0.0012499999, z: -0.35624993} - m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} - m_Children: [] - m_Father: {fileID: 4490327083081870} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4886523625983604 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 4424188858784126} + - component: {fileID: 225892931205557926} + m_Layer: 5 + m_Name: DiagonalArrows + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1277691287488752 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1010111456622354} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.0012499999, y: 0.0012499999, z: 0.3574999} - m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} - m_Children: [] - m_Father: {fileID: 4490327083081870} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4947664076386474 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 224948863731782614} + - component: {fileID: 222447643541202192} + - component: {fileID: 114742457022644888} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1288076055191678 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1539960486036454} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.35624993, y: 0.0012499999, z: 0} - m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} - m_Children: [] - m_Father: {fileID: 4490327083081870} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4982260476637878 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 224211381368016420} + - component: {fileID: 222123858154635328} + - component: {fileID: 114137758696402814} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1374759649448910 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1267413807553356} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.3574999, y: 0.0012499999, z: 0} - m_LocalScale: {x: 0.031249994, y: 0.031249994, z: 0.031249994} - m_Children: [] - m_Father: {fileID: 4490327083081870} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23020214490570890 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1267413807553356} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23251901085109124 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1869225334479398} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23343159395137930 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1539960486036454} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23542172210224264 -MeshRenderer: + serializedVersion: 5 + m_Component: + - component: {fileID: 4888922240738846} + m_Layer: 5 + m_Name: BottomArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1408640227645536 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1236151594399662} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23590276871445402 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1076216916843686} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23633161707023522 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1010111456622354} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &33107560542711044 -MeshFilter: + serializedVersion: 5 + m_Component: + - component: {fileID: 4416256937175418} + - component: {fileID: 114117379512495918} + m_Layer: 5 + m_Name: BottomArrow (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1417797850913266 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1010111456622354} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33130744985660702 -MeshFilter: + serializedVersion: 5 + m_Component: + - component: {fileID: 224665261672936376} + - component: {fileID: 222904426838931346} + - component: {fileID: 114183467226746200} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1422966589754858 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1267413807553356} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33152143725165046 -MeshFilter: + serializedVersion: 5 + m_Component: + - component: {fileID: 224141220472168564} + - component: {fileID: 222556119809042824} + - component: {fileID: 114813176157330038} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1426506580573374 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1869225334479398} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33222025853848168 -MeshFilter: + serializedVersion: 5 + m_Component: + - component: {fileID: 4929512635594470} + - component: {fileID: 114263984546135386} + m_Layer: 5 + m_Name: TopArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1429866494825076 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1076216916843686} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33685955442159952 -MeshFilter: + serializedVersion: 5 + m_Component: + - component: {fileID: 4073155563956874} + - component: {fileID: 114097487828792400} + m_Layer: 5 + m_Name: TopArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1467485354617718 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1236151594399662} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33836873376687798 -MeshFilter: + serializedVersion: 5 + m_Component: + - component: {fileID: 224365571383024546} + - component: {fileID: 222746842890793678} + - component: {fileID: 114242316492250394} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1481108235756974 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1539960486036454} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!114 &114000010527895234 -MonoBehaviour: + serializedVersion: 5 + m_Component: + - component: {fileID: 4928569707817658} + m_Layer: 5 + m_Name: BackArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1520471712351910 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014083153210} + serializedVersion: 5 + m_Component: + - component: {fileID: 4679261784804500} + - component: {fileID: 114350519079292674} + m_Layer: 5 + m_Name: LeftArrow (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1528577298737296 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224278859857227398} + - component: {fileID: 222410890664544046} + - component: {fileID: 114598401377257748} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1542713640412182 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224496829589271966} + - component: {fileID: 222735165262294470} + - component: {fileID: 114025535967204422} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1573710362226728 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4770502844307052} + m_Layer: 5 + m_Name: LeftArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1576168663341530 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4058550772719746} + - component: {fileID: 114755079460350674} + m_Layer: 5 + m_Name: TopArrow (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1598041239745882 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224415910323943488} + - component: {fileID: 222831654399493144} + - component: {fileID: 114823076312193430} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1631410678625586 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224598666989053882} + - component: {fileID: 222853750888495964} + - component: {fileID: 114563865778918000} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1645397446809114 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4230921424453902} + - component: {fileID: 114709129698682498} + m_Layer: 5 + m_Name: BottomArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1657489799168288 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4606543685854042} + m_Layer: 5 + m_Name: TopArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1661827634449264 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4574955065994976} + - component: {fileID: 114211348936724016} + m_Layer: 5 + m_Name: RightArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1675697369700164 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4054773723513416} + - component: {fileID: 114952136032051262} + m_Layer: 5 + m_Name: BottomArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1677176722312172 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224722272734808106} + - component: {fileID: 222381275818579690} + - component: {fileID: 114219147691969104} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1689057037272646 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224227513434018164} + - component: {fileID: 222045765058194512} + - component: {fileID: 114197230093624006} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1692885133297322 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224043746415228348} + - component: {fileID: 222159349607427246} + - component: {fileID: 114804887785659340} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1736942055089654 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4691544615733376} + - component: {fileID: 114802558585402892} + m_Layer: 5 + m_Name: LeftArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1768337939050664 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4688592375184416} + m_Layer: 5 + m_Name: BackArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1775608398571146 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224402193235821058} + - component: {fileID: 222497862031640068} + - component: {fileID: 114627454420162904} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1803092220005186 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224463898306038578} + - component: {fileID: 222773264695355860} + - component: {fileID: 114737674627737730} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1822357995854076 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224373908585438004} + - component: {fileID: 222363707075413156} + - component: {fileID: 114153458796039378} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1837478099313884 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4298904777987284} + - component: {fileID: 114154224343743956} + m_Layer: 5 + m_Name: RightArrow (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1866128806406452 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4925765156807252} + m_Layer: 5 + m_Name: FrontArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1909408486964086 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224265400135533474} + - component: {fileID: 222240515654960256} + - component: {fileID: 114222681976531280} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1909738417943642 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224846752056185278} + - component: {fileID: 222504959554748288} + - component: {fileID: 114106655877952548} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1914077346605324 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224053839113242232} + - component: {fileID: 222234007190448478} + - component: {fileID: 114467679702415144} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1931608236507870 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4303414394448688} + m_Layer: 5 + m_Name: RightArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950708251885582 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224284014073092618} + - component: {fileID: 222524122592722440} + - component: {fileID: 114555859501867138} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000011260103804 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014083153210} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} + m_Children: + - {fileID: 224926333701432290} + - {fileID: 4000012301197336} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000012301197336 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010819337252} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000011260103804} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000874305746072 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1077445558168692} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224921899845820908} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!4 &4054773723513416 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1675697369700164} + m_LocalRotation: {x: 0.2705894, y: 0.27059057, z: -0.00000017881389, w: 0.92388433} + m_LocalPosition: {x: -0.052311167, y: -0.30518684, z: -0.17876795} + m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} + m_Children: + - {fileID: 224278859857227398} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} +--- !u!4 &4058550772719746 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1576168663341530} + m_LocalRotation: {x: -0.27060428, y: -0.27060556, z: -0.0000000074505797, w: 0.9238756} + m_LocalPosition: {x: 0.05231689, y: 0.30518025, z: -0.17878139} + m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} + m_Children: + - {fileID: 224523839693825596} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} +--- !u!4 &4073155563956874 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1429866494825076} + m_LocalRotation: {x: 0.2705894, y: 0.27059057, z: -0.00000017881389, w: 0.92388433} + m_LocalPosition: {x: 0.05238819, y: 0.3051088, z: 0.17872259} + m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} + m_Children: + - {fileID: 224284014073092618} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} +--- !u!4 &4230921424453902 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1645397446809114} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.35749984, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224265400135533474} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4298904777987284 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1837478099313884} + m_LocalRotation: {x: -0.38269445, y: -0.0000009089707, z: 0.6532774, w: 0.6532791} + m_LocalPosition: {x: -0.30520254, y: -0.05231519, z: -0.17879169} + m_LocalScale: {x: 1.0000001, y: 1.0000006, z: 1.0000006} + m_Children: + - {fileID: 224665261672936376} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} +--- !u!4 &4303414394448688 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1931608236507870} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: -0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224496829589271966} + m_Father: {fileID: 224926333701432290} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!4 &4348701280787806 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1063523385287442} + m_LocalRotation: {x: 0.49999815, y: 0.5000008, z: -0.000000119209275, w: 0.70710754} + m_LocalPosition: {x: -0.17869319, y: -0.17880538, z: -0.2528689} + m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} + m_Children: + - {fileID: 224365571383024546} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} +--- !u!4 &4386844247658442 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1236151594399662} + m_LocalRotation: {x: 0.707106, y: 0.0000017287589, z: 0.5000004, w: 0.5000008} + m_LocalPosition: {x: -0.1786963, y: -0.17880678, z: 0.25271866} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224053839113242232} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} +--- !u!4 &4416256937175418 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408640227645536} + m_LocalRotation: {x: -0.27060428, y: -0.27060556, z: -0.0000000074505797, w: 0.9238756} + m_LocalPosition: {x: -0.05239579, y: -0.3051027, z: 0.17873496} + m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} + m_Children: + - {fileID: 224463898306038578} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} +--- !u!4 &4424188858784126 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1243100648521718} + m_LocalRotation: {x: 0.2705973, y: 0.65328187, z: 0.2705973, w: 0.6532818} + m_LocalPosition: {x: 0.00011226709, y: 0.000016883754, z: -0.000107623935} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4928569707817658} + - {fileID: 4925765156807252} + - {fileID: 4574955065994976} + - {fileID: 4000874305746072} + - {fileID: 4230921424453902} + - {fileID: 4929512635594470} + - {fileID: 4073155563956874} + - {fileID: 4054773723513416} + - {fileID: 4691544615733376} + - {fileID: 4627373214459226} + - {fileID: 4298904777987284} + - {fileID: 4679261784804500} + - {fileID: 4416256937175418} + - {fileID: 4058550772719746} + - {fileID: 4883774153867170} + - {fileID: 4348701280787806} + - {fileID: 4575203095433520} + - {fileID: 4386844247658442} + m_Father: {fileID: 224926333701432290} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 90.00001, z: 45.000004} +--- !u!4 &4574955065994976 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1661827634449264} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: -0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224832882527011820} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!4 &4575203095433520 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1162277860306230} + m_LocalRotation: {x: 0.707106, y: 0.0000017287589, z: 0.5000004, w: 0.5000008} + m_LocalPosition: {x: 0.17880696, y: 0.17869617, z: -0.25287494} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224948863731782614} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} +--- !u!4 &4606543685854042 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1657489799168288} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.3574999, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224563120333433268} + m_Father: {fileID: 224926333701432290} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4627373214459226 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1052082992177756} + m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} + m_LocalPosition: {x: -0.3051234, y: -0.052390024, z: 0.17873323} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224415910323943488} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} +--- !u!4 &4648779473311770 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1133158312748406} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.35741758} + m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} + m_Children: + - {fileID: 224141220472168564} + m_Father: {fileID: 224926333701432290} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!4 &4679261784804500 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1520471712351910} + m_LocalRotation: {x: -0.38269445, y: -0.0000009089707, z: 0.6532774, w: 0.6532791} + m_LocalPosition: {x: 0.30512458, y: 0.05239418, z: 0.17874639} + m_LocalScale: {x: 1.0000001, y: 1.0000006, z: 1.0000006} + m_Children: + - {fileID: 224846752056185278} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} +--- !u!4 &4688592375184416 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1768337939050664} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.35757425} + m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} + m_Children: + - {fileID: 224043746415228348} + m_Father: {fileID: 224926333701432290} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!4 &4691544615733376 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1736942055089654} + m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} + m_LocalPosition: {x: 0.30520225, y: 0.052312464, z: -0.17877874} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224722272734808106} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} +--- !u!4 &4770502844307052 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1573710362226728} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224373908585438004} + m_Father: {fileID: 224926333701432290} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!4 &4883774153867170 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1031849814866140} + m_LocalRotation: {x: 0.49999815, y: 0.5000008, z: -0.000000119209275, w: 0.70710754} + m_LocalPosition: {x: 0.17880443, y: 0.17869522, z: 0.25271186} + m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} + m_Children: + - {fileID: 224402193235821058} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} +--- !u!4 &4888922240738846 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1374759649448910} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.3574999, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224598666989053882} + m_Father: {fileID: 224926333701432290} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4925765156807252 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1866128806406452} + m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.35741758} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224106935460784972} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!4 &4928569707817658 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1481108235756974} + m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.35757425} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224211381368016420} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!4 &4929512635594470 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1426506580573374} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.35749984, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224227513434018164} + m_Father: {fileID: 4424188858784126} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &114000010527895234 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014083153210} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cfe80f5c8b040574dbe8502d4830bf4b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ButtonContainer: {fileID: 4000012301197336} + m_AlternatePosition: {x: 0, y: 0, z: -0.0136} + m_AlternateLocalScale: {x: 0.54, y: 0.54, z: 0.54} + m_HintContentContainer: {fileID: 224926333701432290} + m_HintArrowsCanvasGroup: {fileID: 225918572929103210} + m_SecondaryHintArrows: + - {fileID: 114211348936724016} + - {fileID: 114343363037367066} + - {fileID: 114709129698682498} + - {fileID: 114263984546135386} + - {fileID: 114097487828792400} + - {fileID: 114952136032051262} + - {fileID: 114802558585402892} + - {fileID: 114156664202657108} + - {fileID: 114154224343743956} + - {fileID: 114350519079292674} + - {fileID: 114117379512495918} + - {fileID: 114755079460350674} + - {fileID: 114966871140878844} + - {fileID: 114039844972246400} + - {fileID: 114265858466807592} + - {fileID: 114451923332080912} +--- !u!114 &114000011597863712 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010819337252} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SmoothRotation: 1 + m_TightenRotation: 30 + m_SmoothPosition: 1 + m_TightenPosition: 50 + m_Target: {fileID: 0} +--- !u!114 &114025535967204422 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542713640412182} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114039844972246400 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1063523385287442} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114242316492250394} +--- !u!114 &114097487828792400 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1429866494825076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114555859501867138} +--- !u!114 &114106655877952548 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1909738417943642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114117379512495918 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408640227645536} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114737674627737730} +--- !u!114 &114137758696402814 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1288076055191678} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114153458796039378 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1822357995854076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114154224343743956 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1837478099313884} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114183467226746200} +--- !u!114 &114156664202657108 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1052082992177756} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114823076312193430} +--- !u!114 &114183467226746200 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1417797850913266} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114197230093624006 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1689057037272646} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114211348936724016 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1661827634449264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114581339146061258} +--- !u!114 &114219147691969104 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1677176722312172} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114222681976531280 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1909408486964086} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114242316492250394 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1467485354617718} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114263984546135386 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1426506580573374} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114197230093624006} +--- !u!114 &114265858466807592 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1162277860306230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114742457022644888} +--- !u!114 &114269893187404902 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1215691977135838} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114343363037367066 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1077445558168692} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114880350798214428} +--- !u!114 &114350519079292674 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1520471712351910} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114106655877952548} +--- !u!114 &114451923332080912 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1236151594399662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114467679702415144} +--- !u!114 &114467679702415144 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1914077346605324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114508260567943020 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083125012091370} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114555859501867138 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950708251885582} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114563865778918000 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1631410678625586} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114581339146061258 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1104408707865476} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114598401377257748 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1528577298737296} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114627454420162904 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1775608398571146} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114705618050563776 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1113548126640048} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1e1e059687772584aa432d26dc4b12a1, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &114709129698682498 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1645397446809114} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114222681976531280} +--- !u!114 &114724739900522476 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1086640583229492} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114737674627737730 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1803092220005186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114742457022644888 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1277691287488752} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114755079460350674 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1576168663341530} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114269893187404902} +--- !u!114 &114802558585402892 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1736942055089654} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114219147691969104} +--- !u!114 &114804887785659340 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1692885133297322} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114813176157330038 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1422966589754858} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114823076312193430 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1598041239745882} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114880350798214428 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1058196337944694} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: cfe80f5c8b040574dbe8502d4830bf4b, type: 3} + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_ButtonContainer: {fileID: 4000012301197336} - m_AlternatePosition: {x: 0, y: 0, z: -0.0136} - m_AlternateLocalScale: {x: 0.54, y: 0.54, z: 0.54} - m_HintContentContainer: {fileID: 4490327083081870} ---- !u!114 &114000011597863712 + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114952136032051262 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010819337252} + m_GameObject: {fileID: 1675697369700164} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_SmoothRotation: 1 - m_TightenRotation: 30 - m_SmoothPosition: 1 - m_TightenPosition: 50 - m_Target: {fileID: 0} + m_Icon: {fileID: 114598401377257748} +--- !u!114 &114966871140878844 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1031849814866140} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114627454420162904} +--- !u!222 &222045765058194512 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1689057037272646} +--- !u!222 &222093030019584422 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1104408707865476} +--- !u!222 &222123858154635328 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1288076055191678} +--- !u!222 &222159349607427246 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1692885133297322} +--- !u!222 &222234007190448478 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1914077346605324} +--- !u!222 &222240515654960256 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1909408486964086} +--- !u!222 &222363707075413156 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1822357995854076} +--- !u!222 &222381275818579690 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1677176722312172} +--- !u!222 &222410890664544046 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1528577298737296} +--- !u!222 &222447643541202192 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1277691287488752} +--- !u!222 &222467063938135354 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1058196337944694} +--- !u!222 &222497862031640068 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1775608398571146} +--- !u!222 &222502552576947544 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1215691977135838} +--- !u!222 &222504959554748288 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1909738417943642} +--- !u!222 &222524122592722440 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950708251885582} +--- !u!222 &222556119809042824 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1422966589754858} +--- !u!222 &222609766870474766 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1086640583229492} +--- !u!222 &222735165262294470 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542713640412182} +--- !u!222 &222746842890793678 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1467485354617718} +--- !u!222 &222766034547299188 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083125012091370} +--- !u!222 &222773264695355860 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1803092220005186} +--- !u!222 &222831654399493144 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1598041239745882} +--- !u!222 &222853750888495964 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1631410678625586} +--- !u!222 &222904426838931346 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1417797850913266} +--- !u!223 &223228058598912900 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1113548126640048} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &224043746415228348 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1692885133297322} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4688592375184416} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224053839113242232 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1914077346605324} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4386844247658442} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224106935460784972 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083125012091370} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4925765156807252} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224141220472168564 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1422966589754858} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4648779473311770} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224211381368016420 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1288076055191678} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4928569707817658} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224227513434018164 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1689057037272646} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4929512635594470} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224265400135533474 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1909408486964086} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4230921424453902} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224278859857227398 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1528577298737296} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4054773723513416} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224284014073092618 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950708251885582} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4073155563956874} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224365571383024546 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1467485354617718} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4348701280787806} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224373908585438004 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1822357995854076} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4770502844307052} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224402193235821058 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1775608398571146} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4883774153867170} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224415910323943488 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1598041239745882} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4627373214459226} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224463898306038578 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1803092220005186} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4416256937175418} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224496829589271966 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542713640412182} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4303414394448688} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224523839693825596 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1215691977135838} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4058550772719746} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224563120333433268 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1086640583229492} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4606543685854042} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224598666989053882 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1631410678625586} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4888922240738846} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224665261672936376 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1417797850913266} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4298904777987284} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224722272734808106 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1677176722312172} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4691544615733376} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224832882527011820 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1104408707865476} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4574955065994976} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224846752056185278 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1909738417943642} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4679261784804500} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224921899845820908 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1058196337944694} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4000874305746072} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224926333701432290 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1113548126640048} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4424188858784126} + - {fileID: 4606543685854042} + - {fileID: 4888922240738846} + - {fileID: 4770502844307052} + - {fileID: 4303414394448688} + - {fileID: 4648779473311770} + - {fileID: 4688592375184416} + m_Father: {fileID: 4000011260103804} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224948863731782614 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1277691287488752} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4575203095433520} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &225892931205557926 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1243100648521718} + m_Enabled: 1 + m_Alpha: 0.15 + m_Interactable: 1 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!225 &225918572929103210 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1113548126640048} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 1 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Menus/PinnedToolMenu/Scripts/HintArrow.cs b/Menus/PinnedToolMenu/Scripts/HintArrow.cs new file mode 100644 index 000000000..7ac74860b --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/HintArrow.cs @@ -0,0 +1,82 @@ +using System.Collections; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEngine; +using UnityEngine.UI; +using Random = UnityEngine.Random; + +public class HintArrow : MonoBehaviour +{ + [SerializeField] + Image m_Icon; + + readonly Vector3 k_HiddenScale = Vector3.zero; + + Transform m_IconTransform; + Vector3 m_VisibleLocalScale; + Coroutine m_VisibilityCoroutine; + + public bool visible + { + set + { + if (value) + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + else + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); + } + } + + void Awake() + { + m_IconTransform = m_Icon.transform; + m_VisibleLocalScale = m_IconTransform.localScale * 1.25F; + m_Icon.color = Color.black; + visible = false; + } + + IEnumerator AnimateShow() + { + var currentDuration = 0f; + var targetDuration = 0f; + var currentLocalScale = m_IconTransform.localScale; + + if (currentLocalScale == k_HiddenScale) + { + // Only perform delay if fully hidden; otherwise resume showing + targetDuration = Random.Range(0.25f, 0.35f); // Set an initial random wait duration + while (currentDuration < targetDuration) + { + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + } + + currentDuration = 0f; + targetDuration = 0.125f; // Set animated reveal duration + while (currentDuration < targetDuration) + { + m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, m_VisibleLocalScale, currentDuration / targetDuration); + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + + m_IconTransform.localScale = m_VisibleLocalScale; + } + + IEnumerator AnimateHide() + { + var currentDuration = 0f; + var targetDuration = Random.Range(0.125f, 0.25f); // Set an initial random wait duration + var currentLocalScale = m_IconTransform.localScale; + while (currentDuration < targetDuration) + { + m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, k_HiddenScale, currentDuration / targetDuration); + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + + m_IconTransform.localScale = k_HiddenScale; + } +} diff --git a/Menus/PinnedToolMenu/Scripts/HintArrow.cs.meta b/Menus/PinnedToolMenu/Scripts/HintArrow.cs.meta new file mode 100644 index 000000000..15000ec92 --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/HintArrow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 84c6f1758f39e6f4faff7277b7f6316d +timeCreated: 1498184947 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 30c607606..6270455e5 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -32,6 +32,12 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale [SerializeField] Transform m_HintContentContainer; + [SerializeField] + CanvasGroup m_HintArrowsCanvasGroup; + + [SerializeField] + HintArrow[] m_SecondaryHintArrows; + bool m_AllButtonsVisible; List m_OrderedButtons; Coroutine m_ShowHideAllButtonsCoroutine; @@ -513,7 +519,11 @@ void OnButtonHover() IEnumerator ShowHintContent() { - m_HintContentContainer.gameObject.SetActive(true); + foreach (var arrow in m_SecondaryHintArrows) + { + arrow.visible = true; + } + var currentScale = m_HintContentContainer.localScale; var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals var targetScale = Vector3.one; @@ -531,6 +541,11 @@ IEnumerator ShowHintContent() IEnumerator HideHintContent() { + foreach (var arrow in m_SecondaryHintArrows) + { + arrow.visible = false; + } + var currentScale = m_HintContentContainer.localScale; var timeElapsed = 1 - currentScale.x; var targetScale = Vector3.zero; @@ -544,7 +559,6 @@ IEnumerator HideHintContent() m_HintContentContainer.localScale = targetScale; m_HintContentVisibilityCoroutine = null; - m_HintContentContainer.gameObject.SetActive(false); } } } diff --git a/Menus/PinnedToolMenu/Textures.meta b/Menus/PinnedToolMenu/Textures.meta new file mode 100644 index 000000000..39c4e9521 --- /dev/null +++ b/Menus/PinnedToolMenu/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cea42a940904ef843afd4f579e4caf1c +folderAsset: yes +timeCreated: 1498180934 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/Textures/HintArrow.png b/Menus/PinnedToolMenu/Textures/HintArrow.png new file mode 100644 index 000000000..965152014 --- /dev/null +++ b/Menus/PinnedToolMenu/Textures/HintArrow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d7198533fdba2f62e4e7f3ecfed53aaa6e21ce036dc047fdb93f53a2a9984d5 +size 5978 diff --git a/Menus/PinnedToolMenu/Textures/HintArrow.png.meta b/Menus/PinnedToolMenu/Textures/HintArrow.png.meta new file mode 100644 index 000000000..7715ab94c --- /dev/null +++ b/Menus/PinnedToolMenu/Textures/HintArrow.png.meta @@ -0,0 +1,84 @@ +fileFormatVersion: 2 +guid: da944d70255b19e4ebca037de23078f3 +timeCreated: 1498181222 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 2 + aniso: 3 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 256 + textureFormat: 2 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + - buildTarget: WebGL + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: EditorVR + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png b/Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png new file mode 100644 index 000000000..c75616314 --- /dev/null +++ b/Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f259acbd69d7055b6d3f63b7b29a4a44dc7672db694980378e79be9ff8c94b4a +size 17138 diff --git a/Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png.meta b/Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png.meta new file mode 100644 index 000000000..09d0e4801 --- /dev/null +++ b/Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png.meta @@ -0,0 +1,84 @@ +fileFormatVersion: 2 +guid: b92ddf29a5f32334d8482795e3876db2 +timeCreated: 1498181222 +licenseType: Pro +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: 2 + aniso: 3 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 256 + textureFormat: 2 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 1 + - buildTarget: WebGL + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: EditorVR + userData: + assetBundleName: + assetBundleVariant: From 762231f98e3c92b973ce30ac68f019cabd633336 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 23 Jun 2017 13:00:49 -0700 Subject: [PATCH 506/870] Refactor SerializedPreferences to use a dictionary, and convert to list on serialization --- .../Modules/SerializedPreferencesModule.cs | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/Scripts/Modules/SerializedPreferencesModule.cs b/Scripts/Modules/SerializedPreferencesModule.cs index 05abc25e1..29fd5bad6 100644 --- a/Scripts/Modules/SerializedPreferencesModule.cs +++ b/Scripts/Modules/SerializedPreferencesModule.cs @@ -13,12 +13,34 @@ sealed class SerializedPreferencesModule : MonoBehaviour, IInterfaceConnector SerializedPreferences m_Preferences; [Serializable] - class SerializedPreferences + class SerializedPreferences : ISerializationCallbackReceiver { [SerializeField] - List m_Items = new List(); + SerializedPreferenceItem[] m_Items; - public List items { get { return m_Items; } } + readonly Dictionary m_ItemDictionary = new Dictionary(); + + public Dictionary items { get { return m_ItemDictionary; } } + + public void OnBeforeSerialize() + { + m_Items = m_ItemDictionary.Values.ToArray(); + } + + public void OnAfterDeserialize() + { + foreach (var item in m_Items) + { + var type = Type.GetType(item.name); + if (type != null) + { + if (m_ItemDictionary.ContainsKey(type)) + Debug.LogWarning("Multiple payloads of the same type"); + + m_ItemDictionary[type] = item; + } + } + } } [Serializable] @@ -59,8 +81,8 @@ internal void DeserializePreferences(string serializedPreferences) foreach (var serializer in m_Serializers) { - var item = preferences.items.SingleOrDefault(pi => pi.name == serializer.GetType().FullName); - if (item != null) + SerializedPreferenceItem item; + if (m_Preferences.items.TryGetValue(serializer.GetType(), out item)) { var payload = JsonUtility.FromJson(item.payload, Type.GetType(item.payloadType)); serializer.OnDeserializePreferences(payload); @@ -72,17 +94,6 @@ internal void DeserializePreferences(string serializedPreferences) internal string SerializePreferences() { var preferences = new SerializedPreferences(); - var payloads = new Dictionary(); - - // Use the previously saved preferences as defaults - if (m_Preferences != null) - { - foreach (var serializer in m_Serializers) - { - var type = serializer.GetType(); - payloads[type] = m_Preferences.items.SingleOrDefault(pi => pi.name == type.FullName); - } - } foreach (var serializer in m_Serializers) { @@ -92,15 +103,13 @@ internal string SerializePreferences() continue; var type = serializer.GetType(); - payloads[type] = new SerializedPreferenceItem + m_Preferences.items[type] = new SerializedPreferenceItem { name = type.FullName, payloadType = payload.GetType().FullName, payload = JsonUtility.ToJson(payload) }; } - - preferences.items.AddRange(payloads.Values); m_Preferences = preferences; return JsonUtility.ToJson(preferences); From 15c333522d354ec999d93e9a1521195b360cc50d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 23 Jun 2017 13:14:52 -0700 Subject: [PATCH 507/870] Fix SerializedPreferencesModule --- Scripts/Modules/SerializedPreferencesModule.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Scripts/Modules/SerializedPreferencesModule.cs b/Scripts/Modules/SerializedPreferencesModule.cs index 29fd5bad6..38825718e 100644 --- a/Scripts/Modules/SerializedPreferencesModule.cs +++ b/Scripts/Modules/SerializedPreferencesModule.cs @@ -35,7 +35,7 @@ public void OnAfterDeserialize() if (type != null) { if (m_ItemDictionary.ContainsKey(type)) - Debug.LogWarning("Multiple payloads of the same type"); + Debug.LogWarning("Multiple payloads of the same type on deserialization"); m_ItemDictionary[type] = item; } @@ -93,7 +93,8 @@ internal void DeserializePreferences(string serializedPreferences) internal string SerializePreferences() { - var preferences = new SerializedPreferences(); + if (m_Preferences == null) + m_Preferences = new SerializedPreferences(); foreach (var serializer in m_Serializers) { @@ -103,6 +104,10 @@ internal string SerializePreferences() continue; var type = serializer.GetType(); + + if (m_Preferences.items.ContainsKey(type)) + Debug.LogWarning("Multiple payloads of the same type on serialization"); + m_Preferences.items[type] = new SerializedPreferenceItem { name = type.FullName, @@ -110,9 +115,8 @@ internal string SerializePreferences() payload = JsonUtility.ToJson(payload) }; } - m_Preferences = preferences; - return JsonUtility.ToJson(preferences); + return JsonUtility.ToJson(m_Preferences); } } } From 3592290a3f83db70e6c21cf9b4b142c318008fe9 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 23 Jun 2017 13:40:07 -0700 Subject: [PATCH 508/870] Resolve control issues; Fix SerializedPreferencesModule warning --- .../Modules/SerializedPreferencesModule.cs | 6 +- Tools/LocomotionTool/LocomotionInput.asset | 90 +++++++++++++++++++ Tools/LocomotionTool/LocomotionInput.cs | 3 + Tools/LocomotionTool/LocomotionTool.cs | 59 ++++++------ Tools/SelectionTool/SelectionTool.cs | 3 - 5 files changed, 129 insertions(+), 32 deletions(-) diff --git a/Scripts/Modules/SerializedPreferencesModule.cs b/Scripts/Modules/SerializedPreferencesModule.cs index 38825718e..91d06b6cd 100644 --- a/Scripts/Modules/SerializedPreferencesModule.cs +++ b/Scripts/Modules/SerializedPreferencesModule.cs @@ -96,6 +96,8 @@ internal string SerializePreferences() if (m_Preferences == null) m_Preferences = new SerializedPreferences(); + var serializerTypes = new HashSet(); + foreach (var serializer in m_Serializers) { var payload = serializer.OnSerializePreferences(); @@ -105,8 +107,8 @@ internal string SerializePreferences() var type = serializer.GetType(); - if (m_Preferences.items.ContainsKey(type)) - Debug.LogWarning("Multiple payloads of the same type on serialization"); + if (!serializerTypes.Add(type)) + Debug.LogWarning(string.Format("Multiple payloads of type {0} on serialization", type)); m_Preferences.items[type] = new SerializedPreferenceItem { diff --git a/Tools/LocomotionTool/LocomotionInput.asset b/Tools/LocomotionTool/LocomotionInput.asset index 05d92178a..710e81d24 100644 --- a/Tools/LocomotionTool/LocomotionInput.asset +++ b/Tools/LocomotionTool/LocomotionInput.asset @@ -19,6 +19,9 @@ MonoBehaviour: - {fileID: 114000010166273910} - {fileID: 114000013424161920} - {fileID: 114022299328106344} + - {fileID: 114894458248566326} + - {fileID: 114795339600363638} + - {fileID: 114866277550077874} m_ControlSchemes: - m_Name: LocomotionInput m_DeviceSlots: @@ -92,6 +95,33 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 + - sources: + - controlIndex: 3 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 0 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 1 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 m_MapTypeName: LocomotionInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: @@ -235,3 +265,63 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: WorldReset defaultValue: 0 +--- !u!114 &114795339600363638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Horizontal + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 8 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Horizontal + defaultValue: 0 +--- !u!114 &114866277550077874 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Vertical + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 9 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Vertical + defaultValue: 0 +--- !u!114 &114894458248566326 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Rotate + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 7 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Rotate + defaultValue: 0 diff --git a/Tools/LocomotionTool/LocomotionInput.cs b/Tools/LocomotionTool/LocomotionInput.cs index 459acebf8..df1a4ed93 100644 --- a/Tools/LocomotionTool/LocomotionInput.cs +++ b/Tools/LocomotionTool/LocomotionInput.cs @@ -14,5 +14,8 @@ public LocomotionInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @reverse { get { return (ButtonInputControl)this[4]; } } public ButtonInputControl @forward { get { return (ButtonInputControl)this[5]; } } public ButtonInputControl @worldReset { get { return (ButtonInputControl)this[6]; } } + public ButtonInputControl @rotate { get { return (ButtonInputControl)this[7]; } } + public AxisInputControl @horizontal { get { return (AxisInputControl)this[8]; } } + public AxisInputControl @vertical { get { return (AxisInputControl)this[9]; } } } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index e6c7f7a30..2a3370028 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -74,7 +74,6 @@ class Preferences float m_StartYaw; bool m_Rotating; - bool m_WasRotating; bool m_Crawling; Vector3 m_RayOriginStartPosition; Vector3 m_RayOriginStartForward; @@ -211,25 +210,25 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_Preferences.blinkMode) { - if (DoBlink(consumeControl, m_LocomotionInput)) + if (DoBlink(consumeControl)) return; } else { - if (DoFlying(consumeControl, m_LocomotionInput)) + if (DoFlying(consumeControl)) return; } - DoCrawl(m_LocomotionInput); + DoCrawl(consumeControl); } - bool DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionInput) + bool DoFlying(ConsumeControlDelegate consumeControl) { - var reverse = locomotionInput.reverse.isHeld; - var moving = locomotionInput.forward.isHeld || reverse; + var reverse = m_LocomotionInput.reverse.isHeld; + var moving = m_LocomotionInput.forward.isHeld || reverse; if (moving) { - if (locomotionInput.crawl.isHeld) + if (m_LocomotionInput.rotate.isHeld) { var localRayRotation = Quaternion.Inverse(cameraRig.rotation) * rayOrigin.rotation; var localRayForward = localRayRotation * Vector3.forward; @@ -241,7 +240,6 @@ bool DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionI if (!m_Rotating) { m_Rotating = true; - m_WasRotating = true; m_RigStartPosition = cameraRig.position; m_RigStartRotation = cameraRig.rotation; @@ -254,7 +252,7 @@ bool DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionI m_LastRotationDiff = Quaternion.identity; } - consumeControl(locomotionInput.crawl); + consumeControl(m_LocomotionInput.rotate); var startOffset = m_RigStartPosition - m_CameraStartPosition; var angle = Vector3.Angle(m_RayOriginStartForward, localRayForward); @@ -273,7 +271,7 @@ bool DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionI else { var speed = k_SlowMoveSpeed; - var speedControl = locomotionInput.speed; + var speedControl = m_LocomotionInput.speed; var speedControlValue = speedControl.value; if (!Mathf.Approximately(speedControlValue, 0)) // Consume control to block selection { @@ -289,21 +287,22 @@ bool DoFlying(ConsumeControlDelegate consumeControl, LocomotionInput locomotionI cameraRig.Translate(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.forward * speed * Time.unscaledDeltaTime); } - consumeControl(locomotionInput.forward); + consumeControl(m_LocomotionInput.forward); return true; } - if (!locomotionInput.crawl.isHeld) - m_WasRotating = false; - m_Rotating = false; return false; } - bool DoCrawl(LocomotionInput locomotionInput) + bool DoCrawl(ConsumeControlDelegate consumeControl) { - if (!locomotionInput.forward.isHeld && !locomotionInput.blink.isHeld && locomotionInput.crawl.isHeld) + if (!m_LocomotionInput.forward.isHeld && !m_LocomotionInput.blink.isHeld && m_LocomotionInput.crawl.isHeld) { + consumeControl(m_LocomotionInput.crawl); + // Also consume thumbstick axes to disable radial menu + consumeControl(m_LocomotionInput.horizontal); + consumeControl(m_LocomotionInput.vertical); if (!m_Crawling) { m_Crawling = true; @@ -321,9 +320,9 @@ bool DoCrawl(LocomotionInput locomotionInput) return false; } - bool DoBlink(ConsumeControlDelegate consumeControl, LocomotionInput locomotionInput) + bool DoBlink(ConsumeControlDelegate consumeControl) { - if (locomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) + if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; this.SetDefaultRayVisibility(rayOrigin, false); @@ -331,11 +330,11 @@ bool DoBlink(ConsumeControlDelegate consumeControl, LocomotionInput locomotionIn m_BlinkVisuals.ShowVisuals(); - consumeControl(locomotionInput.blink); + consumeControl(m_LocomotionInput.blink); return true; } - if (m_State == State.Aiming && locomotionInput.blink.wasJustReleased) + if (m_State == State.Aiming && m_LocomotionInput.blink.wasJustReleased) { this.UnlockRay(rayOrigin, this); this.SetDefaultRayVisibility(rayOrigin, true); @@ -361,8 +360,8 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) if (this.IsSharedUpdater(this)) { - var grip = m_LocomotionInput.crawl; - if (grip.isHeld) + var crawl = m_LocomotionInput.crawl; + if (crawl.isHeld) { if (m_AllowScaling) { @@ -374,12 +373,18 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) continue; var otherLocomotionInput = locomotionTool.m_LocomotionInput; - var otherGrip = otherLocomotionInput.crawl; - if (otherGrip.isHeld) + var otherCrawl = otherLocomotionInput.crawl; + if (otherCrawl.isHeld) { otherGripHeld = true; - consumeControl(grip); - consumeControl(otherGrip); + consumeControl(crawl); + consumeControl(otherCrawl); + + // Also consume thumbstick axes to disable radial menu + consumeControl(m_LocomotionInput.horizontal); + consumeControl(m_LocomotionInput.vertical); + consumeControl(otherLocomotionInput.horizontal); + consumeControl(otherLocomotionInput.vertical); var thisPosition = cameraRig.InverseTransformPoint(rayOrigin.position); var otherRayOrigin = locomotionTool.rayOrigin; diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index b7520c100..f3cdda5cd 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -162,9 +162,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PressedObject = null; } - - if (multiSelectControl.wasJustPressed) - consumeControl(multiSelectControl); } bool GetSelectionCandidate(ref GameObject hoveredObject) From 70f07c2bc4d63f03f4b9e1d520495167218feab8 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 23 Jun 2017 14:12:21 -0700 Subject: [PATCH 509/870] Hide DefaultProxyRay when crawling and two-handed scaling; Fix issue when showing DefaultProxyRay at large viewer scales --- Scripts/Proxies/DefaultProxyRay.cs | 4 ++-- Tools/LocomotionTool/LocomotionTool.cs | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 863325b55..61ec6c550 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -179,9 +179,9 @@ private IEnumerator ShowRay() { m_Tip.transform.localScale = m_TipStartScale; - float viewerScale; + float viewerScale = this.GetViewerScale(); float scaledWidth; - var currentWidth = m_LineRenderer.widthStart; + var currentWidth = m_LineRenderer.widthStart / viewerScale; var smoothVelocity = 0f; const float kSmoothTime = 0.3125f; var currentDuration = 0f; diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 2a3370028..de9fcc7c7 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -308,6 +308,9 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; + + this.SetDefaultRayVisibility(rayOrigin, false); + this.LockRay(rayOrigin, this); } var localRayPosition = cameraRig.position - rayOrigin.position; @@ -316,6 +319,9 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) return true; } + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true); + m_Crawling = false; return false; } @@ -391,6 +397,11 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); + this.SetDefaultRayVisibility(rayOrigin, false); + this.LockRay(rayOrigin, this); + this.SetDefaultRayVisibility(otherRayOrigin, false); + this.LockRay(otherRayOrigin, this); + var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; @@ -516,9 +527,18 @@ void CancelScale() foreach (var linkedObject in linkedObjects) { - ((LocomotionTool)linkedObject).m_Scaling = false; + var locomotionTool = (LocomotionTool)linkedObject; + locomotionTool.m_Scaling = false; + + if (!locomotionTool.m_Crawling) + { + var rayOrigin = locomotionTool.rayOrigin; + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true); + } } + m_ViewerScaleVisuals.gameObject.SetActive(false); } From 8ca3315a3c097e6dba691884cbde95d649e02e95 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 23 Jun 2017 15:04:38 -0700 Subject: [PATCH 510/870] Fix menu hiding when dragging UI --- Scripts/Core/EditorVR.Menus.cs | 31 +++++++++++++++++++++++-------- Scripts/Core/EditorVR.Rays.cs | 5 +---- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index a2a8de16a..6f372874e 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -212,28 +212,43 @@ static Vector3 GetPointerPositionForRayOrigin(Transform rayOrigin) return rayOrigin.position + rayOrigin.forward * DirectSelection.GetPointerLength(rayOrigin); } - internal static void OnHover(GameObject go, RayEventData rayEventData) + internal static bool OnHover(MultipleRayInputModule.RaycastSource source) { + var go = source.draggedObject; + if (!go) + go = source.hoveredObject; + + if (go == null) + return false; + if (go == evr.gameObject) - return; + return false; - var rayOrigin = rayEventData.rayOrigin; + var eventData = source.eventData; + var rayOrigin = eventData.rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); if (deviceData != null) { if (go.transform.IsChildOf(deviceData.rayOrigin)) // Don't let UI on this hand block the menu - return; + return false; - var scaledPointerDistance = rayEventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); + var scaledPointerDistance = eventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); var isManipulator = go.GetComponentInParent() != null; var menus = deviceData.menuHideFlags.Keys.ToList(); - foreach (var menu in menus) + var hideDistance = deviceData.mainMenu.hideDistance; + if (!(isManipulator || scaledPointerDistance > hideDistance + k_MenuHideMargin)) { - // Only set if hidden--value is reset every frame - if (!(isManipulator || scaledPointerDistance > menu.hideDistance + k_MenuHideMargin)) + foreach (var menu in menus) + { + // Only set if hidden--value is reset every frame deviceData.menuHideFlags[menu] |= MenuHideFlags.OverUI; + } + + return true; } } + + return false; } internal static void UpdateAlternateMenuOnSelectionChanged(Transform rayOrigin) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 43f487e5d..6b3a5de89 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -206,11 +206,8 @@ void OnProxyActiveChanged(IProxy proxy) { if ((deviceData.menuHideFlags[deviceData.mainMenu] & Menus.MenuHideFlags.Hidden) == 0) { - if (source.hoveredObject) - { - Menus.OnHover(source.hoveredObject, source.eventData); + if (Menus.OnHover(source)) return true; - } return false; } From 1e96af3d1404e654a84995acd8753ba828eca607 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 23 Jun 2017 17:13:00 -0700 Subject: [PATCH 511/870] Fix direct selection not changing selection with right hand --- Tools/SelectionTool/SelectionTool.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index fa75e07a6..14f55007d 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -119,8 +119,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // Only overwrite an existing selection if it does not contain the hovered object // In the case of multi-select, only add, do not remove - if (m_SelectionInput.select.wasJustPressed && !Selection.objects.Contains(directHoveredObject)) - this.SelectObject(directHoveredObject, rayOrigin, multiSelect); + if (selectionTool.m_SelectionInput.select.wasJustPressed && !Selection.objects.Contains(directHoveredObject)) + this.SelectObject(directHoveredObject, directRayOrigin, multiSelect); GameObject lastHover; if (m_HoverGameObjects.TryGetValue(directRayOrigin, out lastHover) && lastHover != directHoveredObject) From 3f50fc706a3daa9db7c9ee3452f38d30608cd0b2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 23 Jun 2017 18:34:14 -0700 Subject: [PATCH 512/870] Extract SpatialHint arch from PinnedTool related classes --- .../Prefabs/PinnedToolsMenu.prefab | 168 ++++++++++++++++-- Menus/PinnedToolMenu/Scripts/HintArrow.cs | 82 --------- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 105 +++++++++++ .../{HintArrow.cs.meta => HintIcon.cs.meta} | 0 .../Scripts/PinnedToolsMenuUI.cs | 25 ++- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 61 +++++++ .../Scripts/SpatialHintUI.cs.meta | 12 ++ 7 files changed, 339 insertions(+), 114 deletions(-) delete mode 100644 Menus/PinnedToolMenu/Scripts/HintArrow.cs create mode 100644 Menus/PinnedToolMenu/Scripts/HintIcon.cs rename Menus/PinnedToolMenu/Scripts/{HintArrow.cs.meta => HintIcon.cs.meta} (100%) create mode 100644 Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs create mode 100644 Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs.meta diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 4e09e8c43..bfa26dd4b 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -201,6 +201,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4648779473311770} + - component: {fileID: 114410950009439322} m_Layer: 5 m_Name: FrontArrow m_TagString: Untagged @@ -315,6 +316,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4888922240738846} + - component: {fileID: 114878526282868244} m_Layer: 5 m_Name: BottomArrow m_TagString: Untagged @@ -494,6 +496,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4770502844307052} + - component: {fileID: 114749204276375926} m_Layer: 5 m_Name: LeftArrow m_TagString: Untagged @@ -575,6 +578,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4606543685854042} + - component: {fileID: 114389520305227152} m_Layer: 5 m_Name: TopArrow m_TagString: Untagged @@ -689,6 +693,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4688592375184416} + - component: {fileID: 114742037330891170} m_Layer: 5 m_Name: BackArrow m_TagString: Untagged @@ -837,6 +842,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4303414394448688} + - component: {fileID: 114690163547946086} m_Layer: 5 m_Name: RightArrow m_TagString: Untagged @@ -1272,23 +1278,7 @@ MonoBehaviour: m_AlternateLocalScale: {x: 0.54, y: 0.54, z: 0.54} m_HintContentContainer: {fileID: 224926333701432290} m_HintArrowsCanvasGroup: {fileID: 225918572929103210} - m_SecondaryHintArrows: - - {fileID: 114211348936724016} - - {fileID: 114343363037367066} - - {fileID: 114709129698682498} - - {fileID: 114263984546135386} - - {fileID: 114097487828792400} - - {fileID: 114952136032051262} - - {fileID: 114802558585402892} - - {fileID: 114156664202657108} - - {fileID: 114154224343743956} - - {fileID: 114350519079292674} - - {fileID: 114117379512495918} - - {fileID: 114755079460350674} - - {fileID: 114966871140878844} - - {fileID: 114039844972246400} - - {fileID: 114265858466807592} - - {fileID: 114451923332080912} + m_SpatialHintUI: {fileID: 114705618050563776} --- !u!114 &114000011597863712 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1344,6 +1334,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114242316492250394} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114097487828792400 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1356,6 +1348,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114555859501867138} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114106655877952548 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1395,6 +1389,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114737674627737730} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114137758696402814 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1461,6 +1457,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114183467226746200} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114156664202657108 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1473,6 +1471,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114823076312193430} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114183467226746200 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1539,6 +1539,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114581339146061258} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114219147691969104 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1632,6 +1634,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114197230093624006} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114265858466807592 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1644,6 +1648,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114742457022644888} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114269893187404902 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1683,6 +1689,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114880350798214428} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114350519079292674 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1695,6 +1703,36 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114106655877952548} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114389520305227152 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1657489799168288} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114724739900522476} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114410950009439322 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1133158312748406} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114813176157330038} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114451923332080912 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1707,6 +1745,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114467679702415144} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114467679702415144 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1896,6 +1936,20 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114690163547946086 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1931608236507870} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114025535967204422} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114705618050563776 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1904,9 +1958,33 @@ MonoBehaviour: m_GameObject: {fileID: 1113548126640048} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1e1e059687772584aa432d26dc4b12a1, type: 3} + m_Script: {fileID: 11500000, guid: a9e4377fb5567cc4ea23d3ad3d292114, type: 3} m_Name: m_EditorClassIdentifier: + m_PrimaryHintArrows: + - {fileID: 114389520305227152} + - {fileID: 114878526282868244} + - {fileID: 114749204276375926} + - {fileID: 114690163547946086} + - {fileID: 114410950009439322} + - {fileID: 114742037330891170} + m_SecondaryHintArrows: + - {fileID: 114211348936724016} + - {fileID: 114343363037367066} + - {fileID: 114709129698682498} + - {fileID: 114263984546135386} + - {fileID: 114097487828792400} + - {fileID: 114952136032051262} + - {fileID: 114802558585402892} + - {fileID: 114156664202657108} + - {fileID: 114154224343743956} + - {fileID: 114350519079292674} + - {fileID: 114117379512495918} + - {fileID: 114755079460350674} + - {fileID: 114966871140878844} + - {fileID: 114039844972246400} + - {fileID: 114265858466807592} + - {fileID: 114451923332080912} --- !u!114 &114709129698682498 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1919,6 +1997,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114222681976531280} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114724739900522476 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1973,6 +2053,20 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114742037330891170 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1768337939050664} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114804887785659340} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114742457022644888 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2000,6 +2094,20 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114749204276375926 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1573710362226728} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114153458796039378} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114755079460350674 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2012,6 +2120,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114269893187404902} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114802558585402892 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2024,6 +2134,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114219147691969104} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114804887785659340 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2105,6 +2217,20 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114878526282868244 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1374759649448910} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114563865778918000} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114880350798214428 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2144,6 +2270,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114598401377257748} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114966871140878844 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2156,6 +2284,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 114627454420162904} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!222 &222045765058194512 CanvasRenderer: m_ObjectHideFlags: 1 @@ -2784,7 +2914,7 @@ CanvasGroup: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1243100648521718} m_Enabled: 1 - m_Alpha: 0.15 + m_Alpha: 0.1 m_Interactable: 1 m_BlocksRaycasts: 1 m_IgnoreParentGroups: 0 diff --git a/Menus/PinnedToolMenu/Scripts/HintArrow.cs b/Menus/PinnedToolMenu/Scripts/HintArrow.cs deleted file mode 100644 index 7ac74860b..000000000 --- a/Menus/PinnedToolMenu/Scripts/HintArrow.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Security.Cryptography.X509Certificates; -using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEngine; -using UnityEngine.UI; -using Random = UnityEngine.Random; - -public class HintArrow : MonoBehaviour -{ - [SerializeField] - Image m_Icon; - - readonly Vector3 k_HiddenScale = Vector3.zero; - - Transform m_IconTransform; - Vector3 m_VisibleLocalScale; - Coroutine m_VisibilityCoroutine; - - public bool visible - { - set - { - if (value) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); - else - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); - } - } - - void Awake() - { - m_IconTransform = m_Icon.transform; - m_VisibleLocalScale = m_IconTransform.localScale * 1.25F; - m_Icon.color = Color.black; - visible = false; - } - - IEnumerator AnimateShow() - { - var currentDuration = 0f; - var targetDuration = 0f; - var currentLocalScale = m_IconTransform.localScale; - - if (currentLocalScale == k_HiddenScale) - { - // Only perform delay if fully hidden; otherwise resume showing - targetDuration = Random.Range(0.25f, 0.35f); // Set an initial random wait duration - while (currentDuration < targetDuration) - { - currentDuration += Time.unscaledDeltaTime; - yield return null; - } - } - - currentDuration = 0f; - targetDuration = 0.125f; // Set animated reveal duration - while (currentDuration < targetDuration) - { - m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, m_VisibleLocalScale, currentDuration / targetDuration); - currentDuration += Time.unscaledDeltaTime; - yield return null; - } - - m_IconTransform.localScale = m_VisibleLocalScale; - } - - IEnumerator AnimateHide() - { - var currentDuration = 0f; - var targetDuration = Random.Range(0.125f, 0.25f); // Set an initial random wait duration - var currentLocalScale = m_IconTransform.localScale; - while (currentDuration < targetDuration) - { - m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, k_HiddenScale, currentDuration / targetDuration); - currentDuration += Time.unscaledDeltaTime; - yield return null; - } - - m_IconTransform.localScale = k_HiddenScale; - } -} diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs new file mode 100644 index 000000000..b16c452d3 --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -0,0 +1,105 @@ +using System.Collections; +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; +using UnityEngine.UI; +using Random = UnityEngine.Random; + +namespace UnityEditor.Experimental.EditorVR.Menus +{ + public class HintIcon : MonoBehaviour + { + [SerializeField] + Image m_Icon; + + [SerializeField] + Color m_VisibleColor = Color.white; + + [SerializeField] + Color m_HiddenColor = Color.clear; + + readonly Vector3 k_HiddenScale = Vector3.zero; + + Transform m_IconTransform; + Vector3 m_VisibleLocalScale; + Coroutine m_VisibilityCoroutine; + + public bool visible + { + set + { + if (value) + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + else + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); + } + } + + public Color visibleColor + { + set + { + m_VisibleColor = value; + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + } + } + + void Awake() + { + m_IconTransform = m_Icon.transform; + m_VisibleLocalScale = m_IconTransform.localScale * 1.25F; + m_Icon.color = m_VisibleColor; + visible = false; + } + + IEnumerator AnimateShow() + { + var currentDuration = 0f; + var targetDuration = 0f; + var currentLocalScale = m_IconTransform.localScale; + if (currentLocalScale == k_HiddenScale) + { + // Only perform delay if fully hidden; otherwise resume showing + targetDuration = Random.Range(0.25f, 0.35f); // Set an initial random wait duration + while (currentDuration < targetDuration) + { + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + } + + currentDuration = 0f; + targetDuration = 0.125f; // Set animated reveal duration + var currentColor = m_Icon.color; + while (currentDuration < targetDuration) + { + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / targetDuration); + m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, m_VisibleLocalScale, shapedDuration); + m_Icon.color = Color.Lerp(currentColor, m_VisibleColor, shapedDuration); + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + + m_IconTransform.localScale = m_VisibleLocalScale; + } + + IEnumerator AnimateHide() + { + var currentDuration = 0f; + var targetDuration = Random.Range(0.125f, 0.25f); // Set an initial random wait duration + var currentLocalScale = m_IconTransform.localScale; + var currentColor = m_Icon.color; + while (currentDuration < targetDuration) + { + m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, k_HiddenScale, currentDuration / targetDuration); + m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + + m_IconTransform.localScale = k_HiddenScale; + } + } +} diff --git a/Menus/PinnedToolMenu/Scripts/HintArrow.cs.meta b/Menus/PinnedToolMenu/Scripts/HintIcon.cs.meta similarity index 100% rename from Menus/PinnedToolMenu/Scripts/HintArrow.cs.meta rename to Menus/PinnedToolMenu/Scripts/HintIcon.cs.meta diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 6270455e5..08f9cae1e 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -3,13 +3,10 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Security.Cryptography.X509Certificates; -using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -using System.Text; namespace UnityEditor.Experimental.EditorVR.Menus { @@ -36,7 +33,7 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale CanvasGroup m_HintArrowsCanvasGroup; [SerializeField] - HintArrow[] m_SecondaryHintArrows; + SpatialHintUI m_SpatialHintUI; bool m_AllButtonsVisible; List m_OrderedButtons; @@ -147,17 +144,21 @@ void Update() var newHintContainerRotation = m_HintContentContainerInitialRotation; if (m_SpatialDragDistance > 1f && m_SmoothedSpatialDragDistance < 1) { + /* // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold //Debug.LogError("INSIDE rotation update loop"); m_SmoothedSpatialDragDistance = Mathf.Clamp01(m_SmoothedSpatialDragDistance += Time.unscaledDeltaTime * 1.5f); var shapedDragAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(m_SmoothedSpatialDragDistance), 6); m_HintContentContainerCurrentRotation = Quaternion.Lerp(m_HintContentContainerInitialRotation, m_SpatialScrollOrientation, shapedDragAmount); newHintContainerRotation = m_HintContentContainerCurrentRotation; + */ } + /* else if (Mathf.Approximately(m_SmoothedSpatialDragDistance, 1f)) newHintContainerRotation = m_HintContentContainerCurrentRotation; else m_HintContentWorldPosition = Vector3.Lerp(m_HintContentWorldPosition, transform.position, Time.unscaledDeltaTime * 6); + */ //Debug.LogError("Hint Container" + m_HintContentContainerInitialRotation); //Debug.LogError("UI" + transform.rotation); @@ -296,6 +297,8 @@ void SetupButtonOrder() void ShowAllExceptMenuButton() { Debug.LogError("ShowAllExceptMenuButton"); + + m_SpatialHintUI.enableSelectVisuals = true; m_VisibleButtonCount = Mathf.Max(0, m_OrderedButtons.Count - 1); // The MainMenu button will be hidden, subtract 1 from the m_VisibleButtonCount for (int i = 0; i < m_OrderedButtons.Count; ++i) { @@ -519,10 +522,7 @@ void OnButtonHover() IEnumerator ShowHintContent() { - foreach (var arrow in m_SecondaryHintArrows) - { - arrow.visible = true; - } + m_SpatialHintUI.enablePreSelectVisuals = true; var currentScale = m_HintContentContainer.localScale; var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals @@ -541,17 +541,16 @@ IEnumerator ShowHintContent() IEnumerator HideHintContent() { - foreach (var arrow in m_SecondaryHintArrows) - { - arrow.visible = false; - } + m_SpatialHintUI.enableSelectVisuals = false; + + yield break; var currentScale = m_HintContentContainer.localScale; var timeElapsed = 1 - currentScale.x; var targetScale = Vector3.zero; while (timeElapsed < 1f) { - timeElapsed += Time.unscaledDeltaTime * 2f; + timeElapsed += Time.unscaledDeltaTime * 4f; var durationShaped = MathUtilsExt.SmoothInOutLerpFloat(timeElapsed); m_HintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); yield return null; diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs new file mode 100644 index 000000000..d5c14eeaf --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -0,0 +1,61 @@ +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Menus +{ + public class SpatialHintUI : MonoBehaviour + { + [SerializeField] + HintIcon[] m_PrimaryHintArrows; + + [SerializeField] + HintIcon[] m_SecondaryHintArrows; + + public bool enablePreSelectVisuals + { + set + { + var semiTransparentWhite = new Color(1f, 1f, 1f, 0.5f); + foreach (var arrow in m_PrimaryHintArrows) + { + arrow.visibleColor = semiTransparentWhite; + } + + foreach (var arrow in m_SecondaryHintArrows) + { + arrow.visible = true; + } + } + } + + public bool enableSelectVisuals + { + set + { + if (value) + { + foreach (var arrow in m_PrimaryHintArrows) + { + arrow.visibleColor = Color.white; + } + + foreach (var arrow in m_SecondaryHintArrows) + { + arrow.visible = false; + } + } + else + { + foreach (var arrow in m_SecondaryHintArrows) + { + arrow.visible = false; + } + + foreach (var arrow in m_PrimaryHintArrows) + { + arrow.visible = false; + } + } + } + } + } +} \ No newline at end of file diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs.meta b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs.meta new file mode 100644 index 000000000..c5dda0972 --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a9e4377fb5567cc4ea23d3ad3d292114 +timeCreated: 1498266481 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 7815adac71c3b98e70b61fbebd06ccedd79f1bd1 Mon Sep 17 00:00:00 2001 From: andrewm Date: Mon, 26 Jun 2017 12:25:37 -0700 Subject: [PATCH 513/870] Removed DisconnectInterfaces that took an inputDevice parameter --- Scripts/Core/EditorVR.Interfaces.cs | 10 ---------- Scripts/Core/EditorVR.Tools.cs | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Scripts/Core/EditorVR.Interfaces.cs b/Scripts/Core/EditorVR.Interfaces.cs index f8d8ae04a..2ca6701d6 100644 --- a/Scripts/Core/EditorVR.Interfaces.cs +++ b/Scripts/Core/EditorVR.Interfaces.cs @@ -51,16 +51,6 @@ internal void ConnectInterfaces(object obj, Transform rayOrigin = null) connectInterfaces(obj, rayOrigin); } - internal void DisconnectInterfaces(object obj, InputDevice device) - { - Transform rayOrigin = null; - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.inputDevice == device); - if (deviceData != null) - rayOrigin = deviceData.rayOrigin; - - DisconnectInterfaces(obj, rayOrigin); - } - internal void DisconnectInterfaces(object obj, Transform rayOrigin = null) { m_ConnectedInterfaces.Remove(obj); diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 4b1b0328e..9f5ca37e8 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -289,7 +289,7 @@ static void DespawnTool(DeviceData deviceData, ITool tool) } } } - evr.m_Interfaces.DisconnectInterfaces(tool, deviceData.inputDevice); + evr.m_Interfaces.DisconnectInterfaces(tool, deviceData.rayOrigin); // Exclusive tools disable other tools underneath, so restore those if (tool is IExclusiveMode) From be31405caa7acf79f658ba1587a1d47abcfe90bb Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 26 Jun 2017 20:24:05 -0700 Subject: [PATCH 514/870] Add anchored drag direction visuals --- .../PinnedToolButton/PinnedToolButton.cs | 4 +- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 +- .../Prefabs/PinnedToolsMenu.prefab | 571 +++++++++++++----- .../Scripts/PinnedToolsMenuUI.cs | 65 +- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 109 +++- 5 files changed, 555 insertions(+), 196 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 2a1f1c3fb..e07c8f781 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -44,11 +44,11 @@ public Type toolType if (m_ToolType != null) { Debug.LogError("Setting up button type : " + m_ToolType.ToString()); + gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair if (isSelectionTool || isMainMenu) { //order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; - gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair secondaryButtonCollidersEnabled = false; } else @@ -56,7 +56,7 @@ public Type toolType tooltipText = toolType.Name; // Tools other than select fetch a random gradientPair; also used by the device when revealed - gradientPair = UnityBrandColorScheme.GetRandomCuratedLightGradient(); + //gradientPair = UnityBrandColorScheme.GetRandomCuratedLightGradient(); } activeTool = activeTool; diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index a9723b983..a1ac925a7 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -336,7 +336,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, { spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton Debug.LogError("" + spatialDirection.Value.ToString("F4") + ""); - m_PinnedToolsMenuUI.spatialDirectionVector = spatialDirection; + m_PinnedToolsMenuUI.startingDragOrigin = spatialDirection; } } else diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index bfa26dd4b..0ad98f4dc 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -59,6 +59,22 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1049941617855090 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224516350747140734} + - component: {fileID: 225496513774942428} + m_Layer: 5 + m_Name: ScrollVisuals + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1052082992177756 GameObject: m_ObjectHideFlags: 1 @@ -75,6 +91,22 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1058135006110656 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4777470692906276} + - component: {fileID: 114120675658605384} + m_Layer: 5 + m_Name: RightArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1058196337944694 GameObject: m_ObjectHideFlags: 1 @@ -187,7 +219,7 @@ GameObject: - component: {fileID: 225918572929103210} - component: {fileID: 114705618050563776} m_Layer: 5 - m_Name: ArrowsContainer + m_Name: SpatialHintUI m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -274,6 +306,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1269561316698028 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4967341377978414} + m_Layer: 5 + m_Name: RightArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1277691287488752 GameObject: m_ObjectHideFlags: 1 @@ -471,34 +518,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1542713640412182 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224496829589271966} - - component: {fileID: 222735165262294470} - - component: {fileID: 114025535967204422} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1573710362226728 +--- !u!1 &1559511730278864 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4770502844307052} - - component: {fileID: 114749204276375926} + - component: {fileID: 4406467021179730} m_Layer: 5 - m_Name: LeftArrow + m_Name: LeftArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -635,6 +664,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1680574195269602 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224965907269186458} + - component: {fileID: 222619279999190876} + - component: {fileID: 114370147208166848} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1689057037272646 GameObject: m_ObjectHideFlags: 1 @@ -669,6 +715,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1721480280295696 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224066018184099266} + - component: {fileID: 222387717327774104} + - component: {fileID: 114126998682949342} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1736942055089654 GameObject: m_ObjectHideFlags: 1 @@ -685,6 +748,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1765042644591010 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224602939580724082} + - component: {fileID: 222576415916729906} + - component: {fileID: 114349826085895928} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1768337939050664 GameObject: m_ObjectHideFlags: 1 @@ -735,34 +815,33 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1822357995854076 +--- !u!1 &1837478099313884 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224373908585438004} - - component: {fileID: 222363707075413156} - - component: {fileID: 114153458796039378} + - component: {fileID: 4298904777987284} + - component: {fileID: 114154224343743956} m_Layer: 5 - m_Name: Icon + m_Name: RightArrow (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1837478099313884 +--- !u!1 &1859289517789558 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4298904777987284} - - component: {fileID: 114154224343743956} + - component: {fileID: 4580549783542080} + - component: {fileID: 114626721792749568} m_Layer: 5 - m_Name: RightArrow (3) + m_Name: LeftArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -783,16 +862,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!1 &1909408486964086 +--- !u!1 &1884907985164560 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224265400135533474} - - component: {fileID: 222240515654960256} - - component: {fileID: 114222681976531280} + - component: {fileID: 224968954540649746} + - component: {fileID: 222330902578677406} + - component: {fileID: 114648102325649086} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -800,16 +879,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1909738417943642 +--- !u!1 &1909408486964086 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224846752056185278} - - component: {fileID: 222504959554748288} - - component: {fileID: 114106655877952548} + - component: {fileID: 224265400135533474} + - component: {fileID: 222240515654960256} + - component: {fileID: 114222681976531280} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -817,16 +896,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1914077346605324 +--- !u!1 &1909738417943642 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224053839113242232} - - component: {fileID: 222234007190448478} - - component: {fileID: 114467679702415144} + - component: {fileID: 224846752056185278} + - component: {fileID: 222504959554748288} + - component: {fileID: 114106655877952548} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -834,17 +913,18 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1931608236507870 +--- !u!1 &1914077346605324 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4303414394448688} - - component: {fileID: 114690163547946086} + - component: {fileID: 224053839113242232} + - component: {fileID: 222234007190448478} + - component: {fileID: 114467679702415144} m_Layer: 5 - m_Name: RightArrow + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -979,20 +1059,6 @@ Transform: m_Father: {fileID: 4424188858784126} m_RootOrder: 10 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} ---- !u!4 &4303414394448688 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1931608236507870} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: -0.35749826, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224496829589271966} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} --- !u!4 &4348701280787806 Transform: m_ObjectHideFlags: 1 @@ -1021,6 +1087,20 @@ Transform: m_Father: {fileID: 4424188858784126} m_RootOrder: 17 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} +--- !u!4 &4406467021179730 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1559511730278864} + m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: -0.35749817} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224965907269186458} + m_Father: {fileID: 224516350747140734} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} --- !u!4 &4416256937175418 Transform: m_ObjectHideFlags: 1 @@ -1064,7 +1144,7 @@ Transform: - {fileID: 4575203095433520} - {fileID: 4386844247658442} m_Father: {fileID: 224926333701432290} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 90.00001, z: 45.000004} --- !u!4 &4574955065994976 Transform: @@ -1094,6 +1174,20 @@ Transform: m_Father: {fileID: 4424188858784126} m_RootOrder: 16 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} +--- !u!4 &4580549783542080 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1859289517789558} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224066018184099266} + m_Father: {fileID: 224926333701432290} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} --- !u!4 &4606543685854042 Transform: m_ObjectHideFlags: 1 @@ -1106,7 +1200,7 @@ Transform: m_Children: - {fileID: 224563120333433268} m_Father: {fileID: 224926333701432290} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4627373214459226 Transform: @@ -1134,7 +1228,7 @@ Transform: m_Children: - {fileID: 224141220472168564} m_Father: {fileID: 224926333701432290} - m_RootOrder: 5 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} --- !u!4 &4679261784804500 Transform: @@ -1162,7 +1256,7 @@ Transform: m_Children: - {fileID: 224043746415228348} m_Father: {fileID: 224926333701432290} - m_RootOrder: 6 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} --- !u!4 &4691544615733376 Transform: @@ -1178,19 +1272,19 @@ Transform: m_Father: {fileID: 4424188858784126} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} ---- !u!4 &4770502844307052 +--- !u!4 &4777470692906276 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1573710362226728} + m_GameObject: {fileID: 1058135006110656} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0.35749826, y: 0, z: 0} + m_LocalPosition: {x: -0.35749826, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224373908585438004} + - {fileID: 224602939580724082} m_Father: {fileID: 224926333701432290} - m_RootOrder: 3 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} --- !u!4 &4883774153867170 Transform: @@ -1218,7 +1312,7 @@ Transform: m_Children: - {fileID: 224598666989053882} m_Father: {fileID: 224926333701432290} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4925765156807252 Transform: @@ -1262,6 +1356,20 @@ Transform: m_Father: {fileID: 4424188858784126} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4967341377978414 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1269561316698028} + m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0.3574982} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224968954540649746} + m_Father: {fileID: 224516350747140734} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} --- !u!114 &114000010527895234 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1295,33 +1403,6 @@ MonoBehaviour: m_SmoothPosition: 1 m_TightenPosition: 50 m_Target: {fileID: 0} ---- !u!114 &114025535967204422 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1542713640412182} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 --- !u!114 &114039844972246400 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1391,12 +1472,26 @@ MonoBehaviour: m_Icon: {fileID: 114737674627737730} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114137758696402814 +--- !u!114 &114120675658605384 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1288076055191678} + m_GameObject: {fileID: 1058135006110656} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114349826085895928} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114126998682949342 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1721480280295696} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1418,12 +1513,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114153458796039378 +--- !u!114 &114137758696402814 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1822357995854076} + m_GameObject: {fileID: 1288076055191678} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1691,6 +1786,33 @@ MonoBehaviour: m_Icon: {fileID: 114880350798214428} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114349826085895928 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1765042644591010} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 --- !u!114 &114350519079292674 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1705,6 +1827,33 @@ MonoBehaviour: m_Icon: {fileID: 114106655877952548} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114370147208166848 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680574195269602} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 0.428} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 --- !u!114 &114389520305227152 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1909,6 +2058,20 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114626721792749568 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1859289517789558} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114126998682949342} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114627454420162904 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1936,20 +2099,33 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114690163547946086 +--- !u!114 &114648102325649086 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1931608236507870} + m_GameObject: {fileID: 1884907985164560} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114025535967204422} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 0.428} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 --- !u!114 &114705618050563776 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1961,14 +2137,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a9e4377fb5567cc4ea23d3ad3d292114, type: 3} m_Name: m_EditorClassIdentifier: - m_PrimaryHintArrows: + m_PrimaryDirectionalHintArrows: - {fileID: 114389520305227152} - {fileID: 114878526282868244} - - {fileID: 114749204276375926} - - {fileID: 114690163547946086} + - {fileID: 114626721792749568} + - {fileID: 114120675658605384} - {fileID: 114410950009439322} - {fileID: 114742037330891170} - m_SecondaryHintArrows: + m_SecondaryDirectionalHintArrows: - {fileID: 114211348936724016} - {fileID: 114343363037367066} - {fileID: 114709129698682498} @@ -1985,6 +2161,9 @@ MonoBehaviour: - {fileID: 114039844972246400} - {fileID: 114265858466807592} - {fileID: 114451923332080912} + m_PrimaryRotationalHintArrows: [] + m_SecondaryRotationalHintArrows: [] + m_ScrollVisualsCanvasGroup: {fileID: 225496513774942428} --- !u!114 &114709129698682498 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2094,20 +2273,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114749204276375926 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1573710362226728} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114153458796039378} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114755079460350674 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2322,18 +2487,24 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1909408486964086} ---- !u!222 &222363707075413156 +--- !u!222 &222330902578677406 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1822357995854076} + m_GameObject: {fileID: 1884907985164560} --- !u!222 &222381275818579690 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1677176722312172} +--- !u!222 &222387717327774104 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1721480280295696} --- !u!222 &222410890664544046 CanvasRenderer: m_ObjectHideFlags: 1 @@ -2382,18 +2553,24 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1422966589754858} +--- !u!222 &222576415916729906 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1765042644591010} --- !u!222 &222609766870474766 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1086640583229492} ---- !u!222 &222735165262294470 +--- !u!222 &222619279999190876 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1542713640412182} + m_GameObject: {fileID: 1680574195269602} --- !u!222 &222746842890793678 CanvasRenderer: m_ObjectHideFlags: 1 @@ -2486,6 +2663,24 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224066018184099266 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1721480280295696} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4580549783542080} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224106935460784972 RectTransform: m_ObjectHideFlags: 1 @@ -2630,24 +2825,6 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224373908585438004 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1822357995854076} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4770502844307052} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224402193235821058 RectTransform: m_ObjectHideFlags: 1 @@ -2702,23 +2879,25 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224496829589271966 +--- !u!224 &224516350747140734 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1542713640412182} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4303414394448688} + m_GameObject: {fileID: 1049941617855090} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00007861845} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4967341377978414} + - {fileID: 4406467021179730} + m_Father: {fileID: 224926333701432290} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_AnchoredPosition: {x: 0.00007836966, y: 0} + m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224523839693825596 RectTransform: @@ -2774,6 +2953,24 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224602939580724082 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1765042644591010} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4777470692906276} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224665261672936376 RectTransform: m_ObjectHideFlags: 1 @@ -2874,11 +3071,12 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 224516350747140734} - {fileID: 4424188858784126} - {fileID: 4606543685854042} - {fileID: 4888922240738846} - - {fileID: 4770502844307052} - - {fileID: 4303414394448688} + - {fileID: 4580549783542080} + - {fileID: 4777470692906276} - {fileID: 4648779473311770} - {fileID: 4688592375184416} m_Father: {fileID: 4000011260103804} @@ -2907,6 +3105,53 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224965907269186458 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1680574195269602} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4406467021179730} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224968954540649746 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1884907985164560} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4967341377978414} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &225496513774942428 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1049941617855090} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 --- !u!225 &225892931205557926 CanvasGroup: m_ObjectHideFlags: 1 @@ -2914,9 +3159,9 @@ CanvasGroup: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1243100648521718} m_Enabled: 1 - m_Alpha: 0.1 - m_Interactable: 1 - m_BlocksRaycasts: 1 + m_Alpha: 0.05 + m_Interactable: 0 + m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 --- !u!225 &225918572929103210 CanvasGroup: @@ -2926,6 +3171,6 @@ CanvasGroup: m_GameObject: {fileID: 1113548126640048} m_Enabled: 1 m_Alpha: 1 - m_Interactable: 1 + m_Interactable: 0 m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 08f9cae1e..9dc94739f 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Security.Cryptography.X509Certificates; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; @@ -10,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -46,11 +47,11 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale Vector3 m_OriginalLocalScale; bool m_RayHovered; float m_SpatialDragDistance; - float m_SmoothedSpatialDragDistance; + float m_SmoothDragDuration; Quaternion m_HintContentContainerInitialRotation; Quaternion m_HintContentContainerCurrentRotation; Vector3 m_HintContentWorldPosition; - Quaternion m_SpatialScrollOrientation; + //Quaternion m_SpatialScrollOrientation; public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } @@ -103,8 +104,8 @@ public float spatialDragDistance if (Mathf.Approximately(value, 0f)) { m_SpatialDragDistance = 0f; - m_SmoothedSpatialDragDistance = 0f; - m_SpatialScrollOrientation = Quaternion.identity; + m_SmoothDragDuration = 0f; + m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; var currentRotation = transform.rotation.eulerAngles; m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); this.RestartCoroutine(ref m_HintContentVisibilityCoroutine, ShowHintContent()); @@ -117,14 +118,17 @@ public float spatialDragDistance } } - public Vector3? spatialDirectionVector + public Vector3? startingDragOrigin { set { + Debug.LogWarning("SETTING STARGIN DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); + m_StartingDragOrigin = transform.position; + var orig = m_HintContentContainer.rotation; m_HintContentContainer.LookAt(value.Value); Debug.LogError(value.Value.ToString("F4")); - m_SpatialScrollOrientation = Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); + //m_SpatialScrollOrientation = Quaternion.Euler(value.Value); // Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); m_HintContentContainer.rotation = orig; } } @@ -132,6 +136,10 @@ public Vector3? spatialDirectionVector public event Action buttonHovered; public event Action buttonClicked; + private Vector3 m_StartingDragOrigin; + private Vector3 m_InitialDragTarget; + private IUsesNode m_UsesNodeImplementation; + void Awake() { m_OriginalLocalScale = transform.localScale; @@ -142,17 +150,29 @@ void Awake() void Update() { var newHintContainerRotation = m_HintContentContainerInitialRotation; - if (m_SpatialDragDistance > 1f && m_SmoothedSpatialDragDistance < 1) + if (m_SpatialDragDistance > 1f && m_SmoothDragDuration < 0.99) { - /* + if (Mathf.Approximately(m_SmoothDragDuration, 0f)) + m_InitialDragTarget = transform.position; // Cache the initial drag target position + + //m_SpatialDragDistance = 0f; // reset drag distance + m_SpatialHintUI.enablePrimaryArrowVisuals = false; + m_SpatialHintUI.scrollVisualsRotation = Vector3.Lerp(m_InitialDragTarget, transform.position, m_SmoothDragDuration); // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold - //Debug.LogError("INSIDE rotation update loop"); - m_SmoothedSpatialDragDistance = Mathf.Clamp01(m_SmoothedSpatialDragDistance += Time.unscaledDeltaTime * 1.5f); - var shapedDragAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(m_SmoothedSpatialDragDistance), 6); - m_HintContentContainerCurrentRotation = Quaternion.Lerp(m_HintContentContainerInitialRotation, m_SpatialScrollOrientation, shapedDragAmount); - newHintContainerRotation = m_HintContentContainerCurrentRotation; - */ + Debug.LogError("INSIDE rotation update loop"); + + m_SpatialDragDistance += Time.unscaledDeltaTime; + var smoothDuration = m_SpatialDragDistance - 1f; + m_SmoothDragDuration = 1 - MathUtilsExt.SmoothInOutLerpFloat(m_SmoothDragDuration += Time.unscaledDeltaTime * 0.5f); + + /* + var shapedDragAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(m_SmoothedSpatialDragDistance), 6); + m_HintContentContainerCurrentRotation = Quaternion.Lerp(m_HintContentContainerInitialRotation, m_SpatialScrollOrientation, shapedDragAmount); + newHintContainerRotation = m_HintContentContainerCurrentRotation; + */ } + + //m_SpatialHintUI.scrollVisualsRotation = Quaternion.Euler(endingDragDefinitionPosition - startingDragDefinitionPosition); /* else if (Mathf.Approximately(m_SmoothedSpatialDragDistance, 1f)) newHintContainerRotation = m_HintContentContainerCurrentRotation; @@ -165,6 +185,8 @@ void Update() m_HintContentContainer.rotation = newHintContainerRotation; m_HintContentContainer.position = m_HintContentWorldPosition; + + Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); } public void AddButton(IPinnedToolButton button, Transform buttonTransform) @@ -297,8 +319,8 @@ void SetupButtonOrder() void ShowAllExceptMenuButton() { Debug.LogError("ShowAllExceptMenuButton"); - - m_SpatialHintUI.enableSelectVisuals = true; + //m_SpatialHintUI.enableVisuals = true; + //m_SpatialHintUI.scrollVisualsRotation = m_SpatialScrollOrientation; m_VisibleButtonCount = Mathf.Max(0, m_OrderedButtons.Count - 1); // The MainMenu button will be hidden, subtract 1 from the m_VisibleButtonCount for (int i = 0; i < m_OrderedButtons.Count; ++i) { @@ -522,7 +544,7 @@ void OnButtonHover() IEnumerator ShowHintContent() { - m_SpatialHintUI.enablePreSelectVisuals = true; + m_SpatialHintUI.enablePreviewVisuals = true; var currentScale = m_HintContentContainer.localScale; var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals @@ -541,7 +563,7 @@ IEnumerator ShowHintContent() IEnumerator HideHintContent() { - m_SpatialHintUI.enableSelectVisuals = false; + m_SpatialHintUI.enableVisuals = false; yield break; @@ -559,6 +581,11 @@ IEnumerator HideHintContent() m_HintContentContainer.localScale = targetScale; m_HintContentVisibilityCoroutine = null; } + + public Node? node + { + set { m_UsesNodeImplementation.node = value; } + } } } #endif diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index d5c14eeaf..94cd43e43 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -1,61 +1,148 @@ using UnityEngine; +using UnityEngine.Serialization; namespace UnityEditor.Experimental.EditorVR.Menus { public class SpatialHintUI : MonoBehaviour { + readonly Color k_PrimaryArrowColor = Color.white; + + [SerializeField] [FormerlySerializedAs("m_PrimaryHintArrows")] + HintIcon[] m_PrimaryDirectionalHintArrows; + + [SerializeField] [FormerlySerializedAs("m_SecondaryHintArrows")] + HintIcon[] m_SecondaryDirectionalHintArrows; + [SerializeField] - HintIcon[] m_PrimaryHintArrows; + HintIcon[] m_PrimaryRotationalHintArrows; [SerializeField] - HintIcon[] m_SecondaryHintArrows; + HintIcon[] m_SecondaryRotationalHintArrows; + + [SerializeField] + CanvasGroup m_ScrollVisualsCanvasGroup; + + Vector3? m_ScrollVisualsRotation; + Transform m_ScrollVisualsTransform; + GameObject m_ScrollVisualsGameObject; - public bool enablePreSelectVisuals + /// + /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action + /// This is only enabled before the enabling of the main select visuals + /// + public bool enablePreviewVisuals { set { var semiTransparentWhite = new Color(1f, 1f, 1f, 0.5f); - foreach (var arrow in m_PrimaryHintArrows) + foreach (var arrow in m_PrimaryDirectionalHintArrows) { arrow.visibleColor = semiTransparentWhite; } - foreach (var arrow in m_SecondaryHintArrows) + foreach (var arrow in m_SecondaryDirectionalHintArrows) { arrow.visible = true; } } } - public bool enableSelectVisuals + public bool enablePrimaryArrowVisuals + { + set + { + if (value) + { + foreach (var arrow in m_PrimaryDirectionalHintArrows) + { + arrow.visibleColor = k_PrimaryArrowColor; + } + } + else + { + foreach (var arrow in m_PrimaryDirectionalHintArrows) + { + arrow.visible = false; + } + } + } + } + + public bool enableVisuals { set { if (value) { - foreach (var arrow in m_PrimaryHintArrows) + foreach (var arrow in m_PrimaryDirectionalHintArrows) { - arrow.visibleColor = Color.white; + arrow.visibleColor = k_PrimaryArrowColor; } - foreach (var arrow in m_SecondaryHintArrows) + foreach (var arrow in m_SecondaryDirectionalHintArrows) { arrow.visible = false; } } else { - foreach (var arrow in m_SecondaryHintArrows) + foreach (var arrow in m_PrimaryDirectionalHintArrows) { arrow.visible = false; } - foreach (var arrow in m_PrimaryHintArrows) + foreach (var arrow in m_SecondaryDirectionalHintArrows) { arrow.visible = false; } } } } + + /// + /// If non-null, enable and set the world rotation of the scroll visuals + /// + public Vector3? scrollVisualsRotation + { + // Set null In order to hide the scroll visuals + set + { + if (m_ScrollVisualsRotation == null && value == null) + return; + + var newRotation = value; + + //if (m_ScrollVisualsRotation == newRotation) + //return; + + m_ScrollVisualsRotation = newRotation; + if (m_ScrollVisualsRotation != null) + { + Debug.LogError("SHOWING SPATIAL SCROLL VISUALS"); + + // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector + m_ScrollVisualsGameObject.SetActive(true); + m_ScrollVisualsCanvasGroup.alpha = 1f; + //m_ScrollVisualsTransform.rotation = m_ScrollVisualsRotation.Value; + m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation.Value); + } + else + { + Debug.LogError("HIDING SPATIAL SCROLL VISUALS"); + + // Hide the scroll visuals + m_ScrollVisualsCanvasGroup.alpha = 1; + m_ScrollVisualsGameObject.SetActive(false); + } + } + } + + void Awake() + { + m_ScrollVisualsTransform = m_ScrollVisualsCanvasGroup.transform; + m_ScrollVisualsGameObject = m_ScrollVisualsTransform.gameObject; + m_ScrollVisualsCanvasGroup.alpha = 0f; + m_ScrollVisualsGameObject.SetActive(false); + } } } \ No newline at end of file From 2ad5b3ebfc1eaf1b6490ffaba2f30a2d3762e094 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 29 Jun 2017 20:50:22 -0700 Subject: [PATCH 515/870] Fix a various ToolFlow input bugs; add support for setting scrollVisuals characteristics in PinnedToolsMenuUI & SpatialHint --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 + .../Prefabs/PinnedToolsMenu.prefab | 10 +-- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 2 - .../Scripts/PinnedToolsMenuUI.cs | 49 ++++++++--- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 88 +++++++++++++------ 5 files changed, 102 insertions(+), 49 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index a1ac925a7..333a3c579 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -230,6 +230,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // Hide if no direction as been defined after a given duration m_PinnedToolsMenuUI.allButtonsVisible = false; allowSpatialScrollBeforeThisTime = null; + m_PinnedToolsMenuUI.spatialScrollVisualsVisible = false; return; } @@ -302,6 +303,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (spatialDirection != null) { m_PinnedToolsMenuUI.SelectHighlightedButton(); + m_PinnedToolsMenuUI.spatialDragDistance = 0f; // Triggers the display of the directional hint arrows spatialDirection = null; consumeControl(pinnedToolInput.select); this.Pulse(node, m_HidingPulse); diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 0ad98f4dc..4399ac7a7 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -2161,8 +2161,6 @@ MonoBehaviour: - {fileID: 114039844972246400} - {fileID: 114265858466807592} - {fileID: 114451923332080912} - m_PrimaryRotationalHintArrows: [] - m_SecondaryRotationalHintArrows: [] m_ScrollVisualsCanvasGroup: {fileID: 225496513774942428} --- !u!114 &114709129698682498 MonoBehaviour: @@ -2885,8 +2883,8 @@ RectTransform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1049941617855090} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.00007861845} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00007861798} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4967341377978414} @@ -2896,7 +2894,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.00007836966, y: 0} + m_AnchoredPosition: {x: 0.00007836922, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224523839693825596 @@ -3159,7 +3157,7 @@ CanvasGroup: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1243100648521718} m_Enabled: 1 - m_Alpha: 0.05 + m_Alpha: 0.025 m_Interactable: 0 m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index b16c452d3..ddf1092db 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -1,6 +1,4 @@ using System.Collections; -using System.Collections.Generic; -using System.Security.Cryptography.X509Certificates; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 9dc94739f..c7c24dde3 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -3,7 +3,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Security.Cryptography.X509Certificates; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; @@ -47,7 +46,6 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I Vector3 m_OriginalLocalScale; bool m_RayHovered; float m_SpatialDragDistance; - float m_SmoothDragDuration; Quaternion m_HintContentContainerInitialRotation; Quaternion m_HintContentContainerCurrentRotation; Vector3 m_HintContentWorldPosition; @@ -97,6 +95,15 @@ public bool moveToAlternatePosition private bool aboveMinimumButtonCount { get { return m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1; } } + public bool spatialScrollVisualsVisible + { + set + { + if (!value) + m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; + } + } + public float spatialDragDistance { set @@ -104,7 +111,6 @@ public float spatialDragDistance if (Mathf.Approximately(value, 0f)) { m_SpatialDragDistance = 0f; - m_SmoothDragDuration = 0f; m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; var currentRotation = transform.rotation.eulerAngles; m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); @@ -137,7 +143,7 @@ public Vector3? startingDragOrigin public event Action buttonClicked; private Vector3 m_StartingDragOrigin; - private Vector3 m_InitialDragTarget; + private Vector3 m_DragTarget; private IUsesNode m_UsesNodeImplementation; void Awake() @@ -150,27 +156,42 @@ void Awake() void Update() { var newHintContainerRotation = m_HintContentContainerInitialRotation; - if (m_SpatialDragDistance > 1f && m_SmoothDragDuration < 0.99) + + // Perform activation of visuals after the user has dragged beyond the initial drag trigger threshold + // The drag distance is a 0-1 lerped value, based off of the origin to trigger magnitude + if (m_SpatialDragDistance >= 1f && m_SpatialDragDistance < 2) { - if (Mathf.Approximately(m_SmoothDragDuration, 0f)) - m_InitialDragTarget = transform.position; // Cache the initial drag target position + if (Mathf.Approximately(m_SpatialDragDistance, 1f)) + { + m_DragTarget = transform.position; // Cache the initial drag target position, before performing any extra shapting to the target Vec3 + m_SpatialHintUI.enablePrimaryArrowVisuals = false; + m_SpatialHintUI.enablePreviewVisuals = false; + } + + // Follow the user's input for a short additional period of time + // Update the dragTarget with the current device position, to allow for visuals to better match the expected rotation/position + m_DragTarget = transform.position; - //m_SpatialDragDistance = 0f; // reset drag distance - m_SpatialHintUI.enablePrimaryArrowVisuals = false; - m_SpatialHintUI.scrollVisualsRotation = Vector3.Lerp(m_InitialDragTarget, transform.position, m_SmoothDragDuration); // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold - Debug.LogError("INSIDE rotation update loop"); + m_SpatialDragDistance += Time.unscaledDeltaTime; // Continue to increase the amount + /////var extentedDragDurationSmoothed = 1 - MathUtilsExt.SmoothInOutLerpFloat(m_SpatialDragDistance - 1f); + /////m_SpatialHintUI.scrollVisualsRotation = Vector3.Lerp(m_InitialDragTarget, transform.position, extentedDragDurationSmoothed); - m_SpatialDragDistance += Time.unscaledDeltaTime; - var smoothDuration = m_SpatialDragDistance - 1f; - m_SmoothDragDuration = 1 - MathUtilsExt.SmoothInOutLerpFloat(m_SmoothDragDuration += Time.unscaledDeltaTime * 0.5f); + // Add additional smoothed rotation to the scroll visuals to better align them with the user's continued device movemet after crossing the threshold + // The m_InitialDragTarget is the actualy vector being scrolled against, however adding a slight continuation of the user's device input position + // allows for the scroll visuals to appear to be more closely aligned to the user's expected rotation. + //Debug.LogError("INSIDE rotation update loop"); /* var shapedDragAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(m_SmoothedSpatialDragDistance), 6); m_HintContentContainerCurrentRotation = Quaternion.Lerp(m_HintContentContainerInitialRotation, m_SpatialScrollOrientation, shapedDragAmount); newHintContainerRotation = m_HintContentContainerCurrentRotation; */ } + else if (m_SpatialDragDistance > 2) + { + m_SpatialHintUI.scrollVisualsRotation = m_DragTarget; + } //m_SpatialHintUI.scrollVisualsRotation = Quaternion.Euler(endingDragDefinitionPosition - startingDragDefinitionPosition); /* diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index 94cd43e43..6e0cd8f17 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -1,5 +1,8 @@ -using UnityEngine; -using UnityEngine.Serialization; +using System.Collections; +using System.Security.Cryptography.X509Certificates; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Menus { @@ -7,24 +10,27 @@ public class SpatialHintUI : MonoBehaviour { readonly Color k_PrimaryArrowColor = Color.white; - [SerializeField] [FormerlySerializedAs("m_PrimaryHintArrows")] + [SerializeField] HintIcon[] m_PrimaryDirectionalHintArrows; - [SerializeField] [FormerlySerializedAs("m_SecondaryHintArrows")] + [SerializeField] HintIcon[] m_SecondaryDirectionalHintArrows; + /* [SerializeField] HintIcon[] m_PrimaryRotationalHintArrows; [SerializeField] HintIcon[] m_SecondaryRotationalHintArrows; + */ [SerializeField] CanvasGroup m_ScrollVisualsCanvasGroup; - Vector3? m_ScrollVisualsRotation; + Vector3 m_ScrollVisualsRotation; Transform m_ScrollVisualsTransform; GameObject m_ScrollVisualsGameObject; + Coroutine m_ScrollVisualsVisibilityCoroutine; /// /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action @@ -42,7 +48,7 @@ public bool enablePreviewVisuals foreach (var arrow in m_SecondaryDirectionalHintArrows) { - arrow.visible = true; + arrow.visible = value; } } } @@ -102,37 +108,25 @@ public bool enableVisuals /// /// If non-null, enable and set the world rotation of the scroll visuals /// - public Vector3? scrollVisualsRotation + public Vector3 scrollVisualsRotation { // Set null In order to hide the scroll visuals set { - if (m_ScrollVisualsRotation == null && value == null) - return; + if (value == Vector3.zero) + Debug.LogError("??????????????????????!!!!!!!!!!!!!!!!!!!!!!!"); - var newRotation = value; - - //if (m_ScrollVisualsRotation == newRotation) - //return; + if (m_ScrollVisualsRotation == value) + return; - m_ScrollVisualsRotation = newRotation; - if (m_ScrollVisualsRotation != null) + m_ScrollVisualsRotation = value; + if (m_ScrollVisualsRotation != Vector3.zero) { - Debug.LogError("SHOWING SPATIAL SCROLL VISUALS"); - - // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector - m_ScrollVisualsGameObject.SetActive(true); - m_ScrollVisualsCanvasGroup.alpha = 1f; - //m_ScrollVisualsTransform.rotation = m_ScrollVisualsRotation.Value; - m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation.Value); + this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, ShowScrollVisuals()); } else { - Debug.LogError("HIDING SPATIAL SCROLL VISUALS"); - - // Hide the scroll visuals - m_ScrollVisualsCanvasGroup.alpha = 1; - m_ScrollVisualsGameObject.SetActive(false); + this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, HideScrollVisuals()); } } } @@ -144,5 +138,45 @@ void Awake() m_ScrollVisualsCanvasGroup.alpha = 0f; m_ScrollVisualsGameObject.SetActive(false); } + + IEnumerator ShowScrollVisuals() + { + Debug.LogError("SHOWING SPATIAL SCROLL VISUALS"); + + enableVisuals = false; + // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector + m_ScrollVisualsGameObject.SetActive(true); + m_ScrollVisualsCanvasGroup.alpha = 1f; + //m_ScrollVisualsTransform.rotation = m_ScrollVisualsRotation.Value; + m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation); + m_ScrollVisualsTransform.localScale = Vector3.one; + yield break; + } + + IEnumerator HideScrollVisuals() + { + Debug.LogError("HIDING SPATIAL SCROLL VISUALS"); + // Hide the scroll visuals + + const float kTargetDuration = 1f; + var hiddenLocalScale = Vector3.zero; + var currentDuration = 0f; + var currentLocalScale = m_ScrollVisualsTransform.localScale; + var currentAlpha = m_ScrollVisualsCanvasGroup.alpha; + while (currentDuration < kTargetDuration) + { + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); + m_ScrollVisualsTransform.localScale = Vector3.Lerp(currentLocalScale, hiddenLocalScale, shapedDuration); + m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 0f, shapedDuration); + //m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); + currentDuration += Time.unscaledDeltaTime * 2f; + yield return null; + } + + m_ScrollVisualsCanvasGroup.alpha = 0; + m_ScrollVisualsTransform.localScale = hiddenLocalScale; + //m_ScrollVisualsTransform.localRotation = Quaternion.identity; + m_ScrollVisualsGameObject.SetActive(false); + } } } \ No newline at end of file From 2cfa14540d347f94c9a524b704eea2f7419e0c69 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 30 Jun 2017 20:02:59 -0700 Subject: [PATCH 516/870] Add functionality to PinnedToolsMenuUI & SpatialHintUI that displays the animated spatial scroll vector displayed after crossing the drag-trigger threshold; continued following of the input device was added to better convey to the user the angle they're scrolling against. --- .../Prefabs/PinnedToolsMenu.prefab | 5 +-- .../Scripts/PinnedToolsMenuUI.cs | 3 +- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 32 +++++++++++++++---- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 4399ac7a7..2603aeb76 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -1094,7 +1094,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1559511730278864} m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} - m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: -0.35749817} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 224965907269186458} @@ -1363,7 +1363,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1269561316698028} m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} - m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0.3574982} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 224968954540649746} @@ -2162,6 +2162,7 @@ MonoBehaviour: - {fileID: 114265858466807592} - {fileID: 114451923332080912} m_ScrollVisualsCanvasGroup: {fileID: 225496513774942428} + m_ScrollVisualsDragTargetArrow: {fileID: 4967341377978414} --- !u!114 &114709129698682498 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index c7c24dde3..8a4d34495 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -173,7 +173,7 @@ void Update() m_DragTarget = transform.position; // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold - m_SpatialDragDistance += Time.unscaledDeltaTime; // Continue to increase the amount + m_SpatialDragDistance += Time.unscaledDeltaTime * 8; // Continue to increase the amount /////var extentedDragDurationSmoothed = 1 - MathUtilsExt.SmoothInOutLerpFloat(m_SpatialDragDistance - 1f); /////m_SpatialHintUI.scrollVisualsRotation = Vector3.Lerp(m_InitialDragTarget, transform.position, extentedDragDurationSmoothed); @@ -193,6 +193,7 @@ void Update() m_SpatialHintUI.scrollVisualsRotation = m_DragTarget; } + m_SpatialHintUI.scrollVisualsDragThresholdTriggerPosition = transform.position; //m_SpatialHintUI.scrollVisualsRotation = Quaternion.Euler(endingDragDefinitionPosition - startingDragDefinitionPosition); /* else if (Mathf.Approximately(m_SmoothedSpatialDragDistance, 1f)) diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index 6e0cd8f17..e10988562 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -27,6 +27,9 @@ public class SpatialHintUI : MonoBehaviour [SerializeField] CanvasGroup m_ScrollVisualsCanvasGroup; + [SerializeField] + Transform m_ScrollVisualsDragTargetArrow; + Vector3 m_ScrollVisualsRotation; Transform m_ScrollVisualsTransform; GameObject m_ScrollVisualsGameObject; @@ -131,6 +134,8 @@ public Vector3 scrollVisualsRotation } } + public Vector3 scrollVisualsDragThresholdTriggerPosition { get; set; } + void Awake() { m_ScrollVisualsTransform = m_ScrollVisualsCanvasGroup.transform; @@ -142,15 +147,30 @@ void Awake() IEnumerator ShowScrollVisuals() { Debug.LogError("SHOWING SPATIAL SCROLL VISUALS"); - - enableVisuals = false; // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector m_ScrollVisualsGameObject.SetActive(true); - m_ScrollVisualsCanvasGroup.alpha = 1f; - //m_ScrollVisualsTransform.rotation = m_ScrollVisualsRotation.Value; - m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation); + enableVisuals = false; m_ScrollVisualsTransform.localScale = Vector3.one; - yield break; + m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation); + m_ScrollVisualsCanvasGroup.alpha = 1f; // remove + m_ScrollVisualsDragTargetArrow.localPosition = Vector3.zero; + + const float kTargetDuration = 1f; + var currentDuration = 0f; + var currentLocalScale = m_ScrollVisualsTransform.localScale; + var currentAlpha = m_ScrollVisualsCanvasGroup.alpha; + var secondArrowCurrentPosition = m_ScrollVisualsDragTargetArrow.position; + while (currentDuration < kTargetDuration) + { + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); + m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 1f, shapedDuration); + m_ScrollVisualsDragTargetArrow.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); + currentDuration += Time.unscaledDeltaTime * 2f; + yield return null; + } + + //m_ScrollVisualsTransform.rotation = m_ScrollVisualsRotation.Value; + m_ScrollVisualsCanvasGroup.alpha = 1f; } IEnumerator HideScrollVisuals() From 1c38bf17f70f638f9bd07c1daaa9b9166f5f724e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Jul 2017 14:54:56 -0700 Subject: [PATCH 517/870] Fix ray hiding when two-handed scaling objects --- Tools/TransformTool/TransformTool.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 9055ebce4..c15baeefd 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -459,22 +459,22 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (hasRight && rightHeld) rightData.UpdatePositions(this); } - } - if (!hasObject) - { // Reset direct selection state in case of a ray selection foreach (TransformTool transformTool in linkedObjects) { var rayOrigin = transformTool.rayOrigin; - this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true, true); - - var transformInput = transformTool.m_Input; - if (transformInput != null && transformInput.select.wasJustReleased) + if (!(m_Scaling || directSelection.ContainsKey(rayOrigin) || m_GrabData.ContainsKey(transformTool.node.Value))) { - m_DirectSelected = false; - break; + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true, true); + + var transformInput = transformTool.m_Input; + if (transformInput != null && transformInput.select.wasJustReleased) + { + m_DirectSelected = false; + break; + } } } } From 2673fc3529ba57c7d0fcb02533fd5522021e947d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Jul 2017 14:56:27 -0700 Subject: [PATCH 518/870] Reduce duration/intensity of hover pulse (selection change) --- Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset index 3a0c639ac..dbe82a114 100644 --- a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset +++ b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: HoverPulse m_EditorClassIdentifier: - m_Duration: 0.45 - m_Intensity: 0.3 + m_Duration: 0.3 + m_Intensity: 0.15 m_FadeIn: 0 m_FadeOut: 1 From 20ff737f9d0c88607817c1878df35622147b82cf Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Jul 2017 15:42:16 -0700 Subject: [PATCH 519/870] Update default/min bounds for workspaces to prevent excess menu hiding in scene region --- Workspaces/Base/Workspace.cs | 7 ++++++- Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs | 5 +++-- Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs | 1 - Workspaces/ProjectWorkspace/ProjectWorkspace.cs | 7 +++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index bf9bc88de..e0714ccab 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -15,7 +15,7 @@ abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStenc const float k_MaxFrameSize = 100f; // Because BlendShapes cap at 100, our workspace maxes out at 100m wide public static readonly Vector3 DefaultBounds = new Vector3(0.7f, 0.4f, 0.4f); - public static readonly Vector3 MinBounds = new Vector3(0.55f, 0.4f, 0.1f); + public static readonly Vector3 MinBounds = new Vector3(0.55f, 0f, 0.1f); public const float FaceMargin = 0.025f; public const float HighlightMargin = 0.002f; @@ -66,6 +66,11 @@ public Bounds contentBounds size.z = Mathf.Clamp(Mathf.Max(size.z, minBounds.z), 0, k_MaxFrameSize); m_ContentBounds.size = size; + // Offset by half height + var center = m_ContentBounds.center; + center.y = size.y * 0.5f; + m_ContentBounds.center = center; + UpdateBounds(); OnBoundsChanged(); } diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs index d549322ed..3042cd5b5 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs @@ -106,9 +106,10 @@ public float zoomSliderMax public override void Setup() { + const float yBounds = 0.5f; // Initial bounds must be set before the base.Setup() is called - minBounds = new Vector3(MinBounds.x, MinBounds.y, 0.25f); - m_CustomStartingBounds = new Vector3(MinBounds.x, MinBounds.y, 0.5f); + minBounds = new Vector3(MinBounds.x, yBounds, 0.25f); + m_CustomStartingBounds = new Vector3(MinBounds.x, yBounds, 0.5f); base.Setup(); diff --git a/Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs b/Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs index d8b4a8d0c..70064853f 100644 --- a/Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs +++ b/Workspaces/ProfilerWorkspace/ProfilerWorkspace.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; diff --git a/Workspaces/ProjectWorkspace/ProjectWorkspace.cs b/Workspaces/ProjectWorkspace/ProjectWorkspace.cs index f9e3fac37..2a2c489c5 100644 --- a/Workspaces/ProjectWorkspace/ProjectWorkspace.cs +++ b/Workspaces/ProjectWorkspace/ProjectWorkspace.cs @@ -7,7 +7,6 @@ using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -using UnityEngine.InputNew; namespace UnityEditor.Experimental.EditorVR.Workspaces { @@ -15,7 +14,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces sealed class ProjectWorkspace : Workspace, IUsesProjectFolderData, IFilterUI, ISerializeWorkspace { const float k_LeftPaneRatio = 0.3333333f; // Size of left pane relative to workspace bounds - const float k_YBounds = 0.2f; + const float k_YBounds = 0.1f; const float k_MinScale = 0.04f; const float k_MaxScale = 0.09f; @@ -82,8 +81,8 @@ class Preferences public override void Setup() { // Initial bounds must be set before the base.Setup() is called - minBounds = new Vector3(MinBounds.x, MinBounds.y, 0.5f); - m_CustomStartingBounds = new Vector3(0.8f, 0.4f, 0.5f); + minBounds = new Vector3(MinBounds.x, k_YBounds, 0.5f); + m_CustomStartingBounds = new Vector3(0.8f, k_YBounds, 0.5f); base.Setup(); From 0a87094ee739f9efd874c961fd712980e4bc0c55 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 5 Jul 2017 16:46:02 -0700 Subject: [PATCH 520/870] Fix issue where, while menu was visible, UI would override direct scaling --- Scripts/Core/EditorVR.Rays.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 6b3a5de89..96052f128 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -204,6 +204,9 @@ void OnProxyActiveChanged(IProxy proxy) // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => { + if (!source.draggedObject && evr.GetNestedModule().IsHovering(source.rayOrigin)) + return false; + if ((deviceData.menuHideFlags[deviceData.mainMenu] & Menus.MenuHideFlags.Hidden) == 0) { if (Menus.OnHover(source)) @@ -212,9 +215,6 @@ void OnProxyActiveChanged(IProxy proxy) return false; } - if (!source.draggedObject && evr.GetNestedModule().IsHovering(source.rayOrigin)) - return false; - return true; }); } From 5508bbcc7808420bd256635aa5858810531dc52b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 6 Jul 2017 12:36:15 -0700 Subject: [PATCH 521/870] Fix errors and warnings in HapticsModule caused by not having Oculus Utilities First fix is to wrap LateUpdate in #if ENABLE_OVR_INPUT to remove call to missing OVRHaptics class; Second fix is to leave the usage of m_MasterIntensity in Pulse in order to eliminate assigned but never used warning. --- Scripts/Modules/HapticsModule/HapticsModule.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index beddcacd2..8b9d1f38a 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -37,11 +37,13 @@ void Start() #endif } +#if ENABLE_OVR_INPUT void LateUpdate() { // Perform a manual update of OVR haptics OVRHaptics.Process(); } +#endif /// /// Pulse haptic feedback @@ -50,12 +52,12 @@ void LateUpdate() /// Haptic pulse public void Pulse(Node? node, HapticPulse hapticPulse) { -#if ENABLE_OVR_INPUT // Clip buffer can hold up to 800 milliseconds of samples // At 320Hz, each sample is 3.125f milliseconds if (Mathf.Approximately(m_MasterIntensity, 0)) return; +#if ENABLE_OVR_INPUT m_GeneratedHapticClip.Reset(); const float kMaxDuration = 0.8f; From 11e163327f8cdaf7874bff97cc4599abf5cb118b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 6 Jul 2017 19:08:12 -0700 Subject: [PATCH 522/870] Perform post-development merge cleanup --- Menus/MainMenu/MainMenu.cs | 17 ++++++++++------- Menus/MainMenu/Scripts/MainMenuButton.cs | 2 ++ Scripts/Core/EditorVR.PinnedToolButtons.cs | 6 +++++- Scripts/Core/EditorVR.cs | 12 ------------ Tools/BlinkLocomotionTool/BlinkLocomotion.cs | 17 ----------------- 5 files changed, 17 insertions(+), 37 deletions(-) delete mode 100644 Tools/BlinkLocomotionTool/BlinkLocomotion.cs diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 8185b47e4..63bb99a2c 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -92,12 +92,11 @@ public bool visible public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } public Func previewToolInPinnedToolButton { private get; set; } - public Transform rayOrigin { get; set; } // TODO: still needed for previewToolInPinnedToolButton - consider changing to NODE public Node? node { get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } - public Transform rayOrigin { private get; set; } + public Transform rayOrigin { private get; set; } // TODO: still needed for previewToolInPinnedToolButton - consider changing to NODE void Start() { @@ -171,6 +170,7 @@ void CreateFaceButtons(List types) { sectionName = customMenuAttribute.sectionName, description = customMenuAttribute.description + }; } @@ -186,7 +186,7 @@ void CreateFaceButtons(List types) this.SelectTool(targetRayOrigin, selectedType); UpdateToolButtons(); } - }); + }, selectedType); } if (isWorkspace) @@ -242,7 +242,7 @@ void CreateFaceButtons(List types) } } - void CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action buttonClickCallback) + void CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action buttonClickCallback, Type selectedType = null) { var mainMenuButton = m_MainMenuUI.CreateFaceButton(buttonData); mainMenuButton.button.onClick.RemoveAllListeners(); @@ -254,9 +254,12 @@ void CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action mainMenuButton.tooltip = tooltip; - // Assign pinned tool button preview properties - b.toolType = selectedType; - b.previewToolInPinnedToolButton = previewToolInPinnedToolButton; + if (selectedType != null) + { + // Assign pinned tool button preview properties + mainMenuButton.toolType = selectedType; + mainMenuButton.previewToolInPinnedToolButton = previewToolInPinnedToolButton; + } } void UpdateToolButtons() diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 2de5a7c8f..85d8efef0 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -35,6 +35,8 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IPointe public ITooltip tooltip { private get; set; } + public Type toolType { get; set; } + public void OnPointerClick(PointerEventData eventData) { if (clicked != null) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index aa29bd967..8fddf1788 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -21,9 +21,13 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) mainMenu.previewToolInPinnedToolButton = PreviewToolInPinnedToolButton; } - public void DisconnectInterface(object obj) + public void DisconnectInterface(object obj, Transform rayOrigin = null) { + var mainMenu = obj as IMainMenu; + if (mainMenu != null) + mainMenu.previewToolInPinnedToolButton = null; } + /* TODO remove after removal of main menu activator codebase internal MainMenuActivator SpawnMainMenuActivator(InputDevice device) { diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 3ae21cee8..e1361511e 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -352,25 +352,13 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate if (altMenuInput != null && altMenu.visible) altMenuInput.ProcessInput(deviceData.alternateMenuInput, consumeControl); - ActionMapInput testBlinkActionMap = null; // HACK - implement proper fetching of action map input that minds the grip move/zoom - foreach (var toolData in deviceData.toolData) { - var blink = (toolData.tool as BlinkLocomotionTool); - if (blink) - { - testBlinkActionMap = toolData.input; - } var process = toolData.tool as IProcessInput; if (process != null && ((MonoBehaviour)toolData.tool).enabled && processedInputs.Add(process)) // Only process inputs for an instance of a tool once (e.g. two-handed tools) process.ProcessInput(toolData.input, consumeControl); } - - var pinnedToolsMenu = deviceData.pinnedToolsMenu; - var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; - if (pinnedToolsMenuInput != null) - pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); } } diff --git a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs b/Tools/BlinkLocomotionTool/BlinkLocomotion.cs deleted file mode 100644 index cb6532fe2..000000000 --- a/Tools/BlinkLocomotionTool/BlinkLocomotion.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEngine; -using UnityEngine.InputNew; - -// GENERATED FILE - DO NOT EDIT MANUALLY -namespace UnityEngine.InputNew -{ - public class BlinkLocomotion : ActionMapInput { - public BlinkLocomotion (ActionMap actionMap) : base (actionMap) { } - - public ButtonInputControl @blink { get { return (ButtonInputControl)this[0]; } } - public AxisInputControl @yaw { get { return (AxisInputControl)this[1]; } } - public AxisInputControl @forward { get { return (AxisInputControl)this[2]; } } - public ButtonInputControl @grip { get { return (ButtonInputControl)this[3]; } } - public ButtonInputControl @thumb { get { return (ButtonInputControl)this[4]; } } - public ButtonInputControl @trigger { get { return (ButtonInputControl)this[5]; } } - } -} From b63b17bed1daab4cf549dcda8ab8cae69c085a8b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 6 Jul 2017 20:11:05 -0700 Subject: [PATCH 523/870] Remove rule about not hovering manipulator; Replace with auto-hide delay --- Scripts/Core/EditorVR.Menus.cs | 56 ++++++++++++++++++++++++---------- Scripts/Core/EditorVR.cs | 3 ++ Workspaces/Base/Workspace.cs | 6 ++++ 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 6f372874e..0eca7177b 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -12,6 +12,8 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { + const float k_MainMenuAutoHideDelay = 0.25f; + [SerializeField] MainMenuActivator m_MainMenuActivatorPrefab; @@ -24,9 +26,9 @@ class Menus : Nested, IInterfaceConnector, ILateBindInterfaceMethods internal enum MenuHideFlags { Hidden = 1 << 0, - OverUI = 1 << 1, - OverWorkspace = 1 << 2, - Overridden = 1 << 3, + Overridden = 1 << 1, + OverUI = 1 << 2, + OverWorkspace = 1 << 3, HasDirectSelection = 1 << 4 } @@ -141,13 +143,11 @@ internal void UpdateMenuVisibilities() hoveringWorkspace = true; } - var menus = deviceData.menuHideFlags.Keys.ToList(); + var menus = menuHideFlags.Keys.ToList(); foreach (var menu in menus) { if (hoveringWorkspace) - deviceData.menuHideFlags[menu] |= MenuHideFlags.OverWorkspace; - else - deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverWorkspace; + menuHideFlags[menu] |= MenuHideFlags.OverWorkspace; } var heldObjects = directSelection.GetHeldObjects(rayOrigin); @@ -156,7 +156,7 @@ internal void UpdateMenuVisibilities() { foreach (var menu in menus) { - deviceData.menuHideFlags[menu] |= MenuHideFlags.HasDirectSelection; + menuHideFlags[menu] |= MenuHideFlags.HasDirectSelection; } foreach (var otherDeviceData in m_ActiveDeviceData) @@ -168,10 +168,11 @@ internal void UpdateMenuVisibilities() if (directSelection.IsHovering(otherRayOrigin) || directSelection.IsScaling(otherRayOrigin) || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * Viewer.GetViewerScale()) { - var otherMenus = otherDeviceData.menuHideFlags.Keys.ToList(); + var otherHideFlags = otherDeviceData.menuHideFlags; + var otherMenus = otherHideFlags.Keys.ToList(); foreach (var menu in otherMenus) { - otherDeviceData.menuHideFlags[menu] |= MenuHideFlags.HasDirectSelection; + otherHideFlags[menu] |= MenuHideFlags.HasDirectSelection; } break; } @@ -183,7 +184,26 @@ internal void UpdateMenuVisibilities() foreach (var deviceData in m_ActiveDeviceData) { var mainMenu = deviceData.mainMenu; - mainMenu.visible = deviceData.menuHideFlags[mainMenu] == 0; + var mainMenuHideFlags = deviceData.menuHideFlags[mainMenu]; + if (mainMenuHideFlags != 0) + { + if ((mainMenuHideFlags & MenuHideFlags.Hidden) != 0) + { + mainMenu.visible = false; + } + else if (Time.time > deviceData.menuAutoHideTimes[mainMenu] + k_MainMenuAutoHideDelay) + { + mainMenu.visible = false; + } + else + { + mainMenu.visible = true; + } + } + else + { + mainMenu.visible = true; + } var customMenu = deviceData.customMenu; if (customMenu != null) @@ -196,11 +216,16 @@ internal void UpdateMenuVisibilities() // Reset Temporary states foreach (var deviceData in m_ActiveDeviceData) { - var menus = deviceData.menuHideFlags.Keys.ToList(); + var menuHideFlags = deviceData.menuHideFlags; + var menus = menuHideFlags.Keys.ToList(); foreach (var menu in menus) { - deviceData.menuHideFlags[menu] &= ~MenuHideFlags.OverUI; - deviceData.menuHideFlags[menu] &= ~MenuHideFlags.HasDirectSelection; + var hideFlags = menuHideFlags[menu]; + if ((hideFlags & ~MenuHideFlags.Hidden & ~MenuHideFlags.Overridden) == 0) + deviceData.menuAutoHideTimes[menu] = Time.time; + + menuHideFlags[menu] = hideFlags & ~MenuHideFlags.OverUI & ~MenuHideFlags.HasDirectSelection + & ~MenuHideFlags.OverWorkspace; } } @@ -233,10 +258,9 @@ internal static bool OnHover(MultipleRayInputModule.RaycastSource source) return false; var scaledPointerDistance = eventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); - var isManipulator = go.GetComponentInParent() != null; var menus = deviceData.menuHideFlags.Keys.ToList(); var hideDistance = deviceData.mainMenu.hideDistance; - if (!(isManipulator || scaledPointerDistance > hideDistance + k_MenuHideMargin)) + if (scaledPointerDistance < hideDistance + k_MenuHideMargin) { foreach (var menu in menus) { diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 29935ac12..5fe48b7c8 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -76,6 +76,7 @@ class DeviceData public IMenu customMenu; public PinnedToolButton previousToolButton; public readonly Dictionary menuHideFlags = new Dictionary(); + public readonly Dictionary menuAutoHideTimes = new Dictionary(); } class Nested @@ -198,6 +199,8 @@ void Awake() AddModule(); + AddModule(); + viewer.AddPlayerModel(); GetNestedModule().CreateAllProxies(); diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index e0714ccab..58d6df5ea 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -278,6 +278,12 @@ IEnumerator AnimateResetSize() } } + void Update() + { + GizmoModule.instance.DrawCube(transform.position + transform.rotation * outerBounds.center, + transform.rotation, Vector3.Scale(transform.lossyScale, outerBounds.size), Color.white); + } + public virtual void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { m_WorkspaceUI.ProcessInput((WorkspaceInput)input, consumeControl); From 67382b723024f7b1cb6858d1f095e99e0b113870 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 6 Jul 2017 20:12:31 -0700 Subject: [PATCH 524/870] Add comments in order to track down lack of tool selection after development merge. --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 3 ++- Scripts/Core/EditorVR.PinnedToolButtons.cs | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 8a4d34495..979765d8a 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -208,7 +208,7 @@ void Update() m_HintContentContainer.rotation = newHintContainerRotation; m_HintContentContainer.position = m_HintContentWorldPosition; - Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); + //Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); } public void AddButton(IPinnedToolButton button, Transform buttonTransform) @@ -403,6 +403,7 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) /// Button ToolType to compare against existing button types public void SelectExistingToolType(Type type) { + Debug.LogError("Selecting Existing ToolType : " + type.ToString()); foreach (var button in m_OrderedButtons) { if (button.toolType == type) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 8fddf1788..4e466d620 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -23,9 +23,6 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) public void DisconnectInterface(object obj, Transform rayOrigin = null) { - var mainMenu = obj as IMainMenu; - if (mainMenu != null) - mainMenu.previewToolInPinnedToolButton = null; } /* TODO remove after removal of main menu activator codebase @@ -212,7 +209,8 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T internal void ToolButtonClicked(Transform rayOrigin, Type toolType) { - Debug.LogError("TOOL BUTTON CLICKED : " + toolType.ToString()); + Debug.LogError("TOOL BUTTON CLICKED : " + toolType.ToString()); + if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); else From 3bf3ef33ccfde9a0e6177876901ca034076f11bd Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 6 Jul 2017 21:12:23 -0700 Subject: [PATCH 525/870] Remove debug code --- Scripts/Core/EditorVR.cs | 2 -- Workspaces/Base/Workspace.cs | 6 ------ 2 files changed, 8 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 5fe48b7c8..7498b3b4e 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -199,8 +199,6 @@ void Awake() AddModule(); - AddModule(); - viewer.AddPlayerModel(); GetNestedModule().CreateAllProxies(); diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 58d6df5ea..e0714ccab 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -278,12 +278,6 @@ IEnumerator AnimateResetSize() } } - void Update() - { - GizmoModule.instance.DrawCube(transform.position + transform.rotation * outerBounds.center, - transform.rotation, Vector3.Scale(transform.lossyScale, outerBounds.size), Color.white); - } - public virtual void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { m_WorkspaceUI.ProcessInput((WorkspaceInput)input, consumeControl); From 9d58bc1dc149c3e4f235b7d7628170b1ef962e45 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 6 Jul 2017 21:53:23 -0700 Subject: [PATCH 526/870] Fix warning in HapticPulsesEditor --- Editor/HapticPulsesEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Editor/HapticPulsesEditor.cs b/Editor/HapticPulsesEditor.cs index 68274defb..58e690553 100644 --- a/Editor/HapticPulsesEditor.cs +++ b/Editor/HapticPulsesEditor.cs @@ -66,7 +66,7 @@ void OnGUI() foreach (var pulse in m_HapticPulses) { GUILayout.BeginHorizontal(); - EditorGUILayout.ObjectField(pulse, typeof(HapticPulse), GUILayout.Width(nameColumnWidth)); + EditorGUILayout.ObjectField(pulse, typeof(HapticPulse), false, GUILayout.Width(nameColumnWidth)); EditorGUI.BeginChangeCheck(); pulse.duration = EditorGUILayout.FloatField(pulse.duration, GUILayout.Width(durationColumnWidth)); pulse.intensity = GUILayout.HorizontalSlider(pulse.intensity, 0, 1); From 125c6eb15ee032b4c7cea8c0264127015e3a38ec Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 10:07:12 -0700 Subject: [PATCH 527/870] Fix Clone/Cut/Copy/Paste so that new objects maintain prefab links --- Actions/Clone.cs | 8 ++----- Actions/Copy.cs | 3 ++- Actions/Cut.cs | 4 +++- Actions/Paste.cs | 57 ++++++++++++++++-------------------------------- 4 files changed, 26 insertions(+), 46 deletions(-) diff --git a/Actions/Clone.cs b/Actions/Clone.cs index 6ef4b9768..035f18972 100644 --- a/Actions/Clone.cs +++ b/Actions/Clone.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using System; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -10,13 +9,12 @@ sealed class Clone : BaseAction, IUsesSpatialHash, IUsesViewerScale { public override void ExecuteAction() { + Unsupported.DuplicateGameObjectsUsingPasteboard(); var selection = Selection.transforms; - var clones = new GameObject[selection.Length]; - var index = 0; var bounds = ObjectUtils.GetBounds(selection); foreach (var s in selection) { - var clone = ObjectUtils.Instantiate(s.gameObject); + var clone = s.gameObject; clone.hideFlags = HideFlags.None; var cloneTransform = clone.transform; var cameraTransform = CameraUtils.GetMainCamera().transform; @@ -24,9 +22,7 @@ public override void ExecuteAction() cloneTransform.position = cameraTransform.TransformPoint(Vector3.forward * viewDirection.magnitude / this.GetViewerScale()) + cloneTransform.position - bounds.center; this.AddToSpatialHash(clone); - clones[index++] = clone; } - Selection.objects = clones; } } } diff --git a/Actions/Copy.cs b/Actions/Copy.cs index bdb0e04c4..ff0fb4f8e 100644 --- a/Actions/Copy.cs +++ b/Actions/Copy.cs @@ -6,7 +6,8 @@ sealed class Copy : BaseAction { public override void ExecuteAction() { - Paste.buffer = Selection.transforms; + Unsupported.CopyGameObjectsToPasteboard(); + Paste.SetBufferDistance(Selection.transforms); } } } diff --git a/Actions/Cut.cs b/Actions/Cut.cs index 65dc4930d..d53b2e798 100644 --- a/Actions/Cut.cs +++ b/Actions/Cut.cs @@ -11,6 +11,9 @@ public override void ExecuteAction() var selection = Selection.transforms; if (selection != null) { + Unsupported.CopyGameObjectsToPasteboard(); + Paste.SetBufferDistance(Selection.transforms); + foreach (var transform in selection) { var go = transform.gameObject; @@ -18,7 +21,6 @@ public override void ExecuteAction() go.SetActive(false); } - Paste.buffer = selection; Selection.activeGameObject = null; } } diff --git a/Actions/Paste.cs b/Actions/Paste.cs index 08857a299..4c09d6138 100644 --- a/Actions/Paste.cs +++ b/Actions/Paste.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using System; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -8,52 +7,34 @@ namespace UnityEditor.Experimental.EditorVR.Actions [ActionMenuItem("Paste", ActionMenuItemAttribute.DefaultActionSectionName, 6)] sealed class Paste : BaseAction, IUsesSpatialHash, IUsesViewerScale { - public static Transform[] buffer + static float s_BufferDistance; + + public static void SetBufferDistance(Transform[] transforms) { - get - { - return s_Buffer; - } - set + if (transforms != null) { - s_Buffer = value; + var bounds = ObjectUtils.GetBounds(transforms); - if (value != null) - { - var bounds = ObjectUtils.GetBounds(value); - - s_BufferDistance = bounds.size != Vector3.zero ? - (bounds.center - CameraUtils.GetMainCamera().transform.position).magnitude : 1f; - s_BufferDistance /= IUsesViewerScaleMethods.getViewerScale(); // Normalize this value, so if viewer scale changes when pasted - } + s_BufferDistance = bounds.size != Vector3.zero ? (bounds.center - CameraUtils.GetMainCamera().transform.position).magnitude : 1f; + s_BufferDistance /= IUsesViewerScaleMethods.getViewerScale(); // Normalize this value in case viewer scale changes before paste happens } } - static Transform[] s_Buffer; - - static float s_BufferDistance; public override void ExecuteAction() { - if (buffer != null) + Unsupported.PasteGameObjectsFromPasteboard(); + var transforms = Selection.transforms; + var bounds = ObjectUtils.GetBounds(transforms); + foreach (var transform in transforms) { - var pastedGameObjects = new GameObject[buffer.Length]; - var index = 0; - var bounds = ObjectUtils.GetBounds(buffer); - foreach (var transform in buffer) - { - var pasted = ObjectUtils.Instantiate(transform.gameObject); - var pastedTransform = pasted.transform; - pasted.hideFlags = HideFlags.None; - var cameraTransform = CameraUtils.GetMainCamera().transform; - pastedTransform.position = cameraTransform.TransformPoint(Vector3.forward * s_BufferDistance) - + pastedTransform.position - bounds.center; - pasted.SetActive(true); - this.AddToSpatialHash(pasted); - pastedGameObjects[index++] = pasted; - } - - if (pastedGameObjects.Length > 0) - Selection.objects = pastedGameObjects; + var pasted = transform.gameObject; + var pastedTransform = pasted.transform; + pasted.hideFlags = HideFlags.None; + var cameraTransform = CameraUtils.GetMainCamera().transform; + pastedTransform.position = cameraTransform.TransformPoint(Vector3.forward * s_BufferDistance) + + pastedTransform.position - bounds.center; + pasted.SetActive(true); + this.AddToSpatialHash(pasted); } } } From d119ac081858d0bd8e226f156cc26ee27a5fe63e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 10:32:45 -0700 Subject: [PATCH 528/870] Add vert count thresholds for deciding whether to auto-hide or always show previews in the asset grid; Fix preview scaling if viewer scale changes since project workspace opened; Fix preview scaling for very small objects and preview objects at the scale they will be set to, if possible --- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 142 +++++++++++++----- 1 file changed, 105 insertions(+), 37 deletions(-) diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index 6e32867bf..d511ffb6c 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -11,14 +11,20 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { - sealed class AssetGridItem : DraggableListItem, IPlaceSceneObject, IUsesSpatialHash, IUsesViewerBody + sealed class AssetGridItem : DraggableListItem, IPlaceSceneObject, IUsesSpatialHash, + IUsesViewerBody, ISetDefaultRayVisibility { const float k_PreviewDuration = 0.1f; + const float k_MinPreviewScale = 0.01f; const float k_MaxPreviewScale = 0.2f; const float k_RotateSpeed = 50f; const float k_TransitionDuration = 0.1f; + const float k_ScaleBump = 1.1f; const int k_PreviewRenderQueue = 9200; + const int k_AutoHidePreviewVertexCount = 10000; + const int k_HidePreviewVertexCount = 100000; + [SerializeField] Text m_Text; @@ -45,10 +51,11 @@ sealed class AssetGridItem : DraggableListItem, IPlaceSceneOb Transform m_PreviewObjectTransform; bool m_Setup; + bool m_AutoHidePreview; Vector3 m_PreviewPrefabScale; Vector3 m_PreviewTargetScale; - Vector3 m_GrabPreviewTargetScale; - Vector3 m_GrabPreviewPivotOffset; + Vector3 m_PreviewPivotOffset; + Bounds m_PreviewBounds; Transform m_PreviewObjectClone; Coroutine m_PreviewCoroutine; @@ -72,6 +79,9 @@ private get if (m_IconPrefab == value) { m_Icon.SetActive(true); + if (m_PreviewObjectTransform && !m_AutoHidePreview) + m_Icon.SetActive(false); + return; } @@ -83,6 +93,9 @@ private get m_Icon.transform.localPosition = Vector3.up * 0.5f; m_Icon.transform.localRotation = Quaternion.AngleAxis(90, Vector3.down); m_Icon.transform.localScale = Vector3.one; + + if (m_PreviewObjectTransform && !m_AutoHidePreview) + m_Icon.SetActive(false); } } @@ -154,6 +167,8 @@ public override void Setup(AssetData listData) m_PreviewCoroutine = null; m_VisibilityCoroutine = null; + m_AutoHidePreview = false; + icon.transform.localScale = Vector3.one; // First time setup if (!m_Setup) @@ -175,11 +190,6 @@ public override void Setup(AssetData listData) InstantiatePreview(); - icon.transform.localScale = Vector3.one; - - if (m_PreviewObjectTransform) - m_PreviewObjectTransform.localScale = Vector3.zero; - m_Text.text = listData.name; } @@ -221,10 +231,10 @@ void InstantiatePreview() m_PreviewPrefabScale = m_PreviewObjectTransform.localScale; // Normalize total scale to 1 - var previewTotalBounds = ObjectUtils.GetBounds(m_PreviewObjectTransform); + m_PreviewBounds = ObjectUtils.GetBounds(m_PreviewObjectTransform); // Don't show a preview if there are no renderers - if (previewTotalBounds.size == Vector3.zero) + if (m_PreviewBounds.size == Vector3.zero) { ObjectUtils.Destroy(m_PreviewObjectTransform.gameObject); return; @@ -245,42 +255,55 @@ void InstantiatePreview() light.enabled = false; } - var pivotOffset = m_PreviewObjectTransform.position - previewTotalBounds.center; + m_PreviewPivotOffset = m_PreviewObjectTransform.position - m_PreviewBounds.center; m_PreviewObjectTransform.SetParent(transform, false); - var maxComponent = previewTotalBounds.size.MaxComponent(); + var maxComponent = m_PreviewBounds.size.MaxComponent(); var scaleFactor = 1 / maxComponent; m_PreviewTargetScale = m_PreviewPrefabScale * scaleFactor; - m_PreviewObjectTransform.localPosition = pivotOffset * scaleFactor + Vector3.up * 0.5f; + m_PreviewObjectTransform.localPosition = m_PreviewPivotOffset * scaleFactor + Vector3.up * 0.5f; - // Object will preview at the same size when grabbed - m_GrabPreviewTargetScale = Vector3.one * maxComponent; - var previewExtents = previewTotalBounds.extents; - m_GrabPreviewPivotOffset = pivotOffset; - - // If bounds are greater than offset, set to bounds - if (previewExtents.y > m_GrabPreviewPivotOffset.y) - m_GrabPreviewPivotOffset.y = previewExtents.y; + var vertCount = 0; + foreach (var meshFilter in m_PreviewObjectTransform.GetComponentsInChildren()) + { + if (meshFilter.sharedMesh) + vertCount += meshFilter.sharedMesh.vertexCount; + } - if (previewExtents.z > m_GrabPreviewPivotOffset.z) - m_GrabPreviewPivotOffset.z = previewExtents.z; + foreach (var skinnedMeshRenderer in m_PreviewObjectTransform.GetComponentsInChildren()) { + if (skinnedMeshRenderer.sharedMesh) + vertCount += skinnedMeshRenderer.sharedMesh.vertexCount; + } - if (maxComponent > k_MaxPreviewScale) + // Do not show previews over a max vert count + if (vertCount > k_HidePreviewVertexCount) { - // Object will be preview at the maximum scale - m_GrabPreviewTargetScale = Vector3.one * k_MaxPreviewScale; - m_GrabPreviewPivotOffset = pivotOffset * scaleFactor + (Vector3.up + Vector3.forward) * 0.5f * k_MaxPreviewScale; + ObjectUtils.Destroy(m_PreviewObjectTransform.gameObject); + return; } - m_PreviewObjectTransform.gameObject.SetActive(false); - m_PreviewObjectTransform.localScale = Vector3.zero; + // Auto hide previews over a smaller vert count + if (vertCount > k_AutoHidePreviewVertexCount) + { + m_AutoHidePreview = true; + m_PreviewObjectTransform.localScale = Vector3.zero; + } + else + { + m_PreviewObjectTransform.localScale = m_PreviewTargetScale; + icon.SetActive(false); + } } protected override void OnDragStarted(BaseHandle handle, HandleEventData eventData) { base.OnDragStarted(handle, eventData); - var clone = (GameObject)Instantiate(gameObject, transform.position, transform.rotation, transform.parent); + var rayOrigin = eventData.rayOrigin; + this.SetDefaultRayVisibility(rayOrigin, false); + this.LockRay(rayOrigin, this); + + var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); if (cloneItem.m_PreviewObjectTransform) @@ -327,6 +350,10 @@ protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData { var gridItem = m_DragObject.GetComponent(); + var rayOrigin = eventData.rayOrigin; + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true); + if (!this.IsOverShoulder(eventData.rayOrigin)) { if (gridItem.m_PreviewObjectTransform) @@ -361,8 +388,15 @@ void OnHoverStarted(BaseHandle handle, HandleEventData eventData) { if (m_PreviewObjectTransform && gameObject.activeInHierarchy) { - this.StopCoroutine(ref m_PreviewCoroutine); - m_PreviewCoroutine = StartCoroutine(AnimatePreview(false)); + if (m_AutoHidePreview) + { + this.StopCoroutine(ref m_PreviewCoroutine); + m_PreviewCoroutine = StartCoroutine(AnimatePreview(false)); + } + else + { + m_PreviewObjectTransform.localScale = m_PreviewTargetScale * k_ScaleBump; + } } } @@ -370,8 +404,15 @@ void OnHoverEnded(BaseHandle handle, HandleEventData eventData) { if (m_PreviewObjectTransform && gameObject.activeInHierarchy) { - this.StopCoroutine(ref m_PreviewCoroutine); - m_PreviewCoroutine = StartCoroutine(AnimatePreview(true)); + if (m_AutoHidePreview) + { + this.StopCoroutine(ref m_PreviewCoroutine); + m_PreviewCoroutine = StartCoroutine(AnimatePreview(true)); + } + else + { + m_PreviewObjectTransform.localScale = m_PreviewTargetScale; + } } } @@ -465,21 +506,48 @@ IEnumerator ShowGrabbedObject() var currentVelocity = 0f; const float kDuration = 1f; + var viewerScale = this.GetViewerScale(); + var maxComponent = m_PreviewBounds.size.MaxComponent() / viewerScale; + var targetScale = Vector3.one * maxComponent; + + // Object will preview at the same size when grabbed + var previewExtents = m_PreviewBounds.extents / viewerScale; + var pivotOffset = m_PreviewPivotOffset / viewerScale; + + // If bounds are greater than offset, set to bounds + if (previewExtents.y > pivotOffset.y) + pivotOffset.y = previewExtents.y; + + if (previewExtents.z > pivotOffset.z) + pivotOffset.z = previewExtents.z; + + if (maxComponent < k_MinPreviewScale) { + // Object will be preview at the maximum scale + targetScale = Vector3.one * k_MinPreviewScale; + pivotOffset = pivotOffset * scaleFactor + (Vector3.up + Vector3.forward) * 0.5f * k_MinPreviewScale; + } + + if (maxComponent > k_MaxPreviewScale) { + // Object will be preview at the maximum scale + targetScale = Vector3.one * k_MaxPreviewScale; + pivotOffset = pivotOffset * scaleFactor + (Vector3.up + Vector3.forward) * 0.5f * k_MaxPreviewScale; + } + while (currentTime < kDuration - 0.05f) { if (m_DragObject == null) yield break; // Exit coroutine if m_GrabbedObject is destroyed before the loop is finished currentTime = MathUtilsExt.SmoothDamp(currentTime, kDuration, ref currentVelocity, 0.5f, Mathf.Infinity, Time.deltaTime); - m_DragObject.localScale = Vector3.Lerp(currentLocalScale, m_GrabPreviewTargetScale, currentTime); + m_DragObject.localScale = Vector3.Lerp(currentLocalScale, targetScale, currentTime); if (m_PreviewObjectClone) - m_PreviewObjectClone.localPosition = Vector3.Lerp(currentPreviewOffset, m_GrabPreviewPivotOffset, currentTime); + m_PreviewObjectClone.localPosition = Vector3.Lerp(currentPreviewOffset, pivotOffset, currentTime); yield return null; } - m_DragObject.localScale = m_GrabPreviewTargetScale; + m_DragObject.localScale = targetScale; } static IEnumerator HideGrabbedObject(GameObject itemToHide, Renderer cubeRenderer) From 6163ca468f6234546d9da56885cfb2937a584e40 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 10:52:05 -0700 Subject: [PATCH 529/870] Prevent Assets folder from being closed --- .../ProjectWorkspace/Scripts/FolderListViewController.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Workspaces/ProjectWorkspace/Scripts/FolderListViewController.cs b/Workspaces/ProjectWorkspace/Scripts/FolderListViewController.cs index 416d009c9..513c209af 100644 --- a/Workspaces/ProjectWorkspace/Scripts/FolderListViewController.cs +++ b/Workspaces/ProjectWorkspace/Scripts/FolderListViewController.cs @@ -136,6 +136,9 @@ protected override FolderListItem GetItem(FolderData listData) void ToggleExpanded(string index) { + if (data.Count == 1 && m_ListItems[index].data == data[0]) // Do not collapse Assets folder + return; + m_ExpandStates[index] = !m_ExpandStates[index]; StartSettling(); } From d3912de52dd2997ce9af1e41b30566f49179c21f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 10:54:06 -0700 Subject: [PATCH 530/870] Only apply scaling logic to objects with previews; Add k_IconPreviewScale for regular icons; Adjust preview rotation to compensate for preview origin --- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 61 +++++++++++-------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index d511ffb6c..6665bda34 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -16,6 +16,7 @@ sealed class AssetGridItem : DraggableListItem, IPlaceSceneOb { const float k_PreviewDuration = 0.1f; const float k_MinPreviewScale = 0.01f; + const float k_IconPreviewScale = 0.1f; const float k_MaxPreviewScale = 0.2f; const float k_RotateSpeed = 50f; const float k_TransitionDuration = 0.1f; @@ -498,6 +499,7 @@ IEnumerator ShowGrabbedObject() { var currentLocalScale = m_DragObject.localScale; var currentPreviewOffset = Vector3.zero; + var currentPreviewRotationOffset = Quaternion.identity; if (m_PreviewObjectClone) currentPreviewOffset = m_PreviewObjectClone.localPosition; @@ -506,31 +508,39 @@ IEnumerator ShowGrabbedObject() var currentVelocity = 0f; const float kDuration = 1f; - var viewerScale = this.GetViewerScale(); - var maxComponent = m_PreviewBounds.size.MaxComponent() / viewerScale; - var targetScale = Vector3.one * maxComponent; - - // Object will preview at the same size when grabbed - var previewExtents = m_PreviewBounds.extents / viewerScale; - var pivotOffset = m_PreviewPivotOffset / viewerScale; - - // If bounds are greater than offset, set to bounds - if (previewExtents.y > pivotOffset.y) - pivotOffset.y = previewExtents.y; - - if (previewExtents.z > pivotOffset.z) - pivotOffset.z = previewExtents.z; - - if (maxComponent < k_MinPreviewScale) { - // Object will be preview at the maximum scale - targetScale = Vector3.one * k_MinPreviewScale; - pivotOffset = pivotOffset * scaleFactor + (Vector3.up + Vector3.forward) * 0.5f * k_MinPreviewScale; - } + var targetScale = Vector3.one * k_IconPreviewScale; + var pivotOffset = Vector3.zero; + var rotationOffset = Quaternion.AngleAxis(30, Vector3.right); + if (m_PreviewObjectClone) + { + var viewerScale = this.GetViewerScale(); + var maxComponent = m_PreviewBounds.size.MaxComponent() / viewerScale; + targetScale = Vector3.one * maxComponent; + + // Object will preview at the same size when grabbed + var previewExtents = m_PreviewBounds.extents / viewerScale; + pivotOffset = m_PreviewPivotOffset / viewerScale; - if (maxComponent > k_MaxPreviewScale) { - // Object will be preview at the maximum scale - targetScale = Vector3.one * k_MaxPreviewScale; - pivotOffset = pivotOffset * scaleFactor + (Vector3.up + Vector3.forward) * 0.5f * k_MaxPreviewScale; + // If bounds are greater than offset, set to bounds + if (previewExtents.y > pivotOffset.y) + pivotOffset.y = previewExtents.y; + + if (previewExtents.z > pivotOffset.z) + pivotOffset.z = previewExtents.z; + + if (maxComponent < k_MinPreviewScale) + { + // Object will be preview at the maximum scale + targetScale = Vector3.one * k_MinPreviewScale; + pivotOffset = pivotOffset * scaleFactor + (Vector3.up + Vector3.forward) * 0.5f * k_MinPreviewScale; + } + + if (maxComponent > k_MaxPreviewScale) + { + // Object will be preview at the maximum scale + targetScale = Vector3.one * k_MaxPreviewScale; + pivotOffset = pivotOffset * scaleFactor + (Vector3.up + Vector3.forward) * 0.5f * k_MaxPreviewScale; + } } while (currentTime < kDuration - 0.05f) @@ -542,7 +552,10 @@ IEnumerator ShowGrabbedObject() m_DragObject.localScale = Vector3.Lerp(currentLocalScale, targetScale, currentTime); if (m_PreviewObjectClone) + { m_PreviewObjectClone.localPosition = Vector3.Lerp(currentPreviewOffset, pivotOffset, currentTime); + m_PreviewObjectClone.localRotation = Quaternion.Lerp(currentPreviewRotationOffset, rotationOffset, currentTime); // Compensate for preview origin rotation + } yield return null; } From f0b38d0fabc02571bc42eba1a921e8de2709d84c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 10:57:27 -0700 Subject: [PATCH 531/870] Fix scale of objects when dropped into miniworld from project workspace --- Scripts/Core/EditorVR.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index da63f78cd..bb61bf241 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; @@ -188,7 +189,7 @@ void Awake() obj.transform.parent = null; obj.position = referenceTransform.position + Vector3.Scale(miniWorld.miniWorldTransform.InverseTransformPoint(obj.position), miniWorld.referenceTransform.localScale); obj.rotation = referenceTransform.rotation * Quaternion.Inverse(miniWorld.miniWorldTransform.rotation) * obj.rotation; - obj.localScale = Vector3.Scale(Vector3.Scale(obj.localScale, referenceTransform.localScale), miniWorld.miniWorldTransform.lossyScale); + obj.localScale = Vector3.Scale(Vector3.Scale(obj.localScale, referenceTransform.localScale), miniWorld.miniWorldTransform.lossyScale.Inverse()); spatialHashModule.AddObject(obj.gameObject); return true; From bcc651600ab5a069980554a6d1526da58b3bdb4d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 11:12:08 -0700 Subject: [PATCH 532/870] Fix TransformTool for selections which for some reason do not have an active transform --- Tools/TransformTool/TransformTool.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 9239f6ff8..e28fc52ba 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -460,9 +460,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_PivotRotation == PivotRotation.Local) // Manipulator does not rotate when in global mode manipulatorTransform.rotation = Quaternion.Slerp(manipulatorTransform.rotation, m_TargetRotation, k_LazyFollowRotate * deltaTime); - Undo.RecordObjects(Selection.transforms, "Move"); + var selectionTransforms = Selection.transforms; + Undo.RecordObjects(selectionTransforms, "Move"); - foreach (var t in Selection.transforms) + foreach (var t in selectionTransforms) { t.rotation = Quaternion.Slerp(t.rotation, m_TargetRotation * m_RotationOffsets[t], k_LazyFollowRotate * deltaTime); @@ -617,7 +618,7 @@ void UpdateCurrentManipulator() UpdateSelectionBounds(); var manipulatorTransform = manipulatorGameObject.transform; - var activeTransform = Selection.activeTransform; + var activeTransform = Selection.activeTransform ?? selectionTransforms[0]; manipulatorTransform.position = m_PivotMode == PivotMode.Pivot ? activeTransform.position : m_SelectionBounds.center; manipulatorTransform.rotation = m_PivotRotation == PivotRotation.Global ? Quaternion.identity : activeTransform.rotation; m_TargetPosition = manipulatorTransform.position; From 507f88672348bd9c690737bc71ea58a6a2333b99 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 11:16:54 -0700 Subject: [PATCH 533/870] Scale thumbstick speed on sphere manipulator based on object distance; Add scale bumps to plane and linear handles --- Manipulators/StandardManipulator.prefab | 9 +++++++-- Scripts/Handles/LinearHandle.cs | 12 ++++++++++++ Scripts/Handles/PlaneHandle.cs | 18 ++++++++++++++++++ Scripts/Handles/SphereHandle.cs | 18 ++++++++++++++---- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/Manipulators/StandardManipulator.prefab b/Manipulators/StandardManipulator.prefab index d10c00606..fd4c5e52d 100644 --- a/Manipulators/StandardManipulator.prefab +++ b/Manipulators/StandardManipulator.prefab @@ -1306,6 +1306,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} + m_ScaleBump: 1 m_Constraints: 5 --- !u!114 &114000011169532704 MonoBehaviour: @@ -1320,6 +1321,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} + m_ScaleBump: 1 m_Constraints: 6 --- !u!114 &114000011250465190 MonoBehaviour: @@ -1335,6 +1337,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000014115655252} m_OrientDragPlaneToRay: 1 + m_ScaleBump: 1 m_Constraints: 1 --- !u!114 &114000011261594914 MonoBehaviour: @@ -1350,6 +1353,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000013116023314} m_OrientDragPlaneToRay: 1 + m_ScaleBump: 1 m_Constraints: 4 --- !u!114 &114000011660595710 MonoBehaviour: @@ -1365,6 +1369,7 @@ MonoBehaviour: m_SelectionFlags: 3 m_HandleTip: {fileID: 4000012695962256} m_OrientDragPlaneToRay: 1 + m_ScaleBump: 1 m_Constraints: 2 --- !u!114 &114000012004783302 MonoBehaviour: @@ -1407,6 +1412,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} + m_ScaleBump: 1 m_Constraints: 3 --- !u!114 &114000012657926048 MonoBehaviour: @@ -1431,8 +1437,6 @@ MonoBehaviour: - {fileID: 114000012656813054} - {fileID: 114000010105022974} - {fileID: 114000011169532704} - m_DragPulse: {fileID: 11400000, guid: a187e6c970cfc58498747aee6dca2919, type: 2} - m_RotatePulse: {fileID: 11400000, guid: 2e2c8d33e61b196448657254e78ba15c, type: 2} --- !u!114 &114000013109644058 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1459,6 +1463,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 + m_ScaleBump: 1 --- !u!135 &135000012924084782 SphereCollider: m_ObjectHideFlags: 1 diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index b8128b74a..8f16b4113 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -9,6 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Handles sealed class LinearHandle : BaseHandle, IAxisConstraints { const float k_MaxDragDistance = 1000f; + const float k_ScaleBump = 1.3f; class LinearHandleEventData : HandleEventData { @@ -23,6 +24,9 @@ public LinearHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, [SerializeField] bool m_OrientDragPlaneToRay = true; + [SerializeField] + bool m_ScaleBump; + [FlagsProperty] [SerializeField] ConstrainedAxis m_Constraints; @@ -51,12 +55,20 @@ protected override void OnHandleHovering(HandleEventData eventData) protected override void OnHandleHoverStarted(HandleEventData eventData) { UpdateHandleTip(eventData as LinearHandleEventData); + + if (m_ScaleBump) + transform.localScale *= k_ScaleBump; + base.OnHandleHoverStarted(eventData); } protected override void OnHandleHoverEnded(HandleEventData eventData) { UpdateHandleTip(eventData as LinearHandleEventData); + + if (m_ScaleBump) + transform.localScale /= k_ScaleBump; + base.OnHandleHoverEnded(eventData); } diff --git a/Scripts/Handles/PlaneHandle.cs b/Scripts/Handles/PlaneHandle.cs index 110c4bed0..b8e98caf6 100644 --- a/Scripts/Handles/PlaneHandle.cs +++ b/Scripts/Handles/PlaneHandle.cs @@ -9,6 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Handles sealed class PlaneHandle : BaseHandle, IAxisConstraints { const float k_MaxDragDistance = 1000f; + const float k_ScaleBump = 1.1f; class PlaneHandleEventData : HandleEventData { @@ -20,6 +21,9 @@ public PlaneHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, [SerializeField] Material m_PlaneMaterial; + [SerializeField] + bool m_ScaleBump; + [FlagsProperty] [SerializeField] ConstrainedAxis m_Constraints; @@ -65,6 +69,20 @@ protected override void OnHandleDragging(HandleEventData eventData) base.OnHandleDragging(eventData); } + + protected override void OnHandleHoverStarted(HandleEventData eventData) { + if (m_ScaleBump) + transform.localScale *= k_ScaleBump; + + base.OnHandleHoverStarted(eventData); + } + + protected override void OnHandleHoverEnded(HandleEventData eventData) { + if (m_ScaleBump) + transform.localScale /= k_ScaleBump; + + base.OnHandleHoverStarted(eventData); + } } } #endif diff --git a/Scripts/Handles/SphereHandle.cs b/Scripts/Handles/SphereHandle.cs index c8b8404ba..ce3028869 100644 --- a/Scripts/Handles/SphereHandle.cs +++ b/Scripts/Handles/SphereHandle.cs @@ -20,7 +20,12 @@ public SphereHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, const float k_ScaleBump = 1.1f; const float k_HideScale = 0.1f; - + + const float k_DistanceScale = 0.1f; + + [SerializeField] + bool m_ScaleBump; + float m_ScrollRate; Vector3 m_LastPosition; float m_CurrentRadius; @@ -63,19 +68,24 @@ protected override void OnHandleDragEnded(HandleEventData eventData) protected override void OnHandleHoverStarted(HandleEventData eventData) { - transform.localScale *= k_ScaleBump; + if (m_ScaleBump) + transform.localScale *= k_ScaleBump; + base.OnHandleHoverStarted(eventData); } protected override void OnHandleHoverEnded(HandleEventData eventData) { - transform.localScale /= k_ScaleBump; + if (m_ScaleBump) + transform.localScale /= k_ScaleBump; + base.OnHandleHoverStarted(eventData); } public void ChangeRadius(float delta) { - m_CurrentRadius += delta; + var distance = Vector3.Distance(CameraUtils.GetMainCamera().transform.position, transform.position); + m_CurrentRadius += delta * distance * k_DistanceScale; m_CurrentRadius = Mathf.Max(m_CurrentRadius, 0f); } From a045672ecc26cc6c328535e09fae9ac9ee7749e0 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 11:22:08 -0700 Subject: [PATCH 534/870] Add skinned meshes to spatial hash --- Scripts/Modules/SpatialHashModule.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Scripts/Modules/SpatialHashModule.cs b/Scripts/Modules/SpatialHashModule.cs index 66bbf2f08..b42406614 100644 --- a/Scripts/Modules/SpatialHashModule.cs +++ b/Scripts/Modules/SpatialHashModule.cs @@ -27,7 +27,7 @@ internal void Setup() void SetupObjects() { - MeshFilter[] meshFilters = FindObjectsOfType(); + var meshFilters = FindObjectsOfType(); foreach (var mf in meshFilters) { if (mf.sharedMesh) @@ -40,9 +40,19 @@ void SetupObjects() spatialHash.AddObject(renderer, renderer.bounds); } } + + var skinnedMeshRenderers = FindObjectsOfType(); + foreach (var skinnedMeshRenderer in skinnedMeshRenderers) { + if (skinnedMeshRenderer.sharedMesh) { + if (shouldExcludeObject != null && shouldExcludeObject(skinnedMeshRenderer.gameObject)) + continue; + + spatialHash.AddObject(skinnedMeshRenderer, skinnedMeshRenderer.bounds); + } + } } - private IEnumerator UpdateDynamicObjects() + IEnumerator UpdateDynamicObjects() { while (true) { From 7b1cc5675042e02937a8e8238f11acf39cef679c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 11:30:07 -0700 Subject: [PATCH 535/870] Fix menu rotation on Vive --- Menus/MainMenu/MainMenu.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 8aaf1632c..b2acac9b1 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -135,9 +135,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { m_MainMenuUI.targetFaceIndex += (int)Mathf.Sign(rotationInput); this.Pulse(node, m_FaceRotationPulse); - consumeControl(mainMenuInput.flickFace); } + if (visible) + consumeControl(mainMenuInput.flickFace); + m_LastRotationInput = rotationInput; } From 03955b5bef5c81319dbb87dbd6d8e149fc3ff3fd Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 12:07:25 -0700 Subject: [PATCH 536/870] Update Hierarchy items to reflect whether an object is a prefab; Adjust hover colors for readability; Add selected-and-hovered color state --- .../Prefabs/HierarchyListItem.prefab | 7 +++-- .../Scripts/HierarchyListItem.cs | 28 +++++++++++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab b/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab index 89665f0b9..a094783c2 100644 --- a/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab +++ b/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab @@ -407,8 +407,11 @@ MonoBehaviour: m_NoClipExpandArrow: {fileID: 2100000, guid: d066c89af6b2b864cb02f409d89ce3ba, type: 2} m_NoClipBackingCube: {fileID: 2100000, guid: 1a070009f7968b74abbf1a1ae823b472, type: 2} m_NoClipText: {fileID: 2100000, guid: 0b1d2d3c4b2d7d948bcd67e085daa7d4, type: 2} - m_HoverColor: {r: 0.20344828, g: 0.20344828, b: 0.20344828, a: 0} - m_SelectedColor: {r: 0.36896548, g: 0.36896548, b: 0.36896548, a: 0} + m_HoverColor: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 0} + m_SelectedColor: {r: 0.23529412, g: 0.23529412, b: 0.23529412, a: 0} + m_SelectedHoverColor: {r: 0.3137255, g: 0.3137255, b: 0.3137255, a: 0} + m_PrefabTextColor: {r: 0.28627452, g: 0.45490196, b: 0.7490196, a: 1} + m_SelectedPrefabTextColor: {r: 0.382199, g: 0.60733, b: 1, a: 1} m_StackingFraction: 0.3 --- !u!114 &114000011951837648 MonoBehaviour: diff --git a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs index 68763abfb..f95740e50 100644 --- a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs +++ b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs @@ -46,11 +46,21 @@ sealed class HierarchyListItem : DraggableListItem, IUsesVie [SerializeField] Color m_SelectedColor; + [SerializeField] + Color m_SelectedHoverColor; + + [SerializeField] + Color m_PrefabTextColor; + + [SerializeField] + Color m_SelectedPrefabTextColor; + [Tooltip("The fraction of the cube height to use for stacking grabbed rows")] [SerializeField] float m_StackingFraction = 0.3f; Color m_NormalColor; + Color m_NormalTextColor; Renderer m_CubeRenderer; Transform m_CubeTransform; Transform m_DropZoneTransform; @@ -134,6 +144,8 @@ public override void Setup(HierarchyData data) m_DropZone.canDrop = CanDrop; m_DropZone.receiveDrop = ReceiveDrop; m_DropZone.getDropObject = GetDropObject; + + m_NormalTextColor = m_Text.color; } m_CubeTransform = m_Cube.transform; @@ -191,13 +203,23 @@ public void UpdateSelf(float width, int depth, bool? expanded, bool selected, bo UpdateArrow(expanded); + var isPrefab = PrefabUtility.GetPrefabType(data.gameObject) == PrefabType.PrefabInstance; // Set selected/hover/normal color - if (hovering) + if (selected) + { + cubeMaterial.color = hovering ? m_SelectedHoverColor : m_SelectedColor; + m_Text.color = isPrefab ? m_SelectedPrefabTextColor : m_NormalTextColor; + } + else if (hovering) + { cubeMaterial.color = m_HoverColor; - else if (selected) - cubeMaterial.color = m_SelectedColor; + m_Text.color = isPrefab ? m_PrefabTextColor : m_NormalTextColor; + } else + { cubeMaterial.color = m_NormalColor; + m_Text.color = isPrefab ? m_PrefabTextColor : m_NormalTextColor; + } } public void UpdateArrow(bool? expanded, bool immediate = false) From 7753588b4afee3b9637d8d988e3b5844b183c638 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 12:09:44 -0700 Subject: [PATCH 537/870] Make smooth camera a child of camera rig so it does not smooth locomotion; Expose pullback distance as serialized field --- Scripts/Core/EditorVR.Viewer.cs | 1 + Scripts/Helpers/VRSmoothCamera.cs | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Scripts/Core/EditorVR.Viewer.cs b/Scripts/Core/EditorVR.Viewer.cs index 0f2af9a4a..743ae36e6 100644 --- a/Scripts/Core/EditorVR.Viewer.cs +++ b/Scripts/Core/EditorVR.Viewer.cs @@ -153,6 +153,7 @@ internal void InitializeCamera() if (evr.m_PreviewCameraPrefab) { var go = ObjectUtils.Instantiate(evr.m_PreviewCameraPrefab); + go.transform.SetParent(CameraUtils.GetCameraRig(), false); customPreviewCamera = go.GetComponentInChildren(); if (customPreviewCamera != null) diff --git a/Scripts/Helpers/VRSmoothCamera.cs b/Scripts/Helpers/VRSmoothCamera.cs index 0d1f5f5ff..c4632b74a 100644 --- a/Scripts/Helpers/VRSmoothCamera.cs +++ b/Scripts/Helpers/VRSmoothCamera.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Helpers /// [RequireComponent(typeof(Camera))] [RequiresLayer(k_HMDOnlyLayer)] - sealed class VRSmoothCamera : MonoBehaviour, IPreviewCamera, IUsesViewerScale + sealed class VRSmoothCamera : MonoBehaviour, IPreviewCamera { /// /// The camera drawing the preview @@ -27,8 +27,13 @@ sealed class VRSmoothCamera : MonoBehaviour, IPreviewCamera, IUsesViewerScale [SerializeField] int m_TargetDisplay; + [SerializeField, Range(1, 180)] int m_FieldOfView = 40; + + [SerializeField] + float m_PullBackDistance = 0.8f; + [SerializeField] float m_SmoothingMultiplier = 3; @@ -52,11 +57,11 @@ void Awake() void Start() { - transform.position = m_VRCamera.transform.position; - transform.rotation = m_VRCamera.transform.rotation; + transform.position = m_VRCamera.transform.localPosition; + transform.localRotation = m_VRCamera.transform.localRotation; - m_Position = transform.position; - m_Forward = transform.forward; + m_Position = transform.localPosition; + m_Forward = transform.localRotation * Vector3.forward; } void LateUpdate() @@ -78,12 +83,11 @@ void LateUpdate() m_SmoothCamera.stereoTargetEye = StereoTargetEyeMask.None; m_SmoothCamera.fieldOfView = m_FieldOfView; - m_Position = Vector3.Lerp(m_Position, m_VRCamera.transform.position, Time.deltaTime * m_SmoothingMultiplier); - m_Forward = Vector3.Lerp(m_Forward, m_VRCamera.transform.forward, Time.deltaTime * m_SmoothingMultiplier); + m_Position = Vector3.Lerp(m_Position, m_VRCamera.transform.localPosition, Time.deltaTime * m_SmoothingMultiplier); + m_Forward = Vector3.Lerp(m_Forward, m_VRCamera.transform.localRotation * Vector3.forward, Time.deltaTime * m_SmoothingMultiplier); - const float kPullBackDistance = 1.1f; - transform.forward = m_Forward; - transform.position = m_Position - transform.forward * kPullBackDistance * this.GetViewerScale(); + transform.localRotation = Quaternion.LookRotation(m_Forward, Vector3.up); + transform.localPosition = m_Position - transform.localRotation * Vector3.forward * m_PullBackDistance; // Don't render any HMD-related visual proxies var hidden = m_VRCamera.GetComponentsInChildren(); From d9f3085f4ae84ac8815441067ca0a7358be2688e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Jul 2017 13:08:12 -0700 Subject: [PATCH 538/870] Add new SpatialHintUI prefab --- .../Prefabs/SpatialHintUI.prefab | 3082 +++++++++++++++++ .../Prefabs/SpatialHintUI.prefab.meta | 9 + 2 files changed, 3091 insertions(+) create mode 100644 Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab create mode 100644 Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab.meta diff --git a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab b/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab new file mode 100644 index 000000000..31662d6a5 --- /dev/null +++ b/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab @@ -0,0 +1,3082 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1789767321393858} + m_IsPrefabParent: 1 +--- !u!1 &1006711227317104 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224780185442623124} + - component: {fileID: 222797658040913998} + - component: {fileID: 114555141257046060} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1016458810671980 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224202520050313972} + - component: {fileID: 222383098631261652} + - component: {fileID: 114768730554743184} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1035625982163522 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224662441432538096} + - component: {fileID: 222939546821322456} + - component: {fileID: 114341816562169696} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1058418693224498 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224135530598210196} + - component: {fileID: 222053575299208536} + - component: {fileID: 114922086105306672} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1075893997324224 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4800155596865708} + - component: {fileID: 114602193729648712} + m_Layer: 5 + m_Name: TopArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1083271504533730 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4234521712409882} + - component: {fileID: 114549952638618038} + m_Layer: 5 + m_Name: TopArrow (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1087189506426152 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4352658633633276} + - component: {fileID: 114508101107919186} + m_Layer: 5 + m_Name: TopArrow (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1112224048980768 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4656611640740372} + - component: {fileID: 225219344075895100} + m_Layer: 5 + m_Name: DiagonalArrows + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1125351313468992 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224536315768338012} + - component: {fileID: 222893828193564900} + - component: {fileID: 114261400763498716} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1138933449834660 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224457231796985382} + - component: {fileID: 225476474272170592} + m_Layer: 5 + m_Name: ScrollVisuals + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1151867513107076 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224768393309507636} + - component: {fileID: 222269790095738828} + - component: {fileID: 114062055406121370} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1166221615258474 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4841372590907710} + - component: {fileID: 114472214291358280} + m_Layer: 5 + m_Name: LeftArrow (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1194110711330918 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4851979343048988} + - component: {fileID: 114085391963444694} + m_Layer: 5 + m_Name: LeftArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1196161126514986 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224081311369273524} + - component: {fileID: 222640872418002352} + - component: {fileID: 114650534892023224} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1208914140055346 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4536356174147362} + - component: {fileID: 114650385070507634} + m_Layer: 5 + m_Name: TopArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1226882853100004 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4920529215995508} + - component: {fileID: 114721502774444018} + m_Layer: 5 + m_Name: RightArrow (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1233422500995160 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4919626380897530} + - component: {fileID: 114279174847565634} + m_Layer: 5 + m_Name: BottomArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1261891554981946 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224068218456614698} + - component: {fileID: 222770186031098170} + - component: {fileID: 114709130866979964} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1278946252185714 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4405923127552798} + - component: {fileID: 114000567662040162} + m_Layer: 5 + m_Name: BottomArrow (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1286179857941560 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4875632078745168} + m_Layer: 5 + m_Name: RightArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1295546017909780 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224375606798488428} + - component: {fileID: 222321531243824390} + - component: {fileID: 114826715084335374} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1310027530136584 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224457270545674496} + - component: {fileID: 222640907686946606} + - component: {fileID: 114749271261725720} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1339250774381076 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224289252517553026} + - component: {fileID: 222034759844148942} + - component: {fileID: 114178251820008812} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1346389602611770 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224535942915412938} + - component: {fileID: 222312163737858760} + - component: {fileID: 114312153825842830} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1411913761068088 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4055687054597960} + - component: {fileID: 114033438707707268} + m_Layer: 5 + m_Name: LeftArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1415035000229474 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4486931087156832} + m_Layer: 5 + m_Name: BackArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1431127396183784 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224737278412607648} + - component: {fileID: 222607553899644316} + - component: {fileID: 114544001302371152} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1476779982288018 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224197558861574286} + - component: {fileID: 222736887738100716} + - component: {fileID: 114788108653890746} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1477005998831424 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4062880161799968} + - component: {fileID: 114873114538619666} + m_Layer: 5 + m_Name: FrontArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1495992040383280 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224195135213235292} + - component: {fileID: 222385931455952620} + - component: {fileID: 114175671559192530} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1498453846321146 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4998463843861972} + m_Layer: 5 + m_Name: FrontArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1515404789711088 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4024087671455752} + - component: {fileID: 114933653232386136} + m_Layer: 5 + m_Name: LeftArrow (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1535950939685256 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4630278991888076} + - component: {fileID: 114755545279478606} + m_Layer: 5 + m_Name: RightArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1537353604937916 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224705911240679902} + - component: {fileID: 222829940863652588} + - component: {fileID: 114464661992143834} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1539692488507350 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4673130869543022} + - component: {fileID: 114347973994711784} + m_Layer: 5 + m_Name: LeftArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1556368157722758 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4094688054820746} + - component: {fileID: 114130122097018780} + m_Layer: 5 + m_Name: BackArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1577626411570396 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224185862510095714} + - component: {fileID: 222981134354437446} + - component: {fileID: 114479113303687970} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1587099013867276 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224334818403569600} + - component: {fileID: 222710834793849708} + - component: {fileID: 114577618702827488} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1627495043617212 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4436731719689366} + - component: {fileID: 114647227679990130} + m_Layer: 5 + m_Name: BottomArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1651169489046500 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224400357811708698} + - component: {fileID: 222730237307327122} + - component: {fileID: 114419057479699580} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1654262832382846 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4157632766833512} + - component: {fileID: 114546261427105744} + m_Layer: 5 + m_Name: RightArrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1656909277096102 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224755403897354710} + - component: {fileID: 222009886304005568} + - component: {fileID: 114484267577154790} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1660141959091138 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224796048607831954} + - component: {fileID: 222305923262322410} + - component: {fileID: 114905976864135670} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1679881730550880 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4680161644130496} + - component: {fileID: 114041376699156020} + m_Layer: 5 + m_Name: TopArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1710819549023888 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224562911775927908} + - component: {fileID: 222380044330408610} + - component: {fileID: 114699673652902324} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1711721311657312 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224083169184976582} + - component: {fileID: 222796193882324548} + - component: {fileID: 114804947298759112} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1721895297109438 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224008343808292248} + - component: {fileID: 222811603868491532} + - component: {fileID: 114741235494283886} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1755047999869798 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224033772257282698} + - component: {fileID: 222792609721424644} + - component: {fileID: 114141921517141998} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1789767321393858 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224052212126334452} + - component: {fileID: 223686309998784866} + - component: {fileID: 225647651707368488} + - component: {fileID: 114885606894613528} + m_Layer: 5 + m_Name: SpatialHintUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1860320476486554 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4715255144694938} + - component: {fileID: 114820192887403444} + m_Layer: 5 + m_Name: RightArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1900815364540156 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224321561277689504} + - component: {fileID: 222555451852467338} + - component: {fileID: 114959322808913320} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1909402341511028 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4724266729072562} + - component: {fileID: 114873812632177310} + m_Layer: 5 + m_Name: BottomArrow (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1951662511308604 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4675647250350146} + - component: {fileID: 114310382182576548} + m_Layer: 5 + m_Name: BottomArrow (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1957453253227530 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4168178459706398} + m_Layer: 5 + m_Name: LeftArrow (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1966187874104382 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4392107344112590} + - component: {fileID: 114004058444794040} + m_Layer: 5 + m_Name: RightArrow (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4024087671455752 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1515404789711088} + m_LocalRotation: {x: -0.38269445, y: -0.0000009089707, z: 0.6532774, w: 0.6532791} + m_LocalPosition: {x: 0.30512458, y: 0.05239418, z: 0.17874639} + m_LocalScale: {x: 1.0000001, y: 1.0000006, z: 1.0000006} + m_Children: + - {fileID: 224008343808292248} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} +--- !u!4 &4055687054597960 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1411913761068088} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224081311369273524} + m_Father: {fileID: 224052212126334452} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!4 &4062880161799968 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1477005998831424} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.35741758} + m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} + m_Children: + - {fileID: 224033772257282698} + m_Father: {fileID: 224052212126334452} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!4 &4094688054820746 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1556368157722758} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.35757425} + m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} + m_Children: + - {fileID: 224400357811708698} + m_Father: {fileID: 224052212126334452} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!4 &4157632766833512 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1654262832382846} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: -0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224796048607831954} + m_Father: {fileID: 224052212126334452} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!4 &4168178459706398 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1957453253227530} + m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224202520050313972} + m_Father: {fileID: 224457231796985382} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} +--- !u!4 &4234521712409882 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083271504533730} + m_LocalRotation: {x: 0.49999815, y: 0.5000008, z: -0.000000119209275, w: 0.70710754} + m_LocalPosition: {x: 0.17880443, y: 0.17869522, z: 0.25271186} + m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} + m_Children: + - {fileID: 224185862510095714} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} +--- !u!4 &4352658633633276 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1087189506426152} + m_LocalRotation: {x: -0.27060428, y: -0.27060556, z: -0.0000000074505797, w: 0.9238756} + m_LocalPosition: {x: 0.05231689, y: 0.30518025, z: -0.17878139} + m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} + m_Children: + - {fileID: 224536315768338012} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} +--- !u!4 &4392107344112590 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1966187874104382} + m_LocalRotation: {x: 0.707106, y: 0.0000017287589, z: 0.5000004, w: 0.5000008} + m_LocalPosition: {x: -0.1786963, y: -0.17880678, z: 0.25271866} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224737278412607648} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} +--- !u!4 &4405923127552798 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1278946252185714} + m_LocalRotation: {x: -0.27060428, y: -0.27060556, z: -0.0000000074505797, w: 0.9238756} + m_LocalPosition: {x: -0.05239579, y: -0.3051027, z: 0.17873496} + m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} + m_Children: + - {fileID: 224334818403569600} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} +--- !u!4 &4436731719689366 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1627495043617212} + m_LocalRotation: {x: 0.2705894, y: 0.27059057, z: -0.00000017881389, w: 0.92388433} + m_LocalPosition: {x: -0.052311167, y: -0.30518684, z: -0.17876795} + m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} + m_Children: + - {fileID: 224535942915412938} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} +--- !u!4 &4486931087156832 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1415035000229474} + m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.35757425} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224195135213235292} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!4 &4536356174147362 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1208914140055346} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.3574999, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224755403897354710} + m_Father: {fileID: 224052212126334452} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4630278991888076 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1535950939685256} + m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} + m_LocalPosition: {x: -0.3051234, y: -0.052390024, z: 0.17873323} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224562911775927908} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} +--- !u!4 &4656611640740372 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1112224048980768} + m_LocalRotation: {x: 0.2705973, y: 0.65328187, z: 0.2705973, w: 0.6532818} + m_LocalPosition: {x: 0.00011226709, y: 0.000016883754, z: -0.000107623935} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4486931087156832} + - {fileID: 4998463843861972} + - {fileID: 4715255144694938} + - {fileID: 4673130869543022} + - {fileID: 4724266729072562} + - {fileID: 4800155596865708} + - {fileID: 4680161644130496} + - {fileID: 4436731719689366} + - {fileID: 4851979343048988} + - {fileID: 4630278991888076} + - {fileID: 4920529215995508} + - {fileID: 4024087671455752} + - {fileID: 4405923127552798} + - {fileID: 4352658633633276} + - {fileID: 4234521712409882} + - {fileID: 4675647250350146} + - {fileID: 4841372590907710} + - {fileID: 4392107344112590} + m_Father: {fileID: 224052212126334452} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 90.00001, z: 45.000004} +--- !u!4 &4673130869543022 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1539692488507350} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224083169184976582} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!4 &4675647250350146 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1951662511308604} + m_LocalRotation: {x: 0.49999815, y: 0.5000008, z: -0.000000119209275, w: 0.70710754} + m_LocalPosition: {x: -0.17869319, y: -0.17880538, z: -0.2528689} + m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} + m_Children: + - {fileID: 224375606798488428} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} +--- !u!4 &4680161644130496 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1679881730550880} + m_LocalRotation: {x: 0.2705894, y: 0.27059057, z: -0.00000017881389, w: 0.92388433} + m_LocalPosition: {x: 0.05238819, y: 0.3051088, z: 0.17872259} + m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} + m_Children: + - {fileID: 224068218456614698} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} +--- !u!4 &4715255144694938 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1860320476486554} + m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: -0.35749826, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224705911240679902} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!4 &4724266729072562 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1909402341511028} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.35749984, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224289252517553026} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4800155596865708 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1075893997324224} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.35749984, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224135530598210196} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4841372590907710 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1166221615258474} + m_LocalRotation: {x: 0.707106, y: 0.0000017287589, z: 0.5000004, w: 0.5000008} + m_LocalPosition: {x: 0.17880696, y: 0.17869617, z: -0.25287494} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224457270545674496} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} +--- !u!4 &4851979343048988 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1194110711330918} + m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} + m_LocalPosition: {x: 0.30520225, y: 0.052312464, z: -0.17877874} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224780185442623124} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} +--- !u!4 &4875632078745168 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1286179857941560} + m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224197558861574286} + m_Father: {fileID: 224457231796985382} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} +--- !u!4 &4919626380897530 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1233422500995160} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.3574999, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224768393309507636} + m_Father: {fileID: 224052212126334452} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4920529215995508 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1226882853100004} + m_LocalRotation: {x: -0.38269445, y: -0.0000009089707, z: 0.6532774, w: 0.6532791} + m_LocalPosition: {x: -0.30520254, y: -0.05231519, z: -0.17879169} + m_LocalScale: {x: 1.0000001, y: 1.0000006, z: 1.0000006} + m_Children: + - {fileID: 224321561277689504} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} +--- !u!4 &4998463843861972 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1498453846321146} + m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.35741758} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224662441432538096} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!114 &114000567662040162 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1278946252185714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114577618702827488} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114004058444794040 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1966187874104382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114544001302371152} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114033438707707268 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1411913761068088} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114650534892023224} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114041376699156020 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1679881730550880} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114709130866979964} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114062055406121370 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1151867513107076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114085391963444694 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1194110711330918} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114555141257046060} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114130122097018780 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1556368157722758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114419057479699580} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114141921517141998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1755047999869798} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114175671559192530 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1495992040383280} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114178251820008812 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1339250774381076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114261400763498716 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1125351313468992} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114279174847565634 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1233422500995160} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114062055406121370} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114310382182576548 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1951662511308604} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114826715084335374} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114312153825842830 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1346389602611770} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114341816562169696 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1035625982163522} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114347973994711784 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1539692488507350} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114804947298759112} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114419057479699580 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1651169489046500} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114464661992143834 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1537353604937916} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114472214291358280 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1166221615258474} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114749271261725720} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114479113303687970 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1577626411570396} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114484267577154790 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1656909277096102} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114508101107919186 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1087189506426152} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114261400763498716} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114544001302371152 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1431127396183784} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114546261427105744 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1654262832382846} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114905976864135670} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114549952638618038 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083271504533730} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114479113303687970} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114555141257046060 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1006711227317104} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114577618702827488 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1587099013867276} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114602193729648712 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1075893997324224} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114922086105306672} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114647227679990130 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1627495043617212} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114312153825842830} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114650385070507634 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1208914140055346} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114484267577154790} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114650534892023224 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1196161126514986} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114699673652902324 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1710819549023888} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114709130866979964 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1261891554981946} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114721502774444018 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1226882853100004} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114959322808913320} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114741235494283886 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1721895297109438} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114749271261725720 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1310027530136584} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114755545279478606 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1535950939685256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114699673652902324} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114768730554743184 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1016458810671980} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 0.428} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114788108653890746 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1476779982288018} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 0.428} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114804947298759112 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1711721311657312} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114820192887403444 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1860320476486554} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114464661992143834} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114826715084335374 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1295546017909780} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114873114538619666 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1477005998831424} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114141921517141998} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114873812632177310 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1909402341511028} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114178251820008812} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114885606894613528 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1789767321393858} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a9e4377fb5567cc4ea23d3ad3d292114, type: 3} + m_Name: + m_EditorClassIdentifier: + m_PrimaryDirectionalHintArrows: + - {fileID: 114650385070507634} + - {fileID: 114279174847565634} + - {fileID: 114033438707707268} + - {fileID: 114546261427105744} + - {fileID: 114873114538619666} + - {fileID: 114130122097018780} + m_SecondaryDirectionalHintArrows: + - {fileID: 114820192887403444} + - {fileID: 114347973994711784} + - {fileID: 114873812632177310} + - {fileID: 114602193729648712} + - {fileID: 114041376699156020} + - {fileID: 114647227679990130} + - {fileID: 114085391963444694} + - {fileID: 114755545279478606} + - {fileID: 114721502774444018} + - {fileID: 114933653232386136} + - {fileID: 114000567662040162} + - {fileID: 114508101107919186} + - {fileID: 114549952638618038} + - {fileID: 114310382182576548} + - {fileID: 114472214291358280} + - {fileID: 114004058444794040} + m_ScrollVisualsCanvasGroup: {fileID: 225476474272170592} + m_ScrollVisualsDragTargetArrow: {fileID: 4875632078745168} +--- !u!114 &114905976864135670 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1660141959091138} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114922086105306672 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1058418693224498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114933653232386136 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1515404789711088} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114741235494283886} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114959322808913320 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1900815364540156} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!222 &222009886304005568 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1656909277096102} +--- !u!222 &222034759844148942 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1339250774381076} +--- !u!222 &222053575299208536 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1058418693224498} +--- !u!222 &222269790095738828 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1151867513107076} +--- !u!222 &222305923262322410 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1660141959091138} +--- !u!222 &222312163737858760 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1346389602611770} +--- !u!222 &222321531243824390 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1295546017909780} +--- !u!222 &222380044330408610 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1710819549023888} +--- !u!222 &222383098631261652 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1016458810671980} +--- !u!222 &222385931455952620 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1495992040383280} +--- !u!222 &222555451852467338 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1900815364540156} +--- !u!222 &222607553899644316 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1431127396183784} +--- !u!222 &222640872418002352 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1196161126514986} +--- !u!222 &222640907686946606 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1310027530136584} +--- !u!222 &222710834793849708 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1587099013867276} +--- !u!222 &222730237307327122 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1651169489046500} +--- !u!222 &222736887738100716 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1476779982288018} +--- !u!222 &222770186031098170 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1261891554981946} +--- !u!222 &222792609721424644 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1755047999869798} +--- !u!222 &222796193882324548 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1711721311657312} +--- !u!222 &222797658040913998 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1006711227317104} +--- !u!222 &222811603868491532 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1721895297109438} +--- !u!222 &222829940863652588 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1537353604937916} +--- !u!222 &222893828193564900 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1125351313468992} +--- !u!222 &222939546821322456 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1035625982163522} +--- !u!222 &222981134354437446 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1577626411570396} +--- !u!223 &223686309998784866 +Canvas: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1789767321393858} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &224008343808292248 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1721895297109438} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4024087671455752} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224033772257282698 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1755047999869798} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4062880161799968} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224052212126334452 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1789767321393858} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224457231796985382} + - {fileID: 4656611640740372} + - {fileID: 4536356174147362} + - {fileID: 4919626380897530} + - {fileID: 4055687054597960} + - {fileID: 4157632766833512} + - {fileID: 4062880161799968} + - {fileID: 4094688054820746} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224068218456614698 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1261891554981946} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4680161644130496} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224081311369273524 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1196161126514986} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4055687054597960} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224083169184976582 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1711721311657312} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4673130869543022} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224135530598210196 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1058418693224498} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4800155596865708} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224185862510095714 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1577626411570396} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4234521712409882} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224195135213235292 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1495992040383280} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4486931087156832} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224197558861574286 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1476779982288018} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4875632078745168} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224202520050313972 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1016458810671980} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4168178459706398} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224289252517553026 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1339250774381076} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4724266729072562} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224321561277689504 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1900815364540156} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4920529215995508} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224334818403569600 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1587099013867276} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4405923127552798} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224375606798488428 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1295546017909780} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4675647250350146} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224400357811708698 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1651169489046500} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4094688054820746} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224457231796985382 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138933449834660} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.00007861798} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4875632078745168} + - {fileID: 4168178459706398} + m_Father: {fileID: 224052212126334452} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.00007836922, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224457270545674496 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1310027530136584} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4841372590907710} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224535942915412938 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1346389602611770} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4436731719689366} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224536315768338012 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1125351313468992} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4352658633633276} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224562911775927908 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1710819549023888} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4630278991888076} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224662441432538096 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1035625982163522} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4998463843861972} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224705911240679902 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1537353604937916} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4715255144694938} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224737278412607648 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1431127396183784} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4392107344112590} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224755403897354710 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1656909277096102} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4536356174147362} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224768393309507636 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1151867513107076} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4919626380897530} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224780185442623124 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1006711227317104} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4851979343048988} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224796048607831954 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1660141959091138} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4157632766833512} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!225 &225219344075895100 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1112224048980768} + m_Enabled: 1 + m_Alpha: 0.025 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 +--- !u!225 &225476474272170592 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138933449834660} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 +--- !u!225 &225647651707368488 +CanvasGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1789767321393858} + m_Enabled: 1 + m_Alpha: 1 + m_Interactable: 0 + m_BlocksRaycasts: 0 + m_IgnoreParentGroups: 0 diff --git a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab.meta b/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab.meta new file mode 100644 index 000000000..358d7a7dc --- /dev/null +++ b/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: cdc0eb858b1c7ed488024c8ad974bd47 +timeCreated: 1499717228 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: From b1aac27c831931e009f3cc05d7a6fcb8f713b7d1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Jul 2017 13:08:54 -0700 Subject: [PATCH 539/870] Add processing of PinnedToolsMenuInput back into EVR's ProcessInput function. --- Scripts/Core/EditorVR.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index e1361511e..9df7f3b2f 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -359,6 +359,11 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate && processedInputs.Add(process)) // Only process inputs for an instance of a tool once (e.g. two-handed tools) process.ProcessInput(toolData.input, consumeControl); } + + var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; + if (pinnedToolsMenuInput != null) + pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); } } From ff7c00f3b2bf14032010c3e9a0f5bd0059ef23de Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 13:45:48 -0700 Subject: [PATCH 540/870] Add skinned mesh support to HighlightModule and IntersectionModule --- .../HighlightModule/HighlightModule.cs | 9 ++++++ .../IntersectionModule/IntersectionModule.cs | 2 ++ Scripts/Utilities/IntersectionUtils.cs | 28 +++++++++++-------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs b/Scripts/Modules/HighlightModule/HighlightModule.cs index e39ba1978..19ff698bb 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -72,6 +72,15 @@ static void HighlightObject(GameObject go, Material material) for (var i = 0; i < m.sharedMesh.subMeshCount; i++) Graphics.DrawMesh(m.sharedMesh, m.transform.localToWorldMatrix, material, m.gameObject.layer, null, i); } + + foreach (var m in go.GetComponentsInChildren()) + { + if (m.sharedMesh == null) + continue; + + for (var i = 0; i < m.sharedMesh.subMeshCount; i++) + Graphics.DrawMesh(m.sharedMesh, m.transform.localToWorldMatrix, material, m.gameObject.layer, null, i); + } } public void AddRayOriginForNode(Node node, Transform rayOrigin) diff --git a/Scripts/Modules/IntersectionModule/IntersectionModule.cs b/Scripts/Modules/IntersectionModule/IntersectionModule.cs index 620702f10..e411ab356 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionModule.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionModule.cs @@ -216,6 +216,8 @@ internal bool Raycast(Ray ray, out RaycastHit hit, out GameObject obj, float max var transform = renderer.transform; + IntersectionUtils.SetupCollisionTester(m_CollisionTester, transform); + RaycastHit tmp; if (IntersectionUtils.TestRay(m_CollisionTester, transform, ray, out tmp, maxDistance)) { diff --git a/Scripts/Utilities/IntersectionUtils.cs b/Scripts/Utilities/IntersectionUtils.cs index 2d5395ced..5e6ef31ce 100644 --- a/Scripts/Utilities/IntersectionUtils.cs +++ b/Scripts/Utilities/IntersectionUtils.cs @@ -20,6 +20,8 @@ public static bool TestObject(MeshCollider collisionTester, Renderer obj, Inters { var transform = obj.transform; + SetupCollisionTester(collisionTester, transform); + // Try a simple test with specific rays located at vertices for (var j = 0; j < tester.rays.Length; j++) { @@ -47,10 +49,6 @@ public static bool TestObject(MeshCollider collisionTester, Renderer obj, Inters /// The result of whether the point/ray is intersection with or located within the object public static bool TestEdges(MeshCollider collisionTester, Transform obj, IntersectionTester tester) { - var mf = obj.GetComponent(); - if (mf) - collisionTester.sharedMesh = mf.sharedMesh; - var boundsMagnitude = collisionTester.bounds.size.magnitude; var triangles = tester.triangles; @@ -132,10 +130,6 @@ public static bool OnSegment(Vector3 A, Vector3 C, Vector3 B) /// The result of whether the point/ray is intersection with or located within the object public static bool TestRay(MeshCollider collisionTester, Transform obj, Ray ray) { - var mf = obj.GetComponent(); - if (mf) - collisionTester.sharedMesh = mf.sharedMesh; - ray.origin = obj.InverseTransformPoint(ray.origin); ray.direction = obj.InverseTransformDirection(ray.direction); @@ -179,16 +173,26 @@ public static bool TestRay(MeshCollider collisionTester, Transform obj, Ray ray) /// The result of whether the ray intersects with the object public static bool TestRay(MeshCollider collisionTester, Transform obj, Ray ray, out RaycastHit hit, float maxDistance = Mathf.Infinity) { - var mf = obj.GetComponent(); - if (mf) - collisionTester.sharedMesh = mf.sharedMesh; - ray.origin = obj.InverseTransformPoint(ray.origin); ray.direction = obj.InverseTransformVector(ray.direction); maxDistance = obj.InverseTransformVector(ray.direction * maxDistance).magnitude; return collisionTester.Raycast(ray, out hit, maxDistance); } + + public static void SetupCollisionTester(MeshCollider collisionTester, Transform obj) + { + var mf = obj.GetComponent(); + if (mf) + collisionTester.sharedMesh = mf.sharedMesh; + + if (!mf) + { + var smr = obj.GetComponent(); + if (smr) + collisionTester.sharedMesh = smr.sharedMesh; + } + } } } #endif From 69ff68fb1ecca39d03b5b97155c00cf667fa2f2a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Jul 2017 14:02:40 -0700 Subject: [PATCH 541/870] Add SpatialHintUI instantiation support to PinnedToolsMenu --- .../Prefabs/PinnedToolsMenu.prefab | 3145 +---------------- .../Prefabs/SpatialHintUI.prefab | 1453 ++++---- .../Scripts/PinnedToolsMenuUI.cs | 36 +- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 18 +- 4 files changed, 806 insertions(+), 3846 deletions(-) diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 2603aeb76..879c4a031 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -43,3133 +43,62 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1031849814866140 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4883774153867170} - - component: {fileID: 114966871140878844} - m_Layer: 5 - m_Name: TopArrow (4) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1049941617855090 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224516350747140734} - - component: {fileID: 225496513774942428} - m_Layer: 5 - m_Name: ScrollVisuals - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1052082992177756 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4627373214459226} - - component: {fileID: 114156664202657108} - m_Layer: 5 - m_Name: RightArrow (2) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1058135006110656 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4777470692906276} - - component: {fileID: 114120675658605384} - m_Layer: 5 - m_Name: RightArrow - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1058196337944694 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224921899845820908} - - component: {fileID: 222467063938135354} - - component: {fileID: 114880350798214428} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1063523385287442 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4348701280787806} - - component: {fileID: 114039844972246400} - m_Layer: 5 - m_Name: BottomArrow (4) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1077445558168692 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000874305746072} - - component: {fileID: 114343363037367066} - m_Layer: 5 - m_Name: LeftArrow (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1083125012091370 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224106935460784972} - - component: {fileID: 222766034547299188} - - component: {fileID: 114508260567943020} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1086640583229492 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224563120333433268} - - component: {fileID: 222609766870474766} - - component: {fileID: 114724739900522476} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1104408707865476 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224832882527011820} - - component: {fileID: 222093030019584422} - - component: {fileID: 114581339146061258} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1113548126640048 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224926333701432290} - - component: {fileID: 223228058598912900} - - component: {fileID: 225918572929103210} - - component: {fileID: 114705618050563776} - m_Layer: 5 - m_Name: SpatialHintUI - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1133158312748406 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4648779473311770} - - component: {fileID: 114410950009439322} - m_Layer: 5 - m_Name: FrontArrow - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1162277860306230 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4575203095433520} - - component: {fileID: 114265858466807592} - m_Layer: 5 - m_Name: LeftArrow (4) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1215691977135838 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224523839693825596} - - component: {fileID: 222502552576947544} - - component: {fileID: 114269893187404902} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1236151594399662 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4386844247658442} - - component: {fileID: 114451923332080912} - m_Layer: 5 - m_Name: RightArrow (4) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1243100648521718 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4424188858784126} - - component: {fileID: 225892931205557926} - m_Layer: 5 - m_Name: DiagonalArrows - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1269561316698028 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4967341377978414} - m_Layer: 5 - m_Name: RightArrow (2) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1277691287488752 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224948863731782614} - - component: {fileID: 222447643541202192} - - component: {fileID: 114742457022644888} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1288076055191678 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224211381368016420} - - component: {fileID: 222123858154635328} - - component: {fileID: 114137758696402814} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1374759649448910 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4888922240738846} - - component: {fileID: 114878526282868244} - m_Layer: 5 - m_Name: BottomArrow - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1408640227645536 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4416256937175418} - - component: {fileID: 114117379512495918} - m_Layer: 5 - m_Name: BottomArrow (3) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1417797850913266 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224665261672936376} - - component: {fileID: 222904426838931346} - - component: {fileID: 114183467226746200} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1422966589754858 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224141220472168564} - - component: {fileID: 222556119809042824} - - component: {fileID: 114813176157330038} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1426506580573374 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4929512635594470} - - component: {fileID: 114263984546135386} - m_Layer: 5 - m_Name: TopArrow (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1429866494825076 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4073155563956874} - - component: {fileID: 114097487828792400} - m_Layer: 5 - m_Name: TopArrow (2) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1467485354617718 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224365571383024546} - - component: {fileID: 222746842890793678} - - component: {fileID: 114242316492250394} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1481108235756974 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4928569707817658} - m_Layer: 5 - m_Name: BackArrow (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1520471712351910 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4679261784804500} - - component: {fileID: 114350519079292674} - m_Layer: 5 - m_Name: LeftArrow (3) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1528577298737296 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224278859857227398} - - component: {fileID: 222410890664544046} - - component: {fileID: 114598401377257748} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1559511730278864 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4406467021179730} - m_Layer: 5 - m_Name: LeftArrow (2) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1576168663341530 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4058550772719746} - - component: {fileID: 114755079460350674} - m_Layer: 5 - m_Name: TopArrow (3) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1598041239745882 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224415910323943488} - - component: {fileID: 222831654399493144} - - component: {fileID: 114823076312193430} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1631410678625586 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224598666989053882} - - component: {fileID: 222853750888495964} - - component: {fileID: 114563865778918000} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1645397446809114 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4230921424453902} - - component: {fileID: 114709129698682498} - m_Layer: 5 - m_Name: BottomArrow (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1657489799168288 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4606543685854042} - - component: {fileID: 114389520305227152} - m_Layer: 5 - m_Name: TopArrow - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1661827634449264 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4574955065994976} - - component: {fileID: 114211348936724016} - m_Layer: 5 - m_Name: RightArrow (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1675697369700164 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4054773723513416} - - component: {fileID: 114952136032051262} - m_Layer: 5 - m_Name: BottomArrow (2) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1677176722312172 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224722272734808106} - - component: {fileID: 222381275818579690} - - component: {fileID: 114219147691969104} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1680574195269602 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224965907269186458} - - component: {fileID: 222619279999190876} - - component: {fileID: 114370147208166848} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1689057037272646 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224227513434018164} - - component: {fileID: 222045765058194512} - - component: {fileID: 114197230093624006} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1692885133297322 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224043746415228348} - - component: {fileID: 222159349607427246} - - component: {fileID: 114804887785659340} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1721480280295696 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224066018184099266} - - component: {fileID: 222387717327774104} - - component: {fileID: 114126998682949342} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1736942055089654 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4691544615733376} - - component: {fileID: 114802558585402892} - m_Layer: 5 - m_Name: LeftArrow (2) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1765042644591010 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224602939580724082} - - component: {fileID: 222576415916729906} - - component: {fileID: 114349826085895928} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1768337939050664 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4688592375184416} - - component: {fileID: 114742037330891170} - m_Layer: 5 - m_Name: BackArrow - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1775608398571146 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224402193235821058} - - component: {fileID: 222497862031640068} - - component: {fileID: 114627454420162904} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1803092220005186 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224463898306038578} - - component: {fileID: 222773264695355860} - - component: {fileID: 114737674627737730} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1837478099313884 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4298904777987284} - - component: {fileID: 114154224343743956} - m_Layer: 5 - m_Name: RightArrow (3) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1859289517789558 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4580549783542080} - - component: {fileID: 114626721792749568} - m_Layer: 5 - m_Name: LeftArrow - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1866128806406452 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4925765156807252} - m_Layer: 5 - m_Name: FrontArrow (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1884907985164560 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224968954540649746} - - component: {fileID: 222330902578677406} - - component: {fileID: 114648102325649086} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1909408486964086 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224265400135533474} - - component: {fileID: 222240515654960256} - - component: {fileID: 114222681976531280} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1909738417943642 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224846752056185278} - - component: {fileID: 222504959554748288} - - component: {fileID: 114106655877952548} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1914077346605324 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224053839113242232} - - component: {fileID: 222234007190448478} - - component: {fileID: 114467679702415144} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1950708251885582 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224284014073092618} - - component: {fileID: 222524122592722440} - - component: {fileID: 114555859501867138} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &4000011260103804 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014083153210} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} - m_Children: - - {fileID: 224926333701432290} - - {fileID: 4000012301197336} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012301197336 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010819337252} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4000011260103804} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000874305746072 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1077445558168692} - m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0.35749826, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224921899845820908} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} ---- !u!4 &4054773723513416 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1675697369700164} - m_LocalRotation: {x: 0.2705894, y: 0.27059057, z: -0.00000017881389, w: 0.92388433} - m_LocalPosition: {x: -0.052311167, y: -0.30518684, z: -0.17876795} - m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} - m_Children: - - {fileID: 224278859857227398} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} ---- !u!4 &4058550772719746 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1576168663341530} - m_LocalRotation: {x: -0.27060428, y: -0.27060556, z: -0.0000000074505797, w: 0.9238756} - m_LocalPosition: {x: 0.05231689, y: 0.30518025, z: -0.17878139} - m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} - m_Children: - - {fileID: 224523839693825596} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 13 - m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} ---- !u!4 &4073155563956874 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1429866494825076} - m_LocalRotation: {x: 0.2705894, y: 0.27059057, z: -0.00000017881389, w: 0.92388433} - m_LocalPosition: {x: 0.05238819, y: 0.3051088, z: 0.17872259} - m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} - m_Children: - - {fileID: 224284014073092618} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} ---- !u!4 &4230921424453902 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1645397446809114} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -0.35749984, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224265400135533474} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4298904777987284 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1837478099313884} - m_LocalRotation: {x: -0.38269445, y: -0.0000009089707, z: 0.6532774, w: 0.6532791} - m_LocalPosition: {x: -0.30520254, y: -0.05231519, z: -0.17879169} - m_LocalScale: {x: 1.0000001, y: 1.0000006, z: 1.0000006} - m_Children: - - {fileID: 224665261672936376} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 10 - m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} ---- !u!4 &4348701280787806 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1063523385287442} - m_LocalRotation: {x: 0.49999815, y: 0.5000008, z: -0.000000119209275, w: 0.70710754} - m_LocalPosition: {x: -0.17869319, y: -0.17880538, z: -0.2528689} - m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} - m_Children: - - {fileID: 224365571383024546} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 15 - m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} ---- !u!4 &4386844247658442 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1236151594399662} - m_LocalRotation: {x: 0.707106, y: 0.0000017287589, z: 0.5000004, w: 0.5000008} - m_LocalPosition: {x: -0.1786963, y: -0.17880678, z: 0.25271866} - m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} - m_Children: - - {fileID: 224053839113242232} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 17 - m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} ---- !u!4 &4406467021179730 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1559511730278864} - m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} - m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224965907269186458} - m_Father: {fileID: 224516350747140734} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} ---- !u!4 &4416256937175418 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1408640227645536} - m_LocalRotation: {x: -0.27060428, y: -0.27060556, z: -0.0000000074505797, w: 0.9238756} - m_LocalPosition: {x: -0.05239579, y: -0.3051027, z: 0.17873496} - m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} - m_Children: - - {fileID: 224463898306038578} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 12 - m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} ---- !u!4 &4424188858784126 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1243100648521718} - m_LocalRotation: {x: 0.2705973, y: 0.65328187, z: 0.2705973, w: 0.6532818} - m_LocalPosition: {x: 0.00011226709, y: 0.000016883754, z: -0.000107623935} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4928569707817658} - - {fileID: 4925765156807252} - - {fileID: 4574955065994976} - - {fileID: 4000874305746072} - - {fileID: 4230921424453902} - - {fileID: 4929512635594470} - - {fileID: 4073155563956874} - - {fileID: 4054773723513416} - - {fileID: 4691544615733376} - - {fileID: 4627373214459226} - - {fileID: 4298904777987284} - - {fileID: 4679261784804500} - - {fileID: 4416256937175418} - - {fileID: 4058550772719746} - - {fileID: 4883774153867170} - - {fileID: 4348701280787806} - - {fileID: 4575203095433520} - - {fileID: 4386844247658442} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 90.00001, z: 45.000004} ---- !u!4 &4574955065994976 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1661827634449264} - m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: -0.35749826, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224832882527011820} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} ---- !u!4 &4575203095433520 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1162277860306230} - m_LocalRotation: {x: 0.707106, y: 0.0000017287589, z: 0.5000004, w: 0.5000008} - m_LocalPosition: {x: 0.17880696, y: 0.17869617, z: -0.25287494} - m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} - m_Children: - - {fileID: 224948863731782614} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 16 - m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} ---- !u!4 &4580549783542080 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1859289517789558} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0.35749826, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224066018184099266} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} ---- !u!4 &4606543685854042 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1657489799168288} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0.3574999, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224563120333433268} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4627373214459226 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1052082992177756} - m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} - m_LocalPosition: {x: -0.3051234, y: -0.052390024, z: 0.17873323} - m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} - m_Children: - - {fileID: 224415910323943488} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 9 - m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} ---- !u!4 &4648779473311770 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1133158312748406} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 0.35741758} - m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} - m_Children: - - {fileID: 224141220472168564} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} ---- !u!4 &4679261784804500 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1520471712351910} - m_LocalRotation: {x: -0.38269445, y: -0.0000009089707, z: 0.6532774, w: 0.6532791} - m_LocalPosition: {x: 0.30512458, y: 0.05239418, z: 0.17874639} - m_LocalScale: {x: 1.0000001, y: 1.0000006, z: 1.0000006} - m_Children: - - {fileID: 224846752056185278} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 11 - m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} ---- !u!4 &4688592375184416 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1768337939050664} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: -0.35757425} - m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} - m_Children: - - {fileID: 224043746415228348} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} ---- !u!4 &4691544615733376 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1736942055089654} - m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} - m_LocalPosition: {x: 0.30520225, y: 0.052312464, z: -0.17877874} - m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} - m_Children: - - {fileID: 224722272734808106} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} ---- !u!4 &4777470692906276 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1058135006110656} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: -0.35749826, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224602939580724082} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} ---- !u!4 &4883774153867170 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1031849814866140} - m_LocalRotation: {x: 0.49999815, y: 0.5000008, z: -0.000000119209275, w: 0.70710754} - m_LocalPosition: {x: 0.17880443, y: 0.17869522, z: 0.25271186} - m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} - m_Children: - - {fileID: 224402193235821058} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 14 - m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} ---- !u!4 &4888922240738846 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1374759649448910} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -0.3574999, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224598666989053882} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4925765156807252 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1866128806406452} - m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 0.35741758} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224106935460784972} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} ---- !u!4 &4928569707817658 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1481108235756974} - m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: -0.35757425} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224211381368016420} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} ---- !u!4 &4929512635594470 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1426506580573374} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0.35749984, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224227513434018164} - m_Father: {fileID: 4424188858784126} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4967341377978414 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1269561316698028} - m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} - m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224968954540649746} - m_Father: {fileID: 224516350747140734} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} ---- !u!114 &114000010527895234 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014083153210} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: cfe80f5c8b040574dbe8502d4830bf4b, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ButtonContainer: {fileID: 4000012301197336} - m_AlternatePosition: {x: 0, y: 0, z: -0.0136} - m_AlternateLocalScale: {x: 0.54, y: 0.54, z: 0.54} - m_HintContentContainer: {fileID: 224926333701432290} - m_HintArrowsCanvasGroup: {fileID: 225918572929103210} - m_SpatialHintUI: {fileID: 114705618050563776} ---- !u!114 &114000011597863712 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010819337252} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} - m_Name: - m_EditorClassIdentifier: - m_SmoothRotation: 1 - m_TightenRotation: 30 - m_SmoothPosition: 1 - m_TightenPosition: 50 - m_Target: {fileID: 0} ---- !u!114 &114039844972246400 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1063523385287442} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114242316492250394} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114097487828792400 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1429866494825076} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114555859501867138} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114106655877952548 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1909738417943642} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114117379512495918 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1408640227645536} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114737674627737730} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114120675658605384 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1058135006110656} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114349826085895928} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114126998682949342 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1721480280295696} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114137758696402814 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1288076055191678} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114154224343743956 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1837478099313884} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114183467226746200} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114156664202657108 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1052082992177756} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114823076312193430} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114183467226746200 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1417797850913266} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114197230093624006 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1689057037272646} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114211348936724016 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1661827634449264} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114581339146061258} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114219147691969104 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1677176722312172} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114222681976531280 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1909408486964086} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114242316492250394 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1467485354617718} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114263984546135386 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1426506580573374} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114197230093624006} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114265858466807592 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1162277860306230} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114742457022644888} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114269893187404902 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1215691977135838} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114343363037367066 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1077445558168692} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114880350798214428} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114349826085895928 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1765042644591010} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114350519079292674 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1520471712351910} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114106655877952548} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114370147208166848 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1680574195269602} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 0, g: 0, b: 0, a: 0.428} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114389520305227152 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1657489799168288} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114724739900522476} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114410950009439322 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1133158312748406} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114813176157330038} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114451923332080912 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1236151594399662} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114467679702415144} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114467679702415144 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1914077346605324} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114508260567943020 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1083125012091370} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114555859501867138 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1950708251885582} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114563865778918000 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1631410678625586} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114581339146061258 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1104408707865476} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114598401377257748 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1528577298737296} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114626721792749568 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1859289517789558} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114126998682949342} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114627454420162904 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1775608398571146} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114648102325649086 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1884907985164560} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 0, g: 0, b: 0, a: 0.428} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114705618050563776 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1113548126640048} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a9e4377fb5567cc4ea23d3ad3d292114, type: 3} - m_Name: - m_EditorClassIdentifier: - m_PrimaryDirectionalHintArrows: - - {fileID: 114389520305227152} - - {fileID: 114878526282868244} - - {fileID: 114626721792749568} - - {fileID: 114120675658605384} - - {fileID: 114410950009439322} - - {fileID: 114742037330891170} - m_SecondaryDirectionalHintArrows: - - {fileID: 114211348936724016} - - {fileID: 114343363037367066} - - {fileID: 114709129698682498} - - {fileID: 114263984546135386} - - {fileID: 114097487828792400} - - {fileID: 114952136032051262} - - {fileID: 114802558585402892} - - {fileID: 114156664202657108} - - {fileID: 114154224343743956} - - {fileID: 114350519079292674} - - {fileID: 114117379512495918} - - {fileID: 114755079460350674} - - {fileID: 114966871140878844} - - {fileID: 114039844972246400} - - {fileID: 114265858466807592} - - {fileID: 114451923332080912} - m_ScrollVisualsCanvasGroup: {fileID: 225496513774942428} - m_ScrollVisualsDragTargetArrow: {fileID: 4967341377978414} ---- !u!114 &114709129698682498 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1645397446809114} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114222681976531280} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114724739900522476 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1086640583229492} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114737674627737730 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1803092220005186} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114742037330891170 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1768337939050664} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114804887785659340} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114742457022644888 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1277691287488752} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114755079460350674 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1576168663341530} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114269893187404902} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114802558585402892 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1736942055089654} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114219147691969104} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114804887785659340 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692885133297322} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114813176157330038 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1422966589754858} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114823076312193430 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1598041239745882} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114878526282868244 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1374759649448910} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114563865778918000} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114880350798214428 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1058196337944694} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114952136032051262 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1675697369700164} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114598401377257748} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114966871140878844 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1031849814866140} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114627454420162904} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!222 &222045765058194512 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1689057037272646} ---- !u!222 &222093030019584422 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1104408707865476} ---- !u!222 &222123858154635328 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1288076055191678} ---- !u!222 &222159349607427246 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692885133297322} ---- !u!222 &222234007190448478 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1914077346605324} ---- !u!222 &222240515654960256 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1909408486964086} ---- !u!222 &222330902578677406 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1884907985164560} ---- !u!222 &222381275818579690 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1677176722312172} ---- !u!222 &222387717327774104 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1721480280295696} ---- !u!222 &222410890664544046 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1528577298737296} ---- !u!222 &222447643541202192 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1277691287488752} ---- !u!222 &222467063938135354 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1058196337944694} ---- !u!222 &222497862031640068 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1775608398571146} ---- !u!222 &222502552576947544 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1215691977135838} ---- !u!222 &222504959554748288 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1909738417943642} ---- !u!222 &222524122592722440 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1950708251885582} ---- !u!222 &222556119809042824 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1422966589754858} ---- !u!222 &222576415916729906 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1765042644591010} ---- !u!222 &222609766870474766 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1086640583229492} ---- !u!222 &222619279999190876 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1680574195269602} ---- !u!222 &222746842890793678 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1467485354617718} ---- !u!222 &222766034547299188 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1083125012091370} ---- !u!222 &222773264695355860 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1803092220005186} ---- !u!222 &222831654399493144 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1598041239745882} ---- !u!222 &222853750888495964 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1631410678625586} ---- !u!222 &222904426838931346 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1417797850913266} ---- !u!223 &223228058598912900 -Canvas: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1113548126640048} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_AdditionalShaderChannelsFlag: 25 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!224 &224043746415228348 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1692885133297322} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4688592375184416} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224053839113242232 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1914077346605324} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4386844247658442} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224066018184099266 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1721480280295696} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4580549783542080} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224106935460784972 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1083125012091370} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4925765156807252} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224141220472168564 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1422966589754858} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4648779473311770} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224211381368016420 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1288076055191678} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4928569707817658} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224227513434018164 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1689057037272646} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4929512635594470} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224265400135533474 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1909408486964086} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4230921424453902} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224278859857227398 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1528577298737296} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4054773723513416} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224284014073092618 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1950708251885582} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4073155563956874} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224365571383024546 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1467485354617718} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4348701280787806} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224402193235821058 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1775608398571146} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4883774153867170} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224415910323943488 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1598041239745882} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4627373214459226} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224463898306038578 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1803092220005186} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4416256937175418} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224516350747140734 -RectTransform: +--- !u!4 &4000011260103804 +Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1049941617855090} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.00007861798} - m_LocalScale: {x: 1, y: 1, z: 1} + m_GameObject: {fileID: 1000014083153210} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} m_Children: - - {fileID: 4967341377978414} - - {fileID: 4406467021179730} - m_Father: {fileID: 224926333701432290} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0.00007836922, y: 0} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224523839693825596 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1215691977135838} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4058550772719746} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224563120333433268 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1086640583229492} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4606543685854042} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224598666989053882 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1631410678625586} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4888922240738846} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224602939580724082 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1765042644591010} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4777470692906276} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224665261672936376 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1417797850913266} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4298904777987284} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224722272734808106 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1677176722312172} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4691544615733376} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224832882527011820 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1104408707865476} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4574955065994976} + - {fileID: 4000012301197336} + m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224846752056185278 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1909738417943642} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4679261784804500} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224921899845820908 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1058196337944694} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4000874305746072} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224926333701432290 -RectTransform: +--- !u!4 &4000012301197336 +Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1113548126640048} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_GameObject: {fileID: 1000010819337252} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224516350747140734} - - {fileID: 4424188858784126} - - {fileID: 4606543685854042} - - {fileID: 4888922240738846} - - {fileID: 4580549783542080} - - {fileID: 4777470692906276} - - {fileID: 4648779473311770} - - {fileID: 4688592375184416} - m_Father: {fileID: 4000011260103804} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224948863731782614 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1277691287488752} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4575203095433520} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224965907269186458 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1680574195269602} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4406467021179730} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224968954540649746 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1884907985164560} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4967341377978414} + m_Father: {fileID: 4000011260103804} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!225 &225496513774942428 -CanvasGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1049941617855090} - m_Enabled: 1 - m_Alpha: 1 - m_Interactable: 0 - m_BlocksRaycasts: 0 - m_IgnoreParentGroups: 0 ---- !u!225 &225892931205557926 -CanvasGroup: +--- !u!114 &114000010527895234 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1243100648521718} + m_GameObject: {fileID: 1000014083153210} m_Enabled: 1 - m_Alpha: 0.025 - m_Interactable: 0 - m_BlocksRaycasts: 0 - m_IgnoreParentGroups: 0 ---- !u!225 &225918572929103210 -CanvasGroup: + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cfe80f5c8b040574dbe8502d4830bf4b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ButtonContainer: {fileID: 4000012301197336} + m_AlternatePosition: {x: 0, y: 0, z: -0.0136} + m_AlternateLocalScale: {x: 0.54, y: 0.54, z: 0.54} + m_SpatialHintUI: {fileID: 114885606894613528, guid: cdc0eb858b1c7ed488024c8ad974bd47, + type: 2} +--- !u!114 &114000011597863712 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1113548126640048} + m_GameObject: {fileID: 1000010819337252} m_Enabled: 1 - m_Alpha: 1 - m_Interactable: 0 - m_BlocksRaycasts: 0 - m_IgnoreParentGroups: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d140242271ba0a94c9685339cdb66ee7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SmoothRotation: 1 + m_TightenRotation: 30 + m_SmoothPosition: 1 + m_TightenPosition: 50 + m_Target: {fileID: 0} diff --git a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab b/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab index 31662d6a5..7b0ecabf0 100644 --- a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab +++ b/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab @@ -11,16 +11,16 @@ Prefab: m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 1789767321393858} m_IsPrefabParent: 1 ---- !u!1 &1006711227317104 +--- !u!1 &1027327312544334 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224780185442623124} - - component: {fileID: 222797658040913998} - - component: {fileID: 114555141257046060} + - component: {fileID: 224988536893287282} + - component: {fileID: 222576734114943816} + - component: {fileID: 114790131153619060} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -28,50 +28,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1016458810671980 +--- !u!1 &1046794607109420 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224202520050313972} - - component: {fileID: 222383098631261652} - - component: {fileID: 114768730554743184} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1035625982163522 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224662441432538096} - - component: {fileID: 222939546821322456} - - component: {fileID: 114341816562169696} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1058418693224498 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224135530598210196} - - component: {fileID: 222053575299208536} - - component: {fileID: 114922086105306672} + - component: {fileID: 224008207930297392} + - component: {fileID: 222044567740138078} + - component: {fileID: 114534977170210908} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -129,7 +95,7 @@ GameObject: m_IsActive: 1 --- !u!1 &1112224048980768 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 @@ -143,16 +109,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1125351313468992 +--- !u!1 &1116655809746968 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224536315768338012} - - component: {fileID: 222893828193564900} - - component: {fileID: 114261400763498716} + - component: {fileID: 224153830142605794} + - component: {fileID: 222324007570340776} + - component: {fileID: 114403956001920920} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -162,7 +128,7 @@ GameObject: m_IsActive: 1 --- !u!1 &1138933449834660 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 @@ -176,16 +142,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1151867513107076 +--- !u!1 &1161415218632242 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224768393309507636} - - component: {fileID: 222269790095738828} - - component: {fileID: 114062055406121370} + - component: {fileID: 224312738310551638} + - component: {fileID: 222471662606385414} + - component: {fileID: 114291859005184956} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -193,50 +159,49 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1166221615258474 +--- !u!1 &1166111979364004 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4841372590907710} - - component: {fileID: 114472214291358280} + - component: {fileID: 224771858595270594} + - component: {fileID: 222340170423981886} + - component: {fileID: 114650107410517210} m_Layer: 5 - m_Name: LeftArrow (4) + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1194110711330918 +--- !u!1 &1166221615258474 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4851979343048988} - - component: {fileID: 114085391963444694} + - component: {fileID: 4841372590907710} + - component: {fileID: 114472214291358280} m_Layer: 5 - m_Name: LeftArrow (2) + m_Name: LeftArrow (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1196161126514986 +--- !u!1 &1194110711330918 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224081311369273524} - - component: {fileID: 222640872418002352} - - component: {fileID: 114650534892023224} + - component: {fileID: 4851979343048988} m_Layer: 5 - m_Name: Icon + m_Name: LeftArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -244,7 +209,7 @@ GameObject: m_IsActive: 1 --- !u!1 &1208914140055346 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 @@ -258,50 +223,50 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1226882853100004 +--- !u!1 &1211413244600520 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4920529215995508} - - component: {fileID: 114721502774444018} + - component: {fileID: 224513997123549140} + - component: {fileID: 222780664714617072} + - component: {fileID: 114992378279027252} m_Layer: 5 - m_Name: RightArrow (3) + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1233422500995160 +--- !u!1 &1226882853100004 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4919626380897530} - - component: {fileID: 114279174847565634} + - component: {fileID: 4920529215995508} + - component: {fileID: 114721502774444018} m_Layer: 5 - m_Name: BottomArrow + m_Name: RightArrow (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1261891554981946 +--- !u!1 &1233422500995160 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224068218456614698} - - component: {fileID: 222770186031098170} - - component: {fileID: 114709130866979964} + - component: {fileID: 4919626380897530} + - component: {fileID: 114279174847565634} m_Layer: 5 - m_Name: Icon + m_Name: BottomArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -323,31 +288,32 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1286179857941560 +--- !u!1 &1302798161695436 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4875632078745168} + - component: {fileID: 4930137114917576} + - component: {fileID: 114478667145759116} m_Layer: 5 - m_Name: RightArrow (2) + m_Name: LeftArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1295546017909780 +--- !u!1 &1303326821258898 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224375606798488428} - - component: {fileID: 222321531243824390} - - component: {fileID: 114826715084335374} + - component: {fileID: 224644784610691812} + - component: {fileID: 222070966549296146} + - component: {fileID: 114728711746979180} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -355,16 +321,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1310027530136584 +--- !u!1 &1313514635800650 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224457270545674496} - - component: {fileID: 222640907686946606} - - component: {fileID: 114749271261725720} + - component: {fileID: 224244514581948698} + - component: {fileID: 222807673838062916} + - component: {fileID: 114757945073081772} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -372,16 +338,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1339250774381076 +--- !u!1 &1391550003226712 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224289252517553026} - - component: {fileID: 222034759844148942} - - component: {fileID: 114178251820008812} + - component: {fileID: 224000303176787042} + - component: {fileID: 222599127361557302} + - component: {fileID: 114105037402801938} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -389,16 +355,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1346389602611770 +--- !u!1 &1404278696444272 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224535942915412938} - - component: {fileID: 222312163737858760} - - component: {fileID: 114312153825842830} + - component: {fileID: 224376509698512154} + - component: {fileID: 222158184680329756} + - component: {fileID: 114878598031735610} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -408,7 +374,7 @@ GameObject: m_IsActive: 1 --- !u!1 &1411913761068088 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 @@ -437,35 +403,34 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!1 &1431127396183784 +--- !u!1 &1435546683708450 GameObject: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224737278412607648} - - component: {fileID: 222607553899644316} - - component: {fileID: 114544001302371152} + - component: {fileID: 224722201347996720} + - component: {fileID: 223651440663421936} + - component: {fileID: 225156185928477662} m_Layer: 5 - m_Name: Icon + m_Name: CanvasContent m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1476779982288018 +--- !u!1 &1436793638745358 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224197558861574286} - - component: {fileID: 222736887738100716} - - component: {fileID: 114788108653890746} + - component: {fileID: 4873933386520716} + - component: {fileID: 114201708188467934} m_Layer: 5 - m_Name: Icon + m_Name: RightArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -473,7 +438,7 @@ GameObject: m_IsActive: 1 --- !u!1 &1477005998831424 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 @@ -487,16 +452,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1495992040383280 +--- !u!1 &1493045224029700 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224195135213235292} - - component: {fileID: 222385931455952620} - - component: {fileID: 114175671559192530} + - component: {fileID: 224935697657075864} + - component: {fileID: 222409781002321340} + - component: {fileID: 114066956829426356} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -543,7 +508,6 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4630278991888076} - - component: {fileID: 114755545279478606} m_Layer: 5 m_Name: RightArrow (2) m_TagString: Untagged @@ -551,65 +515,65 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1537353604937916 +--- !u!1 &1539692488507350 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224705911240679902} - - component: {fileID: 222829940863652588} - - component: {fileID: 114464661992143834} + - component: {fileID: 4673130869543022} + - component: {fileID: 114347973994711784} m_Layer: 5 - m_Name: Icon + m_Name: LeftArrow (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1539692488507350 +--- !u!1 &1556368157722758 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4673130869543022} - - component: {fileID: 114347973994711784} + - component: {fileID: 4094688054820746} + - component: {fileID: 114130122097018780} m_Layer: 5 - m_Name: LeftArrow (1) + m_Name: BackArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1556368157722758 +--- !u!1 &1609304458081020 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4094688054820746} - - component: {fileID: 114130122097018780} + - component: {fileID: 224856635122786234} + - component: {fileID: 222192379656075194} + - component: {fileID: 114974932015195176} m_Layer: 5 - m_Name: BackArrow + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1577626411570396 +--- !u!1 &1612215626004242 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224185862510095714} - - component: {fileID: 222981134354437446} - - component: {fileID: 114479113303687970} + - component: {fileID: 224403490052312444} + - component: {fileID: 222129853383819858} + - component: {fileID: 114889128424409716} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -617,16 +581,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1587099013867276 +--- !u!1 &1620204976623536 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224334818403569600} - - component: {fileID: 222710834793849708} - - component: {fileID: 114577618702827488} + - component: {fileID: 224930925262972702} + - component: {fileID: 222480375094953724} + - component: {fileID: 114502893213131780} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -650,66 +614,65 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1651169489046500 +--- !u!1 &1654262832382846 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224400357811708698} - - component: {fileID: 222730237307327122} - - component: {fileID: 114419057479699580} + - component: {fileID: 4157632766833512} + - component: {fileID: 114546261427105744} m_Layer: 5 - m_Name: Icon + m_Name: RightArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1654262832382846 +--- !u!1 &1659184777115880 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4157632766833512} - - component: {fileID: 114546261427105744} + - component: {fileID: 224196823680673236} + - component: {fileID: 222056117849062356} + - component: {fileID: 114817553842003248} m_Layer: 5 - m_Name: RightArrow + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1656909277096102 +--- !u!1 &1679881730550880 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224755403897354710} - - component: {fileID: 222009886304005568} - - component: {fileID: 114484267577154790} + - component: {fileID: 4680161644130496} + - component: {fileID: 114041376699156020} m_Layer: 5 - m_Name: Icon + m_Name: TopArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1660141959091138 +--- !u!1 &1710819549023888 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224796048607831954} - - component: {fileID: 222305923262322410} - - component: {fileID: 114905976864135670} + - component: {fileID: 224562911775927908} + - component: {fileID: 222380044330408610} + - component: {fileID: 114699673652902324} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -717,32 +680,33 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1679881730550880 +--- !u!1 &1716657442306664 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4680161644130496} - - component: {fileID: 114041376699156020} + - component: {fileID: 224523643313230076} + - component: {fileID: 222616955456755520} + - component: {fileID: 114973295192596792} m_Layer: 5 - m_Name: TopArrow (2) + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1710819549023888 +--- !u!1 &1725995830263476 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224562911775927908} - - component: {fileID: 222380044330408610} - - component: {fileID: 114699673652902324} + - component: {fileID: 224132225024948940} + - component: {fileID: 222756809480138948} + - component: {fileID: 114730443733817358} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -750,16 +714,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1711721311657312 +--- !u!1 &1768368740647586 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224083169184976582} - - component: {fileID: 222796193882324548} - - component: {fileID: 114804947298759112} + - component: {fileID: 224156246626200480} + - component: {fileID: 222912395297889322} + - component: {fileID: 114894859978596498} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -767,16 +731,32 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1721895297109438 +--- !u!1 &1789767321393858 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4542884266341674} + - component: {fileID: 114885606894613528} + m_Layer: 5 + m_Name: SpatialHintUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1809935325035088 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224008343808292248} - - component: {fileID: 222811603868491532} - - component: {fileID: 114741235494283886} + - component: {fileID: 224424293093470762} + - component: {fileID: 222522579556370828} + - component: {fileID: 114719726697718162} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -784,16 +764,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1755047999869798 +--- !u!1 &1824680482131842 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224033772257282698} - - component: {fileID: 222792609721424644} - - component: {fileID: 114141921517141998} + - component: {fileID: 224057756797921652} + - component: {fileID: 222715545229973604} + - component: {fileID: 114106693815540416} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -801,19 +781,18 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1789767321393858 +--- !u!1 &1849044727642112 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224052212126334452} - - component: {fileID: 223686309998784866} - - component: {fileID: 225647651707368488} - - component: {fileID: 114885606894613528} + - component: {fileID: 224129579457830516} + - component: {fileID: 222195468351193870} + - component: {fileID: 114929323479965660} m_Layer: 5 - m_Name: SpatialHintUI + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -835,16 +814,16 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1900815364540156 +--- !u!1 &1884356156747602 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224321561277689504} - - component: {fileID: 222555451852467338} - - component: {fileID: 114959322808913320} + - component: {fileID: 224081872875984476} + - component: {fileID: 222208945968443274} + - component: {fileID: 114006901110602492} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -868,32 +847,34 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1951662511308604 +--- !u!1 &1911079917718974 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4675647250350146} - - component: {fileID: 114310382182576548} + - component: {fileID: 224489897271799108} + - component: {fileID: 222991846028201412} + - component: {fileID: 114439371215997622} m_Layer: 5 - m_Name: BottomArrow (4) + m_Name: Icon m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1957453253227530 +--- !u!1 &1951662511308604 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4168178459706398} + - component: {fileID: 4675647250350146} + - component: {fileID: 114310382182576548} m_Layer: 5 - m_Name: LeftArrow (2) + m_Name: BottomArrow (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -915,6 +896,40 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1981198264515682 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224065573646462090} + - component: {fileID: 222746696093761822} + - component: {fileID: 114261942396204950} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1994094993956278 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224134866915377078} + - component: {fileID: 222642583600497626} + - component: {fileID: 114266648109553236} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4024087671455752 Transform: m_ObjectHideFlags: 1 @@ -925,7 +940,7 @@ Transform: m_LocalPosition: {x: 0.30512458, y: 0.05239418, z: 0.17874639} m_LocalScale: {x: 1.0000001, y: 1.0000006, z: 1.0000006} m_Children: - - {fileID: 224008343808292248} + - {fileID: 224057756797921652} m_Father: {fileID: 4656611640740372} m_RootOrder: 11 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} @@ -939,8 +954,8 @@ Transform: m_LocalPosition: {x: 0.35749826, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224081311369273524} - m_Father: {fileID: 224052212126334452} + - {fileID: 224132225024948940} + m_Father: {fileID: 224722201347996720} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} --- !u!4 &4062880161799968 @@ -953,8 +968,8 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0.35741758} m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} m_Children: - - {fileID: 224033772257282698} - m_Father: {fileID: 224052212126334452} + - {fileID: 224523643313230076} + m_Father: {fileID: 224722201347996720} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} --- !u!4 &4094688054820746 @@ -967,8 +982,8 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: -0.35757425} m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} m_Children: - - {fileID: 224400357811708698} - m_Father: {fileID: 224052212126334452} + - {fileID: 224644784610691812} + m_Father: {fileID: 224722201347996720} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} --- !u!4 &4157632766833512 @@ -981,24 +996,10 @@ Transform: m_LocalPosition: {x: -0.35749826, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224796048607831954} - m_Father: {fileID: 224052212126334452} + - {fileID: 224771858595270594} + m_Father: {fileID: 224722201347996720} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} ---- !u!4 &4168178459706398 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1957453253227530} - m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} - m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224202520050313972} - m_Father: {fileID: 224457231796985382} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} --- !u!4 &4234521712409882 Transform: m_ObjectHideFlags: 1 @@ -1009,7 +1010,7 @@ Transform: m_LocalPosition: {x: 0.17880443, y: 0.17869522, z: 0.25271186} m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} m_Children: - - {fileID: 224185862510095714} + - {fileID: 224153830142605794} m_Father: {fileID: 4656611640740372} m_RootOrder: 14 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} @@ -1023,7 +1024,7 @@ Transform: m_LocalPosition: {x: 0.05231689, y: 0.30518025, z: -0.17878139} m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} m_Children: - - {fileID: 224536315768338012} + - {fileID: 224988536893287282} m_Father: {fileID: 4656611640740372} m_RootOrder: 13 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} @@ -1037,7 +1038,7 @@ Transform: m_LocalPosition: {x: -0.1786963, y: -0.17880678, z: 0.25271866} m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} m_Children: - - {fileID: 224737278412607648} + - {fileID: 224196823680673236} m_Father: {fileID: 4656611640740372} m_RootOrder: 17 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} @@ -1051,7 +1052,7 @@ Transform: m_LocalPosition: {x: -0.05239579, y: -0.3051027, z: 0.17873496} m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} m_Children: - - {fileID: 224334818403569600} + - {fileID: 224935697657075864} m_Father: {fileID: 4656611640740372} m_RootOrder: 12 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} @@ -1065,7 +1066,7 @@ Transform: m_LocalPosition: {x: -0.052311167, y: -0.30518684, z: -0.17876795} m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} m_Children: - - {fileID: 224535942915412938} + - {fileID: 224081872875984476} m_Father: {fileID: 4656611640740372} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} @@ -1079,7 +1080,7 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: -0.35757425} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224195135213235292} + - {fileID: 224008207930297392} m_Father: {fileID: 4656611640740372} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} @@ -1093,24 +1094,38 @@ Transform: m_LocalPosition: {x: 0, y: 0.3574999, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224755403897354710} - m_Father: {fileID: 224052212126334452} + - {fileID: 224000303176787042} + m_Father: {fileID: 224722201347996720} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4542884266341674 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1789767321393858} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224722201347996720} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4630278991888076 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1535950939685256} - m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} - m_LocalPosition: {x: -0.3051234, y: -0.052390024, z: 0.17873323} - m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224562911775927908} - m_Father: {fileID: 4656611640740372} - m_RootOrder: 9 - m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} + - {fileID: 224376509698512154} + m_Father: {fileID: 224457231796985382} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} --- !u!4 &4656611640740372 Transform: m_ObjectHideFlags: 1 @@ -1129,8 +1144,8 @@ Transform: - {fileID: 4800155596865708} - {fileID: 4680161644130496} - {fileID: 4436731719689366} - - {fileID: 4851979343048988} - - {fileID: 4630278991888076} + - {fileID: 4930137114917576} + - {fileID: 4873933386520716} - {fileID: 4920529215995508} - {fileID: 4024087671455752} - {fileID: 4405923127552798} @@ -1139,7 +1154,7 @@ Transform: - {fileID: 4675647250350146} - {fileID: 4841372590907710} - {fileID: 4392107344112590} - m_Father: {fileID: 224052212126334452} + m_Father: {fileID: 224722201347996720} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 90.00001, z: 45.000004} --- !u!4 &4673130869543022 @@ -1152,7 +1167,7 @@ Transform: m_LocalPosition: {x: 0.35749826, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224083169184976582} + - {fileID: 224930925262972702} m_Father: {fileID: 4656611640740372} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} @@ -1166,7 +1181,7 @@ Transform: m_LocalPosition: {x: -0.17869319, y: -0.17880538, z: -0.2528689} m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} m_Children: - - {fileID: 224375606798488428} + - {fileID: 224156246626200480} m_Father: {fileID: 4656611640740372} m_RootOrder: 15 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} @@ -1180,7 +1195,7 @@ Transform: m_LocalPosition: {x: 0.05238819, y: 0.3051088, z: 0.17872259} m_LocalScale: {x: 1.0000005, y: 1.0000001, z: 1.0000002} m_Children: - - {fileID: 224068218456614698} + - {fileID: 224312738310551638} m_Father: {fileID: 4656611640740372} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} @@ -1194,7 +1209,7 @@ Transform: m_LocalPosition: {x: -0.35749826, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224705911240679902} + - {fileID: 224513997123549140} m_Father: {fileID: 4656611640740372} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} @@ -1208,7 +1223,7 @@ Transform: m_LocalPosition: {x: 0, y: -0.35749984, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224289252517553026} + - {fileID: 224489897271799108} m_Father: {fileID: 4656611640740372} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1222,7 +1237,7 @@ Transform: m_LocalPosition: {x: 0, y: 0.35749984, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224135530598210196} + - {fileID: 224424293093470762} m_Father: {fileID: 4656611640740372} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1236,7 +1251,7 @@ Transform: m_LocalPosition: {x: 0.17880696, y: 0.17869617, z: -0.25287494} m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} m_Children: - - {fileID: 224457270545674496} + - {fileID: 224129579457830516} m_Father: {fileID: 4656611640740372} m_RootOrder: 16 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} @@ -1246,28 +1261,28 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1194110711330918} - m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} - m_LocalPosition: {x: 0.30520225, y: 0.052312464, z: -0.17877874} - m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} - m_Children: - - {fileID: 224780185442623124} - m_Father: {fileID: 4656611640740372} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} ---- !u!4 &4875632078745168 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1286179857941560} m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224197558861574286} + - {fileID: 224065573646462090} m_Father: {fileID: 224457231796985382} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} +--- !u!4 &4873933386520716 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1436793638745358} + m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} + m_LocalPosition: {x: -0.3051234, y: -0.052390024, z: 0.17873323} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} + m_Children: + - {fileID: 224856635122786234} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} --- !u!4 &4919626380897530 Transform: m_ObjectHideFlags: 1 @@ -1278,8 +1293,8 @@ Transform: m_LocalPosition: {x: 0, y: -0.3574999, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224768393309507636} - m_Father: {fileID: 224052212126334452} + - {fileID: 224134866915377078} + m_Father: {fileID: 224722201347996720} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4920529215995508 @@ -1292,21 +1307,35 @@ Transform: m_LocalPosition: {x: -0.30520254, y: -0.05231519, z: -0.17879169} m_LocalScale: {x: 1.0000001, y: 1.0000006, z: 1.0000006} m_Children: - - {fileID: 224321561277689504} + - {fileID: 224403490052312444} m_Father: {fileID: 4656611640740372} m_RootOrder: 10 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} ---- !u!4 &4998463843861972 +--- !u!4 &4930137114917576 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1498453846321146} - m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 0.35741758} - m_LocalScale: {x: 1, y: 1, z: 1} + m_GameObject: {fileID: 1302798161695436} + m_LocalRotation: {x: 0.38267118, y: 0.0000014454124, z: 0.65328485, w: 0.6532853} + m_LocalPosition: {x: 0.30520225, y: 0.052312464, z: -0.17877874} + m_LocalScale: {x: 1.0000005, y: 1.0000011, z: 1.0000007} m_Children: - - {fileID: 224662441432538096} + - {fileID: 224244514581948698} + m_Father: {fileID: 4656611640740372} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} +--- !u!4 &4998463843861972 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1498453846321146} + m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.35741758} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224562911775927908} m_Father: {fileID: 4656611640740372} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} @@ -1321,7 +1350,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114577618702827488} + m_Icon: {fileID: 114066956829426356} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114004058444794040 @@ -1335,43 +1364,15 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114544001302371152} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114033438707707268 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1411913761068088} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114650534892023224} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114041376699156020 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1679881730550880} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114709130866979964} + m_Icon: {fileID: 114817553842003248} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114062055406121370 +--- !u!114 &114006901110602492 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1151867513107076} + m_GameObject: {fileID: 1884356156747602} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1385,7 +1386,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -1393,40 +1394,40 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114085391963444694 +--- !u!114 &114033438707707268 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1194110711330918} + m_GameObject: {fileID: 1411913761068088} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114555141257046060} + m_Icon: {fileID: 114730443733817358} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114130122097018780 +--- !u!114 &114041376699156020 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1556368157722758} + m_GameObject: {fileID: 1679881730550880} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114419057479699580} + m_Icon: {fileID: 114291859005184956} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114141921517141998 +--- !u!114 &114066956829426356 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1755047999869798} + m_GameObject: {fileID: 1493045224029700} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1440,7 +1441,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -1448,12 +1449,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114175671559192530 +--- !u!114 &114105037402801938 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1495992040383280} + m_GameObject: {fileID: 1391550003226712} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1475,39 +1476,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114178251820008812 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1339250774381076} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114261400763498716 +--- !u!114 &114106693815540416 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1125351313468992} + m_GameObject: {fileID: 1824680482131842} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1529,54 +1503,54 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114279174847565634 +--- !u!114 &114130122097018780 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1233422500995160} + m_GameObject: {fileID: 1556368157722758} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114062055406121370} + m_Icon: {fileID: 114728711746979180} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114310382182576548 +--- !u!114 &114201708188467934 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1951662511308604} + m_GameObject: {fileID: 1436793638745358} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114826715084335374} + m_Icon: {fileID: 114974932015195176} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114312153825842830 +--- !u!114 &114261942396204950 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1346389602611770} + m_GameObject: {fileID: 1981198264515682} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0, g: 0, b: 0, a: 0.428} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -1584,12 +1558,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114341816562169696 +--- !u!114 &114266648109553236 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1035625982163522} + m_GameObject: {fileID: 1994094993956278} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1611,26 +1585,26 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114347973994711784 +--- !u!114 &114279174847565634 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1539692488507350} + m_GameObject: {fileID: 1233422500995160} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114804947298759112} + m_Icon: {fileID: 114266648109553236} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114419057479699580 +--- !u!114 &114291859005184956 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1651169489046500} + m_GameObject: {fileID: 1161415218632242} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1644,7 +1618,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -1652,53 +1626,40 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114464661992143834 +--- !u!114 &114310382182576548 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1537353604937916} + m_GameObject: {fileID: 1951662511308604} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114472214291358280 + m_Icon: {fileID: 114894859978596498} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114347973994711784 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1166221615258474} + m_GameObject: {fileID: 1539692488507350} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114749271261725720} + m_Icon: {fileID: 114502893213131780} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114479113303687970 +--- !u!114 &114403956001920920 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1577626411570396} + m_GameObject: {fileID: 1116655809746968} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1720,12 +1681,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114484267577154790 +--- !u!114 &114439371215997622 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1656909277096102} + m_GameObject: {fileID: 1911079917718974} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1739,7 +1700,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -1747,26 +1708,40 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114508101107919186 +--- !u!114 &114472214291358280 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1087189506426152} + m_GameObject: {fileID: 1166221615258474} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114929323479965660} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114478667145759116 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1302798161695436} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114261400763498716} + m_Icon: {fileID: 114757945073081772} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114544001302371152 +--- !u!114 &114502893213131780 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1431127396183784} + m_GameObject: {fileID: 1620204976623536} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1788,40 +1763,26 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114546261427105744 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1654262832382846} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114905976864135670} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114549952638618038 +--- !u!114 &114508101107919186 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1083271504533730} + m_GameObject: {fileID: 1087189506426152} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114479113303687970} + m_Icon: {fileID: 114790131153619060} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114555141257046060 +--- !u!114 &114534977170210908 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1006711227317104} + m_GameObject: {fileID: 1046794607109420} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1835,7 +1796,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -1843,81 +1804,68 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114577618702827488 +--- !u!114 &114546261427105744 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1587099013867276} + m_GameObject: {fileID: 1654262832382846} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114602193729648712 + m_Icon: {fileID: 114650107410517210} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} +--- !u!114 &114549952638618038 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1075893997324224} + m_GameObject: {fileID: 1083271504533730} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114922086105306672} + m_Icon: {fileID: 114403956001920920} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114647227679990130 +--- !u!114 &114602193729648712 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1627495043617212} + m_GameObject: {fileID: 1075893997324224} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114312153825842830} + m_Icon: {fileID: 114719726697718162} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114650385070507634 +--- !u!114 &114647227679990130 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1208914140055346} + m_GameObject: {fileID: 1627495043617212} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114484267577154790} + m_Icon: {fileID: 114006901110602492} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114650534892023224 +--- !u!114 &114650107410517210 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1196161126514986} + m_GameObject: {fileID: 1166111979364004} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -1939,6 +1887,20 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114650385070507634 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1208914140055346} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Icon: {fileID: 114105037402801938} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114699673652902324 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1958,7 +1920,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -1966,12 +1928,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114709130866979964 +--- !u!114 &114719726697718162 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1261891554981946} + m_GameObject: {fileID: 1809935325035088} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -2004,15 +1966,15 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114959322808913320} + m_Icon: {fileID: 114889128424409716} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114741235494283886 +--- !u!114 &114728711746979180 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1721895297109438} + m_GameObject: {fileID: 1303326821258898} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -2026,7 +1988,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -2034,12 +1996,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114749271261725720 +--- !u!114 &114730443733817358 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1310027530136584} + m_GameObject: {fileID: 1725995830263476} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -2053,7 +2015,7 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -2061,40 +2023,26 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114755545279478606 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1535950939685256} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Icon: {fileID: 114699673652902324} - m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114768730554743184 +--- !u!114 &114757945073081772 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1016458810671980} + m_GameObject: {fileID: 1313514635800650} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 0, g: 0, b: 0, a: 0.428} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -2102,26 +2050,26 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114788108653890746 +--- !u!114 &114790131153619060 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1476779982288018} + m_GameObject: {fileID: 1027327312544334} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 0, g: 0, b: 0, a: 0.428} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -2129,12 +2077,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114804947298759112 +--- !u!114 &114817553842003248 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1711721311657312} + m_GameObject: {fileID: 1659184777115880} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -2167,36 +2115,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114464661992143834} + m_Icon: {fileID: 114992378279027252} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114826715084335374 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1295546017909780} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 --- !u!114 &114873114538619666 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2208,7 +2129,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114141921517141998} + m_Icon: {fileID: 114973295192596792} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} --- !u!114 &114873812632177310 @@ -2222,20 +2143,49 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114178251820008812} + m_Icon: {fileID: 114439371215997622} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114885606894613528 +--- !u!114 &114878598031735610 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1789767321393858} + m_GameObject: {fileID: 1404278696444272} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a9e4377fb5567cc4ea23d3ad3d292114, type: 3} + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 0.428} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114885606894613528 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1789767321393858} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a9e4377fb5567cc4ea23d3ad3d292114, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ScrollVisualsCanvasGroup: {fileID: 225476474272170592} + m_ScrollVisualsDragTargetArrow: {fileID: 4630278991888076} m_PrimaryDirectionalHintArrows: - {fileID: 114650385070507634} - {fileID: 114279174847565634} @@ -2250,8 +2200,8 @@ MonoBehaviour: - {fileID: 114602193729648712} - {fileID: 114041376699156020} - {fileID: 114647227679990130} - - {fileID: 114085391963444694} - - {fileID: 114755545279478606} + - {fileID: 114478667145759116} + - {fileID: 114201708188467934} - {fileID: 114721502774444018} - {fileID: 114933653232386136} - {fileID: 114000567662040162} @@ -2260,14 +2210,12 @@ MonoBehaviour: - {fileID: 114310382182576548} - {fileID: 114472214291358280} - {fileID: 114004058444794040} - m_ScrollVisualsCanvasGroup: {fileID: 225476474272170592} - m_ScrollVisualsDragTargetArrow: {fileID: 4875632078745168} ---- !u!114 &114905976864135670 +--- !u!114 &114889128424409716 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1660141959091138} + m_GameObject: {fileID: 1612215626004242} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -2281,7 +2229,34 @@ MonoBehaviour: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114894859978596498 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1768368740647586} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} m_Type: 0 m_PreserveAspect: 1 m_FillCenter: 1 @@ -2289,12 +2264,12 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114922086105306672 +--- !u!114 &114929323479965660 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1058418693224498} + m_GameObject: {fileID: 1849044727642112} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -2327,15 +2302,42 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 114741235494283886} + m_Icon: {fileID: 114106693815540416} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} ---- !u!114 &114959322808913320 +--- !u!114 &114973295192596792 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1900815364540156} + m_GameObject: {fileID: 1716657442306664} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!114 &114974932015195176 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1609304458081020} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -2357,168 +2359,195 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!222 &222009886304005568 +--- !u!114 &114992378279027252 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1211413244600520} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: b92ddf29a5f32334d8482795e3876db2, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 2 +--- !u!222 &222044567740138078 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1656909277096102} ---- !u!222 &222034759844148942 + m_GameObject: {fileID: 1046794607109420} +--- !u!222 &222056117849062356 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1339250774381076} ---- !u!222 &222053575299208536 + m_GameObject: {fileID: 1659184777115880} +--- !u!222 &222070966549296146 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1058418693224498} ---- !u!222 &222269790095738828 + m_GameObject: {fileID: 1303326821258898} +--- !u!222 &222129853383819858 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1151867513107076} ---- !u!222 &222305923262322410 + m_GameObject: {fileID: 1612215626004242} +--- !u!222 &222158184680329756 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1660141959091138} ---- !u!222 &222312163737858760 + m_GameObject: {fileID: 1404278696444272} +--- !u!222 &222192379656075194 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1346389602611770} ---- !u!222 &222321531243824390 + m_GameObject: {fileID: 1609304458081020} +--- !u!222 &222195468351193870 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1295546017909780} ---- !u!222 &222380044330408610 + m_GameObject: {fileID: 1849044727642112} +--- !u!222 &222208945968443274 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1710819549023888} ---- !u!222 &222383098631261652 + m_GameObject: {fileID: 1884356156747602} +--- !u!222 &222324007570340776 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1016458810671980} ---- !u!222 &222385931455952620 + m_GameObject: {fileID: 1116655809746968} +--- !u!222 &222340170423981886 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1495992040383280} ---- !u!222 &222555451852467338 + m_GameObject: {fileID: 1166111979364004} +--- !u!222 &222380044330408610 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1900815364540156} ---- !u!222 &222607553899644316 + m_GameObject: {fileID: 1710819549023888} +--- !u!222 &222409781002321340 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1431127396183784} ---- !u!222 &222640872418002352 + m_GameObject: {fileID: 1493045224029700} +--- !u!222 &222471662606385414 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1196161126514986} ---- !u!222 &222640907686946606 + m_GameObject: {fileID: 1161415218632242} +--- !u!222 &222480375094953724 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1310027530136584} ---- !u!222 &222710834793849708 + m_GameObject: {fileID: 1620204976623536} +--- !u!222 &222522579556370828 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1587099013867276} ---- !u!222 &222730237307327122 + m_GameObject: {fileID: 1809935325035088} +--- !u!222 &222576734114943816 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1651169489046500} ---- !u!222 &222736887738100716 + m_GameObject: {fileID: 1027327312544334} +--- !u!222 &222599127361557302 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1476779982288018} ---- !u!222 &222770186031098170 + m_GameObject: {fileID: 1391550003226712} +--- !u!222 &222616955456755520 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1261891554981946} ---- !u!222 &222792609721424644 + m_GameObject: {fileID: 1716657442306664} +--- !u!222 &222642583600497626 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1755047999869798} ---- !u!222 &222796193882324548 + m_GameObject: {fileID: 1994094993956278} +--- !u!222 &222715545229973604 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1711721311657312} ---- !u!222 &222797658040913998 + m_GameObject: {fileID: 1824680482131842} +--- !u!222 &222746696093761822 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1006711227317104} ---- !u!222 &222811603868491532 + m_GameObject: {fileID: 1981198264515682} +--- !u!222 &222756809480138948 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1721895297109438} ---- !u!222 &222829940863652588 + m_GameObject: {fileID: 1725995830263476} +--- !u!222 &222780664714617072 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1537353604937916} ---- !u!222 &222893828193564900 + m_GameObject: {fileID: 1211413244600520} +--- !u!222 &222807673838062916 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1125351313468992} ---- !u!222 &222939546821322456 + m_GameObject: {fileID: 1313514635800650} +--- !u!222 &222912395297889322 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1035625982163522} ---- !u!222 &222981134354437446 + m_GameObject: {fileID: 1768368740647586} +--- !u!222 &222991846028201412 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1577626411570396} ---- !u!223 &223686309998784866 + m_GameObject: {fileID: 1911079917718974} +--- !u!223 &223651440663421936 Canvas: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1789767321393858} + m_GameObject: {fileID: 1435546683708450} m_Enabled: 1 serializedVersion: 3 m_RenderMode: 2 @@ -2533,97 +2562,89 @@ Canvas: m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 ---- !u!224 &224008343808292248 +--- !u!224 &224000303176787042 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1721895297109438} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1391550003226712} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4024087671455752} + m_Father: {fileID: 4536356174147362} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224033772257282698 +--- !u!224 &224008207930297392 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1755047999869798} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1046794607109420} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4062880161799968} + m_Father: {fileID: 4486931087156832} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224052212126334452 +--- !u!224 &224057756797921652 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1789767321393858} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224457231796985382} - - {fileID: 4656611640740372} - - {fileID: 4536356174147362} - - {fileID: 4919626380897530} - - {fileID: 4055687054597960} - - {fileID: 4157632766833512} - - {fileID: 4062880161799968} - - {fileID: 4094688054820746} - m_Father: {fileID: 0} + m_GameObject: {fileID: 1824680482131842} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} + m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_Children: [] + m_Father: {fileID: 4024087671455752} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 100} + m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} + m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224068218456614698 +--- !u!224 &224065573646462090 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1261891554981946} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1981198264515682} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4680161644130496} + m_Father: {fileID: 4851979343048988} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224081311369273524 +--- !u!224 &224081872875984476 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1196161126514986} + m_GameObject: {fileID: 1884356156747602} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4055687054597960} + m_Father: {fileID: 4436731719689366} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2631,17 +2652,17 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224083169184976582 +--- !u!224 &224129579457830516 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1711721311657312} + m_GameObject: {fileID: 1849044727642112} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4673130869543022} + m_Father: {fileID: 4841372590907710} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2649,107 +2670,107 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224135530598210196 +--- !u!224 &224132225024948940 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1058418693224498} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1725995830263476} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4800155596865708} + m_Father: {fileID: 4055687054597960} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224185862510095714 +--- !u!224 &224134866915377078 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1577626411570396} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1994094993956278} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4234521712409882} + m_Father: {fileID: 4919626380897530} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224195135213235292 +--- !u!224 &224153830142605794 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1495992040383280} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1116655809746968} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4486931087156832} + m_Father: {fileID: 4234521712409882} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224197558861574286 +--- !u!224 &224156246626200480 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1476779982288018} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1768368740647586} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4875632078745168} + m_Father: {fileID: 4675647250350146} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224202520050313972 +--- !u!224 &224196823680673236 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1016458810671980} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1659184777115880} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4168178459706398} + m_Father: {fileID: 4392107344112590} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224289252517553026 +--- !u!224 &224244514581948698 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1339250774381076} + m_GameObject: {fileID: 1313514635800650} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4724266729072562} + m_Father: {fileID: 4930137114917576} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2757,17 +2778,17 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224321561277689504 +--- !u!224 &224312738310551638 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1900815364540156} + m_GameObject: {fileID: 1161415218632242} m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4920529215995508} + m_Father: {fileID: 4680161644130496} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2775,55 +2796,55 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224334818403569600 +--- !u!224 &224376509698512154 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1587099013867276} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1404278696444272} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4405923127552798} + m_Father: {fileID: 4630278991888076} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224375606798488428 +--- !u!224 &224403490052312444 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1295546017909780} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1612215626004242} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4675647250350146} + m_Father: {fileID: 4920529215995508} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224400357811708698 +--- !u!224 &224424293093470762 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1651169489046500} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1809935325035088} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4094688054820746} + m_Father: {fileID: 4800155596865708} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} @@ -2839,9 +2860,9 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: -0.00007861798} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 4875632078745168} - - {fileID: 4168178459706398} - m_Father: {fileID: 224052212126334452} + - {fileID: 4630278991888076} + - {fileID: 4851979343048988} + m_Father: {fileID: 224722201347996720} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2849,17 +2870,17 @@ RectTransform: m_AnchoredPosition: {x: 0.00007836922, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224457270545674496 +--- !u!224 &224489897271799108 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1310027530136584} + m_GameObject: {fileID: 1911079917718974} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4841372590907710} + m_Father: {fileID: 4724266729072562} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2867,35 +2888,35 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224535942915412938 +--- !u!224 &224513997123549140 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1346389602611770} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1211413244600520} + m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4436731719689366} + m_Father: {fileID: 4715255144694938} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224536315768338012 +--- !u!224 &224523643313230076 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1125351313468992} + m_GameObject: {fileID: 1716657442306664} m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4352658633633276} + m_Father: {fileID: 4062880161799968} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2913,7 +2934,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4630278991888076} + m_Father: {fileID: 4998463843861972} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2921,53 +2942,61 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224662441432538096 +--- !u!224 &224644784610691812 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1035625982163522} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} + m_GameObject: {fileID: 1303326821258898} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4998463843861972} + m_Father: {fileID: 4094688054820746} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224705911240679902 +--- !u!224 &224722201347996720 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1537353604937916} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4715255144694938} + m_GameObject: {fileID: 1435546683708450} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.35, y: 0.35, z: 0.35} + m_Children: + - {fileID: 224457231796985382} + - {fileID: 4656611640740372} + - {fileID: 4536356174147362} + - {fileID: 4919626380897530} + - {fileID: 4055687054597960} + - {fileID: 4157632766833512} + - {fileID: 4062880161799968} + - {fileID: 4094688054820746} + m_Father: {fileID: 4542884266341674} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224737278412607648 +--- !u!224 &224771858595270594 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1431127396183784} + m_GameObject: {fileID: 1166111979364004} m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4392107344112590} + m_Father: {fileID: 4157632766833512} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2975,17 +3004,17 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224755403897354710 +--- !u!224 &224856635122786234 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1656909277096102} + m_GameObject: {fileID: 1609304458081020} m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4536356174147362} + m_Father: {fileID: 4873933386520716} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -2993,17 +3022,17 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224768393309507636 +--- !u!224 &224930925262972702 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1151867513107076} + m_GameObject: {fileID: 1620204976623536} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4919626380897530} + m_Father: {fileID: 4673130869543022} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} @@ -3011,17 +3040,17 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224780185442623124 +--- !u!224 &224935697657075864 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1006711227317104} + m_GameObject: {fileID: 1493045224029700} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4851979343048988} + m_Father: {fileID: 4405923127552798} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} m_AnchorMin: {x: 0.5, y: 0.5} @@ -3029,17 +3058,17 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224796048607831954 +--- !u!224 &224988536893287282 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1660141959091138} + m_GameObject: {fileID: 1027327312544334} m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} m_Children: [] - m_Father: {fileID: 4157632766833512} + m_Father: {fileID: 4352658633633276} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -3047,34 +3076,34 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!225 &225219344075895100 +--- !u!225 &225156185928477662 CanvasGroup: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1112224048980768} + m_GameObject: {fileID: 1435546683708450} m_Enabled: 1 - m_Alpha: 0.025 + m_Alpha: 1 m_Interactable: 0 m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 ---- !u!225 &225476474272170592 +--- !u!225 &225219344075895100 CanvasGroup: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1138933449834660} + m_GameObject: {fileID: 1112224048980768} m_Enabled: 1 - m_Alpha: 1 + m_Alpha: 0.025 m_Interactable: 0 m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 ---- !u!225 &225647651707368488 +--- !u!225 &225476474272170592 CanvasGroup: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1789767321393858} + m_GameObject: {fileID: 1138933449834660} m_Enabled: 1 m_Alpha: 1 m_Interactable: 0 diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 979765d8a..2cb350f9c 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -26,12 +26,6 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I [SerializeField] Vector3 m_AlternateLocalScale; - [SerializeField] - Transform m_HintContentContainer; - - [SerializeField] - CanvasGroup m_HintArrowsCanvasGroup; - [SerializeField] SpatialHintUI m_SpatialHintUI; @@ -49,6 +43,7 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I Quaternion m_HintContentContainerInitialRotation; Quaternion m_HintContentContainerCurrentRotation; Vector3 m_HintContentWorldPosition; + Transform m_SpatialHintContentContainer; //Quaternion m_SpatialScrollOrientation; public int maxButtonCount { get; set; } @@ -116,7 +111,7 @@ public float spatialDragDistance m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); this.RestartCoroutine(ref m_HintContentVisibilityCoroutine, ShowHintContent()); m_HintContentWorldPosition = transform.position; - m_HintContentContainer.position = m_HintContentWorldPosition; + m_SpatialHintContentContainer.position = m_HintContentWorldPosition; } m_SpatialDragDistance = value; @@ -131,11 +126,11 @@ public Vector3? startingDragOrigin Debug.LogWarning("SETTING STARGIN DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); m_StartingDragOrigin = transform.position; - var orig = m_HintContentContainer.rotation; - m_HintContentContainer.LookAt(value.Value); + var orig = m_SpatialHintContentContainer.rotation; + m_SpatialHintContentContainer.LookAt(value.Value); Debug.LogError(value.Value.ToString("F4")); //m_SpatialScrollOrientation = Quaternion.Euler(value.Value); // Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); - m_HintContentContainer.rotation = orig; + m_SpatialHintContentContainer.rotation = orig; } } @@ -151,6 +146,9 @@ void Awake() m_OriginalLocalScale = transform.localScale; m_OrderedButtons = new List(); Debug.LogError("PinnedToolsMenuUI initialized"); + + m_SpatialHintUI = this.InstantiateUI(m_SpatialHintUI.gameObject).GetComponent(); + m_SpatialHintContentContainer = m_SpatialHintUI.contentContainer; } void Update() @@ -205,8 +203,8 @@ void Update() //Debug.LogError("Hint Container" + m_HintContentContainerInitialRotation); //Debug.LogError("UI" + transform.rotation); - m_HintContentContainer.rotation = newHintContainerRotation; - m_HintContentContainer.position = m_HintContentWorldPosition; + m_SpatialHintContentContainer.rotation = newHintContainerRotation; + m_SpatialHintContentContainer.position = m_HintContentWorldPosition; //Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); } @@ -569,18 +567,18 @@ IEnumerator ShowHintContent() { m_SpatialHintUI.enablePreviewVisuals = true; - var currentScale = m_HintContentContainer.localScale; + var currentScale = m_SpatialHintContentContainer.localScale; var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals var targetScale = Vector3.one; while (timeElapsed < 1f) { timeElapsed += Time.unscaledDeltaTime * 5f; var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(timeElapsed), 2); - m_HintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + m_SpatialHintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); yield return null; } - m_HintContentContainer.localScale = targetScale; + m_SpatialHintContentContainer.localScale = targetScale; m_HintContentVisibilityCoroutine = null; } @@ -590,18 +588,18 @@ IEnumerator HideHintContent() yield break; - var currentScale = m_HintContentContainer.localScale; + var currentScale = m_SpatialHintContentContainer.localScale; var timeElapsed = 1 - currentScale.x; var targetScale = Vector3.zero; while (timeElapsed < 1f) { timeElapsed += Time.unscaledDeltaTime * 4f; var durationShaped = MathUtilsExt.SmoothInOutLerpFloat(timeElapsed); - m_HintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + m_SpatialHintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); yield return null; } - m_HintContentContainer.localScale = targetScale; + m_SpatialHintContentContainer.localScale = targetScale; m_HintContentVisibilityCoroutine = null; } diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index e10988562..517d11906 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -1,5 +1,4 @@ using System.Collections; -using System.Security.Cryptography.X509Certificates; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -10,6 +9,15 @@ public class SpatialHintUI : MonoBehaviour { readonly Color k_PrimaryArrowColor = Color.white; + [SerializeField] + CanvasGroup m_ScrollVisualsCanvasGroup; + + [SerializeField] + Transform m_ScrollVisualsDragTargetArrow; + + //[SerializeField] + //CanvasGroup m_HintArrowsCanvasGroup; // TODO: add back in later + [SerializeField] HintIcon[] m_PrimaryDirectionalHintArrows; @@ -24,12 +32,6 @@ public class SpatialHintUI : MonoBehaviour HintIcon[] m_SecondaryRotationalHintArrows; */ - [SerializeField] - CanvasGroup m_ScrollVisualsCanvasGroup; - - [SerializeField] - Transform m_ScrollVisualsDragTargetArrow; - Vector3 m_ScrollVisualsRotation; Transform m_ScrollVisualsTransform; GameObject m_ScrollVisualsGameObject; @@ -136,6 +138,8 @@ public Vector3 scrollVisualsRotation public Vector3 scrollVisualsDragThresholdTriggerPosition { get; set; } + public Transform contentContainer { get { return transform; } } + void Awake() { m_ScrollVisualsTransform = m_ScrollVisualsCanvasGroup.transform; From 14c06ddab5d6232847bf00c2454f921ef14756b5 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 14:09:50 -0700 Subject: [PATCH 542/870] Add EditorWindow in Edit/Project Settings/EditorVR to adjust all haptic pulse assets in the project --- Editor/HapticPulsesEditor.cs | 84 +++++++++++++++++++ Editor/HapticPulsesEditor.cs.meta | 12 +++ .../HapticPulses/FaceRotationPulse.asset | 2 +- .../MainMenu/HapticPulses/HideMenuPulse.asset | 2 +- .../MainMenuActivatorHoverPulse.asset | 2 +- .../MainMenuButtonClickPulse.asset | 2 +- .../MainMenuButtonHoverPulse.asset | 2 +- .../MainMenu/HapticPulses/ShowMenuPulse.asset | 2 +- .../HapticPulses/ClickPulse.asset | 2 +- .../HapticPulses/HoverPulse.asset | 2 +- .../HapticPulses/ButtonClickedPulse.asset | 2 +- .../HapticPulses/ButtonHoverPulse.asset | 2 +- .../HapticPulses/ReleasePulse.asset | 2 +- .../ListView/HapticPulses/ScrollPulse.asset | 4 +- Scripts/Modules/HapticsModule/HapticPulse.cs | 4 +- .../Modules/HapticsModule/HapticsModule.cs | 2 +- .../HapticPulses/HoverPulse.asset | 4 +- .../HapticPulses/DragPulse.asset | 2 +- .../HapticPulses/RotatePulse.asset | 2 +- .../Base/HapticPulses/FrameHoverPulse.asset | 4 +- Workspaces/Base/HapticPulses/MovePulse.asset | 2 +- .../Base/HapticPulses/ResizePulse.asset | 2 +- .../HapticPulses/WorkspaceButtonClick.asset | 4 +- .../HapticPulses/WorkspaceButtonHover.asset | 2 +- 24 files changed, 123 insertions(+), 27 deletions(-) create mode 100644 Editor/HapticPulsesEditor.cs create mode 100644 Editor/HapticPulsesEditor.cs.meta diff --git a/Editor/HapticPulsesEditor.cs b/Editor/HapticPulsesEditor.cs new file mode 100644 index 000000000..58e690553 --- /dev/null +++ b/Editor/HapticPulsesEditor.cs @@ -0,0 +1,84 @@ +using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Core; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.UI +{ + sealed class HapticPulseEditor : EditorWindow + { + readonly List m_HapticPulses = new List(); + + Vector2 m_Scroll; + float m_Multiplier = 1; + + [MenuItem("Edit/Project Settings/EditorVR/Haptic Pulses")] + static void Init() + { + GetWindow("Haptic Pulse Editor").Show(); + } + + void OnEnable() + { + m_HapticPulses.Clear(); + var pulses = AssetDatabase.FindAssets("t:HapticPulse"); + foreach (var pulse in pulses) + { + var asset = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(pulse)); + if (asset) + m_HapticPulses.Add(asset); + } + } + + void OnGUI() + { + const float nameColumnWidth = 250f; + const float durationColumnWidth = 60f; + + m_Scroll = GUILayout.BeginScrollView(m_Scroll); + + GUILayout.BeginHorizontal(); + m_Multiplier = EditorGUILayout.FloatField("Multiplier", m_Multiplier); + if (GUILayout.Button("Multiply Intensity")) + { + foreach (var pulse in m_HapticPulses) + { + pulse.intensity *= m_Multiplier; + EditorUtility.SetDirty(pulse); + } + } + + if (GUILayout.Button("Multiply Duration")) + { + foreach (var pulse in m_HapticPulses) + { + pulse.duration *= m_Multiplier; + EditorUtility.SetDirty(pulse); + } + } + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Haptic Pulses", EditorStyles.boldLabel, GUILayout.Width(nameColumnWidth)); + GUILayout.Label("Duration", GUILayout.Width(durationColumnWidth)); + GUILayout.Label("Intensity"); + GUILayout.EndHorizontal(); + + foreach (var pulse in m_HapticPulses) + { + GUILayout.BeginHorizontal(); + EditorGUILayout.ObjectField(pulse, typeof(HapticPulse), false, GUILayout.Width(nameColumnWidth)); + EditorGUI.BeginChangeCheck(); + pulse.duration = EditorGUILayout.FloatField(pulse.duration, GUILayout.Width(durationColumnWidth)); + pulse.intensity = GUILayout.HorizontalSlider(pulse.intensity, 0, 1); + pulse.intensity = EditorGUILayout.FloatField(pulse.intensity, GUILayout.Width(durationColumnWidth)); + if (EditorGUI.EndChangeCheck()) + { + EditorUtility.SetDirty(pulse); + } + GUILayout.EndHorizontal(); + } + + GUILayout.EndScrollView(); + } + } +} diff --git a/Editor/HapticPulsesEditor.cs.meta b/Editor/HapticPulsesEditor.cs.meta new file mode 100644 index 000000000..324c8b899 --- /dev/null +++ b/Editor/HapticPulsesEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 29b662520f19dc94792648a80927ebaa +timeCreated: 1486770624 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset b/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset index 7b73cbb01..271a57e73 100644 --- a/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset +++ b/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: FaceRotationPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.055 + m_Intensity: 0.22 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/HideMenuPulse.asset b/Menus/MainMenu/HapticPulses/HideMenuPulse.asset index 6caa84382..1eec78985 100644 --- a/Menus/MainMenu/HapticPulses/HideMenuPulse.asset +++ b/Menus/MainMenu/HapticPulses/HideMenuPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: HideMenuPulse m_EditorClassIdentifier: m_Duration: 0.75 - m_Intensity: 0.075 + m_Intensity: 0.2 m_FadeIn: 0 m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset index cdda7adc7..6840a650d 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuActivatorHoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: MainMenuActivatorHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.2 + m_Intensity: 0.4 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset index 082a7d134..0ff2c87db 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuButtonClickPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: MainMenuButtonClickPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.095 + m_Intensity: 0.38 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset index 7050b9cfe..c3394f615 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuButtonHoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: MainMenuButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.175 + m_Intensity: 0.6 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset b/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset index 1e28033cc..f6800cc77 100644 --- a/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset +++ b/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ShowMenuPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.1 + m_Intensity: 0.3 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset b/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset index 472e131ad..e63620e33 100644 --- a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset +++ b/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ClickPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.2 + m_Intensity: 0.6 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset b/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset index 2bafd1c7d..a691b68a8 100644 --- a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset +++ b/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: HoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.2 + m_Intensity: 0.6 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset b/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset index aeb5b89f6..33591d18a 100644 --- a/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset +++ b/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ButtonClickedPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.1 + m_Intensity: 0.4 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset b/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset index ac3775938..ab9b2cfae 100644 --- a/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset +++ b/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.2 + m_Intensity: 0.8 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/RadialMenu/HapticPulses/ReleasePulse.asset b/Menus/RadialMenu/HapticPulses/ReleasePulse.asset index 0c337d8c5..927294cc3 100644 --- a/Menus/RadialMenu/HapticPulses/ReleasePulse.asset +++ b/Menus/RadialMenu/HapticPulses/ReleasePulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: ReleasePulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.1 + m_Intensity: 0.4 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Scripts/ListView/HapticPulses/ScrollPulse.asset b/Scripts/ListView/HapticPulses/ScrollPulse.asset index b34ee7969..b4bc52ee4 100644 --- a/Scripts/ListView/HapticPulses/ScrollPulse.asset +++ b/Scripts/ListView/HapticPulses/ScrollPulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: ScrollPulse m_EditorClassIdentifier: - m_Duration: 0.25 - m_Intensity: 1 + m_Duration: 0.15 + m_Intensity: 0.15 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Scripts/Modules/HapticsModule/HapticPulse.cs b/Scripts/Modules/HapticsModule/HapticPulse.cs index 2b82e6842..ae9cfa01a 100644 --- a/Scripts/Modules/HapticsModule/HapticPulse.cs +++ b/Scripts/Modules/HapticsModule/HapticPulse.cs @@ -21,8 +21,8 @@ public class HapticPulse : ScriptableObject bool m_FadeOut = false; // Don't allow public setting of value; use inspector-set values - public float duration { get { return m_Duration; } } - public float intensity { get { return m_Intensity; } } + public float duration { get { return m_Duration; } internal set { m_Duration = value; } } + public float intensity { get { return m_Intensity; } internal set { m_Intensity = value; } } public bool fadeIn { get { return m_FadeIn; } } public bool fadeOut { get { return m_FadeOut; } } } diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index 8b9d1f38a..5bb104a2c 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules sealed class HapticsModule : MonoBehaviour { [SerializeField] - float m_MasterIntensity = 4f; + float m_MasterIntensity = 0.8f; /// /// Overall intensity of haptics. diff --git a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset index 93ac16b02..dbe82a114 100644 --- a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset +++ b/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: HoverPulse m_EditorClassIdentifier: - m_Duration: 0.45 - m_Intensity: 0.075 + m_Duration: 0.3 + m_Intensity: 0.15 m_FadeIn: 0 m_FadeOut: 1 diff --git a/Tools/TransformTool/HapticPulses/DragPulse.asset b/Tools/TransformTool/HapticPulses/DragPulse.asset index 3663a437f..81c9f1f70 100644 --- a/Tools/TransformTool/HapticPulses/DragPulse.asset +++ b/Tools/TransformTool/HapticPulses/DragPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: DragPulse m_EditorClassIdentifier: m_Duration: 0.2 - m_Intensity: 0.175 + m_Intensity: 0.4 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Tools/TransformTool/HapticPulses/RotatePulse.asset b/Tools/TransformTool/HapticPulses/RotatePulse.asset index 4e4e94ae7..977027c45 100644 --- a/Tools/TransformTool/HapticPulses/RotatePulse.asset +++ b/Tools/TransformTool/HapticPulses/RotatePulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: RotatePulse m_EditorClassIdentifier: m_Duration: 0.25 - m_Intensity: 0.25 + m_Intensity: 0.6 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/FrameHoverPulse.asset b/Workspaces/Base/HapticPulses/FrameHoverPulse.asset index 89960b6cf..61e4ee0f6 100644 --- a/Workspaces/Base/HapticPulses/FrameHoverPulse.asset +++ b/Workspaces/Base/HapticPulses/FrameHoverPulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: FrameHoverPulse m_EditorClassIdentifier: - m_Duration: 0.8 - m_Intensity: 0.065 + m_Duration: 0.5 + m_Intensity: 0.6 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/MovePulse.asset b/Workspaces/Base/HapticPulses/MovePulse.asset index 7a58c99d1..a34bdca20 100644 --- a/Workspaces/Base/HapticPulses/MovePulse.asset +++ b/Workspaces/Base/HapticPulses/MovePulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: MovePulse m_EditorClassIdentifier: m_Duration: 0.25 - m_Intensity: 0.075 + m_Intensity: 0.15 m_FadeIn: 0 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/ResizePulse.asset b/Workspaces/Base/HapticPulses/ResizePulse.asset index c284cb1c9..ac028edcf 100644 --- a/Workspaces/Base/HapticPulses/ResizePulse.asset +++ b/Workspaces/Base/HapticPulses/ResizePulse.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: ResizePulse m_EditorClassIdentifier: - m_Duration: 0.25 + m_Duration: 0.2 m_Intensity: 0.35 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset b/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset index 304ae3747..7c269c62b 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceButtonClick.asset @@ -11,7 +11,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} m_Name: WorkspaceButtonClick m_EditorClassIdentifier: - m_Duration: 0.25 - m_Intensity: 0.15 + m_Duration: 0.15 + m_Intensity: 0.35 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset index 1c0c837c0..910898653 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceButtonHover.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: WorkspaceButtonHover m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.175 + m_Intensity: 0.7 m_FadeIn: 0 m_FadeOut: 0 From aa4abd8be7cf182c0fd86f0fe1f510bf6a9ed4c1 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 14:48:53 -0700 Subject: [PATCH 543/870] Smooth local rotation and then compute forward vector instead of lerping forward vector --- Scripts/Helpers/VRSmoothCamera.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/Helpers/VRSmoothCamera.cs b/Scripts/Helpers/VRSmoothCamera.cs index c4632b74a..2a22a1240 100644 --- a/Scripts/Helpers/VRSmoothCamera.cs +++ b/Scripts/Helpers/VRSmoothCamera.cs @@ -42,7 +42,7 @@ sealed class VRSmoothCamera : MonoBehaviour, IPreviewCamera RenderTexture m_RenderTexture; Vector3 m_Position; - Vector3 m_Forward; + Quaternion m_Rotation; /// /// A layer mask that controls what will always render in the HMD and not in the preview @@ -61,7 +61,7 @@ void Start() transform.localRotation = m_VRCamera.transform.localRotation; m_Position = transform.localPosition; - m_Forward = transform.localRotation * Vector3.forward; + m_Rotation = transform.localRotation; } void LateUpdate() @@ -84,9 +84,9 @@ void LateUpdate() m_SmoothCamera.fieldOfView = m_FieldOfView; m_Position = Vector3.Lerp(m_Position, m_VRCamera.transform.localPosition, Time.deltaTime * m_SmoothingMultiplier); - m_Forward = Vector3.Lerp(m_Forward, m_VRCamera.transform.localRotation * Vector3.forward, Time.deltaTime * m_SmoothingMultiplier); + m_Rotation = Quaternion.Slerp(m_Rotation, m_VRCamera.transform.localRotation, Time.deltaTime * m_SmoothingMultiplier); - transform.localRotation = Quaternion.LookRotation(m_Forward, Vector3.up); + transform.localRotation = Quaternion.LookRotation(m_Rotation * Vector3.forward, Vector3.up); transform.localPosition = m_Position - transform.localRotation * Vector3.forward * m_PullBackDistance; // Don't render any HMD-related visual proxies From ca3ab8ac4df1e0a70f02530a250c8b952a02817e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 16:17:47 -0700 Subject: [PATCH 544/870] Refactor set_icon logic in AssetGridItem to avoid wasted effort --- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index 6665bda34..d536e8f96 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -77,26 +77,23 @@ private get m_Cube.gameObject.SetActive(false); m_Sphere.gameObject.SetActive(false); - if (m_IconPrefab == value) + if (m_IconPrefab == value) // If this GridItem already has this icon loaded, jus trefresh it's active state { - m_Icon.SetActive(true); - if (m_PreviewObjectTransform && !m_AutoHidePreview) - m_Icon.SetActive(false); - + m_Icon.SetActive(!m_PreviewObjectTransform || m_AutoHidePreview); return; } if (m_Icon) ObjectUtils.Destroy(m_Icon); + if (m_PreviewObjectTransform && !m_AutoHidePreview) // We don't need the icon if we never hide the preview + return; + m_IconPrefab = value; m_Icon = ObjectUtils.Instantiate(m_IconPrefab, transform, false); m_Icon.transform.localPosition = Vector3.up * 0.5f; m_Icon.transform.localRotation = Quaternion.AngleAxis(90, Vector3.down); m_Icon.transform.localScale = Vector3.one; - - if (m_PreviewObjectTransform && !m_AutoHidePreview) - m_Icon.SetActive(false); } } @@ -530,7 +527,7 @@ IEnumerator ShowGrabbedObject() if (maxComponent < k_MinPreviewScale) { - // Object will be preview at the maximum scale + // Object will be preview at the minimum scale targetScale = Vector3.one * k_MinPreviewScale; pivotOffset = pivotOffset * scaleFactor + (Vector3.up + Vector3.forward) * 0.5f * k_MinPreviewScale; } From f682e4fb65de49f70165bd54553f088a79d37a5d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 10 Jul 2017 16:21:33 -0700 Subject: [PATCH 545/870] Go back to just deactivating the icon --- Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index d536e8f96..44d910c22 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -77,7 +77,7 @@ private get m_Cube.gameObject.SetActive(false); m_Sphere.gameObject.SetActive(false); - if (m_IconPrefab == value) // If this GridItem already has this icon loaded, jus trefresh it's active state + if (m_IconPrefab == value) // If this GridItem already has this icon loaded, just refresh it's active state { m_Icon.SetActive(!m_PreviewObjectTransform || m_AutoHidePreview); return; @@ -86,14 +86,14 @@ private get if (m_Icon) ObjectUtils.Destroy(m_Icon); - if (m_PreviewObjectTransform && !m_AutoHidePreview) // We don't need the icon if we never hide the preview - return; - m_IconPrefab = value; m_Icon = ObjectUtils.Instantiate(m_IconPrefab, transform, false); m_Icon.transform.localPosition = Vector3.up * 0.5f; m_Icon.transform.localRotation = Quaternion.AngleAxis(90, Vector3.down); m_Icon.transform.localScale = Vector3.one; + + if (m_PreviewObjectTransform && !m_AutoHidePreview) + m_Icon.SetActive(false); } } From 5e65baf2b9d28ea48ca99897e606d2f0371c955c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Jul 2017 16:25:32 -0700 Subject: [PATCH 546/870] Assign more specific & appropriate naming to haptic pulses, for better display/relevancy in the new haptic pulse editor --- .../{FaceRotationPulse.asset => MainMenuFaceRotationPulse.asset} | 0 ...ationPulse.asset.meta => MainMenuFaceRotationPulse.asset.meta} | 0 .../HapticPulses/{HideMenuPulse.asset => MainMenuHidePulse.asset} | 0 .../{HideMenuPulse.asset.meta => MainMenuHidePulse.asset.meta} | 0 .../HapticPulses/{ShowMenuPulse.asset => MainMenuShowPulse.asset} | 0 .../{ShowMenuPulse.asset.meta => MainMenuShowPulse.asset.meta} | 0 .../{ClickPulse.asset => PinnedToolButtonClickPulse.asset} | 0 ...lickPulse.asset.meta => PinnedToolButtonClickPulse.asset.meta} | 0 .../{HoverPulse.asset => PinnedToolButtonHoverPulse.asset} | 0 ...overPulse.asset.meta => PinnedToolButtonHoverPulse.asset.meta} | 0 ...uttonClickedPulse.asset => RadialMenuButtonClickedPulse.asset} | 0 ...edPulse.asset.meta => RadialMenuButtonClickedPulse.asset.meta} | 0 .../{ButtonHoverPulse.asset => RadialMenuButtonHoverPulse.asset} | 0 ...overPulse.asset.meta => RadialMenuButtonHoverPulse.asset.meta} | 0 .../{ReleasePulse.asset => RadialMenuButtonReleasePulse.asset} | 0 ...sePulse.asset.meta => RadialMenuButtonReleasePulse.asset.meta} | 0 .../HapticPulses/{ScrollPulse.asset => ListViewScrollPulse.asset} | 0 .../{ScrollPulse.asset.meta => ListViewScrollPulse.asset.meta} | 0 .../{HoverPulse.asset => SelectionModuleHoverPulse.asset} | 0 ...HoverPulse.asset.meta => SelectionModuleHoverPulse.asset.meta} | 0 .../{DragPulse.asset => TransformToolDragPulse.asset} | 0 .../{DragPulse.asset.meta => TransformToolDragPulse.asset.meta} | 0 .../{RotatePulse.asset => TransformToolRotatePulse.asset} | 0 ...RotatePulse.asset.meta => TransformToolRotatePulse.asset.meta} | 0 .../{FrameHoverPulse.asset => WorkspaceFrameHoverPulse.asset} | 0 ...eHoverPulse.asset.meta => WorkspaceFrameHoverPulse.asset.meta} | 0 .../HapticPulses/{MovePulse.asset => WorkspaceMovePulse.asset} | 0 .../{MovePulse.asset.meta => WorkspaceMovePulse.asset.meta} | 0 .../{ResizePulse.asset => WorkspaceResizePulse.asset} | 0 .../{ResizePulse.asset.meta => WorkspaceResizePulse.asset.meta} | 0 30 files changed, 0 insertions(+), 0 deletions(-) rename Menus/MainMenu/HapticPulses/{FaceRotationPulse.asset => MainMenuFaceRotationPulse.asset} (100%) rename Menus/MainMenu/HapticPulses/{FaceRotationPulse.asset.meta => MainMenuFaceRotationPulse.asset.meta} (100%) rename Menus/MainMenu/HapticPulses/{HideMenuPulse.asset => MainMenuHidePulse.asset} (100%) rename Menus/MainMenu/HapticPulses/{HideMenuPulse.asset.meta => MainMenuHidePulse.asset.meta} (100%) rename Menus/MainMenu/HapticPulses/{ShowMenuPulse.asset => MainMenuShowPulse.asset} (100%) rename Menus/MainMenu/HapticPulses/{ShowMenuPulse.asset.meta => MainMenuShowPulse.asset.meta} (100%) rename Menus/PinnedToolButton/HapticPulses/{ClickPulse.asset => PinnedToolButtonClickPulse.asset} (100%) rename Menus/PinnedToolButton/HapticPulses/{ClickPulse.asset.meta => PinnedToolButtonClickPulse.asset.meta} (100%) rename Menus/PinnedToolButton/HapticPulses/{HoverPulse.asset => PinnedToolButtonHoverPulse.asset} (100%) rename Menus/PinnedToolButton/HapticPulses/{HoverPulse.asset.meta => PinnedToolButtonHoverPulse.asset.meta} (100%) rename Menus/RadialMenu/HapticPulses/{ButtonClickedPulse.asset => RadialMenuButtonClickedPulse.asset} (100%) rename Menus/RadialMenu/HapticPulses/{ButtonClickedPulse.asset.meta => RadialMenuButtonClickedPulse.asset.meta} (100%) rename Menus/RadialMenu/HapticPulses/{ButtonHoverPulse.asset => RadialMenuButtonHoverPulse.asset} (100%) rename Menus/RadialMenu/HapticPulses/{ButtonHoverPulse.asset.meta => RadialMenuButtonHoverPulse.asset.meta} (100%) rename Menus/RadialMenu/HapticPulses/{ReleasePulse.asset => RadialMenuButtonReleasePulse.asset} (100%) rename Menus/RadialMenu/HapticPulses/{ReleasePulse.asset.meta => RadialMenuButtonReleasePulse.asset.meta} (100%) rename Scripts/ListView/HapticPulses/{ScrollPulse.asset => ListViewScrollPulse.asset} (100%) rename Scripts/ListView/HapticPulses/{ScrollPulse.asset.meta => ListViewScrollPulse.asset.meta} (100%) rename Scripts/Modules/SelectionModule/HapticPulses/{HoverPulse.asset => SelectionModuleHoverPulse.asset} (100%) rename Scripts/Modules/SelectionModule/HapticPulses/{HoverPulse.asset.meta => SelectionModuleHoverPulse.asset.meta} (100%) rename Tools/TransformTool/HapticPulses/{DragPulse.asset => TransformToolDragPulse.asset} (100%) rename Tools/TransformTool/HapticPulses/{DragPulse.asset.meta => TransformToolDragPulse.asset.meta} (100%) rename Tools/TransformTool/HapticPulses/{RotatePulse.asset => TransformToolRotatePulse.asset} (100%) rename Tools/TransformTool/HapticPulses/{RotatePulse.asset.meta => TransformToolRotatePulse.asset.meta} (100%) rename Workspaces/Base/HapticPulses/{FrameHoverPulse.asset => WorkspaceFrameHoverPulse.asset} (100%) rename Workspaces/Base/HapticPulses/{FrameHoverPulse.asset.meta => WorkspaceFrameHoverPulse.asset.meta} (100%) rename Workspaces/Base/HapticPulses/{MovePulse.asset => WorkspaceMovePulse.asset} (100%) rename Workspaces/Base/HapticPulses/{MovePulse.asset.meta => WorkspaceMovePulse.asset.meta} (100%) rename Workspaces/Base/HapticPulses/{ResizePulse.asset => WorkspaceResizePulse.asset} (100%) rename Workspaces/Base/HapticPulses/{ResizePulse.asset.meta => WorkspaceResizePulse.asset.meta} (100%) diff --git a/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuFaceRotationPulse.asset similarity index 100% rename from Menus/MainMenu/HapticPulses/FaceRotationPulse.asset rename to Menus/MainMenu/HapticPulses/MainMenuFaceRotationPulse.asset diff --git a/Menus/MainMenu/HapticPulses/FaceRotationPulse.asset.meta b/Menus/MainMenu/HapticPulses/MainMenuFaceRotationPulse.asset.meta similarity index 100% rename from Menus/MainMenu/HapticPulses/FaceRotationPulse.asset.meta rename to Menus/MainMenu/HapticPulses/MainMenuFaceRotationPulse.asset.meta diff --git a/Menus/MainMenu/HapticPulses/HideMenuPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuHidePulse.asset similarity index 100% rename from Menus/MainMenu/HapticPulses/HideMenuPulse.asset rename to Menus/MainMenu/HapticPulses/MainMenuHidePulse.asset diff --git a/Menus/MainMenu/HapticPulses/HideMenuPulse.asset.meta b/Menus/MainMenu/HapticPulses/MainMenuHidePulse.asset.meta similarity index 100% rename from Menus/MainMenu/HapticPulses/HideMenuPulse.asset.meta rename to Menus/MainMenu/HapticPulses/MainMenuHidePulse.asset.meta diff --git a/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuShowPulse.asset similarity index 100% rename from Menus/MainMenu/HapticPulses/ShowMenuPulse.asset rename to Menus/MainMenu/HapticPulses/MainMenuShowPulse.asset diff --git a/Menus/MainMenu/HapticPulses/ShowMenuPulse.asset.meta b/Menus/MainMenu/HapticPulses/MainMenuShowPulse.asset.meta similarity index 100% rename from Menus/MainMenu/HapticPulses/ShowMenuPulse.asset.meta rename to Menus/MainMenu/HapticPulses/MainMenuShowPulse.asset.meta diff --git a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset b/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset similarity index 100% rename from Menus/PinnedToolButton/HapticPulses/ClickPulse.asset rename to Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset diff --git a/Menus/PinnedToolButton/HapticPulses/ClickPulse.asset.meta b/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset.meta similarity index 100% rename from Menus/PinnedToolButton/HapticPulses/ClickPulse.asset.meta rename to Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset.meta diff --git a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset b/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset similarity index 100% rename from Menus/PinnedToolButton/HapticPulses/HoverPulse.asset rename to Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset diff --git a/Menus/PinnedToolButton/HapticPulses/HoverPulse.asset.meta b/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset.meta similarity index 100% rename from Menus/PinnedToolButton/HapticPulses/HoverPulse.asset.meta rename to Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset.meta diff --git a/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset b/Menus/RadialMenu/HapticPulses/RadialMenuButtonClickedPulse.asset similarity index 100% rename from Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset rename to Menus/RadialMenu/HapticPulses/RadialMenuButtonClickedPulse.asset diff --git a/Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset.meta b/Menus/RadialMenu/HapticPulses/RadialMenuButtonClickedPulse.asset.meta similarity index 100% rename from Menus/RadialMenu/HapticPulses/ButtonClickedPulse.asset.meta rename to Menus/RadialMenu/HapticPulses/RadialMenuButtonClickedPulse.asset.meta diff --git a/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset b/Menus/RadialMenu/HapticPulses/RadialMenuButtonHoverPulse.asset similarity index 100% rename from Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset rename to Menus/RadialMenu/HapticPulses/RadialMenuButtonHoverPulse.asset diff --git a/Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset.meta b/Menus/RadialMenu/HapticPulses/RadialMenuButtonHoverPulse.asset.meta similarity index 100% rename from Menus/RadialMenu/HapticPulses/ButtonHoverPulse.asset.meta rename to Menus/RadialMenu/HapticPulses/RadialMenuButtonHoverPulse.asset.meta diff --git a/Menus/RadialMenu/HapticPulses/ReleasePulse.asset b/Menus/RadialMenu/HapticPulses/RadialMenuButtonReleasePulse.asset similarity index 100% rename from Menus/RadialMenu/HapticPulses/ReleasePulse.asset rename to Menus/RadialMenu/HapticPulses/RadialMenuButtonReleasePulse.asset diff --git a/Menus/RadialMenu/HapticPulses/ReleasePulse.asset.meta b/Menus/RadialMenu/HapticPulses/RadialMenuButtonReleasePulse.asset.meta similarity index 100% rename from Menus/RadialMenu/HapticPulses/ReleasePulse.asset.meta rename to Menus/RadialMenu/HapticPulses/RadialMenuButtonReleasePulse.asset.meta diff --git a/Scripts/ListView/HapticPulses/ScrollPulse.asset b/Scripts/ListView/HapticPulses/ListViewScrollPulse.asset similarity index 100% rename from Scripts/ListView/HapticPulses/ScrollPulse.asset rename to Scripts/ListView/HapticPulses/ListViewScrollPulse.asset diff --git a/Scripts/ListView/HapticPulses/ScrollPulse.asset.meta b/Scripts/ListView/HapticPulses/ListViewScrollPulse.asset.meta similarity index 100% rename from Scripts/ListView/HapticPulses/ScrollPulse.asset.meta rename to Scripts/ListView/HapticPulses/ListViewScrollPulse.asset.meta diff --git a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset b/Scripts/Modules/SelectionModule/HapticPulses/SelectionModuleHoverPulse.asset similarity index 100% rename from Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset rename to Scripts/Modules/SelectionModule/HapticPulses/SelectionModuleHoverPulse.asset diff --git a/Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset.meta b/Scripts/Modules/SelectionModule/HapticPulses/SelectionModuleHoverPulse.asset.meta similarity index 100% rename from Scripts/Modules/SelectionModule/HapticPulses/HoverPulse.asset.meta rename to Scripts/Modules/SelectionModule/HapticPulses/SelectionModuleHoverPulse.asset.meta diff --git a/Tools/TransformTool/HapticPulses/DragPulse.asset b/Tools/TransformTool/HapticPulses/TransformToolDragPulse.asset similarity index 100% rename from Tools/TransformTool/HapticPulses/DragPulse.asset rename to Tools/TransformTool/HapticPulses/TransformToolDragPulse.asset diff --git a/Tools/TransformTool/HapticPulses/DragPulse.asset.meta b/Tools/TransformTool/HapticPulses/TransformToolDragPulse.asset.meta similarity index 100% rename from Tools/TransformTool/HapticPulses/DragPulse.asset.meta rename to Tools/TransformTool/HapticPulses/TransformToolDragPulse.asset.meta diff --git a/Tools/TransformTool/HapticPulses/RotatePulse.asset b/Tools/TransformTool/HapticPulses/TransformToolRotatePulse.asset similarity index 100% rename from Tools/TransformTool/HapticPulses/RotatePulse.asset rename to Tools/TransformTool/HapticPulses/TransformToolRotatePulse.asset diff --git a/Tools/TransformTool/HapticPulses/RotatePulse.asset.meta b/Tools/TransformTool/HapticPulses/TransformToolRotatePulse.asset.meta similarity index 100% rename from Tools/TransformTool/HapticPulses/RotatePulse.asset.meta rename to Tools/TransformTool/HapticPulses/TransformToolRotatePulse.asset.meta diff --git a/Workspaces/Base/HapticPulses/FrameHoverPulse.asset b/Workspaces/Base/HapticPulses/WorkspaceFrameHoverPulse.asset similarity index 100% rename from Workspaces/Base/HapticPulses/FrameHoverPulse.asset rename to Workspaces/Base/HapticPulses/WorkspaceFrameHoverPulse.asset diff --git a/Workspaces/Base/HapticPulses/FrameHoverPulse.asset.meta b/Workspaces/Base/HapticPulses/WorkspaceFrameHoverPulse.asset.meta similarity index 100% rename from Workspaces/Base/HapticPulses/FrameHoverPulse.asset.meta rename to Workspaces/Base/HapticPulses/WorkspaceFrameHoverPulse.asset.meta diff --git a/Workspaces/Base/HapticPulses/MovePulse.asset b/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset similarity index 100% rename from Workspaces/Base/HapticPulses/MovePulse.asset rename to Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset diff --git a/Workspaces/Base/HapticPulses/MovePulse.asset.meta b/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset.meta similarity index 100% rename from Workspaces/Base/HapticPulses/MovePulse.asset.meta rename to Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset.meta diff --git a/Workspaces/Base/HapticPulses/ResizePulse.asset b/Workspaces/Base/HapticPulses/WorkspaceResizePulse.asset similarity index 100% rename from Workspaces/Base/HapticPulses/ResizePulse.asset rename to Workspaces/Base/HapticPulses/WorkspaceResizePulse.asset diff --git a/Workspaces/Base/HapticPulses/ResizePulse.asset.meta b/Workspaces/Base/HapticPulses/WorkspaceResizePulse.asset.meta similarity index 100% rename from Workspaces/Base/HapticPulses/ResizePulse.asset.meta rename to Workspaces/Base/HapticPulses/WorkspaceResizePulse.asset.meta From 2a5309999b6699777b1cb3ebef1cb4ed88109525 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Jul 2017 19:47:56 -0700 Subject: [PATCH 547/870] Apply ViewerScale to Spatial Hinting implementation; Move remaining SpatialHintUI show/hide logic out of PinnedToolsMenuUI, handle via property in SpatialHintUI. --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 8 +-- .../Scripts/PinnedToolsMenuUI.cs | 50 +++---------------- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 50 ++++++++++++++++++- 3 files changed, 58 insertions(+), 50 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 333a3c579..75d25a365 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -18,7 +18,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics + sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics, IUsesViewerScale { const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation @@ -331,10 +331,10 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, //const float kMinFineTuneVelocity = 0.000001f; if (spatialDirection == null) { - const float kNewDirectionVectorThreshold = 0.0175f; // Initial magnitude beyond which spatial scrolling will be evaluated + var newDirectionVectorThreshold = 0.0175f * this.GetViewerScale(); // Initial magnitude beyond which spatial scrolling will be evaluated var dragAmount = Vector3.Magnitude(directionVector); - m_PinnedToolsMenuUI.spatialDragDistance = dragAmount > 0 ? dragAmount / kNewDirectionVectorThreshold : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred - if (dragAmount > kNewDirectionVectorThreshold) + m_PinnedToolsMenuUI.spatialDragDistance = dragAmount > 0 ? dragAmount / newDirectionVectorThreshold : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred + if (dragAmount > newDirectionVectorThreshold) { spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton Debug.LogError("" + spatialDirection.Value.ToString("F4") + ""); diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 2cb350f9c..3117d4e9a 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI, IConnectInterfaces { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -34,7 +34,6 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I Coroutine m_ShowHideAllButtonsCoroutine; Coroutine m_MoveCoroutine; Coroutine m_ButtonHoverExitDelayCoroutine; - Coroutine m_HintContentVisibilityCoroutine; int m_VisibleButtonCount; bool m_MoveToAlternatePosition; Vector3 m_OriginalLocalScale; @@ -69,7 +68,9 @@ public bool allButtonsVisible Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); //this.Pulse(rayOrigin, 0.5f, 0.065f, false, true); ShowOnlyMenuAndActiveToolButtons(); - this.RestartCoroutine(ref m_HintContentVisibilityCoroutine, HideHintContent()); + + m_SpatialHintUI.enablePreviewVisuals = false; + m_SpatialHintUI.enablePrimaryArrowVisuals = false; } } } @@ -109,7 +110,7 @@ public float spatialDragDistance m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; var currentRotation = transform.rotation.eulerAngles; m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); - this.RestartCoroutine(ref m_HintContentVisibilityCoroutine, ShowHintContent()); + m_SpatialHintUI.enablePreviewVisuals = true; m_HintContentWorldPosition = transform.position; m_SpatialHintContentContainer.position = m_HintContentWorldPosition; } @@ -148,6 +149,7 @@ void Awake() Debug.LogError("PinnedToolsMenuUI initialized"); m_SpatialHintUI = this.InstantiateUI(m_SpatialHintUI.gameObject).GetComponent(); + this.ConnectInterfaces(m_SpatialHintUI); m_SpatialHintContentContainer = m_SpatialHintUI.contentContainer; } @@ -563,46 +565,6 @@ void OnButtonHover() buttonHovered(); } - IEnumerator ShowHintContent() - { - m_SpatialHintUI.enablePreviewVisuals = true; - - var currentScale = m_SpatialHintContentContainer.localScale; - var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals - var targetScale = Vector3.one; - while (timeElapsed < 1f) - { - timeElapsed += Time.unscaledDeltaTime * 5f; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(timeElapsed), 2); - m_SpatialHintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); - yield return null; - } - - m_SpatialHintContentContainer.localScale = targetScale; - m_HintContentVisibilityCoroutine = null; - } - - IEnumerator HideHintContent() - { - m_SpatialHintUI.enableVisuals = false; - - yield break; - - var currentScale = m_SpatialHintContentContainer.localScale; - var timeElapsed = 1 - currentScale.x; - var targetScale = Vector3.zero; - while (timeElapsed < 1f) - { - timeElapsed += Time.unscaledDeltaTime * 4f; - var durationShaped = MathUtilsExt.SmoothInOutLerpFloat(timeElapsed); - m_SpatialHintContentContainer.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); - yield return null; - } - - m_SpatialHintContentContainer.localScale = targetScale; - m_HintContentVisibilityCoroutine = null; - } - public Node? node { set { m_UsesNodeImplementation.node = value; } diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index 517d11906..0c01f5593 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public class SpatialHintUI : MonoBehaviour + public class SpatialHintUI : MonoBehaviour, IUsesViewerScale { readonly Color k_PrimaryArrowColor = Color.white; @@ -36,6 +36,7 @@ public class SpatialHintUI : MonoBehaviour Transform m_ScrollVisualsTransform; GameObject m_ScrollVisualsGameObject; Coroutine m_ScrollVisualsVisibilityCoroutine; + Coroutine m_VisibilityCoroutine; /// /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action @@ -45,6 +46,11 @@ public bool enablePreviewVisuals { set { + transform.localScale = Vector3.one * this.GetViewerScale(); + Debug.LogError("Spatial Hint Viewer Scale : " + this.GetViewerScale()); + + this.RestartCoroutine(ref m_VisibilityCoroutine, value ? AnimateShow() : AnimateHide()); + var semiTransparentWhite = new Color(1f, 1f, 1f, 0.5f); foreach (var arrow in m_PrimaryDirectionalHintArrows) { @@ -148,9 +154,49 @@ void Awake() m_ScrollVisualsGameObject.SetActive(false); } + IEnumerator AnimateShow() + { + //m_SpatialHintUI.enablePreviewVisuals = true; + + var currentScale = transform.localScale; + var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals + var targetScale = Vector3.one * this.GetViewerScale(); + while (timeElapsed < 1f) + { + timeElapsed += Time.unscaledDeltaTime * 5f; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(timeElapsed), 2); + transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + yield return null; + } + + transform.localScale = targetScale; + m_VisibilityCoroutine = null; + } + + IEnumerator AnimateHide() + { + //m_SpatialHintUI.enableVisuals = false; + + yield break; + + var currentScale = transform.localScale; + var timeElapsed = 1 - currentScale.x; + var targetScale = Vector3.zero; + while (timeElapsed < 1f) + { + timeElapsed += Time.unscaledDeltaTime * 4f; + var durationShaped = MathUtilsExt.SmoothInOutLerpFloat(timeElapsed); + transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); + yield return null; + } + + transform.localScale = targetScale; + m_VisibilityCoroutine = null; + } + IEnumerator ShowScrollVisuals() { - Debug.LogError("SHOWING SPATIAL SCROLL VISUALS"); + Debug.LogError("SHOWING SPATIAL SCROLL VISUALS : viewscale is " + this.GetViewerScale()); // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector m_ScrollVisualsGameObject.SetActive(true); enableVisuals = false; From e5700d9c5a2277043bea5d1a7336daaeab8d101c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 10 Jul 2017 19:58:22 -0700 Subject: [PATCH 548/870] Scale the (normalized) spatial scroll amount according to the ViewerScale --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 75d25a365..275fc2775 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -357,7 +357,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, } //Debug.LogError(directionVector.magnitude); - var projectedAmount = Vector3.Project(directionVector, spatialDirection.Value).magnitude; + var projectedAmount = Vector3.Project(directionVector, spatialDirection.Value).magnitude / this.GetViewerScale(); normalizedLoopingPosition = (Mathf.Abs(projectedAmount) % repeatingScrollLengthRange) * (1 / repeatingScrollLengthRange); //Debug.LogError("" + velocity + ""); From 67aa6a9bc74bfc8e79efd05f446154e01babe203 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Jul 2017 12:39:02 -0700 Subject: [PATCH 549/870] Make Spatial Scroll Hint arrows face the user / billboard --- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index 0c01f5593..fb3db5b6a 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -201,7 +201,7 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsGameObject.SetActive(true); enableVisuals = false; m_ScrollVisualsTransform.localScale = Vector3.one; - m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation); + m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. m_ScrollVisualsCanvasGroup.alpha = 1f; // remove m_ScrollVisualsDragTargetArrow.localPosition = Vector3.zero; @@ -219,7 +219,6 @@ IEnumerator ShowScrollVisuals() yield return null; } - //m_ScrollVisualsTransform.rotation = m_ScrollVisualsRotation.Value; m_ScrollVisualsCanvasGroup.alpha = 1f; } From 6d0e0a235d77825bdf598eae16c4ca5589409a1f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 11 Jul 2017 13:16:09 -0700 Subject: [PATCH 550/870] Set hideflags on EditorVR objects on Awake and on change of preferences toggle This state has an issue where the EditorVR object won't hide itself in the Hierarchy when you toggle the setting off --- Scripts/Core/EditorVR.cs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index bb61bf241..8bc1bc09b 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -35,6 +35,8 @@ sealed partial class EditorVR : MonoBehaviour bool m_HasDeserialized; + static EditorVR s_Instance; + static HideFlags defaultHideFlags { get { return showGameObjects ? HideFlags.DontSave : HideFlags.HideAndDontSave; } @@ -97,8 +99,10 @@ static void ResetPreferences() void Awake() { + s_Instance = this; // Used only by PreferencesGUI Nested.evr = this; // Set this once for the convenience of all nested classes m_DefaultTools = defaultTools; + SetHideFlags(defaultHideFlags); ClearDeveloperConsoleIfNecessary(); @@ -296,6 +300,7 @@ internal void Shutdown() void OnDestroy() { + s_Instance = null; foreach (var nested in m_NestedModules.Values) { nested.OnDestroy(); @@ -438,6 +443,33 @@ void LateBindNestedModules(IEnumerable types) } } + void SetHideFlags(HideFlags hideFlags) + { + foreach (var manager in FindObjectsOfType()) + { + manager.gameObject.hideFlags = hideFlags; + } + + foreach (var manager in FindObjectsOfType()) + { + manager.gameObject.hideFlags = hideFlags; + } + + foreach (var child in GetComponentsInChildren(true)) + { + child.gameObject.hideFlags = hideFlags; + } + + EditorApplication.delayCall += () => + { + gameObject.hideFlags = hideFlags; + + Debug.Log(gameObject.hideFlags); + + EditorApplication.RepaintHierarchyWindow(); + }; + + static EditorVR() { ObjectUtils.hideFlags = defaultHideFlags; @@ -474,7 +506,11 @@ static void PreferencesGUI() { string title = "Show EditorVR GameObjects"; string tooltip = "Normally, EditorVR GameObjects are hidden in the Hierarchy. Would you like to show them?"; + + EditorGUI.BeginChangeCheck(); showGameObjects = EditorGUILayout.Toggle(new GUIContent(title, tooltip), showGameObjects); + if (EditorGUI.EndChangeCheck() && s_Instance) + s_Instance.SetHideFlags(defaultHideFlags); } // Preserve Layout From d6ce8f6b0f967c9b227d3d4197616129a86d0c2d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 11 Jul 2017 13:30:24 -0700 Subject: [PATCH 551/870] Fix showing of objects in hierarchy --- Scripts/Core/EditorVR.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 8bc1bc09b..ce455a587 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -100,7 +100,7 @@ static void ResetPreferences() void Awake() { s_Instance = this; // Used only by PreferencesGUI - Nested.evr = this; // Set this once for the convenience of all nested classes + Nested.evr = this; // Set this once for the convenience of all nested classes m_DefaultTools = defaultTools; SetHideFlags(defaultHideFlags); @@ -445,12 +445,12 @@ void LateBindNestedModules(IEnumerable types) void SetHideFlags(HideFlags hideFlags) { - foreach (var manager in FindObjectsOfType()) + foreach (var manager in Resources.FindObjectsOfTypeAll()) { manager.gameObject.hideFlags = hideFlags; } - foreach (var manager in FindObjectsOfType()) + foreach (var manager in Resources.FindObjectsOfTypeAll()) { manager.gameObject.hideFlags = hideFlags; } @@ -460,15 +460,8 @@ void SetHideFlags(HideFlags hideFlags) child.gameObject.hideFlags = hideFlags; } - EditorApplication.delayCall += () => - { - gameObject.hideFlags = hideFlags; - - Debug.Log(gameObject.hideFlags); - - EditorApplication.RepaintHierarchyWindow(); - }; - + EditorApplication.DirtyHierarchyWindowSorting(); // Otherwise objects aren't shown/hidden in hierarchy window + } static EditorVR() { From 3646c87188c2d265aee8f8385052352c3120959c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Jul 2017 13:43:35 -0700 Subject: [PATCH 552/870] Allow scroll arrow visuals to expand only if dragging away from the origin in the initial drag/trigger direction; rename a few visibility properties --- .../Scripts/PinnedToolsMenuUI.cs | 10 +-- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 78 ++++++++++--------- 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 3117d4e9a..d29c720b1 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -69,8 +69,8 @@ public bool allButtonsVisible //this.Pulse(rayOrigin, 0.5f, 0.065f, false, true); ShowOnlyMenuAndActiveToolButtons(); - m_SpatialHintUI.enablePreviewVisuals = false; - m_SpatialHintUI.enablePrimaryArrowVisuals = false; + m_SpatialHintUI.preScrollVisualsVisible = false; + m_SpatialHintUI.primaryArrowsVisible = false; } } } @@ -110,7 +110,7 @@ public float spatialDragDistance m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; var currentRotation = transform.rotation.eulerAngles; m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); - m_SpatialHintUI.enablePreviewVisuals = true; + m_SpatialHintUI.preScrollVisualsVisible = true; m_HintContentWorldPosition = transform.position; m_SpatialHintContentContainer.position = m_HintContentWorldPosition; } @@ -164,8 +164,8 @@ void Update() if (Mathf.Approximately(m_SpatialDragDistance, 1f)) { m_DragTarget = transform.position; // Cache the initial drag target position, before performing any extra shapting to the target Vec3 - m_SpatialHintUI.enablePrimaryArrowVisuals = false; - m_SpatialHintUI.enablePreviewVisuals = false; + m_SpatialHintUI.primaryArrowsVisible = false; + m_SpatialHintUI.preScrollVisualsVisible = false; } // Follow the user's input for a short additional period of time diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index fb3db5b6a..eb7216e2b 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -1,4 +1,5 @@ using System.Collections; +using System.Security.Cryptography.X509Certificates; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -38,11 +39,42 @@ public class SpatialHintUI : MonoBehaviour, IUsesViewerScale Coroutine m_ScrollVisualsVisibilityCoroutine; Coroutine m_VisibilityCoroutine; + public bool vislble + { + set + { + if (value) + { + foreach (var arrow in m_PrimaryDirectionalHintArrows) + { + arrow.visibleColor = k_PrimaryArrowColor; + } + + foreach (var arrow in m_SecondaryDirectionalHintArrows) + { + arrow.visible = false; + } + } + else + { + foreach (var arrow in m_PrimaryDirectionalHintArrows) + { + arrow.visible = false; + } + + foreach (var arrow in m_SecondaryDirectionalHintArrows) + { + arrow.visible = false; + } + } + } + } + /// /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action /// This is only enabled before the enabling of the main select visuals /// - public bool enablePreviewVisuals + public bool preScrollVisualsVisible { set { @@ -64,7 +96,7 @@ public bool enablePreviewVisuals } } - public bool enablePrimaryArrowVisuals + public bool primaryArrowsVisible { set { @@ -85,37 +117,6 @@ public bool enablePrimaryArrowVisuals } } - public bool enableVisuals - { - set - { - if (value) - { - foreach (var arrow in m_PrimaryDirectionalHintArrows) - { - arrow.visibleColor = k_PrimaryArrowColor; - } - - foreach (var arrow in m_SecondaryDirectionalHintArrows) - { - arrow.visible = false; - } - } - else - { - foreach (var arrow in m_PrimaryDirectionalHintArrows) - { - arrow.visible = false; - } - - foreach (var arrow in m_SecondaryDirectionalHintArrows) - { - arrow.visible = false; - } - } - } - } - /// /// If non-null, enable and set the world rotation of the scroll visuals /// @@ -199,7 +200,7 @@ IEnumerator ShowScrollVisuals() Debug.LogError("SHOWING SPATIAL SCROLL VISUALS : viewscale is " + this.GetViewerScale()); // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector m_ScrollVisualsGameObject.SetActive(true); - enableVisuals = false; + vislble = false; m_ScrollVisualsTransform.localScale = Vector3.one; m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. m_ScrollVisualsCanvasGroup.alpha = 1f; // remove @@ -210,11 +211,18 @@ IEnumerator ShowScrollVisuals() var currentLocalScale = m_ScrollVisualsTransform.localScale; var currentAlpha = m_ScrollVisualsCanvasGroup.alpha; var secondArrowCurrentPosition = m_ScrollVisualsDragTargetArrow.position; + var normalizedScrollVisualsForward = Vector3.Normalize(m_ScrollVisualsTransform.forward); + while (currentDuration < kTargetDuration) { var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 1f, shapedDuration); - m_ScrollVisualsDragTargetArrow.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); + + // Only validate movement in the initial direction with which the user began the drag + var movingAwayFromSource = Vector3.Dot(normalizedScrollVisualsForward, Vector3.Normalize(scrollVisualsDragThresholdTriggerPosition - secondArrowCurrentPosition)) > 0; + if (movingAwayFromSource && (scrollVisualsDragThresholdTriggerPosition - secondArrowCurrentPosition).magnitude >= (m_ScrollVisualsDragTargetArrow.position - secondArrowCurrentPosition).magnitude) + m_ScrollVisualsDragTargetArrow.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); + currentDuration += Time.unscaledDeltaTime * 2f; yield return null; } From 350a4301bee81e26e886e377469996b9501289b0 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 11 Jul 2017 14:27:29 -0700 Subject: [PATCH 553/870] WIP --- Manipulators/BaseManipulator.cs | 50 +++++++++++++++++++++++++++++ Manipulators/ScaleManipulator.cs | 2 -- Manipulators/StandardManipulator.cs | 49 ++++++++++------------------ 3 files changed, 67 insertions(+), 34 deletions(-) diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index dd97f31c3..013ea3778 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -1,5 +1,7 @@ #if UNITY_EDITOR using System; +using System.Collections.Generic; +using UnityEditor.Experimental.EditorVR.Handles; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Manipulators @@ -8,6 +10,18 @@ class BaseManipulator : MonoBehaviour, IManipulator { protected const float k_BaseManipulatorSize = 0.3f; + [SerializeField] + protected List m_AllHandles; + + [SerializeField] + float m_LinearHandleScaleBump = 1.3f; + + [SerializeField] + float m_PlaneHandleScaleBump = 1.1f; + + [SerializeField] + float m_SphereHandleScaleBump = 1.1f; + public bool adjustScaleForCamera { get; set; } public Action translate { protected get; set; } @@ -18,10 +32,46 @@ class BaseManipulator : MonoBehaviour, IManipulator public event Action dragStarted; public event Action dragEnded; + readonly Dictionary m_ScaleBumps = new Dictionary(); + + void Awake() + { + m_ScaleBumps[typeof(LinearHandle)] = m_LinearHandleScaleBump; + m_ScaleBumps[typeof(PlaneHandle)] = m_LinearHandleScaleBump; + m_ScaleBumps[typeof(SphereHandle)] = m_LinearHandleScaleBump; + } + + protected virtual void OnHandleHoverStarted(BaseHandle handle, HandleEventData eventData, float scaleBump) + { + handle.transform.localScale *= scaleBump; + } + + protected virtual void OnHandleHovering(BaseHandle handle, HandleEventData eventData, float scaleBump) + { + + } + + void OnHoverEnded(BaseHandle handle, HandleEventData eventData, float scaleBump) + { + handle.transform.localScale /= scaleBump; + } + protected virtual void OnEnable() { if (adjustScaleForCamera) Camera.onPreRender += OnCameraPreRender; + + foreach (var h in m_AllHandles) { + SetUpHandle(h); + } + } + + protected virtual void SetUpHandle(BaseHandle handle) + { + handle.hoverStarted += + } + + protected virtual void TakeDownHandle(BaseHandle handle) { } protected virtual void OnDisable() diff --git a/Manipulators/ScaleManipulator.cs b/Manipulators/ScaleManipulator.cs index 1c8ab4279..ee17d7caf 100644 --- a/Manipulators/ScaleManipulator.cs +++ b/Manipulators/ScaleManipulator.cs @@ -13,8 +13,6 @@ sealed class ScaleManipulator : BaseManipulator [SerializeField] List m_AxesHandles; - readonly List m_AllHandles = new List(); - void Awake() { m_AllHandles.Add(m_UniformHandle); diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index e745eb5ad..22c37eddd 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -1,53 +1,38 @@ #if UNITY_EDITOR -using System; -using System.Collections.Generic; -using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Handles; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -namespace UnityEditor.Experimental.EditorVR.Manipulators -{ +namespace UnityEditor.Experimental.EditorVR.Manipulators { sealed class StandardManipulator : BaseManipulator { [SerializeField] Transform m_PlaneHandlesParent; - [SerializeField] - List m_AllHandles; - - protected override void OnEnable() + protected override void SetUpHandle(BaseHandle handle) { - base.OnEnable(); - - foreach (var h in m_AllHandles) - { - if (h is LinearHandle || h is PlaneHandle || h is SphereHandle) - h.dragging += OnTranslateDragging; + base.SetUpHandle(handle); + if (handle is LinearHandle || handle is PlaneHandle || handle is SphereHandle) + handle.dragging += OnTranslateDragging; - if (h is RadialHandle) - h.dragging += OnRotateDragging; + if (handle is RadialHandle) + handle.dragging += OnRotateDragging; - h.dragStarted += OnHandleDragStarted; - h.dragEnded += OnHandleDragEnded; - } + handle.dragStarted += OnHandleDragStarted; + handle.dragEnded += OnHandleDragEnded; } - protected override void OnDisable() + protected override void TakeDownHandle(BaseHandle handle) { - base.OnDisable(); + base.TakeDownHandle(handle); + if (handle is LinearHandle || handle is PlaneHandle || handle is SphereHandle) + handle.dragging -= OnTranslateDragging; - foreach (var h in m_AllHandles) - { - if (h is LinearHandle || h is PlaneHandle || h is SphereHandle) - h.dragging -= OnTranslateDragging; + if (handle is RadialHandle) + handle.dragging -= OnRotateDragging; - if (h is RadialHandle) - h.dragging -= OnRotateDragging; - - h.dragStarted -= OnHandleDragStarted; - h.dragEnded -= OnHandleDragEnded; - } + handle.dragStarted -= OnHandleDragStarted; + handle.dragEnded -= OnHandleDragEnded; } void Update() From 3b66df389b5299162a65d7384b780117d8968713 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 11 Jul 2017 16:52:08 -0700 Subject: [PATCH 554/870] Use BakeMesh to do collisions on skinned meshes; Try command buffer approach to render skinned outlines --- Scripts/Helpers/VRSmoothCamera.cs | 2 +- .../HighlightModule/HighlightModule.cs | 61 +++++++++++++++---- Scripts/Utilities/IntersectionUtils.cs | 6 +- 3 files changed, 54 insertions(+), 15 deletions(-) diff --git a/Scripts/Helpers/VRSmoothCamera.cs b/Scripts/Helpers/VRSmoothCamera.cs index 0d1f5f5ff..c088a7480 100644 --- a/Scripts/Helpers/VRSmoothCamera.cs +++ b/Scripts/Helpers/VRSmoothCamera.cs @@ -73,7 +73,7 @@ void LateUpdate() m_SmoothCamera.targetTexture = m_RenderTexture; m_SmoothCamera.targetDisplay = m_TargetDisplay; m_SmoothCamera.cameraType = CameraType.Game; - m_SmoothCamera.cullingMask &= ~hmdOnlyLayerMask; + //m_SmoothCamera.cullingMask &= ~hmdOnlyLayerMask; m_SmoothCamera.rect = new Rect(0f, 0f, 1f, 1f); m_SmoothCamera.stereoTargetEye = StereoTargetEyeMask.None; m_SmoothCamera.fieldOfView = m_FieldOfView; diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs b/Scripts/Modules/HighlightModule/HighlightModule.cs index 19ff698bb..276399042 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; +using UnityEngine.Rendering; namespace UnityEditor.Experimental.EditorVR.Modules { @@ -19,6 +20,7 @@ sealed class HighlightModule : MonoBehaviour, IUsesGameObjectLocking readonly Dictionary> m_Highlights = new Dictionary>(); readonly Dictionary> m_NodeMap = new Dictionary>(); + readonly Dictionary m_CommandBuffers = new Dictionary(); public event Func customHighlight { @@ -37,8 +39,31 @@ public Color rightColor get { return m_RightHighlightMaterial.color; } } + void OnEnable() + { + foreach (var currentCamera in Resources.FindObjectsOfTypeAll()) + { + var buffer = new CommandBuffer(); + currentCamera.AddCommandBuffer(CameraEvent.AfterForwardAlpha, buffer); + m_CommandBuffers[currentCamera] = buffer; + } + } + + void OnDisable() + { + foreach (var kvp in m_CommandBuffers) { + kvp.Key.RemoveCommandBuffer(CameraEvent.AfterForwardOpaque, kvp.Value); + } + m_CommandBuffers.Clear(); + } + void LateUpdate() { + foreach (var kvp in m_CommandBuffers) + { + kvp.Value.Clear(); + } + foreach (var highlight in m_Highlights) { var material = highlight.Key; @@ -62,24 +87,34 @@ void LateUpdate() } } - static void HighlightObject(GameObject go, Material material) + void HighlightObject(GameObject go, Material material) { - foreach (var m in go.GetComponentsInChildren()) - { - if (m.sharedMesh == null) - continue; + //foreach (var m in go.GetComponentsInChildren()) + //{ + // if (m.sharedMesh == null) + // continue; - for (var i = 0; i < m.sharedMesh.subMeshCount; i++) - Graphics.DrawMesh(m.sharedMesh, m.transform.localToWorldMatrix, material, m.gameObject.layer, null, i); - } + // for (var i = 0; i < m.sharedMesh.subMeshCount; i++) + // Graphics.DrawMesh(m.sharedMesh, m.transform.localToWorldMatrix, material, m.gameObject.layer, null, i); + //} - foreach (var m in go.GetComponentsInChildren()) + foreach (var kvp in m_CommandBuffers) { - if (m.sharedMesh == null) - continue; + var buffer = kvp.Value; + foreach (var m in go.GetComponentsInChildren()) + { + //if (m.sharedMesh == null) + // continue; - for (var i = 0; i < m.sharedMesh.subMeshCount; i++) - Graphics.DrawMesh(m.sharedMesh, m.transform.localToWorldMatrix, material, m.gameObject.layer, null, i); + //s_CommandBuffer.Clear(); + //s_CommandBuffer.SetRenderTarget(RenderTexture.active); + //Debug.Log(m + ", " + m.gameObject.hideFlags); + buffer.DrawRenderer(m, material); + Graphics.ExecuteCommandBuffer(buffer); + + //for (var i = 0; i < m.sharedMesh.subMeshCount; i++) + // Graphics.DrawMesh(m.sharedMesh, m.transform.localToWorldMatrix, material, m.gameObject.layer, null, i); + } } } diff --git a/Scripts/Utilities/IntersectionUtils.cs b/Scripts/Utilities/IntersectionUtils.cs index 5e6ef31ce..dad489355 100644 --- a/Scripts/Utilities/IntersectionUtils.cs +++ b/Scripts/Utilities/IntersectionUtils.cs @@ -8,6 +8,7 @@ static class IntersectionUtils { // Local method use only -- created here to reduce garbage collection static readonly Vector3[] s_TriangleVertices = new Vector3[3]; + static Mesh s_BakedMesh = new Mesh(); /// /// Test whether an object collides with the tester @@ -190,7 +191,10 @@ public static void SetupCollisionTester(MeshCollider collisionTester, Transform { var smr = obj.GetComponent(); if (smr) - collisionTester.sharedMesh = smr.sharedMesh; + { + smr.BakeMesh(s_BakedMesh); + collisionTester.sharedMesh = s_BakedMesh; + } } } } From d49a766a9cf268ba1f3dce6e8515c0b729eaccf5 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 11 Jul 2017 17:07:33 -0700 Subject: [PATCH 555/870] Clean up code; Revert to using BakeMesh in HighlightModule because of error spam on highlighting player head using command buffer approach --- Scripts/Helpers/VRSmoothCamera.cs | 2 +- .../HighlightModule/HighlightModule.cs | 72 +++++++------------ Scripts/Modules/SpatialHashModule.cs | 6 +- Scripts/Utilities/IntersectionUtils.cs | 18 ++--- 4 files changed, 41 insertions(+), 57 deletions(-) diff --git a/Scripts/Helpers/VRSmoothCamera.cs b/Scripts/Helpers/VRSmoothCamera.cs index c088a7480..0d1f5f5ff 100644 --- a/Scripts/Helpers/VRSmoothCamera.cs +++ b/Scripts/Helpers/VRSmoothCamera.cs @@ -73,7 +73,7 @@ void LateUpdate() m_SmoothCamera.targetTexture = m_RenderTexture; m_SmoothCamera.targetDisplay = m_TargetDisplay; m_SmoothCamera.cameraType = CameraType.Game; - //m_SmoothCamera.cullingMask &= ~hmdOnlyLayerMask; + m_SmoothCamera.cullingMask &= ~hmdOnlyLayerMask; m_SmoothCamera.rect = new Rect(0f, 0f, 1f, 1f); m_SmoothCamera.stereoTargetEye = StereoTargetEyeMask.None; m_SmoothCamera.fieldOfView = m_FieldOfView; diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs b/Scripts/Modules/HighlightModule/HighlightModule.cs index 276399042..cc4b695e0 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -3,10 +3,8 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -using UnityEngine.Rendering; -namespace UnityEditor.Experimental.EditorVR.Modules -{ +namespace UnityEditor.Experimental.EditorVR.Modules { sealed class HighlightModule : MonoBehaviour, IUsesGameObjectLocking { [SerializeField] @@ -20,7 +18,8 @@ sealed class HighlightModule : MonoBehaviour, IUsesGameObjectLocking readonly Dictionary> m_Highlights = new Dictionary>(); readonly Dictionary> m_NodeMap = new Dictionary>(); - readonly Dictionary m_CommandBuffers = new Dictionary(); + + static Mesh s_BakedMesh; public event Func customHighlight { @@ -39,31 +38,13 @@ public Color rightColor get { return m_RightHighlightMaterial.color; } } - void OnEnable() - { - foreach (var currentCamera in Resources.FindObjectsOfTypeAll()) - { - var buffer = new CommandBuffer(); - currentCamera.AddCommandBuffer(CameraEvent.AfterForwardAlpha, buffer); - m_CommandBuffers[currentCamera] = buffer; - } - } - - void OnDisable() + void Awake() { - foreach (var kvp in m_CommandBuffers) { - kvp.Key.RemoveCommandBuffer(CameraEvent.AfterForwardOpaque, kvp.Value); - } - m_CommandBuffers.Clear(); + s_BakedMesh = new Mesh(); } void LateUpdate() { - foreach (var kvp in m_CommandBuffers) - { - kvp.Value.Clear(); - } - foreach (var highlight in m_Highlights) { var material = highlight.Key; @@ -87,33 +68,34 @@ void LateUpdate() } } - void HighlightObject(GameObject go, Material material) + static void HighlightObject(GameObject go, Material material) { - //foreach (var m in go.GetComponentsInChildren()) - //{ - // if (m.sharedMesh == null) - // continue; + foreach (var meshFilter in go.GetComponentsInChildren()) + { + var mesh = meshFilter.sharedMesh; + if (meshFilter.sharedMesh == null) + continue; - // for (var i = 0; i < m.sharedMesh.subMeshCount; i++) - // Graphics.DrawMesh(m.sharedMesh, m.transform.localToWorldMatrix, material, m.gameObject.layer, null, i); - //} + var localToWorldMatrix = meshFilter.transform.localToWorldMatrix; + var layer = meshFilter.gameObject.layer; + for (var i = 0; i < meshFilter.sharedMesh.subMeshCount; i++) + { + Graphics.DrawMesh(mesh, localToWorldMatrix, material, layer, null, i); + } + } - foreach (var kvp in m_CommandBuffers) + foreach (var skinnedMeshRenderer in go.GetComponentsInChildren()) { - var buffer = kvp.Value; - foreach (var m in go.GetComponentsInChildren()) - { - //if (m.sharedMesh == null) - // continue; + if (skinnedMeshRenderer.sharedMesh == null) + continue; - //s_CommandBuffer.Clear(); - //s_CommandBuffer.SetRenderTarget(RenderTexture.active); - //Debug.Log(m + ", " + m.gameObject.hideFlags); - buffer.DrawRenderer(m, material); - Graphics.ExecuteCommandBuffer(buffer); + skinnedMeshRenderer.BakeMesh(s_BakedMesh); - //for (var i = 0; i < m.sharedMesh.subMeshCount; i++) - // Graphics.DrawMesh(m.sharedMesh, m.transform.localToWorldMatrix, material, m.gameObject.layer, null, i); + var localToWorldMatrix = skinnedMeshRenderer.transform.localToWorldMatrix; + var layer = skinnedMeshRenderer.gameObject.layer; + for (var i = 0; i < s_BakedMesh.subMeshCount; i++) + { + Graphics.DrawMesh(s_BakedMesh, localToWorldMatrix, material, layer, null, i); } } } diff --git a/Scripts/Modules/SpatialHashModule.cs b/Scripts/Modules/SpatialHashModule.cs index b42406614..53645d0cb 100644 --- a/Scripts/Modules/SpatialHashModule.cs +++ b/Scripts/Modules/SpatialHashModule.cs @@ -42,8 +42,10 @@ void SetupObjects() } var skinnedMeshRenderers = FindObjectsOfType(); - foreach (var skinnedMeshRenderer in skinnedMeshRenderers) { - if (skinnedMeshRenderer.sharedMesh) { + foreach (var skinnedMeshRenderer in skinnedMeshRenderers) + { + if (skinnedMeshRenderer.sharedMesh) + { if (shouldExcludeObject != null && shouldExcludeObject(skinnedMeshRenderer.gameObject)) continue; diff --git a/Scripts/Utilities/IntersectionUtils.cs b/Scripts/Utilities/IntersectionUtils.cs index dad489355..5ac9a4d73 100644 --- a/Scripts/Utilities/IntersectionUtils.cs +++ b/Scripts/Utilities/IntersectionUtils.cs @@ -7,8 +7,8 @@ namespace UnityEditor.Experimental.EditorVR.Utilities static class IntersectionUtils { // Local method use only -- created here to reduce garbage collection - static readonly Vector3[] s_TriangleVertices = new Vector3[3]; - static Mesh s_BakedMesh = new Mesh(); + static readonly Vector3[] k_TriangleVertices = new Vector3[3]; + static readonly Mesh k_BakedMesh = new Mesh(); /// /// Test whether an object collides with the tester @@ -58,16 +58,16 @@ public static bool TestEdges(MeshCollider collisionTester, Transform obj, Inters var testerTransform = tester.transform; for (var i = 0; i < triangles.Length; i += 3) { - s_TriangleVertices[0] = vertices[triangles[i]]; - s_TriangleVertices[1] = vertices[triangles[i + 1]]; - s_TriangleVertices[2] = vertices[triangles[i + 2]]; + k_TriangleVertices[0] = vertices[triangles[i]]; + k_TriangleVertices[1] = vertices[triangles[i + 1]]; + k_TriangleVertices[2] = vertices[triangles[i + 2]]; for (var j = 0; j < 3; j++) { RaycastHit hitInfo; - var start = obj.InverseTransformPoint(testerTransform.TransformPoint(s_TriangleVertices[j])); - var end = obj.InverseTransformPoint(testerTransform.TransformPoint(s_TriangleVertices[(j + 1) % 3])); + var start = obj.InverseTransformPoint(testerTransform.TransformPoint(k_TriangleVertices[j])); + var end = obj.InverseTransformPoint(testerTransform.TransformPoint(k_TriangleVertices[(j + 1) % 3])); var edge = end - start; var maxDistance = Mathf.Max(edge.magnitude, boundsMagnitude); var direction = edge.normalized; @@ -192,8 +192,8 @@ public static void SetupCollisionTester(MeshCollider collisionTester, Transform var smr = obj.GetComponent(); if (smr) { - smr.BakeMesh(s_BakedMesh); - collisionTester.sharedMesh = s_BakedMesh; + smr.BakeMesh(k_BakedMesh); + collisionTester.sharedMesh = k_BakedMesh; } } } From d49653ba523abf3d75a6064c8ab593f1473b1f90 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 11 Jul 2017 17:22:19 -0700 Subject: [PATCH 556/870] Move additional spatial select/highlight logic out of PinnedToolsMenu & PinnedToolsMenuUI --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 8 +++--- .../Scripts/PinnedToolsMenuUI.cs | 18 +++++++++--- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 28 +++++++++++++++---- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 275fc2775..bb8c5fe3c 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -3,9 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Security.Cryptography.X509Certificates; using System.Text; -using NUnit.Framework.Internal.Filters; using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; @@ -242,7 +240,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon Debug.LogError("Start position : " + m_SpatialScrollStartPosition + ""); allowSpatialScrollBeforeThisTime = Time.realtimeSinceStartup + kAutoHideDuration; allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; - m_PinnedToolsMenuUI.spatialDragDistance = 0f; // Triggers the display of the directional hint arrows + m_PinnedToolsMenuUI.beginningSpatialScrolling = true; // Triggers the display of the directional hint arrows //Dont show if the user hasnt passed the threshold in the given duration } @@ -302,8 +300,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon allowSpatialScrollBeforeThisTime = null; if (spatialDirection != null) { + Debug.LogWarning("PinnedToolButton was just released"); m_PinnedToolsMenuUI.SelectHighlightedButton(); - m_PinnedToolsMenuUI.spatialDragDistance = 0f; // Triggers the display of the directional hint arrows + //m_PinnedToolsMenuUI.spatialDragDistance = 0f; // Triggers the display of the directional hint arrows spatialDirection = null; consumeControl(pinnedToolInput.select); this.Pulse(node, m_HidingPulse); @@ -333,6 +332,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, { var newDirectionVectorThreshold = 0.0175f * this.GetViewerScale(); // Initial magnitude beyond which spatial scrolling will be evaluated var dragAmount = Vector3.Magnitude(directionVector); + Debug.LogWarning("spatial Direction is NULL - setting new one in pricessSpatialScrolling"); m_PinnedToolsMenuUI.spatialDragDistance = dragAmount > 0 ? dragAmount / newDirectionVectorThreshold : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred if (dragAmount > newDirectionVectorThreshold) { diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index d29c720b1..5188ecfbf 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -71,6 +71,7 @@ public bool allButtonsVisible m_SpatialHintUI.preScrollVisualsVisible = false; m_SpatialHintUI.primaryArrowsVisible = false; + m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; } } } @@ -100,12 +101,13 @@ public bool spatialScrollVisualsVisible } } - public float spatialDragDistance + public bool beginningSpatialScrolling { set { - if (Mathf.Approximately(value, 0f)) + if (value) { + Debug.LogWarning("SETTING Spatial Drag Distance : " + value); m_SpatialDragDistance = 0f; m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; var currentRotation = transform.rotation.eulerAngles; @@ -114,7 +116,13 @@ public float spatialDragDistance m_HintContentWorldPosition = transform.position; m_SpatialHintContentContainer.position = m_HintContentWorldPosition; } + } + } + public float spatialDragDistance + { + set + { m_SpatialDragDistance = value; //m_SpatialScrollOrientation = transform.rotation; } @@ -188,7 +196,7 @@ void Update() newHintContainerRotation = m_HintContentContainerCurrentRotation; */ } - else if (m_SpatialDragDistance > 2) + else if (m_AllButtonsVisible && m_SpatialDragDistance > 2) { m_SpatialHintUI.scrollVisualsRotation = m_DragTarget; } @@ -206,7 +214,7 @@ void Update() //Debug.LogError("UI" + transform.rotation); m_SpatialHintContentContainer.rotation = newHintContainerRotation; - m_SpatialHintContentContainer.position = m_HintContentWorldPosition; + //m_SpatialHintContentContainer.position = m_HintContentWorldPosition; //Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); } @@ -455,6 +463,8 @@ public void SelectHighlightedButton() if (buttonClicked != null) buttonClicked(); + m_SpatialHintUI.visible = false; + return; } } diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index eb7216e2b..854471470 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -39,7 +39,7 @@ public class SpatialHintUI : MonoBehaviour, IUsesViewerScale Coroutine m_ScrollVisualsVisibilityCoroutine; Coroutine m_VisibilityCoroutine; - public bool vislble + public bool visible { set { @@ -66,6 +66,8 @@ public bool vislble { arrow.visible = false; } + + scrollVisualsRotation = Vector3.zero; } } } @@ -79,7 +81,6 @@ public bool preScrollVisualsVisible set { transform.localScale = Vector3.one * this.GetViewerScale(); - Debug.LogError("Spatial Hint Viewer Scale : " + this.GetViewerScale()); this.RestartCoroutine(ref m_VisibilityCoroutine, value ? AnimateShow() : AnimateHide()); @@ -117,6 +118,17 @@ public bool primaryArrowsVisible } } + public bool secondaryArrowsVisible + { + set + { + foreach (var arrow in m_SecondaryDirectionalHintArrows) + { + arrow.visible = value; + } + } + } + /// /// If non-null, enable and set the world rotation of the scroll visuals /// @@ -134,7 +146,10 @@ public Vector3 scrollVisualsRotation m_ScrollVisualsRotation = value; if (m_ScrollVisualsRotation != Vector3.zero) { - this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, ShowScrollVisuals()); + Debug.LogError("scrollVisualsRotation was set to a Vec3 non-zero value' beginning showing of scroll visuals : " + m_ScrollVisualsRotation); + + if (m_ScrollVisualsVisibilityCoroutine == null) + this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, ShowScrollVisuals()); } else { @@ -200,7 +215,8 @@ IEnumerator ShowScrollVisuals() Debug.LogError("SHOWING SPATIAL SCROLL VISUALS : viewscale is " + this.GetViewerScale()); // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector m_ScrollVisualsGameObject.SetActive(true); - vislble = false; + primaryArrowsVisible = false; + secondaryArrowsVisible = false; m_ScrollVisualsTransform.localScale = Vector3.one; m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. m_ScrollVisualsCanvasGroup.alpha = 1f; // remove @@ -224,6 +240,7 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsDragTargetArrow.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); currentDuration += Time.unscaledDeltaTime * 2f; + m_ScrollVisualsVisibilityCoroutine = null; yield return null; } @@ -246,13 +263,14 @@ IEnumerator HideScrollVisuals() m_ScrollVisualsTransform.localScale = Vector3.Lerp(currentLocalScale, hiddenLocalScale, shapedDuration); m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 0f, shapedDuration); //m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); - currentDuration += Time.unscaledDeltaTime * 2f; + currentDuration += Time.unscaledDeltaTime * 3.5f; yield return null; } m_ScrollVisualsCanvasGroup.alpha = 0; m_ScrollVisualsTransform.localScale = hiddenLocalScale; //m_ScrollVisualsTransform.localRotation = Quaternion.identity; + m_ScrollVisualsVisibilityCoroutine = null; m_ScrollVisualsGameObject.SetActive(false); } } From 8caea86e0ce3f59cab45d844df6f95cd17356387 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 11 Jul 2017 17:33:56 -0700 Subject: [PATCH 557/870] Use serializedObjects in HapticPulsesEditor for Undo/Redo --- Editor/HapticPulsesEditor.cs | 64 +++++++++++++++----- Scripts/Modules/HapticsModule/HapticPulse.cs | 4 +- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/Editor/HapticPulsesEditor.cs b/Editor/HapticPulsesEditor.cs index 58e690553..ce8b0b3b9 100644 --- a/Editor/HapticPulsesEditor.cs +++ b/Editor/HapticPulsesEditor.cs @@ -6,7 +6,15 @@ namespace UnityEditor.Experimental.EditorVR.UI { sealed class HapticPulseEditor : EditorWindow { - readonly List m_HapticPulses = new List(); + class Pulse + { + public HapticPulse pulse; + public SerializedObject serializedObject; + public SerializedProperty duration; + public SerializedProperty intensity; + } + + readonly List m_HapticPulses = new List(); Vector2 m_Scroll; float m_Multiplier = 1; @@ -18,17 +26,38 @@ static void Init() } void OnEnable() + { + Reset(); + + Undo.undoRedoPerformed += OnUndoRedo; + } + + void Reset() { m_HapticPulses.Clear(); var pulses = AssetDatabase.FindAssets("t:HapticPulse"); - foreach (var pulse in pulses) + foreach (var guid in pulses) { - var asset = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(pulse)); - if (asset) - m_HapticPulses.Add(asset); + var pulse = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid)); + if (pulse) + { + var serializedObject = new SerializedObject(pulse); + m_HapticPulses.Add(new Pulse + { + pulse = pulse, + serializedObject = serializedObject, + duration = serializedObject.FindProperty("m_Duration"), + intensity = serializedObject.FindProperty("m_Intensity") + }); + } } } + void OnDisable() + { + Undo.undoRedoPerformed -= OnUndoRedo; + } + void OnGUI() { const float nameColumnWidth = 250f; @@ -42,8 +71,8 @@ void OnGUI() { foreach (var pulse in m_HapticPulses) { - pulse.intensity *= m_Multiplier; - EditorUtility.SetDirty(pulse); + pulse.intensity.floatValue *= m_Multiplier; + pulse.serializedObject.ApplyModifiedProperties(); } } @@ -51,8 +80,8 @@ void OnGUI() { foreach (var pulse in m_HapticPulses) { - pulse.duration *= m_Multiplier; - EditorUtility.SetDirty(pulse); + pulse.duration.floatValue *= m_Multiplier; + pulse.serializedObject.ApplyModifiedProperties(); } } GUILayout.EndHorizontal(); @@ -66,19 +95,26 @@ void OnGUI() foreach (var pulse in m_HapticPulses) { GUILayout.BeginHorizontal(); - EditorGUILayout.ObjectField(pulse, typeof(HapticPulse), false, GUILayout.Width(nameColumnWidth)); + EditorGUILayout.ObjectField(pulse.pulse, typeof(HapticPulse), false, GUILayout.Width(nameColumnWidth)); EditorGUI.BeginChangeCheck(); - pulse.duration = EditorGUILayout.FloatField(pulse.duration, GUILayout.Width(durationColumnWidth)); - pulse.intensity = GUILayout.HorizontalSlider(pulse.intensity, 0, 1); - pulse.intensity = EditorGUILayout.FloatField(pulse.intensity, GUILayout.Width(durationColumnWidth)); + pulse.duration.floatValue = EditorGUILayout.FloatField(pulse.duration.floatValue, GUILayout.Width(durationColumnWidth)); + pulse.intensity.floatValue = GUILayout.HorizontalSlider(pulse.intensity.floatValue, 0, 1); + pulse.intensity.floatValue = EditorGUILayout.FloatField(pulse.intensity.floatValue, GUILayout.Width(durationColumnWidth)); if (EditorGUI.EndChangeCheck()) { - EditorUtility.SetDirty(pulse); + pulse.serializedObject.ApplyModifiedProperties(); } + GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } + + void OnUndoRedo() + { + Reset(); + Repaint(); + } } } diff --git a/Scripts/Modules/HapticsModule/HapticPulse.cs b/Scripts/Modules/HapticsModule/HapticPulse.cs index ae9cfa01a..32621b52c 100644 --- a/Scripts/Modules/HapticsModule/HapticPulse.cs +++ b/Scripts/Modules/HapticsModule/HapticPulse.cs @@ -15,10 +15,10 @@ public class HapticPulse : ScriptableObject float m_Intensity = 1f; [SerializeField] - bool m_FadeIn = false; + bool m_FadeIn; [SerializeField] - bool m_FadeOut = false; + bool m_FadeOut; // Don't allow public setting of value; use inspector-set values public float duration { get { return m_Duration; } internal set { m_Duration = value; } } From bbb9bd6b48b8589895bc416b80760b0aec67bc87 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 12 Jul 2017 11:13:34 -0700 Subject: [PATCH 558/870] Add pulse preview button; Add ctrl+w to close HapitcPulsesEditor and TooltipsEditor; Add reset/repaint on project change to reflect new/deleted assets --- Editor/HapticPulsesEditor.cs | 24 +++++++++++++++++++ Editor/TooltipsEditor.cs | 5 ++++ .../MainMenuFaceRotationPulse.asset | 2 +- .../HapticPulses/MainMenuHidePulse.asset | 2 +- .../HapticPulses/MainMenuShowPulse.asset | 2 +- .../PinnedToolButtonClickPulse.asset | 2 +- .../PinnedToolButtonHoverPulse.asset | 2 +- .../RadialMenuButtonClickedPulse.asset | 2 +- .../RadialMenuButtonHoverPulse.asset | 2 +- .../RadialMenuButtonReleasePulse.asset | 2 +- .../HapticPulses/ListViewScrollPulse.asset | 2 +- .../SelectionModuleHoverPulse.asset | 2 +- .../HapticPulses/TransformToolDragPulse.asset | 2 +- .../TransformToolRotatePulse.asset | 2 +- .../WorkspaceFrameHoverPulse.asset | 2 +- .../HapticPulses/WorkspaceResizePulse.asset | 2 +- 16 files changed, 43 insertions(+), 14 deletions(-) diff --git a/Editor/HapticPulsesEditor.cs b/Editor/HapticPulsesEditor.cs index ce8b0b3b9..6ad3e8b4b 100644 --- a/Editor/HapticPulsesEditor.cs +++ b/Editor/HapticPulsesEditor.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; +using UnityEditor.Experimental.EditorVR.Modules; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.UI @@ -19,6 +21,8 @@ class Pulse Vector2 m_Scroll; float m_Multiplier = 1; + HapticsModule m_HapticsModule; + [MenuItem("Edit/Project Settings/EditorVR/Haptic Pulses")] static void Init() { @@ -29,6 +33,10 @@ void OnEnable() { Reset(); + m_HapticsModule = ObjectUtils.CreateGameObjectWithComponent(); + m_HapticsModule.name = "Haptics Module"; + m_HapticsModule.gameObject.hideFlags = HideFlags.HideAndDontSave; + Undo.undoRedoPerformed += OnUndoRedo; } @@ -55,13 +63,20 @@ void Reset() void OnDisable() { + ObjectUtils.Destroy(m_HapticsModule.gameObject); Undo.undoRedoPerformed -= OnUndoRedo; } void OnGUI() { + if (Event.current.Equals(Event.KeyboardEvent("^w"))) { + Close(); + GUIUtility.ExitGUI(); + } + const float nameColumnWidth = 250f; const float durationColumnWidth = 60f; + const float previewColumnWidth = 80f; m_Scroll = GUILayout.BeginScrollView(m_Scroll); @@ -105,6 +120,9 @@ void OnGUI() pulse.serializedObject.ApplyModifiedProperties(); } + if (GUILayout.Button("Preview", GUILayout.Width(previewColumnWidth))) + m_HapticsModule.Pulse(Node.LeftHand, pulse.pulse); + GUILayout.EndHorizontal(); } @@ -116,5 +134,11 @@ void OnUndoRedo() Reset(); Repaint(); } + + void OnProjectChange() + { + Reset(); + Repaint(); + } } } diff --git a/Editor/TooltipsEditor.cs b/Editor/TooltipsEditor.cs index 588aa3ddf..c1d6188cd 100644 --- a/Editor/TooltipsEditor.cs +++ b/Editor/TooltipsEditor.cs @@ -67,6 +67,11 @@ void CollectTooltipAttributes(Type type) void OnGUI() { + if (Event.current.Equals(Event.KeyboardEvent("^w"))) { + Close(); + GUIUtility.ExitGUI(); + } + const float columnWidth = 250f; EditorGUIUtility.labelWidth = columnWidth; diff --git a/Menus/MainMenu/HapticPulses/MainMenuFaceRotationPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuFaceRotationPulse.asset index 271a57e73..ec9184c9a 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuFaceRotationPulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuFaceRotationPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: FaceRotationPulse + m_Name: MainMenuFaceRotationPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.22 diff --git a/Menus/MainMenu/HapticPulses/MainMenuHidePulse.asset b/Menus/MainMenu/HapticPulses/MainMenuHidePulse.asset index 1eec78985..15caf1180 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuHidePulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuHidePulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: HideMenuPulse + m_Name: MainMenuHidePulse m_EditorClassIdentifier: m_Duration: 0.75 m_Intensity: 0.2 diff --git a/Menus/MainMenu/HapticPulses/MainMenuShowPulse.asset b/Menus/MainMenu/HapticPulses/MainMenuShowPulse.asset index f6800cc77..c62143de4 100644 --- a/Menus/MainMenu/HapticPulses/MainMenuShowPulse.asset +++ b/Menus/MainMenu/HapticPulses/MainMenuShowPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ShowMenuPulse + m_Name: MainMenuShowPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.3 diff --git a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset b/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset index e63620e33..d87d71643 100644 --- a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset +++ b/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ClickPulse + m_Name: PinnedToolButtonClickPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.6 diff --git a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset b/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset index a691b68a8..f7f7376df 100644 --- a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset +++ b/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: HoverPulse + m_Name: PinnedToolButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 m_Intensity: 0.6 diff --git a/Menus/RadialMenu/HapticPulses/RadialMenuButtonClickedPulse.asset b/Menus/RadialMenu/HapticPulses/RadialMenuButtonClickedPulse.asset index 33591d18a..20d93807f 100644 --- a/Menus/RadialMenu/HapticPulses/RadialMenuButtonClickedPulse.asset +++ b/Menus/RadialMenu/HapticPulses/RadialMenuButtonClickedPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ButtonClickedPulse + m_Name: RadialMenuButtonClickedPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.4 diff --git a/Menus/RadialMenu/HapticPulses/RadialMenuButtonHoverPulse.asset b/Menus/RadialMenu/HapticPulses/RadialMenuButtonHoverPulse.asset index ab9b2cfae..36c84e884 100644 --- a/Menus/RadialMenu/HapticPulses/RadialMenuButtonHoverPulse.asset +++ b/Menus/RadialMenu/HapticPulses/RadialMenuButtonHoverPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ButtonHoverPulse + m_Name: RadialMenuButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 m_Intensity: 0.8 diff --git a/Menus/RadialMenu/HapticPulses/RadialMenuButtonReleasePulse.asset b/Menus/RadialMenu/HapticPulses/RadialMenuButtonReleasePulse.asset index 927294cc3..c3b134da0 100644 --- a/Menus/RadialMenu/HapticPulses/RadialMenuButtonReleasePulse.asset +++ b/Menus/RadialMenu/HapticPulses/RadialMenuButtonReleasePulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ReleasePulse + m_Name: RadialMenuButtonReleasePulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.4 diff --git a/Scripts/ListView/HapticPulses/ListViewScrollPulse.asset b/Scripts/ListView/HapticPulses/ListViewScrollPulse.asset index b4bc52ee4..99f83abbb 100644 --- a/Scripts/ListView/HapticPulses/ListViewScrollPulse.asset +++ b/Scripts/ListView/HapticPulses/ListViewScrollPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ScrollPulse + m_Name: ListViewScrollPulse m_EditorClassIdentifier: m_Duration: 0.15 m_Intensity: 0.15 diff --git a/Scripts/Modules/SelectionModule/HapticPulses/SelectionModuleHoverPulse.asset b/Scripts/Modules/SelectionModule/HapticPulses/SelectionModuleHoverPulse.asset index dbe82a114..019068bfe 100644 --- a/Scripts/Modules/SelectionModule/HapticPulses/SelectionModuleHoverPulse.asset +++ b/Scripts/Modules/SelectionModule/HapticPulses/SelectionModuleHoverPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: HoverPulse + m_Name: SelectionModuleHoverPulse m_EditorClassIdentifier: m_Duration: 0.3 m_Intensity: 0.15 diff --git a/Tools/TransformTool/HapticPulses/TransformToolDragPulse.asset b/Tools/TransformTool/HapticPulses/TransformToolDragPulse.asset index 81c9f1f70..c2a815781 100644 --- a/Tools/TransformTool/HapticPulses/TransformToolDragPulse.asset +++ b/Tools/TransformTool/HapticPulses/TransformToolDragPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: DragPulse + m_Name: TransformToolDragPulse m_EditorClassIdentifier: m_Duration: 0.2 m_Intensity: 0.4 diff --git a/Tools/TransformTool/HapticPulses/TransformToolRotatePulse.asset b/Tools/TransformTool/HapticPulses/TransformToolRotatePulse.asset index 977027c45..75430372f 100644 --- a/Tools/TransformTool/HapticPulses/TransformToolRotatePulse.asset +++ b/Tools/TransformTool/HapticPulses/TransformToolRotatePulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: RotatePulse + m_Name: TransformToolRotatePulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 0.6 diff --git a/Workspaces/Base/HapticPulses/WorkspaceFrameHoverPulse.asset b/Workspaces/Base/HapticPulses/WorkspaceFrameHoverPulse.asset index 61e4ee0f6..8fdf51cff 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceFrameHoverPulse.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceFrameHoverPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: FrameHoverPulse + m_Name: WorkspaceFrameHoverPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.6 diff --git a/Workspaces/Base/HapticPulses/WorkspaceResizePulse.asset b/Workspaces/Base/HapticPulses/WorkspaceResizePulse.asset index ac028edcf..f5a83a86e 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceResizePulse.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceResizePulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ResizePulse + m_Name: WorkspaceResizePulse m_EditorClassIdentifier: m_Duration: 0.2 m_Intensity: 0.35 From 45dda812ac53977c7bf0390769d736a027550442 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 12 Jul 2017 11:16:32 -0700 Subject: [PATCH 559/870] Remove preview button because it does not work and causes errors; Fix conventions --- Editor/HapticPulsesEditor.cs | 18 ++---------------- Editor/TooltipsEditor.cs | 3 ++- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/Editor/HapticPulsesEditor.cs b/Editor/HapticPulsesEditor.cs index 6ad3e8b4b..becfc22f0 100644 --- a/Editor/HapticPulsesEditor.cs +++ b/Editor/HapticPulsesEditor.cs @@ -1,7 +1,5 @@ using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; -using UnityEditor.Experimental.EditorVR.Modules; -using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.UI @@ -21,8 +19,6 @@ class Pulse Vector2 m_Scroll; float m_Multiplier = 1; - HapticsModule m_HapticsModule; - [MenuItem("Edit/Project Settings/EditorVR/Haptic Pulses")] static void Init() { @@ -33,10 +29,6 @@ void OnEnable() { Reset(); - m_HapticsModule = ObjectUtils.CreateGameObjectWithComponent(); - m_HapticsModule.name = "Haptics Module"; - m_HapticsModule.gameObject.hideFlags = HideFlags.HideAndDontSave; - Undo.undoRedoPerformed += OnUndoRedo; } @@ -63,20 +55,19 @@ void Reset() void OnDisable() { - ObjectUtils.Destroy(m_HapticsModule.gameObject); Undo.undoRedoPerformed -= OnUndoRedo; } void OnGUI() { - if (Event.current.Equals(Event.KeyboardEvent("^w"))) { + if (Event.current.Equals(Event.KeyboardEvent("^w"))) + { Close(); GUIUtility.ExitGUI(); } const float nameColumnWidth = 250f; const float durationColumnWidth = 60f; - const float previewColumnWidth = 80f; m_Scroll = GUILayout.BeginScrollView(m_Scroll); @@ -116,12 +107,7 @@ void OnGUI() pulse.intensity.floatValue = GUILayout.HorizontalSlider(pulse.intensity.floatValue, 0, 1); pulse.intensity.floatValue = EditorGUILayout.FloatField(pulse.intensity.floatValue, GUILayout.Width(durationColumnWidth)); if (EditorGUI.EndChangeCheck()) - { pulse.serializedObject.ApplyModifiedProperties(); - } - - if (GUILayout.Button("Preview", GUILayout.Width(previewColumnWidth))) - m_HapticsModule.Pulse(Node.LeftHand, pulse.pulse); GUILayout.EndHorizontal(); } diff --git a/Editor/TooltipsEditor.cs b/Editor/TooltipsEditor.cs index c1d6188cd..304391ea9 100644 --- a/Editor/TooltipsEditor.cs +++ b/Editor/TooltipsEditor.cs @@ -67,7 +67,8 @@ void CollectTooltipAttributes(Type type) void OnGUI() { - if (Event.current.Equals(Event.KeyboardEvent("^w"))) { + if (Event.current.Equals(Event.KeyboardEvent("^w"))) + { Close(); GUIUtility.ExitGUI(); } From 7cae2eb451369860a091fcdc309c7c99e1be4a37 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Jul 2017 12:55:53 -0700 Subject: [PATCH 560/870] Hide Spatial Scroll Hint arrows after selecting new tool --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 4 +++- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 5188ecfbf..dfa5d002a 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -57,6 +57,7 @@ public bool allButtonsVisible set { m_AllButtonsVisible = value; + Debug.LogError("AllButtonsVisible set to : " + value); if (m_AllButtonsVisible) { @@ -65,8 +66,8 @@ public bool allButtonsVisible } else { - Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); //this.Pulse(rayOrigin, 0.5f, 0.065f, false, true); + //spatialDragDistance = 0f; ShowOnlyMenuAndActiveToolButtons(); m_SpatialHintUI.preScrollVisualsVisible = false; @@ -463,6 +464,7 @@ public void SelectHighlightedButton() if (buttonClicked != null) buttonClicked(); + allButtonsVisible = false; m_SpatialHintUI.visible = false; return; diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index 854471470..6890cfeea 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -147,9 +147,7 @@ public Vector3 scrollVisualsRotation if (m_ScrollVisualsRotation != Vector3.zero) { Debug.LogError("scrollVisualsRotation was set to a Vec3 non-zero value' beginning showing of scroll visuals : " + m_ScrollVisualsRotation); - - if (m_ScrollVisualsVisibilityCoroutine == null) - this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, ShowScrollVisuals()); + this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, ShowScrollVisuals()); } else { @@ -240,7 +238,6 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsDragTargetArrow.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); currentDuration += Time.unscaledDeltaTime * 2f; - m_ScrollVisualsVisibilityCoroutine = null; yield return null; } @@ -270,7 +267,6 @@ IEnumerator HideScrollVisuals() m_ScrollVisualsCanvasGroup.alpha = 0; m_ScrollVisualsTransform.localScale = hiddenLocalScale; //m_ScrollVisualsTransform.localRotation = Quaternion.identity; - m_ScrollVisualsVisibilityCoroutine = null; m_ScrollVisualsGameObject.SetActive(false); } } From 37cf87ed4199c2ece54cb50e4a91e06fb2003530 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 12 Jul 2017 14:59:27 -0700 Subject: [PATCH 561/870] Expose MaxDuration as public const and clamp durations and intensities --- Editor/HapticPulsesEditor.cs | 16 +++++++++++----- Scripts/Modules/HapticsModule/HapticsModule.cs | 7 ++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Editor/HapticPulsesEditor.cs b/Editor/HapticPulsesEditor.cs index becfc22f0..97e2778ca 100644 --- a/Editor/HapticPulsesEditor.cs +++ b/Editor/HapticPulsesEditor.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; +using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.UI @@ -67,7 +68,7 @@ void OnGUI() } const float nameColumnWidth = 250f; - const float durationColumnWidth = 60f; + const float floatFieldColumnWidth = 60f; m_Scroll = GUILayout.BeginScrollView(m_Scroll); @@ -94,7 +95,7 @@ void OnGUI() GUILayout.BeginHorizontal(); GUILayout.Label("Haptic Pulses", EditorStyles.boldLabel, GUILayout.Width(nameColumnWidth)); - GUILayout.Label("Duration", GUILayout.Width(durationColumnWidth)); + GUILayout.Label("Duration"); GUILayout.Label("Intensity"); GUILayout.EndHorizontal(); @@ -103,9 +104,14 @@ void OnGUI() GUILayout.BeginHorizontal(); EditorGUILayout.ObjectField(pulse.pulse, typeof(HapticPulse), false, GUILayout.Width(nameColumnWidth)); EditorGUI.BeginChangeCheck(); - pulse.duration.floatValue = EditorGUILayout.FloatField(pulse.duration.floatValue, GUILayout.Width(durationColumnWidth)); - pulse.intensity.floatValue = GUILayout.HorizontalSlider(pulse.intensity.floatValue, 0, 1); - pulse.intensity.floatValue = EditorGUILayout.FloatField(pulse.intensity.floatValue, GUILayout.Width(durationColumnWidth)); + var durationProperty = pulse.duration; + durationProperty.floatValue = GUILayout.HorizontalSlider(durationProperty.floatValue, 0, HapticsModule.MaxDuration); + durationProperty.floatValue = EditorGUILayout.FloatField(durationProperty.floatValue, GUILayout.Width(floatFieldColumnWidth)); + durationProperty.floatValue = Mathf.Clamp(durationProperty.floatValue, 0, HapticsModule.MaxDuration); + var intensityProperty = pulse.intensity; + intensityProperty.floatValue = GUILayout.HorizontalSlider(intensityProperty.floatValue, 0, 1); + intensityProperty.floatValue = EditorGUILayout.FloatField(intensityProperty.floatValue, GUILayout.Width(floatFieldColumnWidth)); + intensityProperty.floatValue = Mathf.Clamp01(intensityProperty.floatValue); if (EditorGUI.EndChangeCheck()) pulse.serializedObject.ApplyModifiedProperties(); diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index 5bb104a2c..cf0afb7bc 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -7,6 +7,8 @@ namespace UnityEditor.Experimental.EditorVR.Modules { sealed class HapticsModule : MonoBehaviour { + public const float MaxDuration = 0.8f; + [SerializeField] float m_MasterIntensity = 0.8f; @@ -60,14 +62,13 @@ public void Pulse(Node? node, HapticPulse hapticPulse) #if ENABLE_OVR_INPUT m_GeneratedHapticClip.Reset(); - const float kMaxDuration = 0.8f; var duration = hapticPulse.duration; var intensity = hapticPulse.intensity; var fadeIn = hapticPulse.fadeIn; var fadeOut = hapticPulse.fadeOut; - if (duration > kMaxDuration) + if (duration > MaxDuration) { - duration = Mathf.Clamp(duration, 0f, kMaxDuration); // Clamp at maxiumum 800ms for sample buffer + duration = Mathf.Clamp(duration, 0f, MaxDuration); // Clamp at maxiumum 800ms for sample buffer if (!m_SampleLengthWarningShown) Debug.LogWarning("Pulse durations greater than 0.8f are not currently supported"); From 8a1bad3f3365f34dc3122a227ed7778cd33ba022 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Jul 2017 15:12:39 -0700 Subject: [PATCH 562/870] Add Spatial Scroll arrow pulsing functionality; trigger pulse when changing selected tool button in PinnedToolsMenu --- .../Prefabs/SpatialHintUI.prefab | 91 ++++++++++++++++++- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 41 ++++++++- .../Scripts/PinnedToolsMenuUI.cs | 6 +- Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs | 13 +++ 4 files changed, 144 insertions(+), 7 deletions(-) diff --git a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab b/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab index 7b0ecabf0..0e6aa262b 100644 --- a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab +++ b/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab @@ -200,6 +200,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4851979343048988} + - component: {fileID: 114595085207455294} m_Layer: 5 m_Name: LeftArrow (2) m_TagString: Untagged @@ -508,6 +509,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4630278991888076} + - component: {fileID: 114693150127021580} m_Layer: 5 m_Name: RightArrow (2) m_TagString: Untagged @@ -1104,7 +1106,7 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1789767321393858} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: @@ -1118,8 +1120,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1535950939685256} - m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} - m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} + m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.0000075997623, w: 0.7071068} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0.00000000547152} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 224376509698512154} @@ -1261,8 +1263,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1194110711330918} - m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.000007599592, w: 0.7071068} - m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0} + m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.0000075996104, w: 0.7071068} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0.0000000010186341} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 224065573646462090} @@ -1350,9 +1352,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114066956829426356} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114004058444794040 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1364,9 +1368,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114817553842003248} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114006901110602492 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1405,9 +1411,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114730443733817358} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114041376699156020 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1419,9 +1427,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114291859005184956} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114066956829426356 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1514,9 +1524,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114728711746979180} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114201708188467934 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1528,9 +1540,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114974932015195176} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114261942396204950 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1596,9 +1610,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114266648109553236} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114291859005184956 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1637,9 +1653,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114894859978596498} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114347973994711784 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1651,9 +1669,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114502893213131780} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114403956001920920 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1719,9 +1739,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114929323479965660} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114478667145759116 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1733,9 +1755,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114757945073081772} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114502893213131780 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1774,9 +1798,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114790131153619060} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114534977170210908 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1815,9 +1841,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114650107410517210} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114549952638618038 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1829,9 +1857,27 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114403956001920920} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!114 &114595085207455294 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1194110711330918} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HideOnInitialize: 0 + m_Icon: {fileID: 114261942396204950} + m_VisibleColor: {r: 0, g: 0, b: 0, a: 0.42745098} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 1} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114602193729648712 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1843,9 +1889,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114719726697718162} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114647227679990130 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1857,9 +1905,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114006901110602492} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114650107410517210 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1898,9 +1948,27 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114105037402801938} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!114 &114693150127021580 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1535950939685256} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HideOnInitialize: 0 + m_Icon: {fileID: 114878598031735610} + m_VisibleColor: {r: 0, g: 0, b: 0, a: 0.42745098} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 1} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114699673652902324 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1966,9 +2034,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114889128424409716} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114728711746979180 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2115,9 +2185,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114992378279027252} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114873114538619666 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2129,9 +2201,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114973295192596792} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114873812632177310 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2143,9 +2217,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114439371215997622} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114878598031735610 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2186,6 +2262,9 @@ MonoBehaviour: m_EditorClassIdentifier: m_ScrollVisualsCanvasGroup: {fileID: 225476474272170592} m_ScrollVisualsDragTargetArrow: {fileID: 4630278991888076} + m_ScrollHintArrows: + - {fileID: 114693150127021580} + - {fileID: 114595085207455294} m_PrimaryDirectionalHintArrows: - {fileID: 114650385070507634} - {fileID: 114279174847565634} @@ -2302,9 +2381,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 84c6f1758f39e6f4faff7277b7f6316d, type: 3} m_Name: m_EditorClassIdentifier: + m_HideOnInitialize: 1 m_Icon: {fileID: 114106693815540416} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114973295192596792 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index ddf1092db..21968a6f8 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -9,6 +9,9 @@ namespace UnityEditor.Experimental.EditorVR.Menus { public class HintIcon : MonoBehaviour { + [SerializeField] + bool m_HideOnInitialize = true; + [SerializeField] Image m_Icon; @@ -18,11 +21,15 @@ public class HintIcon : MonoBehaviour [SerializeField] Color m_HiddenColor = Color.clear; + [SerializeField] + Color m_PulseColor = Color.white; + readonly Vector3 k_HiddenScale = Vector3.zero; Transform m_IconTransform; Vector3 m_VisibleLocalScale; Coroutine m_VisibilityCoroutine; + Coroutine m_ScrollArrowPulseCoroutine; public bool visible { @@ -49,7 +56,9 @@ void Awake() m_IconTransform = m_Icon.transform; m_VisibleLocalScale = m_IconTransform.localScale * 1.25F; m_Icon.color = m_VisibleColor; - visible = false; + + if (m_HideOnInitialize) + visible = false; } IEnumerator AnimateShow() @@ -99,5 +108,35 @@ IEnumerator AnimateHide() m_IconTransform.localScale = k_HiddenScale; } + + public void PulseColor() + { + this.RestartCoroutine(ref m_ScrollArrowPulseCoroutine, AnimatePulseColor()); + } + + IEnumerator AnimatePulseColor() + { + Debug.LogError("Pulsing color of hint arrow : " + gameObject.name); + const float kTargetDuration = 1f; + var currentDuration = 0f; + var currentColor = m_Icon.color; + while (currentDuration < kTargetDuration) + { + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); + m_Icon.color = Color.Lerp(currentColor, m_PulseColor, shapedDuration); + currentDuration += Time.unscaledDeltaTime * 4; + yield return null; + } + + while (currentDuration > 0f) + { + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); + m_Icon.color = Color.Lerp(m_VisibleColor, m_PulseColor, shapedDuration); + currentDuration -= Time.unscaledDeltaTime * 2; + yield return null; + } + + m_Icon.color = m_VisibleColor; + } } } diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index dfa5d002a..1f1fc6c14 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -438,8 +438,12 @@ public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) var button = m_OrderedButtons[i]; if (i == buttonOrderPosition) { - if (!button.highlighted && buttonHovered != null) // Process haptic pulse if button was not already highlighted + if (!button.highlighted && buttonHovered != null) + { + // Process haptic pulse if button was not already highlighted + m_SpatialHintUI.PulseScrollArrows(); buttonHovered(); + } button.highlighted = true; } diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs index 6890cfeea..1ccc42741 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs @@ -10,15 +10,20 @@ public class SpatialHintUI : MonoBehaviour, IUsesViewerScale { readonly Color k_PrimaryArrowColor = Color.white; + [Header("Scroll Visuals")] [SerializeField] CanvasGroup m_ScrollVisualsCanvasGroup; [SerializeField] Transform m_ScrollVisualsDragTargetArrow; + [SerializeField] + HintIcon[] m_ScrollHintArrows; + //[SerializeField] //CanvasGroup m_HintArrowsCanvasGroup; // TODO: add back in later + [Header("Primary Directional Visuals")] [SerializeField] HintIcon[] m_PrimaryDirectionalHintArrows; @@ -269,5 +274,13 @@ IEnumerator HideScrollVisuals() //m_ScrollVisualsTransform.localRotation = Quaternion.identity; m_ScrollVisualsGameObject.SetActive(false); } + + public void PulseScrollArrows() + { + foreach (var arrow in m_ScrollHintArrows) + { + arrow.PulseColor(); + } + } } } \ No newline at end of file From bed50e94a73680497c24de6d195487960c312d2f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Jul 2017 18:38:35 -0700 Subject: [PATCH 563/870] Prevent the showing of the SelectionToolButton if only the MainMenu and SelectionTool buttons exist in the OrderedButtons collection in PinnedToolsMenuUI --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 1 + Menus/PinnedToolMenu/Scripts/HintIcon.cs | 2 +- .../Scripts/PinnedToolsMenuUI.cs | 28 ++++++++++++++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index bb8c5fe3c..acf8b8eeb 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -149,6 +149,7 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) return; } + // Select an existing ToolButton if the type is already present in a button if (buttons.Any( (x) => x.toolType == toolType)) { m_PinnedToolsMenuUI.SelectExistingToolType(toolType); diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index 21968a6f8..7ad8b0d87 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -124,7 +124,7 @@ IEnumerator AnimatePulseColor() { var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); m_Icon.color = Color.Lerp(currentColor, m_PulseColor, shapedDuration); - currentDuration += Time.unscaledDeltaTime * 4; + currentDuration += Time.unscaledDeltaTime * 5; yield return null; } diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 1f1fc6c14..c27ee0b7d 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -91,7 +91,21 @@ public bool moveToAlternatePosition } } - private bool aboveMinimumButtonCount { get { return m_OrderedButtons.Count > k_ActiveToolOrderPosition + 1; } } + private bool aboveMinimumButtonCount + { + get + { + const int selectionToolButtonHideCount = 2; + var count = m_OrderedButtons.Count; + var aboveMinCount = count > selectionToolButtonHideCount; // Has at least one tool been added beyond the default MainMenu & SelectionTool + + // Prevent the display of the SelectionTool button, if only the MainMenu and SelectionTool buttons reside in the buttons collection + if (count == selectionToolButtonHideCount) + aboveMinCount = buttons.All( x => x.toolType != typeof(SelectionTool) ); + + return aboveMinCount; + } + } public bool spatialScrollVisualsVisible { @@ -243,7 +257,8 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) } m_OrderedButtons.Insert(insertPosition, button); - m_VisibleButtonCount = m_OrderedButtons.Count; + // If only the MainMenu & SelectionTool buttons exist, set visible button count to 1 + m_VisibleButtonCount = aboveMinimumButtonCount ? m_OrderedButtons.Count : 1; button.implementsSecondaryButton = allowSecondaryButton; button.activeTool = true; @@ -288,7 +303,6 @@ IEnumerator ShowThenHideAllButtons(float delayBeforeHiding = 1.25f, bool showMen // Hide all but menu and active tool buttons after visually adding new button allButtonsVisible = false; - m_ShowHideAllButtonsCoroutine = null; } @@ -343,16 +357,16 @@ void SetupButtonOrder() { var button = m_OrderedButtons[i]; button.activeTool = i == k_ActiveToolOrderPosition; - button.order = i; + // Allow settings of regular button order if there are more buttons that just the MainMenu & SelectionTool + button.order = aboveMinimumButtonCount || IsMainMenuButton(button) ? i : k_InactiveButtonInitialOrderPosition; } } void ShowAllExceptMenuButton() { Debug.LogError("ShowAllExceptMenuButton"); - //m_SpatialHintUI.enableVisuals = true; - //m_SpatialHintUI.scrollVisualsRotation = m_SpatialScrollOrientation; - m_VisibleButtonCount = Mathf.Max(0, m_OrderedButtons.Count - 1); // The MainMenu button will be hidden, subtract 1 from the m_VisibleButtonCount + // The MainMenu button will be hidden, subtract 1 from the m_VisibleButtonCount + m_VisibleButtonCount = Mathf.Max(0, m_OrderedButtons.Count - 1); for (int i = 0; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i]; From 9500637e0b1c540cbb9d806f1213b54606294784 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Jul 2017 19:50:28 -0700 Subject: [PATCH 564/870] Add duration & intensity multipler (optional)parameters to the Pulse() haptics function --- .../FunctionalityInjection/IControlHaptics.cs | 10 +++++++--- Scripts/Modules/HapticsModule/HapticsModule.cs | 8 +++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs index edc27648e..d330f46c7 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs @@ -12,7 +12,7 @@ public interface IControlHaptics public static class IControlHapticsMethods { - internal delegate void PulseDelegate(Node? node, HapticPulse hapticPulse); + internal delegate void PulseDelegate(Node? node, HapticPulse hapticPulse, float durationMultiplier = 1f, float intensityMultiplier = 1f); internal static PulseDelegate pulse { get; set; } @@ -21,9 +21,11 @@ public static class IControlHapticsMethods /// /// Node on which to control the pulse /// Haptic pulse to perform - public static void Pulse(this IControlHaptics obj, Node? node, HapticPulse hapticPulse) + /// (Optional) Multiplier value applied to the hapticPulse duration + /// (Optional) Multiplier value applied to the hapticPulse intensity + public static void Pulse(this IControlHaptics obj, Node? node, HapticPulse hapticPulse, float durationMultiplier = 1f, float intensityMultiplier = 1f) { - pulse(node, hapticPulse); + pulse(node, hapticPulse, durationMultiplier, intensityMultiplier); } internal delegate void StopPulsesDelegate(Node? node); @@ -34,6 +36,8 @@ public static void Pulse(this IControlHaptics obj, Node? node, HapticPulse hapti /// Stop all haptic feedback on a specific device, or all devices /// /// Device RayOrigin/Transform on which to stop all pulses. A NULL value will stop pulses on all devices + /// (Optional) Multiplier value applied to the hapticPulse duration + /// (Optional) Multiplier value applied to the hapticPulse intensity public static void StopPulses(this IControlHaptics obj, Node? node) { stopPulses(node); diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index 8b9d1f38a..18711187f 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -50,7 +50,9 @@ void LateUpdate() /// /// Node on which to perform the pulse. /// Haptic pulse - public void Pulse(Node? node, HapticPulse hapticPulse) + /// (Optional) Multiplier value applied to the hapticPulse duration + /// (Optional) Multiplier value applied to the hapticPulse intensity + public void Pulse(Node? node, HapticPulse hapticPulse, float durationMultiplier = 1f, float intensityMultiplier = 1f) { // Clip buffer can hold up to 800 milliseconds of samples // At 320Hz, each sample is 3.125f milliseconds @@ -61,8 +63,8 @@ public void Pulse(Node? node, HapticPulse hapticPulse) m_GeneratedHapticClip.Reset(); const float kMaxDuration = 0.8f; - var duration = hapticPulse.duration; - var intensity = hapticPulse.intensity; + var duration = hapticPulse.duration * durationMultiplier; + var intensity = hapticPulse.intensity * intensityMultiplier; var fadeIn = hapticPulse.fadeIn; var fadeOut = hapticPulse.fadeOut; if (duration > kMaxDuration) From dc0af860d814b691af03f8def949c71b3b313171 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 12 Jul 2017 20:01:07 -0700 Subject: [PATCH 565/870] Add repeating on/off haptic pulse to the pre-activated spatial scroll state in PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index acf8b8eeb..0b7c3f277 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -284,11 +284,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int) (buttonCount * normalizedRepeatingPosition) + 1); consumeControl(pinnedToolInput.show); consumeControl(pinnedToolInput.select); - - } - else if (allowSpatialScrollBeforeThisTime != null) // User hasn't dragged beyond the trigger magnitude; spatial scrolling hasn't been activated yet - { - this.Pulse(node, m_ActivationPulse); } } else if (pinnedToolInput.show.wasJustReleased) @@ -331,11 +326,14 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, //const float kMinFineTuneVelocity = 0.000001f; if (spatialDirection == null) { - var newDirectionVectorThreshold = 0.0175f * this.GetViewerScale(); // Initial magnitude beyond which spatial scrolling will be evaluated - var dragAmount = Vector3.Magnitude(directionVector); Debug.LogWarning("spatial Direction is NULL - setting new one in pricessSpatialScrolling"); - m_PinnedToolsMenuUI.spatialDragDistance = dragAmount > 0 ? dragAmount / newDirectionVectorThreshold : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred - if (dragAmount > newDirectionVectorThreshold) + var newDirectionVectorThreshold = 0.0175f * this.GetViewerScale(); // Initial magnitude beyond which spatial scrolling will be evaluated + var dragMagnitude = Vector3.Magnitude(directionVector); + var dragPercentage = dragMagnitude / newDirectionVectorThreshold; + var repeatingPulseAmount = Mathf.Sin(Time.realtimeSinceStartup * 20) > 0.5f ? 1f : 0f; + m_PinnedToolsMenuUI.spatialDragDistance = dragMagnitude > 0 ? dragPercentage : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred + this.Pulse(node, m_ActivationPulse, repeatingPulseAmount, repeatingPulseAmount); + if (dragMagnitude > newDirectionVectorThreshold) { spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton Debug.LogError("" + spatialDirection.Value.ToString("F4") + ""); From 38e642cd4c6ad357332cec9791560aa2ebc0fa2b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 12 Jul 2017 20:12:25 -0700 Subject: [PATCH 566/870] Refactor Manipulator-specific code out of the Handle classes, and into BaseManipulator; Add ResetDirectSelectionState to IUsesDirectSelection to show manipulator on ray select after direct select; Add scale bump to radial handle; Make handle tips face the direction of movement --- Manipulators/BaseManipulator.cs | 240 +++++++++-- Manipulators/ManipulatorMeshes.fbx | 4 +- Manipulators/ManipulatorMeshes.fbx.meta | 13 +- Manipulators/ScaleManipulator.cs | 77 +--- Manipulators/ScaleManipulator.prefab | 165 +------- Manipulators/StandardManipulator.cs | 98 +++-- Manipulators/StandardManipulator.prefab | 380 +----------------- Scripts/Core/EditorVR.DirectSelection.cs | 14 + Scripts/Handles/BaseHandle.cs | 42 +- Scripts/Handles/LinearHandle.cs | 126 ++---- Scripts/Handles/PlaneHandle.cs | 25 +- Scripts/Handles/RadialHandle.cs | 84 +--- Scripts/Handles/SphereHandle.cs | 36 +- .../IUsesDirectSelection.cs | 14 + Tools/SelectionTool/SelectionTool.cs | 3 + Tools/TransformTool/TransformTool.cs | 5 + 16 files changed, 452 insertions(+), 874 deletions(-) diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index 013ea3778..de3940470 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Handles; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Manipulators @@ -9,12 +10,24 @@ namespace UnityEditor.Experimental.EditorVR.Manipulators class BaseManipulator : MonoBehaviour, IManipulator { protected const float k_BaseManipulatorSize = 0.3f; + const float k_MinHandleTipDirectionDelta = 0.01f; + + class HandleTip + { + public Renderer handleTip; + public float direction = 1; + public Vector3 lastPosition; + public Vector3? positionOffset; + } + + [SerializeField] + Renderer m_HandleTip; [SerializeField] protected List m_AllHandles; [SerializeField] - float m_LinearHandleScaleBump = 1.3f; + float m_LinearHandleScaleBump = 1.5f; [SerializeField] float m_PlaneHandleScaleBump = 1.1f; @@ -22,6 +35,9 @@ class BaseManipulator : MonoBehaviour, IManipulator [SerializeField] float m_SphereHandleScaleBump = 1.1f; + readonly Dictionary m_ScaleBumps = new Dictionary(); + readonly Dictionary m_HandleTips = new Dictionary(); + public bool adjustScaleForCamera { get; set; } public Action translate { protected get; set; } @@ -32,51 +48,69 @@ class BaseManipulator : MonoBehaviour, IManipulator public event Action dragStarted; public event Action dragEnded; - readonly Dictionary m_ScaleBumps = new Dictionary(); - void Awake() { m_ScaleBumps[typeof(LinearHandle)] = m_LinearHandleScaleBump; - m_ScaleBumps[typeof(PlaneHandle)] = m_LinearHandleScaleBump; - m_ScaleBumps[typeof(SphereHandle)] = m_LinearHandleScaleBump; + m_ScaleBumps[typeof(PlaneHandle)] = m_PlaneHandleScaleBump; + m_ScaleBumps[typeof(SphereHandle)] = m_SphereHandleScaleBump; } - protected virtual void OnHandleHoverStarted(BaseHandle handle, HandleEventData eventData, float scaleBump) - { - handle.transform.localScale *= scaleBump; - } - - protected virtual void OnHandleHovering(BaseHandle handle, HandleEventData eventData, float scaleBump) + protected virtual void OnEnable() { + if (adjustScaleForCamera) + Camera.onPreRender += OnCameraPreRender; + foreach (var h in m_AllHandles) + { + SetUpHandle(h); + } } - void OnHoverEnded(BaseHandle handle, HandleEventData eventData, float scaleBump) + protected virtual void OnDisable() { - handle.transform.localScale /= scaleBump; - } + Camera.onPreRender -= OnCameraPreRender; - protected virtual void OnEnable() - { - if (adjustScaleForCamera) - Camera.onPreRender += OnCameraPreRender; + foreach (var h in m_AllHandles) + { + TakeDownHandle(h); + } - foreach (var h in m_AllHandles) { - SetUpHandle(h); + foreach (var kvp in m_HandleTips) + { + kvp.Value.handleTip.gameObject.SetActive(false); } } protected virtual void SetUpHandle(BaseHandle handle) { - handle.hoverStarted += + handle.hoverStarted += OnHandleHoverStarted; + handle.hovering += OnHandleHovering; + handle.hoverEnded += OnHandleHoverEnded; + + + handle.dragStarted += OnHandleDragStarted; + handle.dragging += OnHandleDragging; + handle.dragEnded += OnHandleDragEnded; } - protected virtual void TakeDownHandle(BaseHandle handle) { + protected virtual void TakeDownHandle(BaseHandle handle) + { + handle.hoverStarted -= OnHandleHoverStarted; + handle.hovering -= OnHandleHovering; + handle.hoverEnded -= OnHandleHoverEnded; + + + handle.dragStarted -= OnHandleDragStarted; + handle.dragging -= OnHandleDragging; + handle.dragEnded -= OnHandleDragEnded; } - protected virtual void OnDisable() + void ScaleBump(BaseHandle handle, bool scaleUp) { - Camera.onPreRender -= OnCameraPreRender; + var type = handle.GetType(); + float scaleBump; + if (m_ScaleBumps.TryGetValue(type, out scaleBump)) + handle.transform.localScale = scaleUp ? handle.transform.localScale * scaleBump : handle.transform.localScale / scaleBump; } void OnCameraPreRender(Camera camera) @@ -87,7 +121,7 @@ void OnCameraPreRender(Camera camera) public void AdjustScale(Vector3 cameraPosition, Matrix4x4 worldToCameraMatrix) { var originalCameraPosition = cameraPosition; - + // Adjust size of manipulator while accounting for any non-standard cameras (e.g. scaling applied to the camera) var manipulatorPosition = worldToCameraMatrix.MultiplyPoint3x4(transform.position); cameraPosition = worldToCameraMatrix.MultiplyPoint3x4(cameraPosition); @@ -95,16 +129,168 @@ public void AdjustScale(Vector3 cameraPosition, Matrix4x4 worldToCameraMatrix) transform.localScale = Vector3.one * delta.magnitude * k_BaseManipulatorSize; } - protected void OnDragStarted() + protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventData, bool active) { + var rayOrigin = eventData.rayOrigin; + HandleTip handleTip; + Renderer handleTipRenderer; + if (!m_HandleTips.TryGetValue(rayOrigin, out handleTip)) + { + handleTipRenderer = m_HandleTip; + if (m_HandleTips.Count > 0) + handleTipRenderer = ObjectUtils.Instantiate(handleTipRenderer.gameObject, transform).GetComponent(); + MaterialUtils.CloneMaterials(handleTipRenderer); + + handleTip = new HandleTip { handleTip = handleTipRenderer }; + m_HandleTips[rayOrigin] = handleTip; + } + else + { + handleTipRenderer = handleTip.handleTip; + } + + active = active && (handle is LinearHandle || handle is RadialHandle); + + handleTipRenderer.gameObject.SetActive(active); + + if (active) // Reposition handle tip based on current raycast position when hovering or dragging + { + handleTipRenderer.sharedMaterial.color = handle.GetComponent().sharedMaterial.color; + + var handleTipTransform = handleTipRenderer.transform; + var handleTransform = handle.transform; + var handleTipPosition = handleTipTransform.position; + var distanceFromRayOrigin = Vector3.Distance(handleTipPosition, rayOrigin.position); + + var linearEventData = eventData as LinearHandle.LinearHandleEventData; + if (linearEventData != null) + { + handleTipTransform.position = + handleTransform.TransformPoint(new Vector3(0, 0, + handleTransform.InverseTransformPoint(linearEventData.raycastHitWorldPosition).z)); + + var handleForward = handleTransform.forward; + var delta = handleTipPosition - handleTip.lastPosition; + if (delta.magnitude > k_MinHandleTipDirectionDelta * distanceFromRayOrigin) + { + handleTip.direction = Mathf.Sign(Vector3.Dot(delta, handleForward)); + handleTip.lastPosition = handleTipPosition; + } + + handleTipTransform.forward = handleForward * handleTip.direction; + } + + var radialEventData = eventData as RadialHandle.RadialHandleEventData; + if (radialEventData != null) + { + var positionOffset = handleTip.positionOffset; + if (positionOffset.HasValue) + { + handleTipTransform.position = handleTransform.TransformPoint(positionOffset.Value); + } + else + { + var newLocalPos = handleTransform.InverseTransformPoint(radialEventData.raycastHitWorldPosition); + newLocalPos.y = 0; + handleTipTransform.position = handleTransform.TransformPoint(newLocalPos.normalized * 0.5f * handleTransform.localScale.x); + } + + var forward = Vector3.Cross(handleTransform.up, (handleTipPosition - handleTransform.position).normalized); + var delta = handleTipPosition - handleTip.lastPosition; + if (delta.magnitude > k_MinHandleTipDirectionDelta * distanceFromRayOrigin) + { + handleTip.direction = Mathf.Sign(Vector3.Dot(delta, forward)); + handleTip.lastPosition = handleTipPosition; + } + + handleTipTransform.forward = forward * handleTip.direction; + } + } + } + + protected virtual void OnHandleHoverStarted(BaseHandle handle, HandleEventData eventData) + { + if (handle.IndexOfHoverSource(eventData.rayOrigin) > 0) + return; + + if (!handle.hasDragSource) + { + UpdateHandleTip(handle, eventData, true); + ScaleBump(handle, true); + } + } + + protected virtual void OnHandleHovering(BaseHandle handle, HandleEventData eventData) + { + if (handle.IndexOfHoverSource(eventData.rayOrigin) > 0) + return; + + if (!handle.hasDragSource) + UpdateHandleTip(handle, eventData, true); + } + + protected virtual void OnHandleHoverEnded(BaseHandle handle, HandleEventData eventData) + { + if (handle.IndexOfHoverSource(eventData.rayOrigin) > 0) + return; + + if (!handle.hasDragSource) + { + UpdateHandleTip(handle, eventData, false); + + if (!handle.hasHoverSource) + ScaleBump(handle, false); + } + } + + protected virtual void OnHandleDragStarted(BaseHandle handle, HandleEventData eventData) + { + var rayOrigin = eventData.rayOrigin; + if (handle.IndexOfDragSource(rayOrigin) > 0) + return; + + foreach (var h in m_AllHandles) + h.gameObject.SetActive(h == handle); + if (dragStarted != null) dragStarted(); + + dragging = true; + + var handleTip = m_HandleTips[rayOrigin]; + handleTip.positionOffset = handle.transform.InverseTransformPoint(handleTip.handleTip.transform.position); + + UpdateHandleTip(handle, eventData, true); } - protected void OnDragEnded(Transform rayOrigin) + protected virtual void OnHandleDragging(BaseHandle handle, HandleEventData eventData) { + if (handle.IndexOfDragSource(eventData.rayOrigin) != 0) + return; + + UpdateHandleTip(handle, eventData, true); + } + + protected virtual void OnHandleDragEnded(BaseHandle handle, HandleEventData eventData) + { + var rayOrigin = eventData.rayOrigin; + m_HandleTips[rayOrigin].positionOffset = null; + + UpdateHandleTip(handle, eventData, false); + + if (!handle.hasDragSource) + return; + + foreach (var h in m_AllHandles) + h.gameObject.SetActive(true); + if (dragEnded != null) dragEnded(rayOrigin); + + dragging = false; + + if (!handle.hasDragSource && !handle.hasHoverSource) + ScaleBump(handle, false); } } } diff --git a/Manipulators/ManipulatorMeshes.fbx b/Manipulators/ManipulatorMeshes.fbx index 273c7ca56..38d0c64e4 100644 --- a/Manipulators/ManipulatorMeshes.fbx +++ b/Manipulators/ManipulatorMeshes.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d5b39362caef073bdd2f64f06e7a700ea46288aad8bb21e3038847c9cbb4e5b1 -size 42960 +oid sha256:176862a76ae38147575ae67ee080bac25cfe5185b6d78ebad280f1a931132541 +size 51484 diff --git a/Manipulators/ManipulatorMeshes.fbx.meta b/Manipulators/ManipulatorMeshes.fbx.meta index 17319b85d..df9d37bcd 100644 --- a/Manipulators/ManipulatorMeshes.fbx.meta +++ b/Manipulators/ManipulatorMeshes.fbx.meta @@ -11,27 +11,32 @@ ModelImporter: 100006: RadialHandle 100008: RadialHandleCollider 100010: //RootNode + 100012: FatRadialHandle 400000: HandleCone 400002: LinearHandle 400004: LinearHandleCollider 400006: RadialHandle 400008: RadialHandleCollider 400010: //RootNode + 400012: FatRadialHandle 2300000: HandleCone 2300002: LinearHandle 2300004: LinearHandleCollider 2300006: RadialHandle 2300008: RadialHandleCollider + 2300010: FatRadialHandle 3300000: HandleCone 3300002: LinearHandle 3300004: LinearHandleCollider 3300006: RadialHandle 3300008: RadialHandleCollider + 3300010: FatRadialHandle 4300000: HandleCone 4300002: LinearHandleCollider 4300004: LinearHandle 4300006: RadialHandleCollider 4300008: RadialHandle + 4300010: FatRadialHandle 9500000: //RootNode materials: importMaterials: 0 @@ -43,6 +48,8 @@ ModelImporter: resampleCurves: 1 optimizeGameObjects: 0 motionNodeName: + rigImportErrors: + rigImportWarnings: animationImportErrors: animationImportWarnings: animationRetargetingWarnings: @@ -71,7 +78,7 @@ ModelImporter: secondaryUVAreaDistortion: 15.000001 secondaryUVHardAngle: 88 secondaryUVPackMargin: 4 - useFileScale: 1 + useFileScale: 0 tangentSpace: normalSmoothAngle: 60 normalImportMode: 0 @@ -79,6 +86,7 @@ ModelImporter: importAnimation: 1 copyAvatar: 0 humanDescription: + serializedVersion: 2 human: [] skeleton: [] armTwist: 0.5 @@ -89,7 +97,10 @@ ModelImporter: legStretch: 0.05 feetSpacing: 0 rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 0 lastHumanDescriptionAvatarSource: {instanceID: 0} animationType: 2 humanoidOversampling: 1 diff --git a/Manipulators/ScaleManipulator.cs b/Manipulators/ScaleManipulator.cs index ee17d7caf..5c59032cd 100644 --- a/Manipulators/ScaleManipulator.cs +++ b/Manipulators/ScaleManipulator.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Handles; using UnityEngine; @@ -10,76 +9,32 @@ sealed class ScaleManipulator : BaseManipulator [SerializeField] BaseHandle m_UniformHandle; - [SerializeField] - List m_AxesHandles; - - void Awake() + protected override void OnHandleDragging(BaseHandle handle, HandleEventData eventData) { - m_AllHandles.Add(m_UniformHandle); - m_AllHandles.AddRange(m_AxesHandles); - } - - protected override void OnEnable() - { - base.OnEnable(); - - m_UniformHandle.dragging += OnUniformScaleDragging; - - foreach (var h in m_AxesHandles) - h.dragging += OnLinearScaleDragging; + base.OnHandleDragging(handle, eventData); - foreach (var h in m_AllHandles) + if (handle == m_UniformHandle) { - h.dragStarted += OnHandleDragStarted; - h.dragEnded += OnHandleDragEnded; + scale(Vector3.one * eventData.deltaPosition.y / transform.localScale.x); } - } - - protected override void OnDisable() - { - base.OnDisable(); - - m_UniformHandle.dragging -= OnUniformScaleDragging; - - foreach (var h in m_AxesHandles) - h.dragging -= OnLinearScaleDragging; - - foreach (var h in m_AllHandles) + else { - h.dragStarted -= OnHandleDragStarted; - h.dragEnded -= OnHandleDragEnded; - } - } + var handleTransform = handle.transform; + var inverseRotation = Quaternion.Inverse(handleTransform.rotation); - void OnLinearScaleDragging(BaseHandle handle, HandleEventData eventData) - { - float delta = handle.transform.InverseTransformVector(eventData.deltaPosition).z / handle.transform.InverseTransformPoint(handle.startDragPosition).z; - scale(delta * transform.InverseTransformVector(handle.transform.forward)); - } - - void OnUniformScaleDragging(BaseHandle handle, HandleEventData eventData) - { - scale(Vector3.one * eventData.deltaPosition.y); - } - - void OnHandleDragStarted(BaseHandle handle, HandleEventData eventData) - { - foreach (var h in m_AllHandles) - h.gameObject.SetActive(h == handle); - - OnDragStarted(); - - dragging = true; + var localStartDragPosition = inverseRotation + * (handle.startDragPositions[eventData.rayOrigin] - handleTransform.position); + var delta = (inverseRotation * eventData.deltaPosition).z / localStartDragPosition.z; + scale(Quaternion.Inverse(transform.rotation) * handleTransform.forward * delta); + } } - void OnHandleDragEnded(BaseHandle handle, HandleEventData eventData) + protected override void UpdateHandleTip(BaseHandle handle, HandleEventData eventData, bool active) { - foreach (var h in m_AllHandles) - h.gameObject.SetActive(true); - - OnDragEnded(eventData.rayOrigin); + if (handle == m_UniformHandle) + return; - dragging = false; + base.UpdateHandleTip(handle, eventData, active); } } } diff --git a/Manipulators/ScaleManipulator.prefab b/Manipulators/ScaleManipulator.prefab index f71a350ac..0d590482b 100644 --- a/Manipulators/ScaleManipulator.prefab +++ b/Manipulators/ScaleManipulator.prefab @@ -114,41 +114,7 @@ GameObject: - component: {fileID: 33000010672728660} - component: {fileID: 23000013012300180} m_Layer: 5 - m_Name: HandleTipX - m_TagString: ShowInMiniWorld - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1000013961335350 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000012243801892} - - component: {fileID: 33000010370004602} - - component: {fileID: 23000013583508080} - m_Layer: 5 - m_Name: HandleTipY - m_TagString: ShowInMiniWorld - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1000014284851774 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000011529957722} - - component: {fileID: 33000012188969536} - - component: {fileID: 23000012040466492} - m_Layer: 5 - m_Name: HandleTipZ + m_Name: HandleTip m_TagString: ShowInMiniWorld m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -180,19 +146,6 @@ Transform: m_Father: {fileID: 4000011621453950} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000011529957722 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014284851774} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} - m_Children: [] - m_Father: {fileID: 4000011621453950} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000011557095828 Transform: m_ObjectHideFlags: 1 @@ -221,24 +174,9 @@ Transform: - {fileID: 4000012386908546} - {fileID: 4000011399904934} - {fileID: 4000012628356964} - - {fileID: 4000012243801892} - - {fileID: 4000011529957722} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012243801892 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013961335350} - m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} - m_Children: [] - m_Father: {fileID: 4000011621453950} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} --- !u!4 &4000012386908546 Transform: m_ObjectHideFlags: 1 @@ -258,13 +196,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012986686592} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} + m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_Children: [] m_Father: {fileID: 4000011621453950} m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} + m_LocalEulerAnglesHint: {x: -90, y: 90, z: 0} --- !u!23 &23000010356371698 MeshRenderer: m_ObjectHideFlags: 1 @@ -315,7 +253,7 @@ MeshRenderer: firstSubMesh: 0 subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 4000012243801892} + m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 1 @@ -361,38 +299,6 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000012040466492 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014284851774} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 1eff2a5d0d0ac094a83daf79dc4b3236, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 --- !u!23 &23000013012300180 MeshRenderer: m_ObjectHideFlags: 1 @@ -457,38 +363,6 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000013583508080 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013961335350} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 64f7672a0b4974340aa7f2cc9b919720, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 --- !u!33 &33000010050981974 MeshFilter: m_ObjectHideFlags: 1 @@ -496,13 +370,6 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011939528544} m_Mesh: {fileID: 4300004, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} ---- !u!33 &33000010370004602 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013961335350} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!33 &33000010489448728 MeshFilter: m_ObjectHideFlags: 1 @@ -524,13 +391,6 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010593969392} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33000012188969536 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014284851774} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!33 &33000013344908628 MeshFilter: m_ObjectHideFlags: 1 @@ -562,8 +422,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_HandleTip: {fileID: 0} m_OrientDragPlaneToRay: 1 + m_Constraints: 0 --- !u!114 &114000011147854508 MonoBehaviour: m_ObjectHideFlags: 1 @@ -576,8 +436,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_HandleTip: {fileID: 4000011529957722} m_OrientDragPlaneToRay: 1 + m_Constraints: 0 --- !u!114 &114000011988091676 MonoBehaviour: m_ObjectHideFlags: 1 @@ -590,8 +450,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_HandleTip: {fileID: 4000012243801892} m_OrientDragPlaneToRay: 1 + m_Constraints: 0 --- !u!114 &114000013052707070 MonoBehaviour: m_ObjectHideFlags: 1 @@ -604,8 +464,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_HandleTip: {fileID: 4000012628356964} m_OrientDragPlaneToRay: 1 + m_Constraints: 0 --- !u!114 &114000013616855498 MonoBehaviour: m_ObjectHideFlags: 1 @@ -617,11 +477,16 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4dbf941c00473034b89a9acd39176c7f, type: 3} m_Name: m_EditorClassIdentifier: - m_UniformHandle: {fileID: 114000010053947466} - m_AxesHandles: + m_HandleTip: {fileID: 23000013012300180} + m_AllHandles: + - {fileID: 114000010053947466} - {fileID: 114000013052707070} - {fileID: 114000011988091676} - {fileID: 114000011147854508} + m_LinearHandleScaleBump: 1.5 + m_PlaneHandleScaleBump: 1.1 + m_SphereHandleScaleBump: 1.1 + m_UniformHandle: {fileID: 114000010053947466} --- !u!136 &136000010215347092 CapsuleCollider: m_ObjectHideFlags: 1 diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index 22c37eddd..bfa179772 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -3,37 +3,21 @@ using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -namespace UnityEditor.Experimental.EditorVR.Manipulators { +namespace UnityEditor.Experimental.EditorVR.Manipulators +{ sealed class StandardManipulator : BaseManipulator { [SerializeField] Transform m_PlaneHandlesParent; - protected override void SetUpHandle(BaseHandle handle) - { - base.SetUpHandle(handle); - if (handle is LinearHandle || handle is PlaneHandle || handle is SphereHandle) - handle.dragging += OnTranslateDragging; - - if (handle is RadialHandle) - handle.dragging += OnRotateDragging; - - handle.dragStarted += OnHandleDragStarted; - handle.dragEnded += OnHandleDragEnded; - } - - protected override void TakeDownHandle(BaseHandle handle) - { - base.TakeDownHandle(handle); - if (handle is LinearHandle || handle is PlaneHandle || handle is SphereHandle) - handle.dragging -= OnTranslateDragging; + [SerializeField] + Mesh m_RadialHandleMesh; - if (handle is RadialHandle) - handle.dragging -= OnRotateDragging; + [SerializeField] + Mesh m_FatRadialHandleMesh; - handle.dragStarted -= OnHandleDragStarted; - handle.dragEnded -= OnHandleDragEnded; - } + [SerializeField] + float m_SphereHandleHideScale = 0.1f; void Update() { @@ -52,40 +36,68 @@ void Update() } } - void OnTranslateDragging(BaseHandle handle, HandleEventData eventData) + protected override void OnHandleHoverStarted(BaseHandle handle, HandleEventData eventData) { - ConstrainedAxis constraints = 0; - var constrainedHandle = handle as IAxisConstraints; - if (constrainedHandle != null) - constraints = constrainedHandle.constraints; + base.OnHandleHoverStarted(handle, eventData); - translate(eventData.deltaPosition, eventData.rayOrigin, constraints); + if (!handle.hasDragSource && handle is RadialHandle) + handle.GetComponent().sharedMesh = m_FatRadialHandleMesh; } - void OnRotateDragging(BaseHandle handle, HandleEventData eventData) + protected override void OnHandleHoverEnded(BaseHandle handle, HandleEventData eventData) { - rotate(eventData.deltaRotation, eventData.rayOrigin); + base.OnHandleHoverEnded(handle, eventData); + + if (!handle.hasDragSource && handle is RadialHandle) + handle.GetComponent().sharedMesh = m_RadialHandleMesh; } - void OnHandleDragStarted(BaseHandle handle, HandleEventData eventData) + protected override void OnHandleDragStarted(BaseHandle handle, HandleEventData eventData) { - foreach (var h in m_AllHandles) - h.gameObject.SetActive(h == handle); + base.OnHandleDragStarted(handle, eventData); - OnDragStarted(); + if (handle.IndexOfDragSource(eventData.rayOrigin) > 0) + return; - dragging = true; + if (handle is SphereHandle) + handle.transform.localScale *= m_SphereHandleHideScale; } - void OnHandleDragEnded(BaseHandle handle, HandleEventData eventData) + protected override void OnHandleDragging(BaseHandle handle, HandleEventData eventData) { - if (gameObject.activeSelf) - foreach (var h in m_AllHandles) - h.gameObject.SetActive(true); + base.OnHandleDragging(handle, eventData); + + var rayOrigin = eventData.rayOrigin; + if (handle.IndexOfDragSource(rayOrigin) > 0) + return; + + if (handle is RadialHandle) + { + rotate(eventData.deltaRotation, rayOrigin); + } + else + { + ConstrainedAxis constraints = 0; + var constrainedHandle = handle as IAxisConstraints; + if (constrainedHandle != null) + constraints = constrainedHandle.constraints; + + translate(eventData.deltaPosition, rayOrigin, constraints); + } + } + + protected override void OnHandleDragEnded(BaseHandle handle, HandleEventData eventData) + { + base.OnHandleDragEnded(handle, eventData); + + if (handle.IndexOfDragSource(eventData.rayOrigin) > 0) + return; - OnDragEnded(eventData.rayOrigin); + if (handle is SphereHandle) + handle.transform.localScale /= m_SphereHandleHideScale; - dragging = false; + if (handle is RadialHandle && !handle.hasDragSource && !handle.hasHoverSource) + handle.GetComponent().sharedMesh = m_RadialHandleMesh; } } } diff --git a/Manipulators/StandardManipulator.prefab b/Manipulators/StandardManipulator.prefab index fd4c5e52d..cdd98ea8d 100644 --- a/Manipulators/StandardManipulator.prefab +++ b/Manipulators/StandardManipulator.prefab @@ -83,23 +83,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000010946832768 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000013116023314} - - component: {fileID: 33000011571584896} - - component: {fileID: 23000012973351642} - m_Layer: 5 - m_Name: TranslateArrowZ - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000011344997370 GameObject: m_ObjectHideFlags: 1 @@ -138,23 +121,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000012325378750 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000012613258266} - - component: {fileID: 33000012245860102} - - component: {fileID: 23000011512687970} - m_Layer: 5 - m_Name: RotateArrowY - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000012528205126 GameObject: m_ObjectHideFlags: 0 @@ -185,7 +151,7 @@ GameObject: - component: {fileID: 33000013153004220} - component: {fileID: 23000012097216674} m_Layer: 5 - m_Name: TranslateArrowX + m_Name: Arrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -207,23 +173,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013091982958 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000012695962256} - - component: {fileID: 33000011887528672} - - component: {fileID: 23000010728977110} - m_Layer: 5 - m_Name: TranslateArrowY - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000013421827600 GameObject: m_ObjectHideFlags: 0 @@ -243,23 +192,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013445618612 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000010934639446} - - component: {fileID: 33000012377709916} - - component: {fileID: 23000010522627972} - m_Layer: 5 - m_Name: RotateArrowX - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000013475015528 GameObject: m_ObjectHideFlags: 0 @@ -298,23 +230,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013891219370 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000010059661420} - - component: {fileID: 33000012478951198} - - component: {fileID: 23000011923190926} - m_Layer: 5 - m_Name: RotateArrowZ - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000014184630802 GameObject: m_ObjectHideFlags: 1 @@ -334,32 +249,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4000010059661420 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013891219370} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4000014078647568} - m_RootOrder: 13 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000010934639446 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013445618612} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4000014078647568} - m_RootOrder: 11 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000011777795562 Transform: m_ObjectHideFlags: 1 @@ -425,32 +314,6 @@ Transform: m_Father: {fileID: 4000014078647568} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} ---- !u!4 &4000012613258266 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012325378750} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4000014078647568} - m_RootOrder: 12 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012695962256 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013091982958} - m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 3.8276591, z: -0.00000047683716} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4000014078647568} - m_RootOrder: 9 - m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} --- !u!4 &4000012812880216 Transform: m_ObjectHideFlags: 1 @@ -493,19 +356,6 @@ Transform: m_Father: {fileID: 4000012837354530} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} ---- !u!4 &4000013116023314 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010946832768} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 5.755573} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4000014078647568} - m_RootOrder: 10 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013302655006 Transform: m_ObjectHideFlags: 1 @@ -564,11 +414,6 @@ Transform: - {fileID: 4000013338702806} - {fileID: 4000012837354530} - {fileID: 4000014115655252} - - {fileID: 4000012695962256} - - {fileID: 4000013116023314} - - {fileID: 4000010934639446} - - {fileID: 4000012613258266} - - {fileID: 4000010059661420} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -617,38 +462,6 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000010522627972 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013445618612} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 0c0bcbee36e026343a113109292ee771, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 --- !u!23 &23000010618549098 MeshRenderer: m_ObjectHideFlags: 1 @@ -681,38 +494,6 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000010728977110 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013091982958} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 64f7672a0b4974340aa7f2cc9b919720, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 --- !u!23 &23000010916434250 MeshRenderer: m_ObjectHideFlags: 1 @@ -873,70 +654,6 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000011512687970 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012325378750} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 64f7672a0b4974340aa7f2cc9b919720, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23000011923190926 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013891219370} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 1eff2a5d0d0ac094a83daf79dc4b3236, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 --- !u!23 &23000012097216674 MeshRenderer: m_ObjectHideFlags: 1 @@ -1019,42 +736,10 @@ MeshRenderer: firstSubMesh: 0 subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 4000012695962256} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23000012973351642 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010946832768} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 1eff2a5d0d0ac094a83daf79dc4b3236, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 - m_PreserveUVs: 0 + m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_SelectedEditorRenderState: 3 @@ -1111,27 +796,6 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011344997370} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33000011571584896 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010946832768} - m_Mesh: {fileID: 4300000, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} ---- !u!33 &33000011887528672 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013091982958} - m_Mesh: {fileID: 4300000, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} ---- !u!33 &33000012245860102 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012325378750} - m_Mesh: {fileID: 4300000, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} --- !u!33 &33000012312166260 MeshFilter: m_ObjectHideFlags: 1 @@ -1146,13 +810,6 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014184630802} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!33 &33000012377709916 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013445618612} - m_Mesh: {fileID: 4300000, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} --- !u!33 &33000012384594734 MeshFilter: m_ObjectHideFlags: 1 @@ -1160,13 +817,6 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011402563972} m_Mesh: {fileID: 4300008, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} ---- !u!33 &33000012478951198 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013891219370} - m_Mesh: {fileID: 4300000, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} --- !u!33 &33000012537898696 MeshFilter: m_ObjectHideFlags: 1 @@ -1305,8 +955,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} - m_ScaleBump: 1 m_Constraints: 5 --- !u!114 &114000011169532704 MonoBehaviour: @@ -1320,8 +968,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} - m_ScaleBump: 1 m_Constraints: 6 --- !u!114 &114000011250465190 MonoBehaviour: @@ -1335,9 +981,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_HandleTip: {fileID: 4000014115655252} m_OrientDragPlaneToRay: 1 - m_ScaleBump: 1 m_Constraints: 1 --- !u!114 &114000011261594914 MonoBehaviour: @@ -1351,9 +995,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_HandleTip: {fileID: 4000013116023314} m_OrientDragPlaneToRay: 1 - m_ScaleBump: 1 m_Constraints: 4 --- !u!114 &114000011660595710 MonoBehaviour: @@ -1367,9 +1009,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_HandleTip: {fileID: 4000012695962256} m_OrientDragPlaneToRay: 1 - m_ScaleBump: 1 m_Constraints: 2 --- !u!114 &114000012004783302 MonoBehaviour: @@ -1384,7 +1024,6 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_TurnSpeed: 4 - m_HandleTip: {fileID: 4000010934639446} --- !u!114 &114000012043475194 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1398,7 +1037,6 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_TurnSpeed: 4 - m_HandleTip: {fileID: 4000010059661420} --- !u!114 &114000012656813054 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1411,8 +1049,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_PlaneMaterial: {fileID: 2100000, guid: faae2cd60c5292c48a46def9df717604, type: 2} - m_ScaleBump: 1 m_Constraints: 3 --- !u!114 &114000012657926048 MonoBehaviour: @@ -1425,7 +1061,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: af502ca53131eb544aac56cc46679171, type: 3} m_Name: m_EditorClassIdentifier: - m_PlaneHandlesParent: {fileID: 4000012837354530} + m_HandleTip: {fileID: 23000012097216674} m_AllHandles: - {fileID: 114000013220464894} - {fileID: 114000011250465190} @@ -1437,6 +1073,14 @@ MonoBehaviour: - {fileID: 114000012656813054} - {fileID: 114000010105022974} - {fileID: 114000011169532704} + m_LinearHandleScaleBump: 1.5 + m_PlaneHandleScaleBump: 1.1 + m_SphereHandleScaleBump: 1.1 + m_PlaneHandlesParent: {fileID: 4000012837354530} + m_RadialHandleMesh: {fileID: 4300008, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} + m_FatRadialHandleMesh: {fileID: 4300010, guid: cdace0cf368873c4796b9f9ade156c53, + type: 3} + m_SphereHandleHideScale: 0.1 --- !u!114 &114000013109644058 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1450,7 +1094,6 @@ MonoBehaviour: m_EditorClassIdentifier: m_SelectionFlags: 3 m_TurnSpeed: 4 - m_HandleTip: {fileID: 4000012613258266} --- !u!114 &114000013220464894 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1463,7 +1106,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 - m_ScaleBump: 1 --- !u!135 &135000012924084782 SphereCollider: m_ObjectHideFlags: 1 diff --git a/Scripts/Core/EditorVR.DirectSelection.cs b/Scripts/Core/EditorVR.DirectSelection.cs index 9c72f91c0..2a0cf3da3 100644 --- a/Scripts/Core/EditorVR.DirectSelection.cs +++ b/Scripts/Core/EditorVR.DirectSelection.cs @@ -15,6 +15,7 @@ class DirectSelection : Nested, IInterfaceConnector readonly Dictionary m_DirectSelections = new Dictionary(); readonly Dictionary> m_GrabbedObjects = new Dictionary>(); readonly List m_ObjectGrabbers = new List(); + readonly List m_DirectSelectionUsers = new List(); IntersectionModule m_IntersectionModule; @@ -25,6 +26,7 @@ class DirectSelection : Nested, IInterfaceConnector public DirectSelection() { IUsesDirectSelectionMethods.getDirectSelection = () => m_DirectSelections; + IUsesDirectSelectionMethods.resetDirectSelectionState = ResetDirectSelectionState; ICanGrabObjectMethods.canGrabObject = CanGrabObject; @@ -41,6 +43,10 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) grabObjects.objectsDropped += OnObjectsDropped; grabObjects.objectsTransferred += OnObjectsTransferred; } + + var usesDirectSelection = obj as IUsesDirectSelection; + if (usesDirectSelection != null) + m_DirectSelectionUsers.Add(usesDirectSelection); } public void DisconnectInterface(object obj, Transform rayOrigin = null) @@ -241,6 +247,14 @@ public void DropHeldObjects(Node node) grabber.TransferHeldObjects(rayOrigin, destRayOrigin, deltaOffset); } } + + void ResetDirectSelectionState() + { + foreach (var usesDirectSelection in m_DirectSelectionUsers) + { + usesDirectSelection.OnResetDirectSelectionState(); + } + } } } } diff --git a/Scripts/Handles/BaseHandle.cs b/Scripts/Handles/BaseHandle.cs index ba5af94a7..0640b531f 100644 --- a/Scripts/Handles/BaseHandle.cs +++ b/Scripts/Handles/BaseHandle.cs @@ -15,7 +15,12 @@ namespace UnityEditor.Experimental.EditorVR.Handles class BaseHandle : MonoBehaviour, ISelectionFlags, IRayBeginDragHandler, IRayDragHandler, IRayEndDragHandler, IRayEnterHandler, IRayExitHandler, IRayHoverHandler, IPointerClickHandler, IDropReceiver, IDroppable { - public SelectionFlags selectionFlags { get { return m_SelectionFlags; } set { m_SelectionFlags = value; } } + public SelectionFlags selectionFlags + { + get { return m_SelectionFlags; } + set { m_SelectionFlags = value; } + } + [SerializeField] [FlagsProperty] SelectionFlags m_SelectionFlags = SelectionFlags.Ray | SelectionFlags.Direct; @@ -24,9 +29,13 @@ class BaseHandle : MonoBehaviour, ISelectionFlags, IRayBeginDragHandler, IRayDra protected readonly List m_HoverSources = new List(k_DefaultCapacity); protected readonly List m_DragSources = new List(k_DefaultCapacity); + protected readonly Dictionary m_StartDragPositions = new Dictionary(k_DefaultCapacity); protected DateTime m_LastClickTime; - public Vector3 startDragPosition { get; protected set; } + public bool hasHoverSource { get { return m_HoverSources.Count > 0; } } + public bool hasDragSource { get { return m_DragSources.Count > 0; } } + + public Dictionary startDragPositions { get { return m_StartDragPositions; } } public Func canDrop { private get; set; } public Action receiveDrop { private get; set; } @@ -51,21 +60,21 @@ void Awake() gameObject.layer = LayerMask.NameToLayer("UI"); } - private void OnDisable() + void OnDisable() { if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) { var eventData = GetHandleEventData(new RayEventData(EventSystem.current)); - for (int i = 0; i < m_HoverSources.Count; i++) + foreach (var rayOrigin in m_HoverSources) { - eventData.rayOrigin = m_HoverSources[i]; + eventData.rayOrigin = rayOrigin; OnHandleHoverEnded(eventData); } m_HoverSources.Clear(); - for (int i = 0; i < m_DragSources.Count; i++) + foreach (var rayOrigin in m_DragSources) { - eventData.rayOrigin = m_DragSources[i]; + eventData.rayOrigin = rayOrigin; OnHandleDragEnded(eventData); } m_DragSources.Clear(); @@ -77,23 +86,32 @@ protected virtual HandleEventData GetHandleEventData(RayEventData eventData) return new HandleEventData(eventData.rayOrigin, UIUtils.IsDirectEvent(eventData)); } + public int IndexOfHoverSource(Transform rayOrigin) + { + return m_HoverSources.IndexOf(rayOrigin); + } + + public int IndexOfDragSource(Transform rayOrigin) + { + return m_DragSources.IndexOf(rayOrigin); + } + public void OnBeginDrag(RayEventData eventData) { if (!UIUtils.IsValidEvent(eventData, selectionFlags)) return; - m_DragSources.Add(eventData.rayOrigin); - startDragPosition = eventData.pointerCurrentRaycast.worldPosition; + var rayOrigin = eventData.rayOrigin; + m_DragSources.Add(rayOrigin); + startDragPositions[rayOrigin] = eventData.pointerCurrentRaycast.worldPosition; var handleEventData = GetHandleEventData(eventData); //Double-click logic - var timeSinceLastClick = (float) (DateTime.Now - m_LastClickTime).TotalSeconds; + var timeSinceLastClick = (float)(DateTime.Now - m_LastClickTime).TotalSeconds; m_LastClickTime = DateTime.Now; if (UIUtils.IsDoubleClick(timeSinceLastClick)) - { OnDoubleClick(handleEventData); - } OnHandleDragStarted(handleEventData); } diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index 8f16b4113..439677d7d 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; @@ -6,40 +7,31 @@ namespace UnityEditor.Experimental.EditorVR.Handles { - sealed class LinearHandle : BaseHandle, IAxisConstraints + sealed class LinearHandle : BaseHandle, IAxisConstraints, IUsesViewerScale { const float k_MaxDragDistance = 1000f; - const float k_ScaleBump = 1.3f; - class LinearHandleEventData : HandleEventData + internal class LinearHandleEventData : HandleEventData { public Vector3 raycastHitWorldPosition; public LinearHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, direct) { } } - [SerializeField] - Transform m_HandleTip; - [SerializeField] bool m_OrientDragPlaneToRay = true; - [SerializeField] - bool m_ScaleBump; - [FlagsProperty] [SerializeField] ConstrainedAxis m_Constraints; - Plane m_Plane; - Vector3 m_LastPosition; + readonly Dictionary m_LastPositions = new Dictionary(); - public ConstrainedAxis constraints { get { return m_Constraints; } } + Plane m_Plane; - void OnDisable() + public ConstrainedAxis constraints { - if (m_HandleTip != null) - m_HandleTip.gameObject.SetActive(false); + get { return m_Constraints; } } protected override HandleEventData GetHandleEventData(RayEventData eventData) @@ -47,49 +39,12 @@ protected override HandleEventData GetHandleEventData(RayEventData eventData) return new LinearHandleEventData(eventData.rayOrigin, UIUtils.IsDirectEvent(eventData)) { raycastHitWorldPosition = eventData.pointerCurrentRaycast.worldPosition }; } - protected override void OnHandleHovering(HandleEventData eventData) - { - UpdateHandleTip(eventData as LinearHandleEventData); - } - - protected override void OnHandleHoverStarted(HandleEventData eventData) - { - UpdateHandleTip(eventData as LinearHandleEventData); - - if (m_ScaleBump) - transform.localScale *= k_ScaleBump; - - base.OnHandleHoverStarted(eventData); - } - - protected override void OnHandleHoverEnded(HandleEventData eventData) - { - UpdateHandleTip(eventData as LinearHandleEventData); - - if (m_ScaleBump) - transform.localScale /= k_ScaleBump; - - base.OnHandleHoverEnded(eventData); - } - - void UpdateHandleTip(LinearHandleEventData eventData) + void UpdateEventData(LinearHandleEventData eventData, bool setLastPosition = true) { - if (m_HandleTip != null) - { - m_HandleTip.gameObject.SetActive(m_HoverSources.Count > 0 || m_DragSources.Count > 0); - - if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering or dragging - { - if (eventData != null) - m_HandleTip.position = - transform.TransformPoint(new Vector3(0, 0, - transform.InverseTransformPoint(eventData.raycastHitWorldPosition).z)); - } - } - } + var rayOrigin = eventData.rayOrigin; + var lastPosition = m_LastPositions[rayOrigin]; + var worldPosition = lastPosition; - void UpdatePlaneOrientation(Transform rayOrigin) - { if (m_OrientDragPlaneToRay) { // Orient a plane for dragging purposes through the axis that rotates to avoid being parallel to the ray, @@ -102,48 +57,55 @@ void UpdatePlaneOrientation(Transform rayOrigin) { m_Plane.SetNormalAndPosition(transform.up, transform.position); } - } - protected override void OnHandleDragStarted(HandleEventData eventData) - { - var linearEventData = eventData as LinearHandleEventData; - m_LastPosition = linearEventData.raycastHitWorldPosition; + float distance; + var ray = new Ray(rayOrigin.position, rayOrigin.forward); + if (m_Plane.Raycast(ray, out distance)) + worldPosition = ray.GetPoint(Mathf.Min(distance, k_MaxDragDistance * this.GetViewerScale())); - UpdatePlaneOrientation(eventData.rayOrigin); - UpdateHandleTip(linearEventData); + eventData.raycastHitWorldPosition = worldPosition; - base.OnHandleDragStarted(eventData); + eventData.deltaPosition = Vector3.Project(worldPosition - lastPosition, transform.forward); + + if (setLastPosition) + m_LastPositions[rayOrigin] = worldPosition; } - protected override void OnHandleDragging(HandleEventData eventData) + protected override void OnHandleHoverStarted(HandleEventData eventData) { - var rayOrigin = eventData.rayOrigin; - var worldPosition = m_LastPosition; - - UpdatePlaneOrientation(rayOrigin); + var linearEventData = (LinearHandleEventData)eventData; - float distance; - var ray = new Ray(rayOrigin.position, rayOrigin.forward); - if (m_Plane.Raycast(ray, out distance)) - worldPosition = ray.GetPoint(Mathf.Min(distance, k_MaxDragDistance)); + if (m_DragSources.Count == 0) + { + m_LastPositions[eventData.rayOrigin] = linearEventData.raycastHitWorldPosition; + UpdateEventData(linearEventData); + } - var linearEventData = eventData as LinearHandleEventData; - linearEventData.raycastHitWorldPosition = worldPosition; + base.OnHandleHoverStarted(eventData); + } - eventData.deltaPosition = Vector3.Project(worldPosition - m_LastPosition, transform.forward); + protected override void OnHandleHovering(HandleEventData eventData) + { + if (m_DragSources.Count == 0) + UpdateEventData((LinearHandleEventData)eventData); - m_LastPosition = worldPosition; + base.OnHandleHovering(eventData); + } - UpdateHandleTip(linearEventData); + protected override void OnHandleDragStarted(HandleEventData eventData) + { + var linearEventData = (LinearHandleEventData)eventData; + m_LastPositions[eventData.rayOrigin] = linearEventData.raycastHitWorldPosition; + UpdateEventData(linearEventData); - base.OnHandleDragging(eventData); + base.OnHandleDragStarted(eventData); } - protected override void OnHandleDragEnded(HandleEventData eventData) + protected override void OnHandleDragging(HandleEventData eventData) { - UpdateHandleTip(eventData as LinearHandleEventData); + UpdateEventData((LinearHandleEventData)eventData); - base.OnHandleDragEnded(eventData); + base.OnHandleDragging(eventData); } } } diff --git a/Scripts/Handles/PlaneHandle.cs b/Scripts/Handles/PlaneHandle.cs index b8e98caf6..e85be90c5 100644 --- a/Scripts/Handles/PlaneHandle.cs +++ b/Scripts/Handles/PlaneHandle.cs @@ -6,10 +6,9 @@ namespace UnityEditor.Experimental.EditorVR.Handles { - sealed class PlaneHandle : BaseHandle, IAxisConstraints + sealed class PlaneHandle : BaseHandle, IAxisConstraints, IUsesViewerScale { const float k_MaxDragDistance = 1000f; - const float k_ScaleBump = 1.1f; class PlaneHandleEventData : HandleEventData { @@ -18,12 +17,6 @@ class PlaneHandleEventData : HandleEventData public PlaneHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, direct) { } } - [SerializeField] - Material m_PlaneMaterial; - - [SerializeField] - bool m_ScaleBump; - [FlagsProperty] [SerializeField] ConstrainedAxis m_Constraints; @@ -57,7 +50,7 @@ protected override void OnHandleDragging(HandleEventData eventData) float distance; var ray = new Ray(rayOrigin.position, rayOrigin.forward); if (m_Plane.Raycast(ray, out distance)) - worldPosition = ray.GetPoint(Mathf.Min(Mathf.Abs(distance), k_MaxDragDistance)); + worldPosition = ray.GetPoint(Mathf.Min(Mathf.Abs(distance), k_MaxDragDistance * this.GetViewerScale())); var deltaPosition = worldPosition - m_LastPosition; m_LastPosition = worldPosition; @@ -69,20 +62,6 @@ protected override void OnHandleDragging(HandleEventData eventData) base.OnHandleDragging(eventData); } - - protected override void OnHandleHoverStarted(HandleEventData eventData) { - if (m_ScaleBump) - transform.localScale *= k_ScaleBump; - - base.OnHandleHoverStarted(eventData); - } - - protected override void OnHandleHoverEnded(HandleEventData eventData) { - if (m_ScaleBump) - transform.localScale /= k_ScaleBump; - - base.OnHandleHoverStarted(eventData); - } } } #endif diff --git a/Scripts/Handles/RadialHandle.cs b/Scripts/Handles/RadialHandle.cs index 9d9e402b2..e2452a18b 100644 --- a/Scripts/Handles/RadialHandle.cs +++ b/Scripts/Handles/RadialHandle.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Handles { sealed class RadialHandle : BaseHandle { - private class RadialHandleEventData : HandleEventData + internal class RadialHandleEventData : HandleEventData { public Vector3 raycastHitWorldPosition; @@ -15,111 +15,51 @@ public RadialHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, } [SerializeField] - private float m_TurnSpeed; - [SerializeField] - private Transform m_HandleTip; - - private Plane m_Plane; - private Vector3 m_LastPosition; - private Vector3 m_LastDragForward; - private Vector3 m_DragTangent; + float m_TurnSpeed; - private void OnDisable() - { - if (m_HandleTip != null) - m_HandleTip.gameObject.SetActive(false); - } + Plane m_Plane; + Vector3 m_LastPosition; + Vector3 m_LastDragForward; protected override HandleEventData GetHandleEventData(RayEventData eventData) { return new RadialHandleEventData(eventData.rayOrigin, UIUtils.IsDirectEvent(eventData)) { raycastHitWorldPosition = eventData.pointerCurrentRaycast.worldPosition }; } - protected override void OnHandleHovering(HandleEventData eventData) - { - UpdateHandleTip(eventData as RadialHandleEventData); - } - - private void UpdateHandleTip(RadialHandleEventData eventData) - { - if (m_HandleTip != null) - { - m_HandleTip.gameObject.SetActive(m_HoverSources.Count > 0 || m_DragSources.Count > 0); - - if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) // Reposition handle tip based on current raycast position when hovering (dragging is handled in OnDrag) - { - if (eventData != null) - { - var newLocalPos = transform.InverseTransformPoint(eventData.raycastHitWorldPosition); - newLocalPos.y = 0; - m_HandleTip.position = transform.TransformPoint(newLocalPos.normalized * 0.5f * transform.localScale.x); - m_DragTangent = Vector3.Cross(transform.up, (m_HandleTip.position - transform.position).normalized); - m_HandleTip.forward = m_DragTangent; - } - } - } - } - - protected override void OnHandleHoverStarted(HandleEventData eventData) - { - UpdateHandleTip(eventData as RadialHandleEventData); - base.OnHandleHoverStarted(eventData); - } - - protected override void OnHandleHoverEnded(HandleEventData eventData) - { - UpdateHandleTip(eventData as RadialHandleEventData); - base.OnHandleHoverEnded(eventData); - } - protected override void OnHandleDragStarted(HandleEventData eventData) { - Transform rayOrigin = eventData.rayOrigin; + var rayOrigin = eventData.rayOrigin; - var radialEventData = eventData as RadialHandleEventData; + var radialEventData = (RadialHandleEventData)eventData; m_LastPosition = radialEventData.raycastHitWorldPosition; m_LastDragForward = rayOrigin.forward; m_Plane.SetNormalAndPosition(rayOrigin.forward, transform.position); - m_DragTangent = Vector3.Cross(transform.up, startDragPosition - transform.position); - - UpdateHandleTip(radialEventData); - base.OnHandleDragStarted(eventData); } protected override void OnHandleDragging(HandleEventData eventData) { - Transform rayOrigin = eventData.rayOrigin; + var rayOrigin = eventData.rayOrigin; - Vector3 worldPosition = m_LastPosition; + var worldPosition = m_LastPosition; float distance; - Ray ray = new Ray(rayOrigin.position, rayOrigin.forward); + var ray = new Ray(rayOrigin.position, rayOrigin.forward); if (m_Plane.Raycast(ray, out distance)) worldPosition = ray.GetPoint(Mathf.Abs(distance)); - m_DragTangent = Vector3.Cross(transform.up, (startDragPosition - transform.position).normalized); + var dragTangent = Vector3.Cross(transform.up, (startDragPositions[rayOrigin] - transform.position).normalized); var angle = m_TurnSpeed * Vector3.Angle(rayOrigin.forward, m_LastDragForward) * - Vector3.Dot((worldPosition - m_LastPosition).normalized, m_DragTangent); + Vector3.Dot((worldPosition - m_LastPosition).normalized, dragTangent); eventData.deltaRotation = Quaternion.AngleAxis(angle, transform.up); m_LastPosition = worldPosition; m_LastDragForward = rayOrigin.forward; - if (m_HandleTip != null) - m_HandleTip.RotateAround(transform.position, transform.up, angle); - base.OnHandleDragging(eventData); } - - protected override void OnHandleDragEnded(HandleEventData eventData) - { - UpdateHandleTip(eventData as RadialHandleEventData); - - base.OnHandleDragEnded(eventData); - } } } #endif diff --git a/Scripts/Handles/SphereHandle.cs b/Scripts/Handles/SphereHandle.cs index ce3028869..8be77bb3c 100644 --- a/Scripts/Handles/SphereHandle.cs +++ b/Scripts/Handles/SphereHandle.cs @@ -6,8 +6,10 @@ namespace UnityEditor.Experimental.EditorVR.Handles { - sealed class SphereHandle : BaseHandle, IScrollHandler + sealed class SphereHandle : BaseHandle, IScrollHandler, IUsesViewerScale { + const float k_MaxSphereRadius = 1000f; + class SphereHandleEventData : HandleEventData { public float raycastHitDistance; @@ -18,14 +20,8 @@ public SphereHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, const float k_InitialScrollRate = 2f; const float k_ScrollAcceleration = 14f; - const float k_ScaleBump = 1.1f; - const float k_HideScale = 0.1f; - const float k_DistanceScale = 0.1f; - [SerializeField] - bool m_ScaleBump; - float m_ScrollRate; Vector3 m_LastPosition; float m_CurrentRadius; @@ -45,8 +41,6 @@ protected override void OnHandleDragStarted(HandleEventData eventData) m_ScrollRate = k_InitialScrollRate; - transform.localScale *= k_HideScale; - base.OnHandleDragStarted(eventData); } @@ -60,33 +54,11 @@ protected override void OnHandleDragging(HandleEventData eventData) base.OnHandleDragging(eventData); } - protected override void OnHandleDragEnded(HandleEventData eventData) - { - transform.localScale /= k_HideScale; - base.OnHandleDragEnded(eventData); - } - - protected override void OnHandleHoverStarted(HandleEventData eventData) - { - if (m_ScaleBump) - transform.localScale *= k_ScaleBump; - - base.OnHandleHoverStarted(eventData); - } - - protected override void OnHandleHoverEnded(HandleEventData eventData) - { - if (m_ScaleBump) - transform.localScale /= k_ScaleBump; - - base.OnHandleHoverStarted(eventData); - } - public void ChangeRadius(float delta) { var distance = Vector3.Distance(CameraUtils.GetMainCamera().transform.position, transform.position); m_CurrentRadius += delta * distance * k_DistanceScale; - m_CurrentRadius = Mathf.Max(m_CurrentRadius, 0f); + m_CurrentRadius = Mathf.Min(Mathf.Max(m_CurrentRadius, 0f), k_MaxSphereRadius * this.GetViewerScale()); } public void OnScroll(PointerEventData eventData) diff --git a/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs index 513db2a45..4a6290103 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using System.Collections.Generic; using UnityEngine; @@ -9,6 +10,10 @@ namespace UnityEditor.Experimental.EditorVR /// public interface IUsesDirectSelection { + /// + /// Called by the system whenever any implementor calls ResetDirectSelectionState + /// + void OnResetDirectSelectionState(); } public static class IUsesDirectSelectionMethods @@ -16,6 +21,7 @@ public static class IUsesDirectSelectionMethods internal delegate Dictionary GetDirectSelectionDelegate(); internal static GetDirectSelectionDelegate getDirectSelection { get; set; } + internal static Action resetDirectSelectionState { get; set; } /// /// Returns a dictionary of direct selections @@ -25,6 +31,14 @@ public static Dictionary GetDirectSelection(this { return getDirectSelection(); } + + /// + /// Calls OnResetDirectSelectionState on all implementors of IUsesDirectSelection + /// + public static void ResetDirectSelectionState(this IUsesDirectSelection obj) + { + resetDirectSelectionState(); + } } } #endif diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index f3cdda5cd..ce526dfeb 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -152,6 +152,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_PressedObject == hoveredObject) { this.SelectObject(m_PressedObject, rayOrigin, multiSelect, true); + this.ResetDirectSelectionState(); if (m_PressedObject != null) this.SetHighlight(m_PressedObject, false, rayOrigin); @@ -200,6 +201,8 @@ void OnDisable() } m_HoverGameObjects.Clear(); } + + public void OnResetDirectSelectionState() { } } } #endif diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index e28fc52ba..ee4f8a637 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -640,6 +640,11 @@ void UpdateCurrentManipulator() } } + public void OnResetDirectSelectionState() + { + m_DirectSelected = false; + } + bool TogglePivotMode() { m_PivotMode = m_PivotMode == PivotMode.Pivot ? PivotMode.Center : PivotMode.Pivot; From bcdb82a48fe80168bf51d7fec51ed1fc64b09a50 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 12 Jul 2017 20:19:21 -0700 Subject: [PATCH 567/870] Style fixes --- Scripts/Handles/BaseHandle.cs | 1 + Scripts/Handles/LinearHandle.cs | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Scripts/Handles/BaseHandle.cs b/Scripts/Handles/BaseHandle.cs index 0640b531f..f9d7c024b 100644 --- a/Scripts/Handles/BaseHandle.cs +++ b/Scripts/Handles/BaseHandle.cs @@ -40,6 +40,7 @@ public SelectionFlags selectionFlags public Func canDrop { private get; set; } public Action receiveDrop { private get; set; } public Func getDropObject { private get; set; } + public event Action dropHoverStarted; public event Action dropHoverEnded; diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index 439677d7d..b5e66dc51 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -29,10 +29,7 @@ public LinearHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, Plane m_Plane; - public ConstrainedAxis constraints - { - get { return m_Constraints; } - } + public ConstrainedAxis constraints { get { return m_Constraints; } } protected override HandleEventData GetHandleEventData(RayEventData eventData) { From dee214ce2676b40d280707cbccaab3394cc385b9 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 12 Jul 2017 22:42:38 -0700 Subject: [PATCH 568/870] Introduce IGetManipulatorDragState to prevent changes in selection while using the manipulator; Fix two-handed hover and drag behavior of manipulator handles; Smooth positioning of handle tips; Disable global rotation mode on ScaleManipulator --- Manipulators/BaseManipulator.cs | 34 ++++++++++++------- Manipulators/StandardManipulator.cs | 2 +- Scripts/Core/EditorVR.UI.cs | 15 ++++++-- Scripts/Handles/BaseHandle.cs | 15 ++++---- Scripts/Handles/LinearHandle.cs | 2 +- Scripts/Handles/PlaneHandle.cs | 12 ++++--- Scripts/Handles/RadialHandle.cs | 21 +++++++----- Scripts/Handles/SphereHandle.cs | 34 ++++++++++++------- .../Capability/IManipulatorController.cs | 20 +++++++++++ ...cs.meta => IManipulatorController.cs.meta} | 0 .../Capability/IManipulatorVisibility.cs | 15 -------- .../IGetManipulatorDragState.cs | 26 ++++++++++++++ .../IGetManipulatorDragState.cs.meta | 12 +++++++ Tools/SelectionTool/SelectionTool.cs | 5 ++- Tools/TransformTool/TransformTool.cs | 18 ++++++++-- .../HapticPulses/WorkspaceMovePulse.asset | 2 +- 16 files changed, 164 insertions(+), 69 deletions(-) create mode 100644 Scripts/Interfaces/Capability/IManipulatorController.cs rename Scripts/Interfaces/Capability/{IManipulatorVisibility.cs.meta => IManipulatorController.cs.meta} (100%) delete mode 100644 Scripts/Interfaces/Capability/IManipulatorVisibility.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IGetManipulatorDragState.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IGetManipulatorDragState.cs.meta diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index de3940470..cbad9597a 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -11,6 +11,7 @@ class BaseManipulator : MonoBehaviour, IManipulator { protected const float k_BaseManipulatorSize = 0.3f; const float k_MinHandleTipDirectionDelta = 0.01f; + const float k_LazyFollow = 50f; class HandleTip { @@ -151,7 +152,9 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD active = active && (handle is LinearHandle || handle is RadialHandle); - handleTipRenderer.gameObject.SetActive(active); + var handleTipGameObject = handleTipRenderer.gameObject; + var wasActive = handleTipGameObject.activeSelf; + handleTipGameObject.SetActive(active); if (active) // Reposition handle tip based on current raycast position when hovering or dragging { @@ -163,11 +166,13 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD var distanceFromRayOrigin = Vector3.Distance(handleTipPosition, rayOrigin.position); var linearEventData = eventData as LinearHandle.LinearHandleEventData; + var lerp = wasActive ? k_LazyFollow * Time.deltaTime : 1; if (linearEventData != null) { - handleTipTransform.position = + handleTipTransform.position = Vector3.Lerp(handleTipPosition, handleTransform.TransformPoint(new Vector3(0, 0, - handleTransform.InverseTransformPoint(linearEventData.raycastHitWorldPosition).z)); + handleTransform.InverseTransformPoint(linearEventData.raycastHitWorldPosition).z)), + lerp); var handleForward = handleTransform.forward; var delta = handleTipPosition - handleTip.lastPosition; @@ -192,7 +197,9 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD { var newLocalPos = handleTransform.InverseTransformPoint(radialEventData.raycastHitWorldPosition); newLocalPos.y = 0; - handleTipTransform.position = handleTransform.TransformPoint(newLocalPos.normalized * 0.5f * handleTransform.localScale.x); + handleTipTransform.position = Vector3.Lerp(handleTipPosition, + handleTransform.TransformPoint(newLocalPos.normalized * 0.5f * handleTransform.localScale.x), + lerp); } var forward = Vector3.Cross(handleTransform.up, (handleTipPosition - handleTransform.position).normalized); @@ -203,8 +210,16 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD handleTip.lastPosition = handleTipPosition; } - handleTipTransform.forward = forward * handleTip.direction; + if (forward != Vector3.zero) + handleTipTransform.forward = forward * handleTip.direction; } + + if (handle.hasDragSource && !handleTip.positionOffset.HasValue) + handleTip.positionOffset = handle.transform.InverseTransformPoint(handleTip.handleTip.transform.position); + } + else if(!handle.hasDragSource) + { + handleTip.positionOffset = null; } } @@ -225,8 +240,7 @@ protected virtual void OnHandleHovering(BaseHandle handle, HandleEventData event if (handle.IndexOfHoverSource(eventData.rayOrigin) > 0) return; - if (!handle.hasDragSource) - UpdateHandleTip(handle, eventData, true); + UpdateHandleTip(handle, eventData, !handle.hasDragSource); } protected virtual void OnHandleHoverEnded(BaseHandle handle, HandleEventData eventData) @@ -257,9 +271,6 @@ protected virtual void OnHandleDragStarted(BaseHandle handle, HandleEventData ev dragging = true; - var handleTip = m_HandleTips[rayOrigin]; - handleTip.positionOffset = handle.transform.InverseTransformPoint(handleTip.handleTip.transform.position); - UpdateHandleTip(handle, eventData, true); } @@ -274,11 +285,10 @@ protected virtual void OnHandleDragging(BaseHandle handle, HandleEventData event protected virtual void OnHandleDragEnded(BaseHandle handle, HandleEventData eventData) { var rayOrigin = eventData.rayOrigin; - m_HandleTips[rayOrigin].positionOffset = null; UpdateHandleTip(handle, eventData, false); - if (!handle.hasDragSource) + if (handle.hasDragSource) return; foreach (var h in m_AllHandles) diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index bfa179772..c8b21427e 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -48,7 +48,7 @@ protected override void OnHandleHoverEnded(BaseHandle handle, HandleEventData ev { base.OnHandleHoverEnded(handle, eventData); - if (!handle.hasDragSource && handle is RadialHandle) + if (!handle.hasDragSource && !handle.hasHoverSource && handle is RadialHandle) handle.GetComponent().sharedMesh = m_RadialHandleMesh; } diff --git a/Scripts/Core/EditorVR.UI.cs b/Scripts/Core/EditorVR.UI.cs index 354577719..6e6806b2f 100644 --- a/Scripts/Core/EditorVR.UI.cs +++ b/Scripts/Core/EditorVR.UI.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR && UNITY_EDITORVR using System.Collections.Generic; +using System.Linq; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; @@ -33,7 +34,7 @@ byte stencilRef Camera m_EventCamera; - readonly List m_ManipulatorVisibilities = new List(); + readonly List m_ManipulatorVisibilities = new List(); readonly HashSet m_ManipulatorsHiddenRequests = new HashSet(); public UI() @@ -41,11 +42,12 @@ public UI() IInstantiateUIMethods.instantiateUI = InstantiateUI; IRequestStencilRefMethods.requestStencilRef = RequestStencilRef; ISetManipulatorsVisibleMethods.setManipulatorsVisible = SetManipulatorsVisible; + IGetManipulatorDragStateMethods.getManipulatorDragState = GetManipulatorDragState; } public void ConnectInterface(object obj, Transform rayOrigin = null) { - var manipulatorVisiblity = obj as IManipulatorVisibility; + var manipulatorVisiblity = obj as IManipulatorController; if (manipulatorVisiblity != null) m_ManipulatorVisibilities.Add(manipulatorVisiblity); @@ -73,7 +75,7 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) public void DisconnectInterface(object obj, Transform rayOrigin = null) { - var manipulatorVisiblity = obj as IManipulatorVisibility; + var manipulatorVisiblity = obj as IManipulatorController; if (manipulatorVisiblity != null) m_ManipulatorVisibilities.Remove(manipulatorVisiblity); } @@ -126,11 +128,18 @@ void SetManipulatorsVisible(ISetManipulatorsVisible setter, bool visible) m_ManipulatorsHiddenRequests.Add(setter); } + bool GetManipulatorDragState() + { + return m_ManipulatorVisibilities.Any(controller => controller.manipulatorDragging); + } + internal void UpdateManipulatorVisibilites() { var manipulatorsVisible = m_ManipulatorsHiddenRequests.Count == 0; foreach (var mv in m_ManipulatorVisibilities) + { mv.manipulatorVisible = manipulatorsVisible; + } } byte RequestStencilRef() diff --git a/Scripts/Handles/BaseHandle.cs b/Scripts/Handles/BaseHandle.cs index f9d7c024b..f7f1dd3d3 100644 --- a/Scripts/Handles/BaseHandle.cs +++ b/Scripts/Handles/BaseHandle.cs @@ -15,6 +15,8 @@ namespace UnityEditor.Experimental.EditorVR.Handles class BaseHandle : MonoBehaviour, ISelectionFlags, IRayBeginDragHandler, IRayDragHandler, IRayEndDragHandler, IRayEnterHandler, IRayExitHandler, IRayHoverHandler, IPointerClickHandler, IDropReceiver, IDroppable { + protected const int k_DefaultCapacity = 2; // i.e. 2 controllers + public SelectionFlags selectionFlags { get { return m_SelectionFlags; } @@ -25,8 +27,6 @@ public SelectionFlags selectionFlags [FlagsProperty] SelectionFlags m_SelectionFlags = SelectionFlags.Ray | SelectionFlags.Direct; - const int k_DefaultCapacity = 2; // i.e. 2 controllers - protected readonly List m_HoverSources = new List(k_DefaultCapacity); protected readonly List m_DragSources = new List(k_DefaultCapacity); protected readonly Dictionary m_StartDragPositions = new Dictionary(k_DefaultCapacity); @@ -66,19 +66,22 @@ void OnDisable() if (m_HoverSources.Count > 0 || m_DragSources.Count > 0) { var eventData = GetHandleEventData(new RayEventData(EventSystem.current)); - foreach (var rayOrigin in m_HoverSources) + var sources = new List(m_HoverSources); + m_HoverSources.Clear(); + foreach (var rayOrigin in sources) { eventData.rayOrigin = rayOrigin; OnHandleHoverEnded(eventData); } - m_HoverSources.Clear(); - foreach (var rayOrigin in m_DragSources) + sources.Clear(); + sources.AddRange(m_DragSources); + m_DragSources.Clear(); + foreach (var rayOrigin in sources) { eventData.rayOrigin = rayOrigin; OnHandleDragEnded(eventData); } - m_DragSources.Clear(); } } diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index b5e66dc51..3c113b3ed 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -25,7 +25,7 @@ public LinearHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, [SerializeField] ConstrainedAxis m_Constraints; - readonly Dictionary m_LastPositions = new Dictionary(); + readonly Dictionary m_LastPositions = new Dictionary(k_DefaultCapacity); Plane m_Plane; diff --git a/Scripts/Handles/PlaneHandle.cs b/Scripts/Handles/PlaneHandle.cs index e85be90c5..549ce405f 100644 --- a/Scripts/Handles/PlaneHandle.cs +++ b/Scripts/Handles/PlaneHandle.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; @@ -22,7 +23,7 @@ public PlaneHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, ConstrainedAxis m_Constraints; Plane m_Plane; - Vector3 m_LastPosition; + readonly Dictionary m_LastPositions = new Dictionary(k_DefaultCapacity); public ConstrainedAxis constraints { get { return m_Constraints; } } @@ -34,7 +35,7 @@ protected override HandleEventData GetHandleEventData(RayEventData eventData) protected override void OnHandleDragStarted(HandleEventData eventData) { var planeEventData = eventData as PlaneHandleEventData; - m_LastPosition = planeEventData.raycastHitWorldPosition; + m_LastPositions[eventData.rayOrigin] = planeEventData.raycastHitWorldPosition; m_Plane.SetNormalAndPosition(transform.forward, transform.position); @@ -45,15 +46,16 @@ protected override void OnHandleDragging(HandleEventData eventData) { var rayOrigin = eventData.rayOrigin; - var worldPosition = m_LastPosition; + var lastPosition = m_LastPositions[eventData.rayOrigin]; + var worldPosition = lastPosition; float distance; var ray = new Ray(rayOrigin.position, rayOrigin.forward); if (m_Plane.Raycast(ray, out distance)) worldPosition = ray.GetPoint(Mathf.Min(Mathf.Abs(distance), k_MaxDragDistance * this.GetViewerScale())); - var deltaPosition = worldPosition - m_LastPosition; - m_LastPosition = worldPosition; + var deltaPosition = worldPosition - lastPosition; + m_LastPositions[eventData.rayOrigin] = worldPosition; deltaPosition = transform.InverseTransformVector(deltaPosition); deltaPosition.z = 0; diff --git a/Scripts/Handles/RadialHandle.cs b/Scripts/Handles/RadialHandle.cs index e2452a18b..1f36236aa 100644 --- a/Scripts/Handles/RadialHandle.cs +++ b/Scripts/Handles/RadialHandle.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -18,8 +19,8 @@ public RadialHandleEventData(Transform rayOrigin, bool direct) : base(rayOrigin, float m_TurnSpeed; Plane m_Plane; - Vector3 m_LastPosition; - Vector3 m_LastDragForward; + readonly Dictionary m_LastPositions = new Dictionary(k_DefaultCapacity); + readonly Dictionary m_LastDragForwards = new Dictionary(k_DefaultCapacity); protected override HandleEventData GetHandleEventData(RayEventData eventData) { @@ -31,8 +32,8 @@ protected override void OnHandleDragStarted(HandleEventData eventData) var rayOrigin = eventData.rayOrigin; var radialEventData = (RadialHandleEventData)eventData; - m_LastPosition = radialEventData.raycastHitWorldPosition; - m_LastDragForward = rayOrigin.forward; + m_LastPositions[rayOrigin] = radialEventData.raycastHitWorldPosition; + m_LastDragForwards[rayOrigin] = rayOrigin.forward; m_Plane.SetNormalAndPosition(rayOrigin.forward, transform.position); @@ -43,7 +44,9 @@ protected override void OnHandleDragging(HandleEventData eventData) { var rayOrigin = eventData.rayOrigin; - var worldPosition = m_LastPosition; + var lastPosition = m_LastPositions[rayOrigin]; + var lastDragForward = m_LastDragForwards[rayOrigin]; + var worldPosition = lastPosition; float distance; var ray = new Ray(rayOrigin.position, rayOrigin.forward); @@ -51,12 +54,12 @@ protected override void OnHandleDragging(HandleEventData eventData) worldPosition = ray.GetPoint(Mathf.Abs(distance)); var dragTangent = Vector3.Cross(transform.up, (startDragPositions[rayOrigin] - transform.position).normalized); - var angle = m_TurnSpeed * Vector3.Angle(rayOrigin.forward, m_LastDragForward) * - Vector3.Dot((worldPosition - m_LastPosition).normalized, dragTangent); + var angle = m_TurnSpeed * Vector3.Angle(rayOrigin.forward, lastDragForward) * + Vector3.Dot((worldPosition - lastPosition).normalized, dragTangent); eventData.deltaRotation = Quaternion.AngleAxis(angle, transform.up); - m_LastPosition = worldPosition; - m_LastDragForward = rayOrigin.forward; + m_LastPositions[rayOrigin] = worldPosition; + m_LastDragForwards[rayOrigin] = rayOrigin.forward; base.OnHandleDragging(eventData); } diff --git a/Scripts/Handles/SphereHandle.cs b/Scripts/Handles/SphereHandle.cs index 8be77bb3c..6e7db7ac2 100644 --- a/Scripts/Handles/SphereHandle.cs +++ b/Scripts/Handles/SphereHandle.cs @@ -1,8 +1,8 @@ #if UNITY_EDITOR -using UnityEngine.EventSystems; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using UnityEngine.EventSystems; namespace UnityEditor.Experimental.EditorVR.Handles { @@ -35,23 +35,33 @@ protected override void OnHandleDragStarted(HandleEventData eventData) { var sphereEventData = (SphereHandleEventData)eventData; - m_CurrentRadius = sphereEventData.raycastHitDistance; - - m_LastPosition = GetRayPoint(eventData); - - m_ScrollRate = k_InitialScrollRate; + var rayOrigin = eventData.rayOrigin; + if (IndexOfDragSource(rayOrigin) == 0) + { + m_CurrentRadius = sphereEventData.raycastHitDistance; + m_ScrollRate = k_InitialScrollRate; + m_LastPosition = GetRayPoint(eventData); - base.OnHandleDragStarted(eventData); + base.OnHandleDragStarted(eventData); + } } protected override void OnHandleDragging(HandleEventData eventData) { - var worldPosition = GetRayPoint(eventData); - - eventData.deltaPosition = worldPosition - m_LastPosition; - m_LastPosition = worldPosition; + if (IndexOfDragSource(eventData.rayOrigin) == 0) + { + var worldPosition = GetRayPoint(eventData); + eventData.deltaPosition = worldPosition - m_LastPosition; + m_LastPosition = worldPosition; + + base.OnHandleDragging(eventData); + } + } - base.OnHandleDragging(eventData); + protected override void OnHandleDragEnded(HandleEventData eventData) + { + if (!hasDragSource) + base.OnHandleDragEnded(eventData); } public void ChangeRadius(float delta) diff --git a/Scripts/Interfaces/Capability/IManipulatorController.cs b/Scripts/Interfaces/Capability/IManipulatorController.cs new file mode 100644 index 000000000..db41ac71e --- /dev/null +++ b/Scripts/Interfaces/Capability/IManipulatorController.cs @@ -0,0 +1,20 @@ +#if UNITY_EDITOR +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provide access to the system to show/hide and check drag state of manipulators on this tool / workspace / etc. + /// + public interface IManipulatorController + { + /// + /// Show or hide the manipulator(s) + /// + bool manipulatorVisible { set; } + + /// + /// Whether the manipulator(s) are in a drag state + /// + bool manipulatorDragging { get; } + } +} +#endif diff --git a/Scripts/Interfaces/Capability/IManipulatorVisibility.cs.meta b/Scripts/Interfaces/Capability/IManipulatorController.cs.meta similarity index 100% rename from Scripts/Interfaces/Capability/IManipulatorVisibility.cs.meta rename to Scripts/Interfaces/Capability/IManipulatorController.cs.meta diff --git a/Scripts/Interfaces/Capability/IManipulatorVisibility.cs b/Scripts/Interfaces/Capability/IManipulatorVisibility.cs deleted file mode 100644 index 02e793c60..000000000 --- a/Scripts/Interfaces/Capability/IManipulatorVisibility.cs +++ /dev/null @@ -1,15 +0,0 @@ -#if UNITY_EDITOR -namespace UnityEditor.Experimental.EditorVR -{ - /// - /// Provide access to the system to show or hide manipulator(s) on this tool / workspace / etc. - /// - public interface IManipulatorVisibility - { - /// - /// Show or hide the manipulator(s) - /// - bool manipulatorVisible { set; } - } -} -#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetManipulatorDragState.cs b/Scripts/Interfaces/FunctionalityInjection/IGetManipulatorDragState.cs new file mode 100644 index 000000000..ba60aa356 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IGetManipulatorDragState.cs @@ -0,0 +1,26 @@ +#if UNITY_EDITOR +using System; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Implementors can check whether the manipulator is in the dragging state + /// + public interface IGetManipulatorDragState + { + } + + public static class IGetManipulatorDragStateMethods + { + internal static Func getManipulatorDragState { get; set; } + + /// + /// Returns whether the manipulator is in the dragging state + /// + public static bool GetManipulatorDragState(this IGetManipulatorDragState obj) + { + return getManipulatorDragState(); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetManipulatorDragState.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IGetManipulatorDragState.cs.meta new file mode 100644 index 000000000..15f3ba62d --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IGetManipulatorDragState.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b3b3593cc8a0dbf4c980ffb97150eb3e +timeCreated: 1473706550 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index ce526dfeb..f1137aec8 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject + ICanGrabObject, IGetManipulatorDragState { public ActionMap actionMap { get { return m_ActionMap; } } [SerializeField] @@ -32,6 +32,9 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { + if (this.GetManipulatorDragState()) + return; + m_SelectionInput = (SelectionInput)input; var multiSelect = false; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index ee4f8a637..23fa1a8f8 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, - IGrabObjects, ISetDefaultRayVisibility, IProcessInput, ISelectObject, IManipulatorVisibility, IUsesSnapping, ISetHighlight, + IGrabObjects, ISetDefaultRayVisibility, IProcessInput, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, ILinkedObject, IRayToNode, IControlHaptics { const float k_LazyFollowTranslate = 8f; @@ -214,6 +214,16 @@ public List actions public bool manipulatorVisible { private get; set; } + public bool manipulatorDragging + { + get + { + return + m_StandardManipulator && m_StandardManipulator.dragging + || m_ScaleManipulator && m_ScaleManipulator.dragging; + } + } + public List linkedObjects { private get; set; } void Start() @@ -457,7 +467,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var manipulatorTransform = manipulatorGameObject.transform; var lerp = m_CurrentlySnapping ? 1f : k_LazyFollowTranslate * deltaTime; manipulatorTransform.position = Vector3.Lerp(manipulatorTransform.position, m_TargetPosition, lerp); - if (m_PivotRotation == PivotRotation.Local) // Manipulator does not rotate when in global mode + // Manipulator does not rotate when in global mode + if (m_PivotRotation == PivotRotation.Local && m_CurrentManipulator == m_StandardManipulator) manipulatorTransform.rotation = Quaternion.Slerp(manipulatorTransform.rotation, m_TargetRotation, k_LazyFollowRotate * deltaTime); var selectionTransforms = Selection.transforms; @@ -620,7 +631,8 @@ void UpdateCurrentManipulator() var manipulatorTransform = manipulatorGameObject.transform; var activeTransform = Selection.activeTransform ?? selectionTransforms[0]; manipulatorTransform.position = m_PivotMode == PivotMode.Pivot ? activeTransform.position : m_SelectionBounds.center; - manipulatorTransform.rotation = m_PivotRotation == PivotRotation.Global ? Quaternion.identity : activeTransform.rotation; + manipulatorTransform.rotation = m_PivotRotation == PivotRotation.Global && m_CurrentManipulator == m_StandardManipulator + ? Quaternion.identity : activeTransform.rotation; m_TargetPosition = manipulatorTransform.position; m_TargetRotation = manipulatorTransform.rotation; m_StartRotation = m_TargetRotation; diff --git a/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset b/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset index a34bdca20..e7945a156 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: MovePulse + m_Name: WorkspaceMovePulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 0.15 From 8897c6040e6ec5a425449de0baee66e7c41f93db Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 13 Jul 2017 12:09:10 -0700 Subject: [PATCH 569/870] Fix haptic pulse naming & duplication development merge issues --- .../HapticPulses/ClickPulse.asset | 17 ----------------- .../HapticPulses/ClickPulse.asset.meta | 9 --------- .../HapticPulses/HoverPulse.asset | 17 ----------------- .../HapticPulses/HoverPulse.asset.meta | 9 --------- .../PinnedToolButtonClickPulse.asset | 2 +- .../PinnedToolButtonClickPulse.asset.meta | 2 +- .../PinnedToolButtonHoverPulse.asset | 2 +- .../PinnedToolButtonHoverPulse.asset.meta | 2 +- ...sset => PinnedToolMenuActivationPulse.asset} | 2 +- ...=> PinnedToolMenuActivationPulse.asset.meta} | 0 ...se.asset => PinnedToolMenuHidingPulse.asset} | 2 +- ...eta => PinnedToolMenuHidingPulse.asset.meta} | 0 ...asset => PinnedToolMenuScrollingPulse.asset} | 2 +- ... => PinnedToolMenuScrollingPulse.asset.meta} | 0 .../PinnedToolButton/PinnedToolButton.cs | 3 --- Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta | 6 +++--- .../Base/HapticPulses/WorkspaceMovePulse.asset | 2 +- 17 files changed, 11 insertions(+), 66 deletions(-) delete mode 100644 Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset delete mode 100644 Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset.meta delete mode 100644 Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset delete mode 100644 Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset.meta rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses/PinnedToolButtonClickPulse.asset (95%) rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses/PinnedToolButtonClickPulse.asset.meta (81%) rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses/PinnedToolButtonHoverPulse.asset (95%) rename Menus/{PinnedToolButton => PinnedToolMenu}/HapticPulses/PinnedToolButtonHoverPulse.asset.meta (81%) rename Menus/PinnedToolMenu/HapticPulses/{ActivationPulse.asset => PinnedToolMenuActivationPulse.asset} (91%) rename Menus/PinnedToolMenu/HapticPulses/{ActivationPulse.asset.meta => PinnedToolMenuActivationPulse.asset.meta} (100%) rename Menus/PinnedToolMenu/HapticPulses/{HidingPulse.asset => PinnedToolMenuHidingPulse.asset} (91%) rename Menus/PinnedToolMenu/HapticPulses/{HidingPulse.asset.meta => PinnedToolMenuHidingPulse.asset.meta} (100%) rename Menus/PinnedToolMenu/HapticPulses/{ScrollingPulse.asset => PinnedToolMenuScrollingPulse.asset} (91%) rename Menus/PinnedToolMenu/HapticPulses/{ScrollingPulse.asset.meta => PinnedToolMenuScrollingPulse.asset.meta} (100%) diff --git a/Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset b/Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset deleted file mode 100644 index 472e131ad..000000000 --- a/Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset +++ /dev/null @@ -1,17 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ClickPulse - m_EditorClassIdentifier: - m_Duration: 0.5 - m_Intensity: 0.2 - m_FadeIn: 1 - m_FadeOut: 1 diff --git a/Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset.meta deleted file mode 100644 index 950984b33..000000000 --- a/Menus/PinnedToolMenu/HapticPulses/ClickPulse.asset.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 90be55fd9292d1e4eb8af66c479333b6 -timeCreated: 1496975270 -licenseType: Pro -NativeFormatImporter: - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset b/Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset deleted file mode 100644 index 2bafd1c7d..000000000 --- a/Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset +++ /dev/null @@ -1,17 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: HoverPulse - m_EditorClassIdentifier: - m_Duration: 0.005 - m_Intensity: 0.2 - m_FadeIn: 0 - m_FadeOut: 0 diff --git a/Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset.meta deleted file mode 100644 index c180c7437..000000000 --- a/Menus/PinnedToolMenu/HapticPulses/HoverPulse.asset.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 53f100a1dd0839141bcace2ecd8cc6b1 -timeCreated: 1496975334 -licenseType: Pro -NativeFormatImporter: - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset similarity index 95% rename from Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset index d87d71643..c9631db4c 100644 --- a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: PinnedToolButtonClickPulse m_EditorClassIdentifier: m_Duration: 0.5 - m_Intensity: 0.6 + m_Intensity: 0.4 m_FadeIn: 1 m_FadeOut: 1 diff --git a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta similarity index 81% rename from Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset.meta rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta index 950984b33..c39b57db5 100644 --- a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonClickPulse.asset.meta +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 90be55fd9292d1e4eb8af66c479333b6 +guid: ddf15856c41896c42bfd9a7b61028844 timeCreated: 1496975270 licenseType: Pro NativeFormatImporter: diff --git a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset similarity index 95% rename from Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset index f7f7376df..966119efc 100644 --- a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: PinnedToolButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.6 + m_Intensity: 0.4 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta similarity index 81% rename from Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset.meta rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta index c180c7437..fb4806685 100644 --- a/Menus/PinnedToolButton/HapticPulses/PinnedToolButtonHoverPulse.asset.meta +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 53f100a1dd0839141bcace2ecd8cc6b1 +guid: 4b4b7c3ee967062409632272431dc428 timeCreated: 1496975334 licenseType: Pro NativeFormatImporter: diff --git a/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset similarity index 91% rename from Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset index db8d312dd..82017833b 100644 --- a/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ActivationPulse + m_Name: PinnedToolMenuActivationPulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 0.075 diff --git a/Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset.meta similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/ActivationPulse.asset.meta rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset.meta diff --git a/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset similarity index 91% rename from Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset index 122122560..9a183d708 100644 --- a/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: HidingPulse + m_Name: PinnedToolMenuHidingPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.35 diff --git a/Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/HidingPulse.asset.meta rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta diff --git a/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset similarity index 91% rename from Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset index 1c29c2592..928e785f0 100644 --- a/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: ScrollingPulse + m_Name: PinnedToolMenuScrollingPulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 0.35 diff --git a/Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset.meta similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/ScrollingPulse.asset.meta rename to Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index e07c8f781..b42c0fde2 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -265,9 +265,6 @@ public Transform alternateMenuOrigin [SerializeField] Image m_ButtonIcon; - [SerializeField] - AudioClip m_HighlightedHapticClip; - Coroutine m_PositionCoroutine; Coroutine m_VisibilityCoroutine; Coroutine m_HighlightCoroutine; diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta index bd354c42b..4bb8da399 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 800ff7c94496eac41ab0b6df27863704 -timeCreated: 1497920492 +timeCreated: 1499972770 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -11,9 +11,9 @@ MonoImporter: type: 2} - m_PinnedToolButtonTemplate: {fileID: 114000011260412956, guid: 7221a75a049ac3949a505c7c2f06bd8e, type: 2} - - m_ButtonClickPulse: {fileID: 11400000, guid: 90be55fd9292d1e4eb8af66c479333b6, + - m_ButtonClickPulse: {fileID: 11400000, guid: ddf15856c41896c42bfd9a7b61028844, type: 2} - - m_ButtonHoverPulse: {fileID: 11400000, guid: 53f100a1dd0839141bcace2ecd8cc6b1, + - m_ButtonHoverPulse: {fileID: 11400000, guid: 4b4b7c3ee967062409632272431dc428, type: 2} - m_ActivationPulse: {fileID: 11400000, guid: c3a3fe0d1f5495c4db58b5282c37a962, type: 2} diff --git a/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset b/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset index a34bdca20..e7945a156 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: MovePulse + m_Name: WorkspaceMovePulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 0.15 From b92ee4cc2aff37be4f8459e4d8e8a4c3f9e2158b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 14:20:26 -0700 Subject: [PATCH 570/870] Allow ray selection of scene objects when they are in front of (but not behind) UI --- Scripts/Core/EditorVR.Rays.cs | 13 +++++++++++-- .../MultipleRayInputModule.cs | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 96052f128..0b9a6bb8a 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -204,8 +204,17 @@ void OnProxyActiveChanged(IProxy proxy) // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => { - if (!source.draggedObject && evr.GetNestedModule().IsHovering(source.rayOrigin)) - return false; + if (!source.draggedObject) + { + if (evr.GetNestedModule().IsHovering(source.rayOrigin)) + return false; + + var isManipulator = source.hoveredObject && source.hoveredObject.GetComponentInParent() != null; + float distance; + var raycastObject = intersectionModule.GetFirstGameObject(source.rayOrigin, out distance); + if (!isManipulator && raycastObject && distance < source.eventData.pointerCurrentRaycast.distance) + return false; + } if ((deviceData.menuHideFlags[deviceData.mainMenu] & Menus.MenuHideFlags.Hidden) == 0) { diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index 76b0f3deb..f2e5d561b 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -135,6 +135,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (source.isValid != null && !source.isValid(source)) { HandlePointerExitAndEnter(eventData, hoveredObject, true); // Send only exit events + var currentRaycast = eventData.pointerCurrentRaycast; + currentRaycast.gameObject = null; + eventData.pointerCurrentRaycast = currentRaycast; + source.hoveredObject = null; continue; } From 028600b85155f4a36d3cb22568a124b0d2ba2bf8 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 14:27:01 -0700 Subject: [PATCH 571/870] Refactor isValid --- Scripts/Core/EditorVR.Rays.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 0b9a6bb8a..710809e1f 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -206,23 +206,21 @@ void OnProxyActiveChanged(IProxy proxy) { if (!source.draggedObject) { - if (evr.GetNestedModule().IsHovering(source.rayOrigin)) + var sourceRayOrigin = source.rayOrigin; + if (evr.GetNestedModule().IsHovering(sourceRayOrigin)) return false; - var isManipulator = source.hoveredObject && source.hoveredObject.GetComponentInParent() != null; - float distance; - var raycastObject = intersectionModule.GetFirstGameObject(source.rayOrigin, out distance); - if (!isManipulator && raycastObject && distance < source.eventData.pointerCurrentRaycast.distance) + var hoveredObject = source.hoveredObject; + var isManipulator = hoveredObject && hoveredObject.GetComponentInParent() != null; + float sceneObjectDistance; + var raycastObject = intersectionModule.GetFirstGameObject(sourceRayOrigin, out sceneObjectDistance); + var uiDistance = source.eventData.pointerCurrentRaycast.distance; + if (!isManipulator && raycastObject && sceneObjectDistance < uiDistance) return false; } if ((deviceData.menuHideFlags[deviceData.mainMenu] & Menus.MenuHideFlags.Hidden) == 0) - { - if (Menus.OnHover(source)) - return true; - - return false; - } + return Menus.OnHover(source); return true; }); From b46f4a6bad5771d57a7dbf4df248602057a3874f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 14:39:21 -0700 Subject: [PATCH 572/870] Remove DirectSelectionData --- Scripts/Core/EditorVR.DirectSelection.cs | 18 +++------------ Scripts/Data/DirectSelectionData.cs | 23 ------------------- Scripts/Data/DirectSelectionData.cs.meta | 12 ---------- .../IUsesDirectSelection.cs | 4 ++-- Tools/SelectionTool/SelectionTool.cs | 8 +++---- Tools/TransformTool/TransformTool.cs | 7 +++--- 6 files changed, 12 insertions(+), 60 deletions(-) delete mode 100644 Scripts/Data/DirectSelectionData.cs delete mode 100644 Scripts/Data/DirectSelectionData.cs.meta diff --git a/Scripts/Core/EditorVR.DirectSelection.cs b/Scripts/Core/EditorVR.DirectSelection.cs index 19449fc81..0f35ab5a8 100644 --- a/Scripts/Core/EditorVR.DirectSelection.cs +++ b/Scripts/Core/EditorVR.DirectSelection.cs @@ -13,7 +13,7 @@ partial class EditorVR { class DirectSelection : Nested, IInterfaceConnector { - readonly Dictionary m_DirectSelections = new Dictionary(); + readonly Dictionary m_DirectSelections = new Dictionary(); readonly Dictionary> m_GrabbedObjects = new Dictionary>(); readonly List m_ObjectGrabbers = new List(); readonly List m_TwoHandedScalers = new List(); @@ -109,13 +109,7 @@ internal void UpdateDirectSelection() var rayOrigin = deviceData.rayOrigin; var obj = GetDirectSelectionForRayOrigin(rayOrigin); if (obj && !obj.CompareTag(k_VRPlayerTag)) - { - m_DirectSelections[rayOrigin] = new DirectSelectionData - { - gameObject = obj, - node = deviceData.node - }; - } + m_DirectSelections[rayOrigin] = obj; }); foreach (var ray in evr.GetNestedModule().rays) @@ -123,13 +117,7 @@ internal void UpdateDirectSelection() var rayOrigin = ray.Key; var go = GetDirectSelectionForRayOrigin(rayOrigin); if (go != null) - { - m_DirectSelections[rayOrigin] = new DirectSelectionData - { - gameObject = go, - node = ray.Value.node - }; - } + m_DirectSelections[rayOrigin] = go; } } diff --git a/Scripts/Data/DirectSelectionData.cs b/Scripts/Data/DirectSelectionData.cs deleted file mode 100644 index 2792f610d..000000000 --- a/Scripts/Data/DirectSelectionData.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if UNITY_EDITOR -using UnityEngine; -using UnityEngine.InputNew; - -namespace UnityEditor.Experimental.EditorVR -{ - /// - /// Stores the state of a direct selection - /// - public sealed class DirectSelectionData - { - /// - /// The Node used to select the object - /// - public Node node { get; set; } - - /// - /// The object which is selected - /// - public GameObject gameObject { get; set; } - } -} -#endif diff --git a/Scripts/Data/DirectSelectionData.cs.meta b/Scripts/Data/DirectSelectionData.cs.meta deleted file mode 100644 index 9df17848b..000000000 --- a/Scripts/Data/DirectSelectionData.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9c8ec2a3c85dcc74cab963433ded00a9 -timeCreated: 1476735197 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs index 513db2a45..8d9e03e5d 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IUsesDirectSelection.cs @@ -13,7 +13,7 @@ public interface IUsesDirectSelection public static class IUsesDirectSelectionMethods { - internal delegate Dictionary GetDirectSelectionDelegate(); + internal delegate Dictionary GetDirectSelectionDelegate(); internal static GetDirectSelectionDelegate getDirectSelection { get; set; } @@ -21,7 +21,7 @@ public static class IUsesDirectSelectionMethods /// Returns a dictionary of direct selections /// /// Dictionary (K,V) where K = rayOrigin used to select the object and V = info about the direct selection - public static Dictionary GetDirectSelection(this IUsesDirectSelection obj) + public static Dictionary GetDirectSelection(this IUsesDirectSelection obj) { return getDirectSelection(); } diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 14f55007d..2ab3ec41b 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Core; using UnityEngine; using UnityEngine.InputNew; @@ -9,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject, IUsesNode, IIsRayActive, IIsMainMenuVisible, IIsInMiniWorld + ICanGrabObject, IUsesNode, IIsRayActive, IIsMainMenuVisible, IIsInMiniWorld, IRayToNode { [SerializeField] ActionMap m_ActionMap; @@ -94,8 +95,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon foreach (var kvp in directSelection) { var directRayOrigin = kvp.Key; - var directSelectionData = kvp.Value; - var directHoveredObject = directSelectionData.gameObject; + var directHoveredObject = kvp.Value; var directSelectionCandidate = this.GetSelectionCandidate(directHoveredObject, true); @@ -109,7 +109,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; - var grabbingNode = directSelectionData.node; + var grabbingNode = this.RequestNodeFromRayOrigin(directRayOrigin); var selectionTool = linkedObjects.Cast().FirstOrDefault(linkedObject => linkedObject.node == grabbingNode); if (selectionTool == null) continue; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index c15baeefd..8887957a2 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -299,8 +299,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_GrabData.Count == 0 && this.IsMainMenuVisible(directRayOrigin)) continue; - var directSelectionData = kvp.Value; - var directHoveredObject = directSelectionData.gameObject; + var directHoveredObject = kvp.Value; var selectionCandidate = this.GetSelectionCandidate(directHoveredObject, true); @@ -314,7 +313,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; - var grabbingNode = directSelectionData.node; + var grabbingNode = this.RequestNodeFromRayOrigin(directRayOrigin); var transformTool = linkedObjects.Cast().FirstOrDefault(linkedObject => linkedObject.node == grabbingNode); if (transformTool == null) continue; @@ -352,7 +351,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (objectsGrabbed != null && !m_Scaling) objectsGrabbed(directRayOrigin, grabbedObjects); - m_GrabData[grabbingNode] = new GrabData(directRayOrigin, transformInput, grabbedObjects.ToArray()); + m_GrabData[grabbingNode.Value] = new GrabData(directRayOrigin, transformInput, grabbedObjects.ToArray()); // A direct selection has been made. Hide the manipulator until the selection changes m_DirectSelected = true; From 3fd0b217e0a1f2bbf78dab2067f6953436ba50f9 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 14:58:49 -0700 Subject: [PATCH 573/870] Fix RequestNodeFromRayOrigin to check MiniWorlds; Add thumbstick press to WorkspaceInput for miniworld --- Scripts/Core/EditorVR.Rays.cs | 18 +++--- .../Base/ActionMaps/WorkspaceInput.asset | 60 +++++++++++++++++++ Workspaces/Base/ActionMaps/WorkspaceInput.cs | 2 + .../HapticPulses/WorkspaceMovePulse.asset | 2 +- .../MiniWorldWorkspace/MiniWorldWorkspace.cs | 4 +- 5 files changed, 74 insertions(+), 12 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 710809e1f..205785dc5 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -462,22 +462,22 @@ internal void PreProcessRaycastSource(Transform rayOrigin) static Node? RequestNodeFromRayOrigin(Transform rayOrigin) { - Node? node = null; - var evrDeviceData = evr.m_DeviceData; - for (var i = 0; i < evrDeviceData.Count; i++) + foreach (var deviceData in evr.m_DeviceData) { - var deviceData = evrDeviceData[i]; if (!deviceData.proxy.active) continue; if (deviceData.rayOrigin == rayOrigin) - { - node = deviceData.node; - break; - } + return deviceData.node; } - return node; + foreach (var kvp in evr.GetNestedModule().rays) + { + if (kvp.Key == rayOrigin) + return kvp.Value.node; + } + + return null; } } } diff --git a/Workspaces/Base/ActionMaps/WorkspaceInput.asset b/Workspaces/Base/ActionMaps/WorkspaceInput.asset index 1afdd9788..7c5d53d87 100644 --- a/Workspaces/Base/ActionMaps/WorkspaceInput.asset +++ b/Workspaces/Base/ActionMaps/WorkspaceInput.asset @@ -14,6 +14,8 @@ MonoBehaviour: m_Actions: - {fileID: 114000012773243498} - {fileID: 114000011558263038} + - {fileID: 114614252640910138} + - {fileID: 114687961567215380} m_ControlSchemes: - m_Name: VR m_DeviceSlots: @@ -47,6 +49,24 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 + - sources: + - controlIndex: 22 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 22 + deviceKey: 2 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 m_MapTypeName: WorkspaceInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: @@ -90,3 +110,43 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Move Resize Left defaultValue: 0 +--- !u!114 &114614252640910138 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: MiniWorld Pan/Zoom Left + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 2 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: MiniWorld Pan/Zoom Left + defaultValue: 0 +--- !u!114 &114687961567215380 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: MiniWorld Pan/Zoom Right + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 3 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: MiniWorld Pan/Zoom Right + defaultValue: 0 diff --git a/Workspaces/Base/ActionMaps/WorkspaceInput.cs b/Workspaces/Base/ActionMaps/WorkspaceInput.cs index 4ae2f1f7d..2981aaa67 100644 --- a/Workspaces/Base/ActionMaps/WorkspaceInput.cs +++ b/Workspaces/Base/ActionMaps/WorkspaceInput.cs @@ -9,5 +9,7 @@ public WorkspaceInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @moveResizeLeft { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @moveResizeRight { get { return (ButtonInputControl)this[1]; } } + public ButtonInputControl @miniWorldPanZoomLeft { get { return (ButtonInputControl)this[2]; } } + public ButtonInputControl @miniWorldPanZoomRight { get { return (ButtonInputControl)this[3]; } } } } diff --git a/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset b/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset index a34bdca20..e7945a156 100644 --- a/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset +++ b/Workspaces/Base/HapticPulses/WorkspaceMovePulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: MovePulse + m_Name: WorkspaceMovePulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 0.15 diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs index 3042cd5b5..ed112b496 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs @@ -229,14 +229,14 @@ public override void ProcessInput(ActionMapInput input, ConsumeControlDelegate c base.ProcessInput(input, consumeControl); var workspaceInput = (WorkspaceInput)input; - var leftControl = workspaceInput.moveResizeLeft; + var leftControl = workspaceInput.miniWorldPanZoomLeft; if (leftControl.wasJustPressed && miniWorld.Contains(leftRayOrigin.position)) { OnPanZoomDragStarted(leftRayOrigin); consumeControl(leftControl); } - var rightControl = workspaceInput.moveResizeRight; + var rightControl = workspaceInput.miniWorldPanZoomRight; if (rightControl.wasJustPressed && miniWorld.Contains(rightRayOrigin.position)) { OnPanZoomDragStarted(rightRayOrigin); From 685b9b03c675b0c63c466922bc53e8c942f23ce2 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 15:01:28 -0700 Subject: [PATCH 574/870] Send HoverExit events when isValid returns false --- .../Modules/MultipleRayInputModule/MultipleRayInputModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index f2e5d561b..b6ab05250 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -134,11 +134,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (source.isValid != null && !source.isValid(source)) { - HandlePointerExitAndEnter(eventData, hoveredObject, true); // Send only exit events var currentRaycast = eventData.pointerCurrentRaycast; currentRaycast.gameObject = null; eventData.pointerCurrentRaycast = currentRaycast; source.hoveredObject = null; + HandlePointerExitAndEnter(eventData, null, true); // Send only exit events continue; } From 576d82bd511d7ce81e8cd57b9c8a1bc60c014ac8 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 15:45:24 -0700 Subject: [PATCH 575/870] Rename HandleTip.handleTip to renderer; Update naming of ManipulatorController uses --- Manipulators/BaseManipulator.cs | 10 +++++----- Scripts/Core/EditorVR.UI.cs | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index cbad9597a..7ea6ade37 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -15,7 +15,7 @@ class BaseManipulator : MonoBehaviour, IManipulator class HandleTip { - public Renderer handleTip; + public Renderer renderer; public float direction = 1; public Vector3 lastPosition; public Vector3? positionOffset; @@ -78,7 +78,7 @@ protected virtual void OnDisable() foreach (var kvp in m_HandleTips) { - kvp.Value.handleTip.gameObject.SetActive(false); + kvp.Value.renderer.gameObject.SetActive(false); } } @@ -142,12 +142,12 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD handleTipRenderer = ObjectUtils.Instantiate(handleTipRenderer.gameObject, transform).GetComponent(); MaterialUtils.CloneMaterials(handleTipRenderer); - handleTip = new HandleTip { handleTip = handleTipRenderer }; + handleTip = new HandleTip { renderer = handleTipRenderer }; m_HandleTips[rayOrigin] = handleTip; } else { - handleTipRenderer = handleTip.handleTip; + handleTipRenderer = handleTip.renderer; } active = active && (handle is LinearHandle || handle is RadialHandle); @@ -215,7 +215,7 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD } if (handle.hasDragSource && !handleTip.positionOffset.HasValue) - handleTip.positionOffset = handle.transform.InverseTransformPoint(handleTip.handleTip.transform.position); + handleTip.positionOffset = handle.transform.InverseTransformPoint(handleTransform.position); } else if(!handle.hasDragSource) { diff --git a/Scripts/Core/EditorVR.UI.cs b/Scripts/Core/EditorVR.UI.cs index 6e6806b2f..2db62cff0 100644 --- a/Scripts/Core/EditorVR.UI.cs +++ b/Scripts/Core/EditorVR.UI.cs @@ -34,7 +34,7 @@ byte stencilRef Camera m_EventCamera; - readonly List m_ManipulatorVisibilities = new List(); + readonly List m_ManipulatorControllers = new List(); readonly HashSet m_ManipulatorsHiddenRequests = new HashSet(); public UI() @@ -47,9 +47,9 @@ public UI() public void ConnectInterface(object obj, Transform rayOrigin = null) { - var manipulatorVisiblity = obj as IManipulatorController; - if (manipulatorVisiblity != null) - m_ManipulatorVisibilities.Add(manipulatorVisiblity); + var manipulatorController = obj as IManipulatorController; + if (manipulatorController != null) + m_ManipulatorControllers.Add(manipulatorController); var usesStencilRef = obj as IUsesStencilRef; if (usesStencilRef != null) @@ -75,9 +75,9 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) public void DisconnectInterface(object obj, Transform rayOrigin = null) { - var manipulatorVisiblity = obj as IManipulatorController; - if (manipulatorVisiblity != null) - m_ManipulatorVisibilities.Remove(manipulatorVisiblity); + var manipulatorController = obj as IManipulatorController; + if (manipulatorController != null) + m_ManipulatorControllers.Remove(manipulatorController); } internal void Initialize() @@ -130,15 +130,15 @@ void SetManipulatorsVisible(ISetManipulatorsVisible setter, bool visible) bool GetManipulatorDragState() { - return m_ManipulatorVisibilities.Any(controller => controller.manipulatorDragging); + return m_ManipulatorControllers.Any(controller => controller.manipulatorDragging); } internal void UpdateManipulatorVisibilites() { var manipulatorsVisible = m_ManipulatorsHiddenRequests.Count == 0; - foreach (var mv in m_ManipulatorVisibilities) + foreach (var controller in m_ManipulatorControllers) { - mv.manipulatorVisible = manipulatorsVisible; + controller.manipulatorVisible = manipulatorsVisible; } } From 416953441b801f30228a5d847f1a8843beba451b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 15:46:33 -0700 Subject: [PATCH 576/870] Keep track of one lastClickTime rayOrigin --- Scripts/Handles/BaseHandle.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Scripts/Handles/BaseHandle.cs b/Scripts/Handles/BaseHandle.cs index f7f1dd3d3..1614c5679 100644 --- a/Scripts/Handles/BaseHandle.cs +++ b/Scripts/Handles/BaseHandle.cs @@ -30,7 +30,7 @@ public SelectionFlags selectionFlags protected readonly List m_HoverSources = new List(k_DefaultCapacity); protected readonly List m_DragSources = new List(k_DefaultCapacity); protected readonly Dictionary m_StartDragPositions = new Dictionary(k_DefaultCapacity); - protected DateTime m_LastClickTime; + protected readonly Dictionary m_LastClickTimes = new Dictionary(k_DefaultCapacity); public bool hasHoverSource { get { return m_HoverSources.Count > 0; } } public bool hasDragSource { get { return m_DragSources.Count > 0; } } @@ -112,8 +112,12 @@ public void OnBeginDrag(RayEventData eventData) var handleEventData = GetHandleEventData(eventData); //Double-click logic - var timeSinceLastClick = (float)(DateTime.Now - m_LastClickTime).TotalSeconds; - m_LastClickTime = DateTime.Now; + DateTime lastClickTime; + if (!m_LastClickTimes.TryGetValue(rayOrigin, out lastClickTime)) + m_LastClickTimes[rayOrigin] = new DateTime(); + + var timeSinceLastClick = (float)(DateTime.Now - lastClickTime).TotalSeconds; + m_LastClickTimes[rayOrigin] = DateTime.Now; if (UIUtils.IsDoubleClick(timeSinceLastClick)) OnDoubleClick(handleEventData); From 69a82cae87f82438d129ff804d23f815b036e9e0 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 15:48:15 -0700 Subject: [PATCH 577/870] Use Mathf.Clamp instead of max/min --- Scripts/Handles/SphereHandle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Handles/SphereHandle.cs b/Scripts/Handles/SphereHandle.cs index 6e7db7ac2..d7aeb755d 100644 --- a/Scripts/Handles/SphereHandle.cs +++ b/Scripts/Handles/SphereHandle.cs @@ -68,7 +68,7 @@ public void ChangeRadius(float delta) { var distance = Vector3.Distance(CameraUtils.GetMainCamera().transform.position, transform.position); m_CurrentRadius += delta * distance * k_DistanceScale; - m_CurrentRadius = Mathf.Min(Mathf.Max(m_CurrentRadius, 0f), k_MaxSphereRadius * this.GetViewerScale()); + m_CurrentRadius = Mathf.Clamp(m_CurrentRadius, 0f, k_MaxSphereRadius * this.GetViewerScale()); } public void OnScroll(PointerEventData eventData) From 1bb229340e6cce3935a2c82fdec7d11f684dba30 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 20:27:16 -0700 Subject: [PATCH 578/870] Refactor UpdateHierarchyData to not rely on recursion; Draw scene root in hierarchy --- Scripts/Data/HierarchyData.cs | 8 +- Scripts/Modules/HierarchyModule.cs | 141 +++++-------- .../Prefabs/HierarchyListItem.prefab | 191 +++++++++++++++++- .../Scripts/HierarchyListItem.cs | 43 +++- 4 files changed, 270 insertions(+), 113 deletions(-) diff --git a/Scripts/Data/HierarchyData.cs b/Scripts/Data/HierarchyData.cs index 89fc5ab55..5c2ff22c2 100644 --- a/Scripts/Data/HierarchyData.cs +++ b/Scripts/Data/HierarchyData.cs @@ -21,13 +21,13 @@ public override int index public HashSet types { get; set; } - public HierarchyData(string name, int instanceID, HashSet types, List children = null) + + public HierarchyData(HierarchyProperty property, HashSet types) { template = k_TemplateName; - this.name = name; - this.instanceID = instanceID; + name = property.name; + instanceID = property.instanceID; this.types = types; - m_Children = children; } } } diff --git a/Scripts/Modules/HierarchyModule.cs b/Scripts/Modules/HierarchyModule.cs index 7ee6afafc..ae741f9a8 100644 --- a/Scripts/Modules/HierarchyModule.cs +++ b/Scripts/Modules/HierarchyModule.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules sealed class HierarchyModule : MonoBehaviour, ISelectionChanged { readonly List m_HierarchyLists = new List(); - HierarchyData m_HierarchyData; + readonly List m_HierarchyData = new List(); HierarchyProperty m_HierarchyProperty; readonly List m_FilterUIs = new List(); @@ -60,128 +60,81 @@ List GetFilterList() List GetHierarchyData() { - if (m_HierarchyData == null) - return new List(); - - return m_HierarchyData.children; + return m_HierarchyData ?? new List(); } void UpdateHierarchyData() { m_ObjectTypes.Clear(); + m_HierarchyData.Clear(); if (m_HierarchyProperty == null) - { m_HierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects); - m_HierarchyProperty.Next(null); - } else - { m_HierarchyProperty.Reset(); - m_HierarchyProperty.Next(null); - } - - var hasChanged = false; - var hasNext = true; - m_HierarchyData = CollectHierarchyData(ref hasNext, ref hasChanged, m_HierarchyData, m_HierarchyProperty, m_ObjectTypes); - if (hasChanged) + var lastDepth = 0; + var stack = new Stack(); + while (m_HierarchyProperty.Next(null)) { - foreach (var list in m_HierarchyLists) - { - list.hierarchyData = GetHierarchyData(); - } - - // Send new data to existing filterUIs - foreach (var filterUI in m_FilterUIs) + var instanceID = m_HierarchyProperty.instanceID; + var go = EditorUtility.InstanceIDToObject(instanceID); + var currentDepth = m_HierarchyProperty.depth; + if (go == gameObject) { - filterUI.filterList = GetFilterList(); + var depth = currentDepth; + // skip children of EVR to prevent the display of EVR contents + while (m_HierarchyProperty.Next(null) && m_HierarchyProperty.depth > depth) { } + + currentDepth = m_HierarchyProperty.depth; + instanceID = m_HierarchyProperty.instanceID; + // If EVR is the last object, early out + if (instanceID == 0) + break; } - } - } - - HierarchyData CollectHierarchyData(ref bool hasNext, ref bool hasChanged, HierarchyData hd, HierarchyProperty hp, HashSet objectTypes) - { - var depth = hp.depth; - var name = hp.name; - var instanceID = hp.instanceID; - var types = InstanceIDToComponentTypes(instanceID, objectTypes); - - List children = null; - if (hp.hasChildren) - { - if (hd != null && hd.children == null) - hasChanged = true; - children = hd == null || hd.children == null ? new List() : hd.children; + var types = InstanceIDToComponentTypes(instanceID, m_ObjectTypes); + var currentHierarchyData = new HierarchyData(m_HierarchyProperty, types); - hasNext = hp.Next(null); - var i = 0; - while (hasNext && hp.depth > depth) + HierarchyData parent = null; + if (currentDepth <= lastDepth) { - var go = EditorUtility.InstanceIDToObject(hp.instanceID); - - if (go == gameObject) + // Add one to pop off last sibling + var count = lastDepth - currentDepth + 1; + while (count-- > 0 && stack.Count > 0) { - // skip children of EVR to prevent the display of EVR contents - while (hp.Next(null) && hp.depth > depth + 1) { } - - // If EVR is the last object, don't add anything to the list - if (hp.instanceID == 0) - break; - - name = hp.name; - instanceID = hp.instanceID; - types = InstanceIDToComponentTypes(instanceID, objectTypes); - } - - if (i >= children.Count) - { - children.Add(CollectHierarchyData(ref hasNext, ref hasChanged, null, hp, objectTypes)); - hasChanged = true; - } - else if (children[i].index != hp.instanceID) - { - children[i] = CollectHierarchyData(ref hasNext, ref hasChanged, null, hp, objectTypes); - hasChanged = true; - } - else - { - children[i] = CollectHierarchyData(ref hasNext, ref hasChanged, children[i], hp, objectTypes); + stack.Pop(); } + } - if (hasNext) - hasNext = hp.Next(null); + if (stack.Count > 0) + parent = stack.Peek(); - i++; + if (parent != null) + { + if (parent.children == null) + parent.children = new List(); + parent.children.Add(currentHierarchyData); } - - if (i != children.Count) + else { - children.RemoveRange(i, children.Count - i); - hasChanged = true; + m_HierarchyData.Add(currentHierarchyData); } - if (children.Count == 0) - children = null; - - if (hasNext) - hp.Previous(null); + stack.Push(currentHierarchyData); + lastDepth = currentDepth; } - else if (hd != null && hd.children != null) + + foreach (var list in m_HierarchyLists) { - hasChanged = true; + list.hierarchyData = GetHierarchyData(); } - if (hd != null) + // Send new data to existing filterUIs + foreach (var filterUI in m_FilterUIs) { - hd.children = children; - hd.name = name; - hd.instanceID = instanceID; - hd.types = types; + filterUI.filterList = GetFilterList(); } - - return hd ?? new HierarchyData(name, instanceID, types, children); } static HashSet InstanceIDToComponentTypes(int instanceID, HashSet allTypes) @@ -191,10 +144,8 @@ static HashSet InstanceIDToComponentTypes(int instanceID, HashSet(); - for (int i = 0; i < components.Length; i++) + foreach (var component in components) { - var component = components[i]; - if (!component) continue; diff --git a/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab b/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab index a094783c2..9ccbca64a 100644 --- a/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab +++ b/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab @@ -41,7 +41,7 @@ GameObject: - component: {fileID: 222000012560431470} - component: {fileID: 114000013632537286} m_Layer: 5 - m_Name: Text + m_Name: SceneText m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -120,6 +120,55 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1407269964740084 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4149368731521994} + - component: {fileID: 33251685153113494} + - component: {fileID: 23280758573819164} + m_Layer: 0 + m_Name: SceneIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1522722938377154 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224115672245688706} + - component: {fileID: 222608860966768846} + - component: {fileID: 114433554785773084} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1668105077605892 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4915716757996668} + m_Layer: 0 + m_Name: SceneIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4000012112020226 Transform: m_ObjectHideFlags: 1 @@ -131,7 +180,7 @@ Transform: m_LocalScale: {x: 0.1, y: 0.005, z: 0.016} m_Children: [] m_Father: {fileID: 224000012423797820} - m_RootOrder: 3 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013103477036 Transform: @@ -157,7 +206,7 @@ Transform: m_LocalScale: {x: 0.02, y: 0.02, z: 0.02} m_Children: [] m_Father: {fileID: 224000012423797820} - m_RootOrder: 4 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000014207549962 Transform: @@ -170,8 +219,35 @@ Transform: m_LocalScale: {x: 0.015, y: 0.015, z: 0.2} m_Children: [] m_Father: {fileID: 224000012423797820} - m_RootOrder: 2 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!4 &4149368731521994 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1407269964740084} + m_LocalRotation: {x: -0.14110889, y: -0.38632697, z: 0.32493064, w: 0.8516219} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.7698965, y: 0.76989645, z: 0.7698965} + m_Children: [] + m_Father: {fileID: 4915716757996668} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0.614, y: -48.569, z: 41.491} +--- !u!4 &4915716757996668 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1668105077605892} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.0243, y: 0.008, z: 0.0003} + m_LocalScale: {x: 0.016412389, y: 0.01641238, z: 0.016412381} + m_Children: + - {fileID: 4149368731521994} + m_Father: {fileID: 224000012423797820} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &23000010055392968 MeshRenderer: m_ObjectHideFlags: 1 @@ -300,6 +376,39 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 +--- !u!23 &23280758573819164 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1407269964740084} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 3ac4991e69337ae41badfeef7c8ba134, type: 2} + - {fileID: 2100000, guid: d3bb23d585e936140a5f274d7450f24e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 --- !u!33 &33000010220856868 MeshFilter: m_ObjectHideFlags: 1 @@ -328,6 +437,13 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013287519124} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &33251685153113494 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1407269964740084} + m_Mesh: {fileID: 4300000, guid: 4f59d2c28d92b4a0486ef9a7530a7236, type: 3} --- !u!65 &65000010297142882 BoxCollider: m_ObjectHideFlags: 1 @@ -399,10 +515,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3bf7c67220198eb46888299659a385ff, type: 3} m_Name: m_EditorClassIdentifier: - m_Text: {fileID: 114000013632537286} + m_Text: {fileID: 114433554785773084} + m_SceneText: {fileID: 114000013632537286} m_Lock: {fileID: 114000011118187708} m_Cube: {fileID: 114000012425087266} m_ExpandArrow: {fileID: 114000011951837648} + m_SceneIcon: {fileID: 4915716757996668} m_DropZone: {fileID: 114000014220381596} m_NoClipExpandArrow: {fileID: 2100000, guid: d066c89af6b2b864cb02f409d89ce3ba, type: 2} m_NoClipBackingCube: {fileID: 2100000, guid: 1a070009f7968b74abbf1a1ae823b472, type: 2} @@ -482,12 +600,51 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_SelectionFlags: 3 +--- !u!114 &114433554785773084 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1522722938377154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: 2569ce4f009c407448c0df4aa8d7db55, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 7 + m_MaxSize: 300 + m_Alignment: 3 + m_AlignByGeometry: 1 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Test Text --- !u!222 &222000012560431470 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012579815556} +--- !u!222 &222608860966768846 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1522722938377154} --- !u!224 &224000012423797820 RectTransform: m_ObjectHideFlags: 1 @@ -499,7 +656,9 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4000013103477036} + - {fileID: 224115672245688706} - {fileID: 224000013671661884} + - {fileID: 4915716757996668} - {fileID: 4000014207549962} - {fileID: 4000012112020226} - {fileID: 4000013634378948} @@ -508,7 +667,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -334, y: -97} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0.1, y: 0.1} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013671661884 @@ -519,6 +678,24 @@ RectTransform: m_GameObject: {fileID: 1000012579815556} m_LocalRotation: {x: 0.38268343, y: -0, z: -0, w: 0.92387956} m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.0009999999, y: 0.0009999999, z: 0.0009999999} + m_Children: [] + m_Father: {fileID: 224000012423797820} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.0141, y: 0.0079956055} + m_SizeDelta: {x: 51.1145, y: 20} + m_Pivot: {x: 0, y: 0.5} +--- !u!224 &224115672245688706 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1522722938377154} + m_LocalRotation: {x: 0.38268343, y: -0, z: -0, w: 0.92387956} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.001, y: 0.001, z: 0.001} m_Children: [] m_Father: {fileID: 224000012423797820} @@ -527,5 +704,5 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -0.033125866, y: 0.008} - m_SizeDelta: {x: 80, y: 20} + m_SizeDelta: {x: 70.0878, y: 20} m_Pivot: {x: 0, y: 0.5} diff --git a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs index f95740e50..926d19645 100644 --- a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs +++ b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs @@ -19,6 +19,9 @@ sealed class HierarchyListItem : DraggableListItem, IUsesVie [SerializeField] Text m_Text; + [SerializeField] + Text m_SceneText; + [SerializeField] BaseHandle m_Lock; @@ -28,6 +31,9 @@ sealed class HierarchyListItem : DraggableListItem, IUsesVie [SerializeField] BaseHandle m_ExpandArrow; + [SerializeField] + Transform m_SceneIcon; + [SerializeField] BaseHandle m_DropZone; @@ -77,7 +83,7 @@ sealed class HierarchyListItem : DraggableListItem, IUsesVie Material m_LockIconMaterial; Material m_UnlockIconMaterial; - bool m_HoveringLock = false; + bool m_HoveringLock; public bool hovering { get; private set; } public Transform hoveringRayOrigin { get; private set; } @@ -150,7 +156,22 @@ public override void Setup(HierarchyData data) m_CubeTransform = m_Cube.transform; m_DropZoneTransform = m_DropZone.transform; - m_Text.text = data.name; + + var name = data.name; + if (data.gameObject == null) + { + m_SceneText.text = string.IsNullOrEmpty(name) ? "Untitled" : name; + m_SceneIcon.gameObject.SetActive(true); + m_SceneText.gameObject.SetActive(true); + m_Text.gameObject.SetActive(false); + } + else + { + m_Text.text = name; + m_SceneIcon.gameObject.SetActive(false); + m_SceneText.gameObject.SetActive(false); + m_Text.gameObject.SetActive(true); + } hovering = false; } @@ -158,6 +179,7 @@ public override void Setup(HierarchyData data) public void SetMaterials(Material textMaterial, Material expandArrowMaterial, Material lockIconMaterial, Material unlockIconMaterial) { m_Text.material = textMaterial; + m_SceneText.material = textMaterial; m_ExpandArrowMaterial = expandArrowMaterial; m_ExpandArrowRenderer.sharedMaterial = expandArrowMaterial; m_LockIconMaterial = lockIconMaterial; @@ -182,17 +204,24 @@ public void UpdateSelf(float width, int depth, bool? expanded, bool selected, bo m_LockRenderer.sharedMaterial = (!locked && m_HoveringLock) || (locked && !m_HoveringLock) ? m_LockIconMaterial : m_UnlockIconMaterial; var lockIconTransform = m_Lock.transform; var lockWidth = lockIconTransform.localScale.x * 0.5f; - + // Text is next to arrow, with a margin and indent, rotated toward camera - var textTransform = m_Text.transform; - m_Text.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, (width - doubleMargin - indent) * 1 / textTransform.localScale.x); - textTransform.localPosition = new Vector3(doubleMargin + indent + arrowWidth - halfWidth, textTransform.localPosition.y, 0); + var gameObject = data.gameObject; + if (gameObject == null) + indent = k_Indent * 2; + var textTransform = gameObject ? m_Text.transform : m_SceneText.transform; + var textRectTransform = gameObject ? m_Text.rectTransform : m_SceneText.rectTransform; + textRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, (width - doubleMargin - indent) * 1 / textTransform.localScale.x); + textTransform.localPosition = new Vector3(doubleMargin + indent + arrowWidth - halfWidth, textTransform.localPosition.y, 0); lockIconTransform.localPosition = new Vector3(halfWidth - lockWidth - k_Margin, lockIconTransform.localPosition.y, 0); + var sceneIconPosition = m_SceneIcon.localPosition; + m_SceneIcon.localPosition = new Vector3(-halfWidth + k_Margin + arrowWidth + k_Indent, sceneIconPosition.y, sceneIconPosition.z); var localRotation = CameraUtils.LocalRotateTowardCamera(transform.parent.rotation); textTransform.localRotation = localRotation; lockIconTransform.localRotation = localRotation; + m_SceneIcon.localRotation = localRotation; var dropZoneScale = m_DropZoneTransform.localScale; dropZoneScale.x = width - indent; @@ -203,7 +232,7 @@ public void UpdateSelf(float width, int depth, bool? expanded, bool selected, bo UpdateArrow(expanded); - var isPrefab = PrefabUtility.GetPrefabType(data.gameObject) == PrefabType.PrefabInstance; + var isPrefab = gameObject && PrefabUtility.GetPrefabType(gameObject) == PrefabType.PrefabInstance; // Set selected/hover/normal color if (selected) { From 83a8160978e147f37cfbeb700ff2e89eaf99e3b6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 13 Jul 2017 21:08:55 -0700 Subject: [PATCH 579/870] Refactor Spatial Hinting system into an EVR module; remove any Spatial Hinting direct references & instantiation logic from PinnedToolsMenuUI --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 11 ++- .../Scripts/PinnedToolsMenuUI.cs | 55 ++++++------ Scripts/Core/EditorVR.Tools.cs | 30 +++++++ Scripts/Core/EditorVR.cs | 1 + .../SpatialHintModuleConnector.cs | 17 ++++ .../SpatialHintModuleConnector.cs.meta | 12 +++ .../IControlSpatialHinting.cs | 63 +++++++++++++ .../IControlSpatialHinting.cs.meta | 12 +++ Scripts/Modules/SpatialHintModule.meta | 9 ++ .../SpatialHintModule/SpatialHintModule.cs | 89 +++++++++++++++++++ .../SpatialHintModule.cs.meta | 14 +++ .../SpatialHintModule/SpatialHintModuleUI.cs | 35 +++++--- .../SpatialHintModuleUI.cs.meta | 0 .../SpatialHintModule}/SpatialHintUI.prefab | 40 ++++----- .../SpatialHintUI.prefab.meta | 0 15 files changed, 329 insertions(+), 59 deletions(-) create mode 100644 Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs create mode 100644 Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs.meta create mode 100644 Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs.meta create mode 100644 Scripts/Modules/SpatialHintModule.meta create mode 100644 Scripts/Modules/SpatialHintModule/SpatialHintModule.cs create mode 100644 Scripts/Modules/SpatialHintModule/SpatialHintModule.cs.meta rename Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs => Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs (89%) rename Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs.meta => Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs.meta (100%) rename {Menus/PinnedToolMenu/Prefabs => Scripts/Modules/SpatialHintModule}/SpatialHintUI.prefab (99%) rename {Menus/PinnedToolMenu/Prefabs => Scripts/Modules/SpatialHintModule}/SpatialHintUI.prefab.meta (100%) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 0b7c3f277..caff2e03e 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -16,7 +16,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics, IUsesViewerScale + sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics, IUsesViewerScale, IControlSpatialHinting { const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation @@ -113,6 +113,15 @@ public Transform alternateMenuOrigin public event Action itemWasSelected; */ + // Spatial Hint Module implementation + public bool spatialHintVisualsVisible { get; set; } + public bool spatialHintPreScrollVisualsVisible { get; set; } + public bool spatialHintPrimaryArrowsVisible { get; set; } + public bool spatialHintSecondaryArrowsVisible { get; set; } + public Vector3 spatialHintScrollVisualsRotation { get; set; } + public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition { get; set; } + public Transform spatialHintContentContainer { get; set; } + void Awake() { createPinnedToolButton = CreatePinnedToolButton; diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index c27ee0b7d..1897c92b5 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI, IConnectInterfaces + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI, IConnectInterfaces, IControlSpatialHinting { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -26,9 +26,6 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I [SerializeField] Vector3 m_AlternateLocalScale; - [SerializeField] - SpatialHintUI m_SpatialHintUI; - bool m_AllButtonsVisible; List m_OrderedButtons; Coroutine m_ShowHideAllButtonsCoroutine; @@ -42,8 +39,6 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I Quaternion m_HintContentContainerInitialRotation; Quaternion m_HintContentContainerCurrentRotation; Vector3 m_HintContentWorldPosition; - Transform m_SpatialHintContentContainer; - //Quaternion m_SpatialScrollOrientation; public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } @@ -51,6 +46,15 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I public Action mainMenuActivatorSelected { get; set; } public List buttons { get { return m_OrderedButtons; } } + // Spatial Hint Module implementation + public bool spatialHintVisualsVisible { get; set; } + public bool spatialHintPreScrollVisualsVisible { get; set; } + public bool spatialHintPrimaryArrowsVisible { get; set; } + public bool spatialHintSecondaryArrowsVisible { get; set; } + public Vector3 spatialHintScrollVisualsRotation { get; set; } + public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition { get; set; } + public Transform spatialHintContentContainer { get; set; } + public bool allButtonsVisible { get { return m_AllButtonsVisible; } @@ -70,9 +74,9 @@ public bool allButtonsVisible //spatialDragDistance = 0f; ShowOnlyMenuAndActiveToolButtons(); - m_SpatialHintUI.preScrollVisualsVisible = false; - m_SpatialHintUI.primaryArrowsVisible = false; - m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; + spatialHintPreScrollVisualsVisible = false; + spatialHintPrimaryArrowsVisible = false; + spatialHintScrollVisualsRotation = Vector3.zero; } } } @@ -112,7 +116,7 @@ public bool spatialScrollVisualsVisible set { if (!value) - m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; + spatialHintScrollVisualsRotation = Vector3.zero; } } @@ -124,12 +128,12 @@ public bool beginningSpatialScrolling { Debug.LogWarning("SETTING Spatial Drag Distance : " + value); m_SpatialDragDistance = 0f; - m_SpatialHintUI.scrollVisualsRotation = Vector3.zero; + spatialHintScrollVisualsRotation = Vector3.zero; var currentRotation = transform.rotation.eulerAngles; m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); - m_SpatialHintUI.preScrollVisualsVisible = true; + spatialHintPreScrollVisualsVisible = true; m_HintContentWorldPosition = transform.position; - m_SpatialHintContentContainer.position = m_HintContentWorldPosition; + spatialHintContentContainer.position = m_HintContentWorldPosition; } } } @@ -150,11 +154,11 @@ public Vector3? startingDragOrigin Debug.LogWarning("SETTING STARGIN DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); m_StartingDragOrigin = transform.position; - var orig = m_SpatialHintContentContainer.rotation; - m_SpatialHintContentContainer.LookAt(value.Value); + var orig = spatialHintContentContainer.rotation; + spatialHintContentContainer.LookAt(value.Value); Debug.LogError(value.Value.ToString("F4")); //m_SpatialScrollOrientation = Quaternion.Euler(value.Value); // Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); - m_SpatialHintContentContainer.rotation = orig; + spatialHintContentContainer.rotation = orig; } } @@ -169,11 +173,6 @@ void Awake() { m_OriginalLocalScale = transform.localScale; m_OrderedButtons = new List(); - Debug.LogError("PinnedToolsMenuUI initialized"); - - m_SpatialHintUI = this.InstantiateUI(m_SpatialHintUI.gameObject).GetComponent(); - this.ConnectInterfaces(m_SpatialHintUI); - m_SpatialHintContentContainer = m_SpatialHintUI.contentContainer; } void Update() @@ -187,8 +186,8 @@ void Update() if (Mathf.Approximately(m_SpatialDragDistance, 1f)) { m_DragTarget = transform.position; // Cache the initial drag target position, before performing any extra shapting to the target Vec3 - m_SpatialHintUI.primaryArrowsVisible = false; - m_SpatialHintUI.preScrollVisualsVisible = false; + spatialHintPrimaryArrowsVisible = false; + spatialHintPreScrollVisualsVisible = false; } // Follow the user's input for a short additional period of time @@ -213,10 +212,10 @@ void Update() } else if (m_AllButtonsVisible && m_SpatialDragDistance > 2) { - m_SpatialHintUI.scrollVisualsRotation = m_DragTarget; + spatialHintScrollVisualsRotation = m_DragTarget; } - m_SpatialHintUI.scrollVisualsDragThresholdTriggerPosition = transform.position; + spatialHintScrollVisualsDragThresholdTriggerPosition = transform.position; //m_SpatialHintUI.scrollVisualsRotation = Quaternion.Euler(endingDragDefinitionPosition - startingDragDefinitionPosition); /* else if (Mathf.Approximately(m_SmoothedSpatialDragDistance, 1f)) @@ -228,7 +227,7 @@ void Update() //Debug.LogError("Hint Container" + m_HintContentContainerInitialRotation); //Debug.LogError("UI" + transform.rotation); - m_SpatialHintContentContainer.rotation = newHintContainerRotation; + spatialHintContentContainer.rotation = newHintContainerRotation; //m_SpatialHintContentContainer.position = m_HintContentWorldPosition; //Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); @@ -455,7 +454,7 @@ public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) if (!button.highlighted && buttonHovered != null) { // Process haptic pulse if button was not already highlighted - m_SpatialHintUI.PulseScrollArrows(); + this.PulseScrollArrows(); buttonHovered(); } @@ -483,7 +482,7 @@ public void SelectHighlightedButton() buttonClicked(); allButtonsVisible = false; - m_SpatialHintUI.visible = false; + spatialHintVisualsVisible = false; return; } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 4a0339d6a..c81554285 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -54,6 +54,19 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) linkedObjectList.Add(linkedObject); linkedObject.linkedObjects = linkedObjectList; } + + var spatialHintModule = evr.GetModule(); + var controlSpatialHinting = obj as IControlSpatialHinting; + if (controlSpatialHinting != null) + { + controlSpatialHinting.spatialHintContentContainer = spatialHintModule.spatialHintContentContainer; + controlSpatialHinting.spatialHintVisualsVisible = spatialHintModule.spatialHintVisualsVisible; + controlSpatialHinting.spatialHintPreScrollVisualsVisible = spatialHintModule.spatialHintPreScrollVisualsVisible; + controlSpatialHinting.spatialHintPrimaryArrowsVisible = spatialHintModule.spatialHintPrimaryArrowsVisible; + controlSpatialHinting.spatialHintSecondaryArrowsVisible = spatialHintModule.spatialHintSecondaryArrowsVisible; + controlSpatialHinting.spatialHintScrollVisualsRotation = spatialHintModule.spatialHintScrollVisualsRotation; + controlSpatialHinting.spatialHintScrollVisualsDragThresholdTriggerPosition = spatialHintModule.spatialHintScrollVisualsDragThresholdTriggerPosition; + } } public void DisconnectInterface(object obj, Transform rayOrigin = null) @@ -78,6 +91,7 @@ internal static void SpawnDefaultTools(IProxy proxy) var lockModule = evr.GetModule(); var defaultTools = evr.m_DefaultTools; var pinnedTools = evr.GetNestedModule(); + var spatialHintModule = evr.GetModule(); foreach (var deviceData in evr.m_DeviceData) { @@ -136,6 +150,22 @@ internal static void SpawnDefaultTools(IProxy proxy) pinnedToolsMenu.createPinnedToolButton(typeof(SelectionTool), selectionToolData.icon, deviceData.node); // Initialize PinnedToolButtons & set SelectionTool as the active tool type //pinnedTools.SetupPinnedToolButtonsForDevice(deviceData.rayOrigin, typeof(SelectionTool), deviceData.node); + + // Hook up Spatial Hinting functionality, if the PinnedToolsMenu implements the interface + /* + var spatialPinnedToolsMenu = pinnedToolsMenu as IControlSpatialHinting; + if (spatialPinnedToolsMenu != null) + { + //evr.m_Interfaces.ConnectInterfaces(pinnedToolsMenu); + spatialPinnedToolsMenu.spatialHintContentContainer = spatialHintModule.spatialHintContentContainer; + spatialPinnedToolsMenu.spatialHintVisualsVisible = spatialHintModule.spatialHintVisualsVisible; + spatialPinnedToolsMenu.spatialHintPreScrollVisualsVisible = spatialHintModule.spatialHintPreScrollVisualsVisible; + spatialPinnedToolsMenu.spatialHintPrimaryArrowsVisible = spatialHintModule.spatialHintPrimaryArrowsVisible; + spatialPinnedToolsMenu.spatialHintSecondaryArrowsVisible = spatialHintModule.spatialHintSecondaryArrowsVisible; + spatialPinnedToolsMenu.spatialHintScrollVisualsRotation = spatialHintModule.spatialHintScrollVisualsRotation; + spatialPinnedToolsMenu.spatialHintScrollVisualsDragThresholdTriggerPosition = spatialHintModule.spatialHintScrollVisualsDragThresholdTriggerPosition; + } + */ } evr.GetModule().UpdatePlayerHandleMaps(); diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 79b0c5493..c69ab187f 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -204,6 +204,7 @@ void Awake() return false; }; + AddModule(); AddModule(); viewer.AddPlayerModel(); diff --git a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs new file mode 100644 index 000000000..79ea905d8 --- /dev/null +++ b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs @@ -0,0 +1,17 @@ +#if UNITY_EDITOR && UNITY_EDITORVR +using UnityEditor.Experimental.EditorVR.Modules; + +namespace UnityEditor.Experimental.EditorVR.Core +{ + partial class EditorVR + { + class SpatialHintModuleConnector : Nested, ILateBindInterfaceMethods + { + public void LateBindInterfaceMethods(SpatialHintModule provider) + { + IControlSpatialHintingMethods.pulseScrollArrows = provider.PulseScrollArrows; + } + } + } +} +#endif diff --git a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs.meta b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs.meta new file mode 100644 index 000000000..0ce5544e0 --- /dev/null +++ b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 160f2053e594df84993a7f20d25165e1 +timeCreated: 1489520545 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs new file mode 100644 index 000000000..90cb17a37 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs @@ -0,0 +1,63 @@ +#if UNITY_EDITOR +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Gives decorated class ability to control spatial-hinting visuals + /// + public interface IControlSpatialHinting + { + /// + /// Description + /// + bool spatialHintVisualsVisible { get; set; } + + /// + /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action + /// This is only enabled before the enabling of the main select visuals + /// + bool spatialHintPreScrollVisualsVisible { set; } + + /// + /// Description + /// + bool spatialHintPrimaryArrowsVisible { set; } + + /// + /// Description + /// + bool spatialHintSecondaryArrowsVisible { set; } + + /// + /// Description + /// + Vector3 spatialHintScrollVisualsRotation { set; } + + /// + /// Description + /// + Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition { set; } + + /// + /// Description + /// + Transform spatialHintContentContainer { get; set; } + } + + public static class IControlSpatialHintingMethods + { + internal delegate void PulseScrollArrowsDelegate(); + + internal static PulseScrollArrowsDelegate pulseScrollArrows { get; set; } + + /// + /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatiatil scroll + /// + public static void PulseScrollArrows(this IControlSpatialHinting obj) + { + pulseScrollArrows(); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs.meta new file mode 100644 index 000000000..ee498b606 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f7acad9cc0296174bade9f5725fbf658 +timeCreated: 1468885156 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SpatialHintModule.meta b/Scripts/Modules/SpatialHintModule.meta new file mode 100644 index 000000000..ffcdaeff4 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 83948b4ab2249124cb3107791e6b7534 +folderAsset: yes +timeCreated: 1499979046 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs new file mode 100644 index 000000000..cb9478cc2 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -0,0 +1,89 @@ +#if UNITY_EDITOR +using UnityEditor.Experimental.EditorVR.Menus; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Modules +{ + sealed class SpatialHintModule : MonoBehaviour, IConnectInterfaces, IInstantiateUI + { + [SerializeField] + SpatialHintModuleUI m_SpatialHintModuleUI; + + /// + /// Description + /// + public bool spatialHintVisualsVisible + { + get { return m_SpatialHintModuleUI.visible; } + set { m_SpatialHintModuleUI.visible = value; } + } + + /// + /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action + /// This is only enabled before the enabling of the main select visuals + /// + public bool spatialHintPreScrollVisualsVisible + { + get { return m_SpatialHintModuleUI.preScrollVisualsVisible; } + set { m_SpatialHintModuleUI.preScrollVisualsVisible = value; } + } + + /// + /// Description + /// + public bool spatialHintPrimaryArrowsVisible + { + get { return m_SpatialHintModuleUI.primaryArrowsVisible; } + set { m_SpatialHintModuleUI.primaryArrowsVisible = value; } + } + + /// + /// Description + /// + public bool spatialHintSecondaryArrowsVisible + { + get { return m_SpatialHintModuleUI.secondaryArrowsVisible; } + set { m_SpatialHintModuleUI.secondaryArrowsVisible = value; } + } + + /// + /// Description + /// + public Vector3 spatialHintScrollVisualsRotation + { + get { return m_SpatialHintModuleUI.scrollVisualsRotation; } + set { m_SpatialHintModuleUI.scrollVisualsRotation = value; } + } + + /// + /// Description + /// + public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition + { + get { return m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition; } + set { m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = value; } + } + + /// + /// Description + /// + public Transform spatialHintContentContainer { get { return m_SpatialHintModuleUI.contentContainer; } } + + void Awake() + { + Debug.LogError("PinnedToolsMenuUI initialized"); + m_SpatialHintModuleUI = this.InstantiateUI(m_SpatialHintModuleUI.gameObject).GetComponent(); + this.ConnectInterfaces(m_SpatialHintModuleUI); + } + + /// + /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatiatil scroll + /// + public void PulseScrollArrows() + { + Debug.LogError("Pulse scroll arrows called !!!!!!!!!! <-------------------------------------------------"); + m_SpatialHintModuleUI.PulseScrollArrows(); + } + } +} +#endif diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs.meta b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs.meta new file mode 100644 index 000000000..9aa0465d2 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 6a66c1a4c74c6454eb9140a886e8f9e8 +timeCreated: 1499980636 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_SpatialHintModuleUI: {fileID: 114885606894613528, guid: cdc0eb858b1c7ed488024c8ad974bd47, + type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs similarity index 89% rename from Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs rename to Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 1ccc42741..833aeda76 100644 --- a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -1,12 +1,11 @@ using System.Collections; -using System.Security.Cryptography.X509Certificates; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Menus { - public class SpatialHintUI : MonoBehaviour, IUsesViewerScale + public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale { readonly Color k_PrimaryArrowColor = Color.white; @@ -38,6 +37,10 @@ public class SpatialHintUI : MonoBehaviour, IUsesViewerScale HintIcon[] m_SecondaryRotationalHintArrows; */ + bool m_Visible; + bool m_PreScrollVisualsVisible; + bool m_PrimaryArrowsVisible; + bool m_SecondaryArrowsVisible; Vector3 m_ScrollVisualsRotation; Transform m_ScrollVisualsTransform; GameObject m_ScrollVisualsGameObject; @@ -46,9 +49,12 @@ public class SpatialHintUI : MonoBehaviour, IUsesViewerScale public bool visible { + get { return m_Visible; } set { - if (value) + m_Visible = value; + + if (m_Visible) { foreach (var arrow in m_PrimaryDirectionalHintArrows) { @@ -83,11 +89,14 @@ public bool visible /// public bool preScrollVisualsVisible { + get { return m_PreScrollVisualsVisible; } set { + m_PreScrollVisualsVisible = value; + transform.localScale = Vector3.one * this.GetViewerScale(); - this.RestartCoroutine(ref m_VisibilityCoroutine, value ? AnimateShow() : AnimateHide()); + this.RestartCoroutine(ref m_VisibilityCoroutine, m_PreScrollVisualsVisible ? AnimateShow() : AnimateHide()); var semiTransparentWhite = new Color(1f, 1f, 1f, 0.5f); foreach (var arrow in m_PrimaryDirectionalHintArrows) @@ -97,16 +106,18 @@ public bool preScrollVisualsVisible foreach (var arrow in m_SecondaryDirectionalHintArrows) { - arrow.visible = value; + arrow.visible = m_PreScrollVisualsVisible; } } } public bool primaryArrowsVisible { + get { return m_PrimaryArrowsVisible; } set { - if (value) + m_PrimaryArrowsVisible = value; + if (m_PrimaryArrowsVisible) { foreach (var arrow in m_PrimaryDirectionalHintArrows) { @@ -125,8 +136,11 @@ public bool primaryArrowsVisible public bool secondaryArrowsVisible { + get { return m_SecondaryArrowsVisible; } set { + m_SecondaryArrowsVisible = value; + foreach (var arrow in m_SecondaryDirectionalHintArrows) { arrow.visible = value; @@ -139,9 +153,10 @@ public bool secondaryArrowsVisible /// public Vector3 scrollVisualsRotation { - // Set null In order to hide the scroll visuals + get { return m_ScrollVisualsRotation ; } set { + // Set null In order to hide the scroll visuals if (value == Vector3.zero) Debug.LogError("??????????????????????!!!!!!!!!!!!!!!!!!!!!!!"); @@ -170,7 +185,7 @@ void Awake() m_ScrollVisualsTransform = m_ScrollVisualsCanvasGroup.transform; m_ScrollVisualsGameObject = m_ScrollVisualsTransform.gameObject; m_ScrollVisualsCanvasGroup.alpha = 0f; - m_ScrollVisualsGameObject.SetActive(false); + //m_ScrollVisualsGameObject.SetActive(false); } IEnumerator AnimateShow() @@ -217,7 +232,7 @@ IEnumerator ShowScrollVisuals() { Debug.LogError("SHOWING SPATIAL SCROLL VISUALS : viewscale is " + this.GetViewerScale()); // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector - m_ScrollVisualsGameObject.SetActive(true); + //m_ScrollVisualsGameObject.SetActive(true); primaryArrowsVisible = false; secondaryArrowsVisible = false; m_ScrollVisualsTransform.localScale = Vector3.one; @@ -272,7 +287,7 @@ IEnumerator HideScrollVisuals() m_ScrollVisualsCanvasGroup.alpha = 0; m_ScrollVisualsTransform.localScale = hiddenLocalScale; //m_ScrollVisualsTransform.localRotation = Quaternion.identity; - m_ScrollVisualsGameObject.SetActive(false); + //m_ScrollVisualsGameObject.SetActive(false); } public void PulseScrollArrows() diff --git a/Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs.meta b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs.meta similarity index 100% rename from Menus/PinnedToolMenu/Scripts/SpatialHintUI.cs.meta rename to Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs.meta diff --git a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab similarity index 99% rename from Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab rename to Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index 0e6aa262b..09e1b0272 100644 --- a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -55,7 +55,7 @@ GameObject: - component: {fileID: 4800155596865708} - component: {fileID: 114602193729648712} m_Layer: 5 - m_Name: TopArrow (1) + m_Name: DiagonalArrowsTopArrow (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -71,7 +71,7 @@ GameObject: - component: {fileID: 4234521712409882} - component: {fileID: 114549952638618038} m_Layer: 5 - m_Name: TopArrow (4) + m_Name: DiagonalArrowsTopArrow (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -87,7 +87,7 @@ GameObject: - component: {fileID: 4352658633633276} - component: {fileID: 114508101107919186} m_Layer: 5 - m_Name: TopArrow (3) + m_Name: DiagonalArrowsTopArrow (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -186,7 +186,7 @@ GameObject: - component: {fileID: 4841372590907710} - component: {fileID: 114472214291358280} m_Layer: 5 - m_Name: LeftArrow (4) + m_Name: DiagonalArrowsLeftArrow (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -202,7 +202,7 @@ GameObject: - component: {fileID: 4851979343048988} - component: {fileID: 114595085207455294} m_Layer: 5 - m_Name: LeftArrow (2) + m_Name: ScrollLeftArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -251,7 +251,7 @@ GameObject: - component: {fileID: 4920529215995508} - component: {fileID: 114721502774444018} m_Layer: 5 - m_Name: RightArrow (3) + m_Name: DiagonalArrowsRightArrow (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -283,7 +283,7 @@ GameObject: - component: {fileID: 4405923127552798} - component: {fileID: 114000567662040162} m_Layer: 5 - m_Name: BottomArrow (3) + m_Name: DiagonalArrowsBottomArrow (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -299,7 +299,7 @@ GameObject: - component: {fileID: 4930137114917576} - component: {fileID: 114478667145759116} m_Layer: 5 - m_Name: LeftArrow (2) + m_Name: DiagonalArrowsLeftArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -398,7 +398,7 @@ GameObject: m_Component: - component: {fileID: 4486931087156832} m_Layer: 5 - m_Name: BackArrow (1) + m_Name: DiagonalArrowsBackArrow (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -431,7 +431,7 @@ GameObject: - component: {fileID: 4873933386520716} - component: {fileID: 114201708188467934} m_Layer: 5 - m_Name: RightArrow (2) + m_Name: DiagonalArrowsRightArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -479,7 +479,7 @@ GameObject: m_Component: - component: {fileID: 4998463843861972} m_Layer: 5 - m_Name: FrontArrow (1) + m_Name: DiagonalArrowsFrontArrow (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -495,7 +495,7 @@ GameObject: - component: {fileID: 4024087671455752} - component: {fileID: 114933653232386136} m_Layer: 5 - m_Name: LeftArrow (3) + m_Name: DiagonalArrowsLeftArrow (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -511,7 +511,7 @@ GameObject: - component: {fileID: 4630278991888076} - component: {fileID: 114693150127021580} m_Layer: 5 - m_Name: RightArrow (2) + m_Name: ScrollRightArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -527,7 +527,7 @@ GameObject: - component: {fileID: 4673130869543022} - component: {fileID: 114347973994711784} m_Layer: 5 - m_Name: LeftArrow (1) + m_Name: DiagonalArrowsLeftArrow (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -610,7 +610,7 @@ GameObject: - component: {fileID: 4436731719689366} - component: {fileID: 114647227679990130} m_Layer: 5 - m_Name: BottomArrow (2) + m_Name: DiagonalArrowsBottomArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -659,7 +659,7 @@ GameObject: - component: {fileID: 4680161644130496} - component: {fileID: 114041376699156020} m_Layer: 5 - m_Name: TopArrow (2) + m_Name: DiagonalArrowsTopArrow (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -810,7 +810,7 @@ GameObject: - component: {fileID: 4715255144694938} - component: {fileID: 114820192887403444} m_Layer: 5 - m_Name: RightArrow (1) + m_Name: DiagonalArrowsRightArrow (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -843,7 +843,7 @@ GameObject: - component: {fileID: 4724266729072562} - component: {fileID: 114873812632177310} m_Layer: 5 - m_Name: BottomArrow (1) + m_Name: DiagonalArrowsBottomArrow (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -876,7 +876,7 @@ GameObject: - component: {fileID: 4675647250350146} - component: {fileID: 114310382182576548} m_Layer: 5 - m_Name: BottomArrow (4) + m_Name: DiagonalArrowsBottomArrow (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -892,7 +892,7 @@ GameObject: - component: {fileID: 4392107344112590} - component: {fileID: 114004058444794040} m_Layer: 5 - m_Name: RightArrow (4) + m_Name: DiagonalArrowsRightArrow (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab.meta b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab.meta similarity index 100% rename from Menus/PinnedToolMenu/Prefabs/SpatialHintUI.prefab.meta rename to Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab.meta From ace4839ce7da09edaace595a64d1b0a822e5b37c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 23:22:52 -0700 Subject: [PATCH 580/870] Add scene icon and prefab changes; Re-use hierarchy data; Default scenes to expanded --- Scripts/Data/HierarchyData.cs | 23 ++ Scripts/Modules/HierarchyModule.cs | 243 ++++++++++++++++-- Scripts/Utilities/CameraUtils.cs | 5 +- .../Prefabs/HierarchyListItem.prefab | 10 +- .../Scripts/HierarchyListItem.cs | 7 +- .../Scripts/HierarchyListViewController.cs | 33 +++ .../ProjectWorkspace/Prefabs/SceneIcon.prefab | 83 ++++++ .../Prefabs/SceneIcon.prefab.meta | 9 + .../ProjectWorkspace/Scripts/AssetGridItem.cs | 2 +- .../Scripts/FolderListItem.cs | 2 +- 10 files changed, 381 insertions(+), 36 deletions(-) create mode 100644 Workspaces/ProjectWorkspace/Prefabs/SceneIcon.prefab create mode 100644 Workspaces/ProjectWorkspace/Prefabs/SceneIcon.prefab.meta diff --git a/Scripts/Data/HierarchyData.cs b/Scripts/Data/HierarchyData.cs index 5c2ff22c2..c25f9511b 100644 --- a/Scripts/Data/HierarchyData.cs +++ b/Scripts/Data/HierarchyData.cs @@ -29,6 +29,29 @@ public HierarchyData(HierarchyProperty property, HashSet types) instanceID = property.instanceID; this.types = types; } + + //public HierarchyData(string name, int instanceID, HashSet types, List children = null) + //{ + // template = k_TemplateName; + // this.name = name; + // this.instanceID = instanceID; + // this.types = types; + // m_Children = children; + //} + + public void Print(int depth = 0) + { + var log = name; + for (var i = 0; i < depth; i++) + { + log = " " + log; + } + Debug.Log(depth + ": " + log); + + if (children != null) + foreach (var hierarchyData in children) + hierarchyData.Print(depth + 1); + } } } #endif diff --git a/Scripts/Modules/HierarchyModule.cs b/Scripts/Modules/HierarchyModule.cs index ae741f9a8..ea8a3f965 100644 --- a/Scripts/Modules/HierarchyModule.cs +++ b/Scripts/Modules/HierarchyModule.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using System; using System.Collections.Generic; using System.Linq; using UnityEngine; @@ -8,6 +7,8 @@ namespace UnityEditor.Experimental.EditorVR.Modules { sealed class HierarchyModule : MonoBehaviour, ISelectionChanged { + readonly string[] k_IgnoredTypes = { "InputManager", "EditingContextManager" }; + readonly List m_HierarchyLists = new List(); readonly List m_HierarchyData = new List(); HierarchyProperty m_HierarchyProperty; @@ -66,21 +67,27 @@ List GetHierarchyData() void UpdateHierarchyData() { m_ObjectTypes.Clear(); - m_HierarchyData.Clear(); if (m_HierarchyProperty == null) m_HierarchyProperty = new HierarchyProperty(HierarchyType.GameObjects); else m_HierarchyProperty.Reset(); + //Debug.Log("update"); + + var hasChanged = false; var lastDepth = 0; - var stack = new Stack(); + var dataStack = new Stack(); + var siblingIndexStack = new Stack(); + dataStack.Push(null); + siblingIndexStack.Push(0); while (m_HierarchyProperty.Next(null)) { var instanceID = m_HierarchyProperty.instanceID; + var types = InstanceIDToComponentTypes(instanceID, m_ObjectTypes); var go = EditorUtility.InstanceIDToObject(instanceID); var currentDepth = m_HierarchyProperty.depth; - if (go == gameObject) + if (go == gameObject || types.Overlaps(k_IgnoredTypes)) { var depth = currentDepth; // skip children of EVR to prevent the display of EVR contents @@ -93,50 +100,234 @@ void UpdateHierarchyData() break; } - var types = InstanceIDToComponentTypes(instanceID, m_ObjectTypes); - var currentHierarchyData = new HierarchyData(m_HierarchyProperty, types); + //if (currentDepth > lastDepth) + // siblingIndexStack.Push(0); - HierarchyData parent = null; if (currentDepth <= lastDepth) { - // Add one to pop off last sibling - var count = lastDepth - currentDepth + 1; - while (count-- > 0 && stack.Count > 0) + //Debug.Log(dataStack.Count); + if (dataStack.Count > 1) // Pop off last sibling + { + if (CleanUpHierarchyData(dataStack.Pop(), siblingIndexStack.Pop())) + hasChanged = true; + } + + //if (currentDepth < lastDepth) + //{ + // if (CleanUpHierarchyData(dataStack.Peek(), siblingIndexStack.Peek())) + // hasChanged = true; + // //var lastParent = dataStack.Peek(); + // //var lastChildren = lastParent == null ? m_HierarchyData : lastParent.children; + // //var lastSiblingIndex = siblingIndexStack.Peek(); + // //var childrenCount = lastChildren.Count; + // //if (lastSiblingIndex != childrenCount) + // //{ + // // lastChildren.RemoveRange(lastSiblingIndex, childrenCount - lastSiblingIndex); + // // hasChanged = true; + // //} + //} + + var count = lastDepth - currentDepth; + while (count-- > 0) { - stack.Pop(); + if (CleanUpHierarchyData(dataStack.Pop(), siblingIndexStack.Pop())) + hasChanged = true; } } - if (stack.Count > 0) - parent = stack.Peek(); + var parent = dataStack.Peek(); + var siblingIndex = siblingIndexStack.Pop(); + + //var log = m_HierarchyProperty.name; + //for (var i = 0; i < m_HierarchyProperty.depth; i++) + //{ + // log = " " + log; + //} + //Debug.Log(lastDepth + " - " + currentDepth + "(" + siblingIndex + "): " + log); - if (parent != null) + if (parent != null && parent.children == null) + parent.children = new List(); + + var children = parent == null ? m_HierarchyData : parent.children; + + HierarchyData currentHierarchyData; + if (siblingIndex >= children.Count) + { + currentHierarchyData = new HierarchyData(m_HierarchyProperty, types); + children.Add(currentHierarchyData); + hasChanged = true; + } + else if (children[siblingIndex].index != instanceID) { - if (parent.children == null) - parent.children = new List(); - parent.children.Add(currentHierarchyData); + currentHierarchyData = new HierarchyData(m_HierarchyProperty, types); + children[siblingIndex] = currentHierarchyData; + hasChanged = true; } else { - m_HierarchyData.Add(currentHierarchyData); + currentHierarchyData = children[siblingIndex]; + + if (!currentHierarchyData.types.SetEquals(types)) + hasChanged = true; + + currentHierarchyData.types = types; // In case of added components } - stack.Push(currentHierarchyData); + dataStack.Push(currentHierarchyData); + siblingIndexStack.Push(siblingIndex + 1); + siblingIndexStack.Push(0); lastDepth = currentDepth; } - foreach (var list in m_HierarchyLists) + while (siblingIndexStack.Count > 0 && dataStack.Count > 0) { - list.hierarchyData = GetHierarchyData(); + if (CleanUpHierarchyData(dataStack.Pop(), siblingIndexStack.Pop())) + hasChanged = true; + + //var siblingIndex = siblingIndexStack.Pop(); + //HierarchyData parent = null; + //if (dataStack.Count > 0) + // parent = dataStack.Pop(); + //Debug.Log(siblingIndex + ", " + (parent == null ? "no parent" : parent.name)); + //var children = parent == null ? m_HierarchyData : parent.children; + //if (children != null) + //{ + // var childrenCount = children.Count; + // Debug.Log(siblingIndex + ", " + childrenCount); + // if (siblingIndex != childrenCount) + // { + // children.RemoveRange(siblingIndex, childrenCount - siblingIndex); + // hasChanged = true; + // } + + // if (parent != null && children.Count == 0) + // parent.children = null; + //} } - // Send new data to existing filterUIs - foreach (var filterUI in m_FilterUIs) + //foreach (var hierarchyData in m_HierarchyData) + //{ + // hierarchyData.Print(); + //} + + if (hasChanged) { - filterUI.filterList = GetFilterList(); + Debug.Log("change"); + foreach (var list in m_HierarchyLists) + { + list.hierarchyData = GetHierarchyData(); + } + + // Send new data to existing filterUIs + foreach (var filterUI in m_FilterUIs) + { + filterUI.filterList = GetFilterList(); + } } } + //HierarchyData CollectHierarchyData(HierarchyProperty hp, HashSet objectTypes) + //{ + // var depth = hp.depth; + // var name = hp.name; + // var instanceID = hp.instanceID; + // var types = InstanceIDToComponentTypes(instanceID, objectTypes); + + // Stack stack = new Stack(); + // if (hp.hasChildren) + // { + // if (hd != null && hd.children == null) + // hasChanged = true; + + // children = hd == null || hd.children == null ? new List() : hd.children; + + // hasNext = hp.Next(null); + // var i = 0; + // while (hasNext && hp.depth > depth) + // { + // var go = EditorUtility.InstanceIDToObject(hp.instanceID); + + // if (go == gameObject) + // { + // // skip children of EVR to prevent the display of EVR contents + // while (hp.Next(null) && hp.depth > depth + 1) { } + + // // If EVR is the last object, don't add anything to the list + // if (hp.instanceID == 0) + // break; + + // name = hp.name; + // instanceID = hp.instanceID; + // types = InstanceIDToComponentTypes(instanceID, objectTypes); + // } + + // if (i >= children.Count) + // { + // children.Add(CollectHierarchyData(ref hasNext, ref hasChanged, null, hp, objectTypes)); + // hasChanged = true; + // } + // else if (children[i].index != hp.instanceID) + // { + // children[i] = CollectHierarchyData(ref hasNext, ref hasChanged, null, hp, objectTypes); + // hasChanged = true; + // } + // else + // { + // children[i] = CollectHierarchyData(ref hasNext, ref hasChanged, children[i], hp, objectTypes); + // } + + // if (hasNext) + // hasNext = hp.Next(null); + + // i++; + // } + + // if (i != children.Count) + // { + // children.RemoveRange(i, children.Count - i); + // hasChanged = true; + // } + + // if (children.Count == 0) + // children = null; + + // if (hasNext) + // hp.Previous(null); + // } + // else if (hd != null && hd.children != null) + // { + // hasChanged = true; + // } + + // if (hd != null) + // { + // hd.children = children; + // hd.name = name; + // hd.instanceID = instanceID; + // hd.types = types; + // } + + // return hd ?? new HierarchyData(name, instanceID, types, children); + //} + + bool CleanUpHierarchyData(HierarchyData data, int lastSiblingIndex) + { + var children = data == null ? m_HierarchyData : data.children; + var childrenCount = children == null ? 0 : children.Count; + //Debug.Log(name + ", " + childrenCount + " - " + lastSiblingIndex); + + if (children != null && lastSiblingIndex < childrenCount) + { + children.RemoveRange(lastSiblingIndex, childrenCount - lastSiblingIndex); + if (data != null && children.Count == 0) + data.children = null; + + return true; + } + + return false; + } + static HashSet InstanceIDToComponentTypes(int instanceID, HashSet allTypes) { var types = new HashSet(); @@ -144,8 +335,10 @@ static HashSet InstanceIDToComponentTypes(int instanceID, HashSet(); - foreach (var component in components) + for (int i = 0; i < components.Length; i++) { + var component = components[i]; + if (!component) continue; diff --git a/Scripts/Utilities/CameraUtils.cs b/Scripts/Utilities/CameraUtils.cs index b097b57c3..210978ad6 100644 --- a/Scripts/Utilities/CameraUtils.cs +++ b/Scripts/Utilities/CameraUtils.cs @@ -65,9 +65,10 @@ public static Transform GetCameraRig() /// /// Glboal rotation of the parent transform /// - public static Quaternion LocalRotateTowardCamera(Quaternion parentRotation) + public static Quaternion LocalRotateTowardCamera(Transform parentTransform) { - var camVector = Quaternion.Inverse(parentRotation) * GetMainCamera().transform.forward; + var toCamera = parentTransform.position - GetMainCamera().transform.position; + var camVector = Quaternion.Inverse(parentTransform.rotation) * toCamera; camVector.x = 0; return Quaternion.LookRotation(camVector, Vector3.Dot(camVector, Vector3.forward) > 0 ? Vector3.up : Vector3.down); } diff --git a/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab b/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab index 9ccbca64a..95d0da908 100644 --- a/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab +++ b/Workspaces/HierarchyWorkspace/Prefabs/HierarchyListItem.prefab @@ -227,13 +227,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1407269964740084} - m_LocalRotation: {x: -0.14110889, y: -0.38632697, z: 0.32493064, w: 0.8516219} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: -0.40332916, y: -0.32925647, z: 0.44692823, w: 0.72744143} + m_LocalPosition: {x: -0.089, y: 0, z: 0} m_LocalScale: {x: 0.7698965, y: 0.76989645, z: 0.7698965} m_Children: [] m_Father: {fileID: 4915716757996668} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0.614, y: -48.569, z: 41.491} + m_LocalEulerAnglesHint: {x: -17.007, y: -61.395, z: 73.277} --- !u!4 &4915716757996668 Transform: m_ObjectHideFlags: 1 @@ -577,7 +577,7 @@ MonoBehaviour: m_FontData: m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} m_FontSize: 14 - m_FontStyle: 0 + m_FontStyle: 1 m_BestFit: 0 m_MinSize: 7 m_MaxSize: 300 @@ -703,6 +703,6 @@ RectTransform: m_LocalEulerAnglesHint: {x: 45, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.033125866, y: 0.008} + m_AnchoredPosition: {x: -0.033125866, y: 0.008000001} m_SizeDelta: {x: 70.0878, y: 20} m_Pivot: {x: 0, y: 0.5} diff --git a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs index 926d19645..9a53c7b2c 100644 --- a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs +++ b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs @@ -189,6 +189,9 @@ public void SetMaterials(Material textMaterial, Material expandArrowMaterial, Ma public void UpdateSelf(float width, int depth, bool? expanded, bool selected, bool locked) { + var childCount = data.children == null ? 0 : data.children.Count; + m_Text.text = data.name + "(" + childCount + ")"; + var cubeScale = m_CubeTransform.localScale; cubeScale.x = width; m_CubeTransform.localScale = cubeScale; @@ -208,7 +211,7 @@ public void UpdateSelf(float width, int depth, bool? expanded, bool selected, bo // Text is next to arrow, with a margin and indent, rotated toward camera var gameObject = data.gameObject; if (gameObject == null) - indent = k_Indent * 2; + indent = k_Indent; var textTransform = gameObject ? m_Text.transform : m_SceneText.transform; var textRectTransform = gameObject ? m_Text.rectTransform : m_SceneText.rectTransform; @@ -218,7 +221,7 @@ public void UpdateSelf(float width, int depth, bool? expanded, bool selected, bo var sceneIconPosition = m_SceneIcon.localPosition; m_SceneIcon.localPosition = new Vector3(-halfWidth + k_Margin + arrowWidth + k_Indent, sceneIconPosition.y, sceneIconPosition.z); - var localRotation = CameraUtils.LocalRotateTowardCamera(transform.parent.rotation); + var localRotation = CameraUtils.LocalRotateTowardCamera(transform.parent); textTransform.localRotation = localRotation; lockIconTransform.localRotation = localRotation; m_SceneIcon.localRotation = localRotation; diff --git a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs index c6d2e3ba0..adacc7543 100644 --- a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs +++ b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs @@ -41,6 +41,39 @@ sealed class HierarchyListViewController : NestedListViewController> m_HoveredGameObjects = new List>(); + public override List data + { + set + { + base.data = value; + + if (m_Data != null && m_Data.Count > 0) + { + // Remove any objects that don't exist any more + var missingKeys = m_Data.Select(d => d.index).Except(m_ExpandStates.Keys); + foreach (var key in missingKeys) + { + m_ExpandStates.Remove(key); + } + + // Expand the scenes by default + foreach (var scene in m_Data) + { + Debug.Log(scene); + var instanceID = scene.index; + if (!m_ExpandStates.ContainsKey(instanceID)) + m_ExpandStates[instanceID] = true; + } + + foreach (var d in m_Data) + { + if (!m_ExpandStates.ContainsKey(d.index)) + m_ExpandStates[d.index] = false; + } + } + } + } + public string lockedQueryString { private get; set; } public Action selectRow { private get; set; } diff --git a/Workspaces/ProjectWorkspace/Prefabs/SceneIcon.prefab b/Workspaces/ProjectWorkspace/Prefabs/SceneIcon.prefab new file mode 100644 index 000000000..d89600a17 --- /dev/null +++ b/Workspaces/ProjectWorkspace/Prefabs/SceneIcon.prefab @@ -0,0 +1,83 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1730059858115038} + m_IsPrefabParent: 1 +--- !u!1 &1730059858115038 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4767487945342266} + - component: {fileID: 33568172976101988} + - component: {fileID: 23990013054134058} + m_Layer: 0 + m_Name: SceneIcon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4767487945342266 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1730059858115038} + m_LocalRotation: {x: -0.40333143, y: -0.32925728, z: 0.4469268, w: 0.72744066} + m_LocalPosition: {x: -0.0032085949, y: 0.009076677, z: 0.020639082} + m_LocalScale: {x: 0.7698965, y: 0.76989645, z: 0.7698965} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0.614, y: -48.569, z: 41.491} +--- !u!23 &23990013054134058 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1730059858115038} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 3ac4991e69337ae41badfeef7c8ba134, type: 2} + - {fileID: 2100000, guid: d3bb23d585e936140a5f274d7450f24e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33568172976101988 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1730059858115038} + m_Mesh: {fileID: 4300000, guid: 4f59d2c28d92b4a0486ef9a7530a7236, type: 3} diff --git a/Workspaces/ProjectWorkspace/Prefabs/SceneIcon.prefab.meta b/Workspaces/ProjectWorkspace/Prefabs/SceneIcon.prefab.meta new file mode 100644 index 000000000..f323aac0f --- /dev/null +++ b/Workspaces/ProjectWorkspace/Prefabs/SceneIcon.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 35ccf65dc9572ec4db1bacd442eef72f +timeCreated: 1500013172 +licenseType: Free +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index 44d910c22..d32e17656 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -201,7 +201,7 @@ public void UpdateTransforms(float scale) transform.localScale = Vector3.one * scale; - m_TextPanel.transform.localRotation = CameraUtils.LocalRotateTowardCamera(transform.parent.rotation); + m_TextPanel.transform.localRotation = CameraUtils.LocalRotateTowardCamera(transform.parent); if (m_Sphere.gameObject.activeInHierarchy) m_Sphere.transform.Rotate(Vector3.up, k_RotateSpeed * Time.deltaTime, Space.Self); diff --git a/Workspaces/ProjectWorkspace/Scripts/FolderListItem.cs b/Workspaces/ProjectWorkspace/Scripts/FolderListItem.cs index bc82d8a8a..699028002 100644 --- a/Workspaces/ProjectWorkspace/Scripts/FolderListItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/FolderListItem.cs @@ -104,7 +104,7 @@ public void UpdateSelf(float width, int depth, bool expanded, bool selected) m_Text.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, (width - doubleMargin - indent) * 1 / textTransform.localScale.x); textTransform.localPosition = new Vector3(doubleMargin + indent + arrowWidth - halfWidth, textTransform.localPosition.y, 0); - textTransform.localRotation = CameraUtils.LocalRotateTowardCamera(transform.parent.rotation); + textTransform.localRotation = CameraUtils.LocalRotateTowardCamera(transform.parent); UpdateArrow(expanded); From d4a9e90c00dada4ae7ee0133fc87e0b48cbde900 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 13 Jul 2017 23:43:57 -0700 Subject: [PATCH 581/870] Clean up debug code; Fix ignoring of EditingContextManager and InputManager --- Scripts/Data/HierarchyData.cs | 23 --- Scripts/Modules/HierarchyModule.cs | 148 +----------------- Workspaces/Common/Materials/ListItemClip.mat | 2 +- .../Scripts/HierarchyListItem.cs | 3 - .../Scripts/HierarchyListViewController.cs | 1 - 5 files changed, 6 insertions(+), 171 deletions(-) diff --git a/Scripts/Data/HierarchyData.cs b/Scripts/Data/HierarchyData.cs index c25f9511b..5c2ff22c2 100644 --- a/Scripts/Data/HierarchyData.cs +++ b/Scripts/Data/HierarchyData.cs @@ -29,29 +29,6 @@ public HierarchyData(HierarchyProperty property, HashSet types) instanceID = property.instanceID; this.types = types; } - - //public HierarchyData(string name, int instanceID, HashSet types, List children = null) - //{ - // template = k_TemplateName; - // this.name = name; - // this.instanceID = instanceID; - // this.types = types; - // m_Children = children; - //} - - public void Print(int depth = 0) - { - var log = name; - for (var i = 0; i < depth; i++) - { - log = " " + log; - } - Debug.Log(depth + ": " + log); - - if (children != null) - foreach (var hierarchyData in children) - hierarchyData.Print(depth + 1); - } } } #endif diff --git a/Scripts/Modules/HierarchyModule.cs b/Scripts/Modules/HierarchyModule.cs index ea8a3f965..787084c6a 100644 --- a/Scripts/Modules/HierarchyModule.cs +++ b/Scripts/Modules/HierarchyModule.cs @@ -1,14 +1,13 @@ #if UNITY_EDITOR using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Core; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Modules { sealed class HierarchyModule : MonoBehaviour, ISelectionChanged { - readonly string[] k_IgnoredTypes = { "InputManager", "EditingContextManager" }; - readonly List m_HierarchyLists = new List(); readonly List m_HierarchyData = new List(); HierarchyProperty m_HierarchyProperty; @@ -73,8 +72,6 @@ void UpdateHierarchyData() else m_HierarchyProperty.Reset(); - //Debug.Log("update"); - var hasChanged = false; var lastDepth = 0; var dataStack = new Stack(); @@ -85,9 +82,9 @@ void UpdateHierarchyData() { var instanceID = m_HierarchyProperty.instanceID; var types = InstanceIDToComponentTypes(instanceID, m_ObjectTypes); - var go = EditorUtility.InstanceIDToObject(instanceID); + var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject; var currentDepth = m_HierarchyProperty.depth; - if (go == gameObject || types.Overlaps(k_IgnoredTypes)) + if (go == gameObject) { var depth = currentDepth; // skip children of EVR to prevent the display of EVR contents @@ -100,33 +97,17 @@ void UpdateHierarchyData() break; } - //if (currentDepth > lastDepth) - // siblingIndexStack.Push(0); + if (go && (go.GetComponent() || go.GetComponent())) + continue; if (currentDepth <= lastDepth) { - //Debug.Log(dataStack.Count); if (dataStack.Count > 1) // Pop off last sibling { if (CleanUpHierarchyData(dataStack.Pop(), siblingIndexStack.Pop())) hasChanged = true; } - //if (currentDepth < lastDepth) - //{ - // if (CleanUpHierarchyData(dataStack.Peek(), siblingIndexStack.Peek())) - // hasChanged = true; - // //var lastParent = dataStack.Peek(); - // //var lastChildren = lastParent == null ? m_HierarchyData : lastParent.children; - // //var lastSiblingIndex = siblingIndexStack.Peek(); - // //var childrenCount = lastChildren.Count; - // //if (lastSiblingIndex != childrenCount) - // //{ - // // lastChildren.RemoveRange(lastSiblingIndex, childrenCount - lastSiblingIndex); - // // hasChanged = true; - // //} - //} - var count = lastDepth - currentDepth; while (count-- > 0) { @@ -138,13 +119,6 @@ void UpdateHierarchyData() var parent = dataStack.Peek(); var siblingIndex = siblingIndexStack.Pop(); - //var log = m_HierarchyProperty.name; - //for (var i = 0; i < m_HierarchyProperty.depth; i++) - //{ - // log = " " + log; - //} - //Debug.Log(lastDepth + " - " + currentDepth + "(" + siblingIndex + "): " + log); - if (parent != null && parent.children == null) parent.children = new List(); @@ -183,36 +157,10 @@ void UpdateHierarchyData() { if (CleanUpHierarchyData(dataStack.Pop(), siblingIndexStack.Pop())) hasChanged = true; - - //var siblingIndex = siblingIndexStack.Pop(); - //HierarchyData parent = null; - //if (dataStack.Count > 0) - // parent = dataStack.Pop(); - //Debug.Log(siblingIndex + ", " + (parent == null ? "no parent" : parent.name)); - //var children = parent == null ? m_HierarchyData : parent.children; - //if (children != null) - //{ - // var childrenCount = children.Count; - // Debug.Log(siblingIndex + ", " + childrenCount); - // if (siblingIndex != childrenCount) - // { - // children.RemoveRange(siblingIndex, childrenCount - siblingIndex); - // hasChanged = true; - // } - - // if (parent != null && children.Count == 0) - // parent.children = null; - //} } - //foreach (var hierarchyData in m_HierarchyData) - //{ - // hierarchyData.Print(); - //} - if (hasChanged) { - Debug.Log("change"); foreach (var list in m_HierarchyLists) { list.hierarchyData = GetHierarchyData(); @@ -226,96 +174,10 @@ void UpdateHierarchyData() } } - //HierarchyData CollectHierarchyData(HierarchyProperty hp, HashSet objectTypes) - //{ - // var depth = hp.depth; - // var name = hp.name; - // var instanceID = hp.instanceID; - // var types = InstanceIDToComponentTypes(instanceID, objectTypes); - - // Stack stack = new Stack(); - // if (hp.hasChildren) - // { - // if (hd != null && hd.children == null) - // hasChanged = true; - - // children = hd == null || hd.children == null ? new List() : hd.children; - - // hasNext = hp.Next(null); - // var i = 0; - // while (hasNext && hp.depth > depth) - // { - // var go = EditorUtility.InstanceIDToObject(hp.instanceID); - - // if (go == gameObject) - // { - // // skip children of EVR to prevent the display of EVR contents - // while (hp.Next(null) && hp.depth > depth + 1) { } - - // // If EVR is the last object, don't add anything to the list - // if (hp.instanceID == 0) - // break; - - // name = hp.name; - // instanceID = hp.instanceID; - // types = InstanceIDToComponentTypes(instanceID, objectTypes); - // } - - // if (i >= children.Count) - // { - // children.Add(CollectHierarchyData(ref hasNext, ref hasChanged, null, hp, objectTypes)); - // hasChanged = true; - // } - // else if (children[i].index != hp.instanceID) - // { - // children[i] = CollectHierarchyData(ref hasNext, ref hasChanged, null, hp, objectTypes); - // hasChanged = true; - // } - // else - // { - // children[i] = CollectHierarchyData(ref hasNext, ref hasChanged, children[i], hp, objectTypes); - // } - - // if (hasNext) - // hasNext = hp.Next(null); - - // i++; - // } - - // if (i != children.Count) - // { - // children.RemoveRange(i, children.Count - i); - // hasChanged = true; - // } - - // if (children.Count == 0) - // children = null; - - // if (hasNext) - // hp.Previous(null); - // } - // else if (hd != null && hd.children != null) - // { - // hasChanged = true; - // } - - // if (hd != null) - // { - // hd.children = children; - // hd.name = name; - // hd.instanceID = instanceID; - // hd.types = types; - // } - - // return hd ?? new HierarchyData(name, instanceID, types, children); - //} - bool CleanUpHierarchyData(HierarchyData data, int lastSiblingIndex) { var children = data == null ? m_HierarchyData : data.children; var childrenCount = children == null ? 0 : children.Count; - //Debug.Log(name + ", " + childrenCount + " - " + lastSiblingIndex); - if (children != null && lastSiblingIndex < childrenCount) { children.RemoveRange(lastSiblingIndex, childrenCount - lastSiblingIndex); diff --git a/Workspaces/Common/Materials/ListItemClip.mat b/Workspaces/Common/Materials/ListItemClip.mat index e95582c41..ff83a2322 100644 --- a/Workspaces/Common/Materials/ListItemClip.mat +++ b/Workspaces/Common/Materials/ListItemClip.mat @@ -72,6 +72,6 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _ClipExtents: {r: 1, g: 1, b: 1, a: 0} + - _ClipExtents: {r: 236.22, g: 96.42, b: 92.61, a: 2.29} - _Color: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs index 9a53c7b2c..760aaf483 100644 --- a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs +++ b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListItem.cs @@ -189,9 +189,6 @@ public void SetMaterials(Material textMaterial, Material expandArrowMaterial, Ma public void UpdateSelf(float width, int depth, bool? expanded, bool selected, bool locked) { - var childCount = data.children == null ? 0 : data.children.Count; - m_Text.text = data.name + "(" + childCount + ")"; - var cubeScale = m_CubeTransform.localScale; cubeScale.x = width; m_CubeTransform.localScale = cubeScale; diff --git a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs index adacc7543..515a27ff1 100644 --- a/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs +++ b/Workspaces/HierarchyWorkspace/Scripts/HierarchyListViewController.cs @@ -59,7 +59,6 @@ public override List data // Expand the scenes by default foreach (var scene in m_Data) { - Debug.Log(scene); var instanceID = scene.index; if (!m_ExpandStates.ContainsKey(instanceID)) m_ExpandStates[instanceID] = true; From 7b4d7acc74a5c8d109f52279f761a661922601b9 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 00:00:23 -0700 Subject: [PATCH 582/870] Clean up GC and improve performance --- Scripts/Data/HierarchyData.cs | 4 +-- Scripts/Modules/HierarchyModule.cs | 52 ++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/Scripts/Data/HierarchyData.cs b/Scripts/Data/HierarchyData.cs index 5c2ff22c2..1c83b06c0 100644 --- a/Scripts/Data/HierarchyData.cs +++ b/Scripts/Data/HierarchyData.cs @@ -21,13 +21,11 @@ public override int index public HashSet types { get; set; } - - public HierarchyData(HierarchyProperty property, HashSet types) + public HierarchyData(HierarchyProperty property) { template = k_TemplateName; name = property.name; instanceID = property.instanceID; - this.types = types; } } } diff --git a/Scripts/Modules/HierarchyModule.cs b/Scripts/Modules/HierarchyModule.cs index 787084c6a..a3d791c13 100644 --- a/Scripts/Modules/HierarchyModule.cs +++ b/Scripts/Modules/HierarchyModule.cs @@ -14,6 +14,24 @@ sealed class HierarchyModule : MonoBehaviour, ISelectionChanged readonly List m_FilterUIs = new List(); readonly HashSet m_ObjectTypes = new HashSet(); + readonly List m_IgnoreList = new List(); + + // Local method use only -- created here to reduce garbage collection + readonly HashSet m_CompareTypes = new HashSet(); + + void Awake() + { + m_IgnoreList.Add(gameObject); // Ignore EditorVR + foreach (var manager in Resources.FindObjectsOfTypeAll()) + { + m_IgnoreList.Add(manager.gameObject); + } + + foreach (var manager in Resources.FindObjectsOfTypeAll()) + { + m_IgnoreList.Add(manager.gameObject); + } + } void OnEnable() { @@ -81,10 +99,9 @@ void UpdateHierarchyData() while (m_HierarchyProperty.Next(null)) { var instanceID = m_HierarchyProperty.instanceID; - var types = InstanceIDToComponentTypes(instanceID, m_ObjectTypes); var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject; var currentDepth = m_HierarchyProperty.depth; - if (go == gameObject) + if (m_IgnoreList.Contains(go)) { var depth = currentDepth; // skip children of EVR to prevent the display of EVR contents @@ -97,9 +114,6 @@ void UpdateHierarchyData() break; } - if (go && (go.GetComponent() || go.GetComponent())) - continue; - if (currentDepth <= lastDepth) { if (dataStack.Count > 1) // Pop off last sibling @@ -127,24 +141,31 @@ void UpdateHierarchyData() HierarchyData currentHierarchyData; if (siblingIndex >= children.Count) { - currentHierarchyData = new HierarchyData(m_HierarchyProperty, types); + currentHierarchyData = new HierarchyData(m_HierarchyProperty); + var types = new HashSet(); + InstanceIDToComponentTypes(instanceID, types, m_ObjectTypes); + currentHierarchyData.types = types; children.Add(currentHierarchyData); hasChanged = true; } else if (children[siblingIndex].index != instanceID) { - currentHierarchyData = new HierarchyData(m_HierarchyProperty, types); + currentHierarchyData = new HierarchyData(m_HierarchyProperty); + var types = new HashSet(); + InstanceIDToComponentTypes(instanceID, types, m_ObjectTypes); + currentHierarchyData.types = types; children[siblingIndex] = currentHierarchyData; hasChanged = true; } else { currentHierarchyData = children[siblingIndex]; - - if (!currentHierarchyData.types.SetEquals(types)) + var currentTypes = currentHierarchyData.types; + m_CompareTypes.Clear(); + m_CompareTypes.UnionWith(currentTypes); + InstanceIDToComponentTypes(instanceID, currentTypes, m_ObjectTypes); + if (!currentTypes.SetEquals(m_CompareTypes)) // Compare old types in case of changes to components hasChanged = true; - - currentHierarchyData.types = types; // In case of added components } dataStack.Push(currentHierarchyData); @@ -190,17 +211,15 @@ bool CleanUpHierarchyData(HierarchyData data, int lastSiblingIndex) return false; } - static HashSet InstanceIDToComponentTypes(int instanceID, HashSet allTypes) + static void InstanceIDToComponentTypes(int instanceID, HashSet types, HashSet allTypes) { - var types = new HashSet(); + types.Clear(); var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject; if (go) { var components = go.GetComponents(); - for (int i = 0; i < components.Length; i++) + foreach (var component in components) { - var component = components[i]; - if (!component) continue; @@ -215,7 +234,6 @@ static HashSet InstanceIDToComponentTypes(int instanceID, HashSet Date: Fri, 14 Jul 2017 00:20:39 -0700 Subject: [PATCH 583/870] Further reduce GC allocations; Remove comparison of component types because it was taking too long --- Scripts/Core/EditorVR.MiniWorlds.cs | 11 ++++-- Scripts/Modules/HierarchyModule.cs | 38 +++++++++---------- .../MultipleRayInputModule.cs | 6 ++- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index 22a9161eb..02daf23c5 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -177,6 +177,9 @@ public void UpdatePreview() bool m_MiniWorldIgnoreListDirty = true; + // Local method use only -- created here to reduce garbage collection + readonly List m_IgnoreList = new List(); + public Dictionary rays { get { return m_Rays; } } public List worlds { get { return m_Worlds; } } @@ -225,8 +228,8 @@ static Transform InstantiateMiniWorldRay() void UpdateMiniWorldIgnoreList() { - var renderers = new List(evr.GetComponentsInChildren(true)); - var ignoreList = new List(renderers.Count); + var renderers = evr.GetComponentsInChildren(true); + m_IgnoreList.Clear(); foreach (var r in renderers) { @@ -236,12 +239,12 @@ void UpdateMiniWorldIgnoreList() if (r.gameObject.layer != LayerMask.NameToLayer("UI") && r.CompareTag(MiniWorldRenderer.ShowInMiniWorldTag)) continue; - ignoreList.Add(r); + m_IgnoreList.Add(r); } foreach (var miniWorld in m_Worlds) { - miniWorld.ignoreList = ignoreList; + miniWorld.ignoreList = m_IgnoreList; } } diff --git a/Scripts/Modules/HierarchyModule.cs b/Scripts/Modules/HierarchyModule.cs index a3d791c13..50d5c0f09 100644 --- a/Scripts/Modules/HierarchyModule.cs +++ b/Scripts/Modules/HierarchyModule.cs @@ -17,7 +17,8 @@ sealed class HierarchyModule : MonoBehaviour, ISelectionChanged readonly List m_IgnoreList = new List(); // Local method use only -- created here to reduce garbage collection - readonly HashSet m_CompareTypes = new HashSet(); + readonly Stack m_DataStack = new Stack(); + readonly Stack m_SiblingIndexStack = new Stack(); void Awake() { @@ -92,10 +93,10 @@ void UpdateHierarchyData() var hasChanged = false; var lastDepth = 0; - var dataStack = new Stack(); - var siblingIndexStack = new Stack(); - dataStack.Push(null); - siblingIndexStack.Push(0); + m_DataStack.Clear(); + m_SiblingIndexStack.Clear(); + m_DataStack.Push(null); + m_SiblingIndexStack.Push(0); while (m_HierarchyProperty.Next(null)) { var instanceID = m_HierarchyProperty.instanceID; @@ -116,22 +117,22 @@ void UpdateHierarchyData() if (currentDepth <= lastDepth) { - if (dataStack.Count > 1) // Pop off last sibling + if (m_DataStack.Count > 1) // Pop off last sibling { - if (CleanUpHierarchyData(dataStack.Pop(), siblingIndexStack.Pop())) + if (CleanUpHierarchyData(m_DataStack.Pop(), m_SiblingIndexStack.Pop())) hasChanged = true; } var count = lastDepth - currentDepth; while (count-- > 0) { - if (CleanUpHierarchyData(dataStack.Pop(), siblingIndexStack.Pop())) + if (CleanUpHierarchyData(m_DataStack.Pop(), m_SiblingIndexStack.Pop())) hasChanged = true; } } - var parent = dataStack.Peek(); - var siblingIndex = siblingIndexStack.Pop(); + var parent = m_DataStack.Peek(); + var siblingIndex = m_SiblingIndexStack.Pop(); if (parent != null && parent.children == null) parent.children = new List(); @@ -160,23 +161,18 @@ void UpdateHierarchyData() else { currentHierarchyData = children[siblingIndex]; - var currentTypes = currentHierarchyData.types; - m_CompareTypes.Clear(); - m_CompareTypes.UnionWith(currentTypes); - InstanceIDToComponentTypes(instanceID, currentTypes, m_ObjectTypes); - if (!currentTypes.SetEquals(m_CompareTypes)) // Compare old types in case of changes to components - hasChanged = true; + InstanceIDToComponentTypes(instanceID, currentHierarchyData.types, m_ObjectTypes); } - dataStack.Push(currentHierarchyData); - siblingIndexStack.Push(siblingIndex + 1); - siblingIndexStack.Push(0); + m_DataStack.Push(currentHierarchyData); + m_SiblingIndexStack.Push(siblingIndex + 1); + m_SiblingIndexStack.Push(0); lastDepth = currentDepth; } - while (siblingIndexStack.Count > 0 && dataStack.Count > 0) + while (m_SiblingIndexStack.Count > 0 && m_DataStack.Count > 0) { - if (CleanUpHierarchyData(dataStack.Pop(), siblingIndexStack.Pop())) + if (CleanUpHierarchyData(m_DataStack.Pop(), m_SiblingIndexStack.Pop())) hasChanged = true; } diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index 850a923ea..be3054e59 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -106,8 +106,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_EventCamera.nearClipPlane = camera.nearClipPlane; m_EventCamera.farClipPlane = camera.farClipPlane; + // The sources dictionary can change during iteration, so cache it before iterating m_RaycastSourcesCopy.Clear(); - m_RaycastSourcesCopy.AddRange(m_RaycastSources.Values); // The sources dictionary can change during iteration, so cache it before iterating + foreach (var kvp in m_RaycastSources) + { + m_RaycastSourcesCopy.Add(kvp.Value); + } //Process events for all different transforms in RayOrigins foreach (var source in m_RaycastSourcesCopy) From bfc1b3133ef9a9434b61a75390896c0afd2f5fd4 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 00:33:19 -0700 Subject: [PATCH 584/870] Fix error where static BakedMesh in IntersectionUtils is destroyed on scene load --- Scripts/Modules/IntersectionModule/IntersectionModule.cs | 5 +++++ Scripts/Utilities/IntersectionUtils.cs | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Scripts/Modules/IntersectionModule/IntersectionModule.cs b/Scripts/Modules/IntersectionModule/IntersectionModule.cs index e411ab356..ca403d176 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionModule.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionModule.cs @@ -38,6 +38,11 @@ struct SortableRenderer public float distance; } + void Awake() + { + IntersectionUtils.BakedMesh = new Mesh(); // Create a new Mesh in each Awake because it is destroyed on scene load + } + internal void Setup(SpatialHash hash) { m_SpatialHash = hash; diff --git a/Scripts/Utilities/IntersectionUtils.cs b/Scripts/Utilities/IntersectionUtils.cs index 5ac9a4d73..f3056f69f 100644 --- a/Scripts/Utilities/IntersectionUtils.cs +++ b/Scripts/Utilities/IntersectionUtils.cs @@ -8,7 +8,7 @@ static class IntersectionUtils { // Local method use only -- created here to reduce garbage collection static readonly Vector3[] k_TriangleVertices = new Vector3[3]; - static readonly Mesh k_BakedMesh = new Mesh(); + public static Mesh BakedMesh { private get; set; } /// /// Test whether an object collides with the tester @@ -192,8 +192,8 @@ public static void SetupCollisionTester(MeshCollider collisionTester, Transform var smr = obj.GetComponent(); if (smr) { - smr.BakeMesh(k_BakedMesh); - collisionTester.sharedMesh = k_BakedMesh; + smr.BakeMesh(BakedMesh); + collisionTester.sharedMesh = BakedMesh; } } } From ce498af8ef1d89d4241f6904349c174f79cd2448 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 14 Jul 2017 11:51:46 -0700 Subject: [PATCH 585/870] Perform formatting cleanups on new SpatialHintModule changes --- Scripts/Core/EditorVR.Tools.cs | 4 ++-- .../FunctionalityInjection/IControlSpatialHinting.cs | 1 - Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs | 6 ++++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index c81554285..9f01045f7 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -55,10 +55,10 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) linkedObject.linkedObjects = linkedObjectList; } - var spatialHintModule = evr.GetModule(); var controlSpatialHinting = obj as IControlSpatialHinting; if (controlSpatialHinting != null) { + var spatialHintModule = evr.GetModule(); controlSpatialHinting.spatialHintContentContainer = spatialHintModule.spatialHintContentContainer; controlSpatialHinting.spatialHintVisualsVisible = spatialHintModule.spatialHintVisualsVisible; controlSpatialHinting.spatialHintPreScrollVisualsVisible = spatialHintModule.spatialHintPreScrollVisualsVisible; @@ -91,7 +91,6 @@ internal static void SpawnDefaultTools(IProxy proxy) var lockModule = evr.GetModule(); var defaultTools = evr.m_DefaultTools; var pinnedTools = evr.GetNestedModule(); - var spatialHintModule = evr.GetModule(); foreach (var deviceData in evr.m_DeviceData) { @@ -153,6 +152,7 @@ internal static void SpawnDefaultTools(IProxy proxy) // Hook up Spatial Hinting functionality, if the PinnedToolsMenu implements the interface /* + var spatialHintModule = evr.GetModule(); var spatialPinnedToolsMenu = pinnedToolsMenu as IControlSpatialHinting; if (spatialPinnedToolsMenu != null) { diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs index 90cb17a37..d79acd4e5 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs @@ -48,7 +48,6 @@ public interface IControlSpatialHinting public static class IControlSpatialHintingMethods { internal delegate void PulseScrollArrowsDelegate(); - internal static PulseScrollArrowsDelegate pulseScrollArrows { get; set; } /// diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 833aeda76..0ab0ce546 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -298,4 +299,5 @@ public void PulseScrollArrows() } } } -} \ No newline at end of file +} +#endif From 139f0973bd1e4268369bbaf22e410bf90a4cde12 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 13:19:26 -0700 Subject: [PATCH 586/870] Disable intersection testers while cones are hidden --- Scripts/Proxies/DefaultProxyRay.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 61ec6c550..656ea5338 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -3,6 +3,7 @@ using System.Collections; using UnityEngine; using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; namespace UnityEditor.Experimental.EditorVR.Proxies @@ -27,6 +28,7 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale Coroutine m_RayVisibilityCoroutine; Coroutine m_ConeVisibilityCoroutine; Material m_RayMaterial; + IntersectionTester m_Tester; /// /// The object that is set when LockRay is called while the ray is unlocked. @@ -145,6 +147,7 @@ private void Awake() m_RayMaterial = MaterialUtils.GetMaterialClone(m_LineRenderer.GetComponent()); m_ConeTransform = m_Cone.transform; m_OriginalConeLocalScale = m_ConeTransform.localScale; + m_Tester = GetComponentInChildren(); } private void Start() @@ -203,6 +206,7 @@ private IEnumerator ShowRay() IEnumerator HideCone() { + m_Tester.active = false; var currentScale = m_ConeTransform.localScale; var smoothVelocity = Vector3.one; const float kSmoothTime = 0.1875f; @@ -235,6 +239,7 @@ IEnumerator ShowCone() m_ConeTransform.localScale = m_OriginalConeLocalScale; m_ConeVisibilityCoroutine = null; + m_Tester.active = true; } void OnDestroy() From 0cbbb6ed0b1478beabaa1704198044f49f51fde8 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 14:50:24 -0700 Subject: [PATCH 587/870] Fix an issue where radial handle tips showed up in the wrong place while rotating --- Manipulators/BaseManipulator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index 7ea6ade37..e5683c13c 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -155,12 +155,12 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD var handleTipGameObject = handleTipRenderer.gameObject; var wasActive = handleTipGameObject.activeSelf; handleTipGameObject.SetActive(active); + var handleTipTransform = handleTipRenderer.transform; if (active) // Reposition handle tip based on current raycast position when hovering or dragging { handleTipRenderer.sharedMaterial.color = handle.GetComponent().sharedMaterial.color; - var handleTipTransform = handleTipRenderer.transform; var handleTransform = handle.transform; var handleTipPosition = handleTipTransform.position; var distanceFromRayOrigin = Vector3.Distance(handleTipPosition, rayOrigin.position); @@ -215,7 +215,7 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD } if (handle.hasDragSource && !handleTip.positionOffset.HasValue) - handleTip.positionOffset = handle.transform.InverseTransformPoint(handleTransform.position); + handleTip.positionOffset = handle.transform.InverseTransformPoint(handleTipTransform.position); } else if(!handle.hasDragSource) { From 9e4e5d44b9aaaf05b45152d9aa132fee56ffbc58 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 15:38:19 -0700 Subject: [PATCH 588/870] Set ObjectUtils.hideFlags when settings hideflags --- Scripts/Core/EditorVR.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index ce455a587..59370e38c 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -445,6 +445,8 @@ void LateBindNestedModules(IEnumerable types) void SetHideFlags(HideFlags hideFlags) { + ObjectUtils.hideFlags = hideFlags; + foreach (var manager in Resources.FindObjectsOfTypeAll()) { manager.gameObject.hideFlags = hideFlags; From f41dccfaebac5f7204d8825d5f5b794ddb6dc2df Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 16:32:58 -0700 Subject: [PATCH 589/870] Add opaque material swap --- Manipulators/BaseManipulator.cs | 97 ++++---- Manipulators/Materials/Handle_G.mat | 2 +- Manipulators/Materials/Handle_Opaque.mat | 75 ++++++ Manipulators/Materials/Handle_Opaque.mat.meta | 8 + Manipulators/Materials/PlaneMaterial.mat | 2 +- Manipulators/ScaleManipulator.prefab | 4 +- Manipulators/StandardManipulator.prefab | 3 +- Shaders/StandardOverlayOpaque.shader | 217 ++++++++++++++++++ Shaders/StandardOverlayOpaque.shader.meta | 9 + 9 files changed, 373 insertions(+), 44 deletions(-) create mode 100644 Manipulators/Materials/Handle_Opaque.mat create mode 100644 Manipulators/Materials/Handle_Opaque.mat.meta create mode 100644 Shaders/StandardOverlayOpaque.shader create mode 100644 Shaders/StandardOverlayOpaque.shader.meta diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index e5683c13c..b4a44c3a1 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -36,8 +36,13 @@ class HandleTip [SerializeField] float m_SphereHandleScaleBump = 1.1f; + [SerializeField] + Material m_OpaqueMaterial; + readonly Dictionary m_ScaleBumps = new Dictionary(); readonly Dictionary m_HandleTips = new Dictionary(); + readonly Dictionary m_OpaqueMaterials = new Dictionary(); + readonly Dictionary m_OldMaterials = new Dictionary(); public bool adjustScaleForCamera { get; set; } @@ -54,64 +59,74 @@ void Awake() m_ScaleBumps[typeof(LinearHandle)] = m_LinearHandleScaleBump; m_ScaleBumps[typeof(PlaneHandle)] = m_PlaneHandleScaleBump; m_ScaleBumps[typeof(SphereHandle)] = m_SphereHandleScaleBump; + + m_OpaqueMaterial = Instantiate(m_OpaqueMaterial); + + foreach (var handle in m_AllHandles) + { + handle.hoverStarted += OnHandleHoverStarted; + handle.hovering += OnHandleHovering; + handle.hoverEnded += OnHandleHoverEnded; + + + handle.dragStarted += OnHandleDragStarted; + handle.dragging += OnHandleDragging; + handle.dragEnded += OnHandleDragEnded; + } } protected virtual void OnEnable() { if (adjustScaleForCamera) Camera.onPreRender += OnCameraPreRender; - - foreach (var h in m_AllHandles) - { - SetUpHandle(h); - } } protected virtual void OnDisable() { Camera.onPreRender -= OnCameraPreRender; - foreach (var h in m_AllHandles) - { - TakeDownHandle(h); - } - foreach (var kvp in m_HandleTips) { kvp.Value.renderer.gameObject.SetActive(false); } } - protected virtual void SetUpHandle(BaseHandle handle) - { - handle.hoverStarted += OnHandleHoverStarted; - handle.hovering += OnHandleHovering; - handle.hoverEnded += OnHandleHoverEnded; - - - handle.dragStarted += OnHandleDragStarted; - handle.dragging += OnHandleDragging; - handle.dragEnded += OnHandleDragEnded; - } - - protected virtual void TakeDownHandle(BaseHandle handle) + void OnDestroy() { - handle.hoverStarted -= OnHandleHoverStarted; - handle.hovering -= OnHandleHovering; - handle.hoverEnded -= OnHandleHoverEnded; - - - handle.dragStarted -= OnHandleDragStarted; - handle.dragging -= OnHandleDragging; - handle.dragEnded -= OnHandleDragEnded; + foreach (var kvp in m_OpaqueMaterials) + { + ObjectUtils.Destroy(kvp.Value); + } } - void ScaleBump(BaseHandle handle, bool scaleUp) + void ShowHoverState(BaseHandle handle, Transform rayOrigin, bool hovering) { var type = handle.GetType(); float scaleBump; if (m_ScaleBumps.TryGetValue(type, out scaleBump)) - handle.transform.localScale = scaleUp ? handle.transform.localScale * scaleBump : handle.transform.localScale / scaleBump; + handle.transform.localScale = hovering ? handle.transform.localScale * scaleBump : handle.transform.localScale / scaleBump; + + var handleRenderer = handle.GetComponent(); + if (hovering) + { + Material opaqueMaterial; + if (!m_OpaqueMaterials.TryGetValue(rayOrigin, out opaqueMaterial)) + { + opaqueMaterial = Instantiate(m_OpaqueMaterial); + m_OpaqueMaterials[rayOrigin] = opaqueMaterial; + } + + var material = handleRenderer.sharedMaterial; + m_OldMaterials[rayOrigin] = material; + var color = material.color; + color.a = 1; + opaqueMaterial.color = color; + handleRenderer.material = opaqueMaterial; + } + else + { + handleRenderer.sharedMaterial = m_OldMaterials[rayOrigin]; + } } void OnCameraPreRender(Camera camera) @@ -140,7 +155,7 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD handleTipRenderer = m_HandleTip; if (m_HandleTips.Count > 0) handleTipRenderer = ObjectUtils.Instantiate(handleTipRenderer.gameObject, transform).GetComponent(); - MaterialUtils.CloneMaterials(handleTipRenderer); + //MaterialUtils.CloneMaterials(handleTipRenderer); handleTip = new HandleTip { renderer = handleTipRenderer }; m_HandleTips[rayOrigin] = handleTip; @@ -159,7 +174,7 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD if (active) // Reposition handle tip based on current raycast position when hovering or dragging { - handleTipRenderer.sharedMaterial.color = handle.GetComponent().sharedMaterial.color; + handleTipRenderer.sharedMaterial = handle.GetComponent().sharedMaterial; var handleTransform = handle.transform; var handleTipPosition = handleTipTransform.position; @@ -225,13 +240,14 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD protected virtual void OnHandleHoverStarted(BaseHandle handle, HandleEventData eventData) { - if (handle.IndexOfHoverSource(eventData.rayOrigin) > 0) + var rayOrigin = eventData.rayOrigin; + if (handle.IndexOfHoverSource(rayOrigin) > 0) return; if (!handle.hasDragSource) { + ShowHoverState(handle, rayOrigin, true); UpdateHandleTip(handle, eventData, true); - ScaleBump(handle, true); } } @@ -245,7 +261,8 @@ protected virtual void OnHandleHovering(BaseHandle handle, HandleEventData event protected virtual void OnHandleHoverEnded(BaseHandle handle, HandleEventData eventData) { - if (handle.IndexOfHoverSource(eventData.rayOrigin) > 0) + var rayOrigin = eventData.rayOrigin; + if (handle.IndexOfHoverSource(rayOrigin) > 0) return; if (!handle.hasDragSource) @@ -253,7 +270,7 @@ protected virtual void OnHandleHoverEnded(BaseHandle handle, HandleEventData eve UpdateHandleTip(handle, eventData, false); if (!handle.hasHoverSource) - ScaleBump(handle, false); + ShowHoverState(handle, rayOrigin, false); } } @@ -300,7 +317,7 @@ protected virtual void OnHandleDragEnded(BaseHandle handle, HandleEventData even dragging = false; if (!handle.hasDragSource && !handle.hasHoverSource) - ScaleBump(handle, false); + ShowHoverState(handle, rayOrigin, false); } } } diff --git a/Manipulators/Materials/Handle_G.mat b/Manipulators/Materials/Handle_G.mat index 9a15496a9..22366da59 100644 --- a/Manipulators/Materials/Handle_G.mat +++ b/Manipulators/Materials/Handle_G.mat @@ -11,7 +11,7 @@ Material: m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A m_LightmapFlags: 1 m_EnableInstancingVariants: 0 - m_CustomRenderQueue: -1 + m_CustomRenderQueue: 3000 stringTagMap: RenderType: Transparent disabledShaderPasses: [] diff --git a/Manipulators/Materials/Handle_Opaque.mat b/Manipulators/Materials/Handle_Opaque.mat new file mode 100644 index 000000000..f4ddd1c2d --- /dev/null +++ b/Manipulators/Materials/Handle_Opaque.mat @@ -0,0 +1,75 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Handle_Opaque + m_Shader: {fileID: 4800000, guid: 60c2f570f19b14c4a9f0265c7d496d95, type: 3} + m_ShaderKeywords: _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 1 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 0, b: 0, a: 1} + - _EmissionColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Manipulators/Materials/Handle_Opaque.mat.meta b/Manipulators/Materials/Handle_Opaque.mat.meta new file mode 100644 index 000000000..102654caf --- /dev/null +++ b/Manipulators/Materials/Handle_Opaque.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 60ba0d848a3eeec49a02ffe6f85017f2 +timeCreated: 1470084931 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Manipulators/Materials/PlaneMaterial.mat b/Manipulators/Materials/PlaneMaterial.mat index 5ed3e705b..c050f9ae9 100644 --- a/Manipulators/Materials/PlaneMaterial.mat +++ b/Manipulators/Materials/PlaneMaterial.mat @@ -11,7 +11,7 @@ Material: m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION m_LightmapFlags: 1 m_EnableInstancingVariants: 0 - m_CustomRenderQueue: -1 + m_CustomRenderQueue: 3000 stringTagMap: RenderType: Transparent disabledShaderPasses: [] diff --git a/Manipulators/ScaleManipulator.prefab b/Manipulators/ScaleManipulator.prefab index 0d590482b..8481b7f36 100644 --- a/Manipulators/ScaleManipulator.prefab +++ b/Manipulators/ScaleManipulator.prefab @@ -312,7 +312,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 0c0bcbee36e026343a113109292ee771, type: 2} + - {fileID: 2100000, guid: 60ba0d848a3eeec49a02ffe6f85017f2, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -486,6 +486,8 @@ MonoBehaviour: m_LinearHandleScaleBump: 1.5 m_PlaneHandleScaleBump: 1.1 m_SphereHandleScaleBump: 1.1 + m_HandleAlpha: 0.39215687 + m_HandleHoverAlpha: 1 m_UniformHandle: {fileID: 114000010053947466} --- !u!136 &136000010215347092 CapsuleCollider: diff --git a/Manipulators/StandardManipulator.prefab b/Manipulators/StandardManipulator.prefab index cdd98ea8d..895107dd5 100644 --- a/Manipulators/StandardManipulator.prefab +++ b/Manipulators/StandardManipulator.prefab @@ -667,7 +667,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 0c0bcbee36e026343a113109292ee771, type: 2} + - {fileID: 2100000, guid: 60ba0d848a3eeec49a02ffe6f85017f2, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1076,6 +1076,7 @@ MonoBehaviour: m_LinearHandleScaleBump: 1.5 m_PlaneHandleScaleBump: 1.1 m_SphereHandleScaleBump: 1.1 + m_OpaqueMaterial: {fileID: 2100000, guid: 60ba0d848a3eeec49a02ffe6f85017f2, type: 2} m_PlaneHandlesParent: {fileID: 4000012837354530} m_RadialHandleMesh: {fileID: 4300008, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} m_FatRadialHandleMesh: {fileID: 4300010, guid: cdace0cf368873c4796b9f9ade156c53, diff --git a/Shaders/StandardOverlayOpaque.shader b/Shaders/StandardOverlayOpaque.shader new file mode 100644 index 000000000..87f2f1348 --- /dev/null +++ b/Shaders/StandardOverlayOpaque.shader @@ -0,0 +1,217 @@ +Shader "EditorVR/StandardOverlayOpaque" +{ + Properties + { + _Color("Color", Color) = (1,1,1,1) + _MainTex("Albedo", 2D) = "white" {} + + _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 + + _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 + _GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0 + [Enum(Metallic Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel ("Smoothness texture channel", Float) = 0 + + [Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0 + _MetallicGlossMap("Metallic", 2D) = "white" {} + + [ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0 + [ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0 + + _BumpScale("Scale", Float) = 1.0 + _BumpMap("Normal Map", 2D) = "bump" {} + + _Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02 + _ParallaxMap ("Height Map", 2D) = "black" {} + + _OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0 + _OcclusionMap("Occlusion", 2D) = "white" {} + + _EmissionColor("Color", Color) = (0,0,0) + _EmissionMap("Emission", 2D) = "white" {} + + _DetailMask("Detail Mask", 2D) = "white" {} + + _DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {} + _DetailNormalMapScale("Scale", Float) = 1.0 + _DetailNormalMap("Normal Map", 2D) = "bump" {} + + [Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0 + + + // Blending state + [HideInInspector] _Mode ("__mode", Float) = 0.0 + [HideInInspector] _SrcBlend ("__src", Float) = 1.0 + [HideInInspector] _DstBlend ("__dst", Float) = 0.0 + [HideInInspector] _ZWrite ("__zw", Float) = 1.0 + } + + CGINCLUDE + #define UNITY_SETUP_BRDF_INPUT MetallicSetup + ENDCG + + SubShader + { + Tags { "Queue" = "Overlay+5000" "RenderType"="Opaque" "PerformanceChecks"="False" } + LOD 300 + + + // ------------------------------------------------------------------ + // Base forward pass (directional light, emission, lightmaps, ...) + Pass + { + Name "FORWARD" + Tags { "LightMode" = "ForwardBase" } + + Blend [_SrcBlend] [_DstBlend] + ZWrite On + ZTest Off + Offset 0, -1 + + CGPROGRAM + #pragma target 3.0 + + // ------------------------------------- + + #pragma shader_feature _NORMALMAP + #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON + #pragma shader_feature _EMISSION + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature ___ _DETAIL_MULX2 + #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + #pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF + #pragma shader_feature _ _GLOSSYREFLECTIONS_OFF + #pragma shader_feature _PARALLAXMAP + + #pragma multi_compile_fwdbase + #pragma multi_compile_fog + + #pragma vertex vertBase + #pragma fragment fragBase + #include "UnityStandardCoreForward.cginc" + + ENDCG + } + // ------------------------------------------------------------------ + // Additive forward pass (one light per pass) + Pass + { + Name "FORWARD_DELTA" + Tags { "LightMode" = "ForwardAdd" } + Blend [_SrcBlend] One + Fog { Color (0,0,0,0) } // in additive pass fog should be black + ZWrite Off + ZTest LEqual + Offset 0, -1 + + CGPROGRAM + #pragma target 3.0 + + // ------------------------------------- + + + #pragma shader_feature _NORMALMAP + #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + #pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF + #pragma shader_feature ___ _DETAIL_MULX2 + #pragma shader_feature _PARALLAXMAP + + #pragma multi_compile_fwdadd_fullshadows + #pragma multi_compile_fog + + + #pragma vertex vertAdd + #pragma fragment fragAdd + #include "UnityStandardCoreForward.cginc" + + ENDCG + } + // ------------------------------------------------------------------ + // Shadow rendering pass + Pass + { + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + + ZWrite On ZTest LEqual + + CGPROGRAM + #pragma target 3.0 + + // ------------------------------------- + + + #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON + #pragma multi_compile_shadowcaster + + #pragma vertex vertShadowCaster + #pragma fragment fragShadowCaster + + #include "UnityStandardShadow.cginc" + + ENDCG + } + // ------------------------------------------------------------------ + // Deferred pass + Pass + { + Name "DEFERRED" + Tags { "LightMode" = "Deferred" } + + CGPROGRAM + #pragma target 3.0 + #pragma exclude_renderers nomrt + + + // ------------------------------------- + + #pragma shader_feature _NORMALMAP + #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON + #pragma shader_feature _EMISSION + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + #pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF + #pragma shader_feature ___ _DETAIL_MULX2 + #pragma shader_feature _PARALLAXMAP + + #pragma multi_compile ___ UNITY_HDR_ON + #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON + #pragma multi_compile ___ DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE + #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON + + #pragma vertex vertDeferred + #pragma fragment fragDeferred + + #include "UnityStandardCore.cginc" + + ENDCG + } + + // ------------------------------------------------------------------ + // Extracts information for lightmapping, GI (emission, albedo, ...) + // This pass it not used during regular rendering. + Pass + { + Name "META" + Tags { "LightMode"="Meta" } + + Cull Off + + CGPROGRAM + #pragma vertex vert_meta + #pragma fragment frag_meta + + #pragma shader_feature _EMISSION + #pragma shader_feature _METALLICGLOSSMAP + #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + #pragma shader_feature ___ _DETAIL_MULX2 + + #include "UnityStandardMeta.cginc" + ENDCG + } + } + + FallBack "VertexLit" + CustomEditor "StandardShaderGUI" +} diff --git a/Shaders/StandardOverlayOpaque.shader.meta b/Shaders/StandardOverlayOpaque.shader.meta new file mode 100644 index 000000000..2e288636e --- /dev/null +++ b/Shaders/StandardOverlayOpaque.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 60c2f570f19b14c4a9f0265c7d496d95 +timeCreated: 1470075377 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: From fe3fe450b90dd86089586b6a9feb0c5b2e713798 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 17:23:06 -0700 Subject: [PATCH 590/870] Remove opaque material swap; Add transparency swap; Clean up instanced materials; Fix KeyNotFoundException in LinearHandle; Tweak scale bump values --- Manipulators/BaseManipulator.cs | 63 +++-- Manipulators/Materials/Handle_Opaque.mat | 75 ------ Manipulators/Materials/Handle_Opaque.mat.meta | 8 - Manipulators/StandardManipulator.cs | 19 +- Manipulators/StandardManipulator.prefab | 11 +- Scripts/Handles/LinearHandle.cs | 5 +- Shaders/StandardOverlayOpaque.shader | 217 ------------------ Shaders/StandardOverlayOpaque.shader.meta | 9 - 8 files changed, 38 insertions(+), 369 deletions(-) delete mode 100644 Manipulators/Materials/Handle_Opaque.mat delete mode 100644 Manipulators/Materials/Handle_Opaque.mat.meta delete mode 100644 Shaders/StandardOverlayOpaque.shader delete mode 100644 Shaders/StandardOverlayOpaque.shader.meta diff --git a/Manipulators/BaseManipulator.cs b/Manipulators/BaseManipulator.cs index b4a44c3a1..8bc82a50a 100644 --- a/Manipulators/BaseManipulator.cs +++ b/Manipulators/BaseManipulator.cs @@ -11,7 +11,7 @@ class BaseManipulator : MonoBehaviour, IManipulator { protected const float k_BaseManipulatorSize = 0.3f; const float k_MinHandleTipDirectionDelta = 0.01f; - const float k_LazyFollow = 50f; + const float k_LazyFollow = 40f; class HandleTip { @@ -28,21 +28,22 @@ class HandleTip protected List m_AllHandles; [SerializeField] - float m_LinearHandleScaleBump = 1.5f; + float m_LinearHandleScaleBump = 1.8f; [SerializeField] - float m_PlaneHandleScaleBump = 1.1f; + float m_PlaneHandleScaleBump = 1.2f; [SerializeField] float m_SphereHandleScaleBump = 1.1f; [SerializeField] - Material m_OpaqueMaterial; + float m_HandleAlpha = 0.4f; + + [SerializeField] + float m_HandleHoverAlpha = 0.8f; readonly Dictionary m_ScaleBumps = new Dictionary(); readonly Dictionary m_HandleTips = new Dictionary(); - readonly Dictionary m_OpaqueMaterials = new Dictionary(); - readonly Dictionary m_OldMaterials = new Dictionary(); public bool adjustScaleForCamera { get; set; } @@ -60,10 +61,10 @@ void Awake() m_ScaleBumps[typeof(PlaneHandle)] = m_PlaneHandleScaleBump; m_ScaleBumps[typeof(SphereHandle)] = m_SphereHandleScaleBump; - m_OpaqueMaterial = Instantiate(m_OpaqueMaterial); - foreach (var handle in m_AllHandles) { + MaterialUtils.CloneMaterials(handle.GetComponent()); + handle.hoverStarted += OnHandleHoverStarted; handle.hovering += OnHandleHovering; handle.hoverEnded += OnHandleHoverEnded; @@ -93,13 +94,13 @@ protected virtual void OnDisable() void OnDestroy() { - foreach (var kvp in m_OpaqueMaterials) + foreach (var handle in m_AllHandles) { - ObjectUtils.Destroy(kvp.Value); + ObjectUtils.Destroy(handle.GetComponent().sharedMaterial); } } - void ShowHoverState(BaseHandle handle, Transform rayOrigin, bool hovering) + protected virtual void ShowHoverState(BaseHandle handle, bool hovering) { var type = handle.GetType(); float scaleBump; @@ -107,26 +108,10 @@ void ShowHoverState(BaseHandle handle, Transform rayOrigin, bool hovering) handle.transform.localScale = hovering ? handle.transform.localScale * scaleBump : handle.transform.localScale / scaleBump; var handleRenderer = handle.GetComponent(); - if (hovering) - { - Material opaqueMaterial; - if (!m_OpaqueMaterials.TryGetValue(rayOrigin, out opaqueMaterial)) - { - opaqueMaterial = Instantiate(m_OpaqueMaterial); - m_OpaqueMaterials[rayOrigin] = opaqueMaterial; - } - - var material = handleRenderer.sharedMaterial; - m_OldMaterials[rayOrigin] = material; - var color = material.color; - color.a = 1; - opaqueMaterial.color = color; - handleRenderer.material = opaqueMaterial; - } - else - { - handleRenderer.sharedMaterial = m_OldMaterials[rayOrigin]; - } + var material = handleRenderer.sharedMaterial; + var color = material.color; + color.a = hovering ? m_HandleHoverAlpha : m_HandleAlpha; + material.color = color; } void OnCameraPreRender(Camera camera) @@ -155,7 +140,6 @@ protected virtual void UpdateHandleTip(BaseHandle handle, HandleEventData eventD handleTipRenderer = m_HandleTip; if (m_HandleTips.Count > 0) handleTipRenderer = ObjectUtils.Instantiate(handleTipRenderer.gameObject, transform).GetComponent(); - //MaterialUtils.CloneMaterials(handleTipRenderer); handleTip = new HandleTip { renderer = handleTipRenderer }; m_HandleTips[rayOrigin] = handleTip; @@ -246,7 +230,7 @@ protected virtual void OnHandleHoverStarted(BaseHandle handle, HandleEventData e if (!handle.hasDragSource) { - ShowHoverState(handle, rayOrigin, true); + ShowHoverState(handle, true); UpdateHandleTip(handle, eventData, true); } } @@ -256,7 +240,8 @@ protected virtual void OnHandleHovering(BaseHandle handle, HandleEventData event if (handle.IndexOfHoverSource(eventData.rayOrigin) > 0) return; - UpdateHandleTip(handle, eventData, !handle.hasDragSource); + if (!handle.hasDragSource) + UpdateHandleTip(handle, eventData, true); } protected virtual void OnHandleHoverEnded(BaseHandle handle, HandleEventData eventData) @@ -270,7 +255,7 @@ protected virtual void OnHandleHoverEnded(BaseHandle handle, HandleEventData eve UpdateHandleTip(handle, eventData, false); if (!handle.hasHoverSource) - ShowHoverState(handle, rayOrigin, false); + ShowHoverState(handle, false); } } @@ -283,11 +268,15 @@ protected virtual void OnHandleDragStarted(BaseHandle handle, HandleEventData ev foreach (var h in m_AllHandles) h.gameObject.SetActive(h == handle); + foreach (var kvp in m_HandleTips) + kvp.Value.renderer.gameObject.SetActive(false); + if (dragStarted != null) dragStarted(); dragging = true; + ShowHoverState(handle, false); UpdateHandleTip(handle, eventData, true); } @@ -316,8 +305,8 @@ protected virtual void OnHandleDragEnded(BaseHandle handle, HandleEventData even dragging = false; - if (!handle.hasDragSource && !handle.hasHoverSource) - ShowHoverState(handle, rayOrigin, false); + if (!handle.hasDragSource && handle.hasHoverSource) + ShowHoverState(handle, true); } } } diff --git a/Manipulators/Materials/Handle_Opaque.mat b/Manipulators/Materials/Handle_Opaque.mat deleted file mode 100644 index f4ddd1c2d..000000000 --- a/Manipulators/Materials/Handle_Opaque.mat +++ /dev/null @@ -1,75 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: Handle_Opaque - m_Shader: {fileID: 4800000, guid: 60c2f570f19b14c4a9f0265c7d496d95, type: 3} - m_ShaderKeywords: _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A - m_LightmapFlags: 1 - m_EnableInstancingVariants: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _GlossMapScale: 1 - - _Glossiness: 0 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 1 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 0, b: 0, a: 1} - - _EmissionColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Manipulators/Materials/Handle_Opaque.mat.meta b/Manipulators/Materials/Handle_Opaque.mat.meta deleted file mode 100644 index 102654caf..000000000 --- a/Manipulators/Materials/Handle_Opaque.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 60ba0d848a3eeec49a02ffe6f85017f2 -timeCreated: 1470084931 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Manipulators/StandardManipulator.cs b/Manipulators/StandardManipulator.cs index c8b21427e..9bd7fd5eb 100644 --- a/Manipulators/StandardManipulator.cs +++ b/Manipulators/StandardManipulator.cs @@ -36,20 +36,12 @@ void Update() } } - protected override void OnHandleHoverStarted(BaseHandle handle, HandleEventData eventData) + protected override void ShowHoverState(BaseHandle handle, bool hovering) { - base.OnHandleHoverStarted(handle, eventData); + base.ShowHoverState(handle, hovering); - if (!handle.hasDragSource && handle is RadialHandle) - handle.GetComponent().sharedMesh = m_FatRadialHandleMesh; - } - - protected override void OnHandleHoverEnded(BaseHandle handle, HandleEventData eventData) - { - base.OnHandleHoverEnded(handle, eventData); - - if (!handle.hasDragSource && !handle.hasHoverSource && handle is RadialHandle) - handle.GetComponent().sharedMesh = m_RadialHandleMesh; + if (handle is RadialHandle) + handle.GetComponent().sharedMesh = hovering ? m_FatRadialHandleMesh : m_RadialHandleMesh; } protected override void OnHandleDragStarted(BaseHandle handle, HandleEventData eventData) @@ -95,9 +87,6 @@ protected override void OnHandleDragEnded(BaseHandle handle, HandleEventData eve if (handle is SphereHandle) handle.transform.localScale /= m_SphereHandleHideScale; - - if (handle is RadialHandle && !handle.hasDragSource && !handle.hasHoverSource) - handle.GetComponent().sharedMesh = m_RadialHandleMesh; } } } diff --git a/Manipulators/StandardManipulator.prefab b/Manipulators/StandardManipulator.prefab index 895107dd5..bb0af45ba 100644 --- a/Manipulators/StandardManipulator.prefab +++ b/Manipulators/StandardManipulator.prefab @@ -151,7 +151,7 @@ GameObject: - component: {fileID: 33000013153004220} - component: {fileID: 23000012097216674} m_Layer: 5 - m_Name: Arrow + m_Name: HandleTip m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -667,7 +667,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 60ba0d848a3eeec49a02ffe6f85017f2, type: 2} + - {fileID: 2100000, guid: 0c0bcbee36e026343a113109292ee771, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1073,10 +1073,11 @@ MonoBehaviour: - {fileID: 114000012656813054} - {fileID: 114000010105022974} - {fileID: 114000011169532704} - m_LinearHandleScaleBump: 1.5 - m_PlaneHandleScaleBump: 1.1 + m_LinearHandleScaleBump: 1.8 + m_PlaneHandleScaleBump: 1.2 m_SphereHandleScaleBump: 1.1 - m_OpaqueMaterial: {fileID: 2100000, guid: 60ba0d848a3eeec49a02ffe6f85017f2, type: 2} + m_HandleAlpha: 0.4 + m_HandleHoverAlpha: 0.8 m_PlaneHandlesParent: {fileID: 4000012837354530} m_RadialHandleMesh: {fileID: 4300008, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} m_FatRadialHandleMesh: {fileID: 4300010, guid: cdace0cf368873c4796b9f9ade156c53, diff --git a/Scripts/Handles/LinearHandle.cs b/Scripts/Handles/LinearHandle.cs index 3c113b3ed..3699d4ed6 100644 --- a/Scripts/Handles/LinearHandle.cs +++ b/Scripts/Handles/LinearHandle.cs @@ -72,11 +72,10 @@ protected override void OnHandleHoverStarted(HandleEventData eventData) { var linearEventData = (LinearHandleEventData)eventData; + m_LastPositions[eventData.rayOrigin] = linearEventData.raycastHitWorldPosition; + if (m_DragSources.Count == 0) - { - m_LastPositions[eventData.rayOrigin] = linearEventData.raycastHitWorldPosition; UpdateEventData(linearEventData); - } base.OnHandleHoverStarted(eventData); } diff --git a/Shaders/StandardOverlayOpaque.shader b/Shaders/StandardOverlayOpaque.shader deleted file mode 100644 index 87f2f1348..000000000 --- a/Shaders/StandardOverlayOpaque.shader +++ /dev/null @@ -1,217 +0,0 @@ -Shader "EditorVR/StandardOverlayOpaque" -{ - Properties - { - _Color("Color", Color) = (1,1,1,1) - _MainTex("Albedo", 2D) = "white" {} - - _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 - - _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 - _GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0 - [Enum(Metallic Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel ("Smoothness texture channel", Float) = 0 - - [Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0 - _MetallicGlossMap("Metallic", 2D) = "white" {} - - [ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0 - [ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0 - - _BumpScale("Scale", Float) = 1.0 - _BumpMap("Normal Map", 2D) = "bump" {} - - _Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02 - _ParallaxMap ("Height Map", 2D) = "black" {} - - _OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0 - _OcclusionMap("Occlusion", 2D) = "white" {} - - _EmissionColor("Color", Color) = (0,0,0) - _EmissionMap("Emission", 2D) = "white" {} - - _DetailMask("Detail Mask", 2D) = "white" {} - - _DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {} - _DetailNormalMapScale("Scale", Float) = 1.0 - _DetailNormalMap("Normal Map", 2D) = "bump" {} - - [Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0 - - - // Blending state - [HideInInspector] _Mode ("__mode", Float) = 0.0 - [HideInInspector] _SrcBlend ("__src", Float) = 1.0 - [HideInInspector] _DstBlend ("__dst", Float) = 0.0 - [HideInInspector] _ZWrite ("__zw", Float) = 1.0 - } - - CGINCLUDE - #define UNITY_SETUP_BRDF_INPUT MetallicSetup - ENDCG - - SubShader - { - Tags { "Queue" = "Overlay+5000" "RenderType"="Opaque" "PerformanceChecks"="False" } - LOD 300 - - - // ------------------------------------------------------------------ - // Base forward pass (directional light, emission, lightmaps, ...) - Pass - { - Name "FORWARD" - Tags { "LightMode" = "ForwardBase" } - - Blend [_SrcBlend] [_DstBlend] - ZWrite On - ZTest Off - Offset 0, -1 - - CGPROGRAM - #pragma target 3.0 - - // ------------------------------------- - - #pragma shader_feature _NORMALMAP - #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON - #pragma shader_feature _EMISSION - #pragma shader_feature _METALLICGLOSSMAP - #pragma shader_feature ___ _DETAIL_MULX2 - #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A - #pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF - #pragma shader_feature _ _GLOSSYREFLECTIONS_OFF - #pragma shader_feature _PARALLAXMAP - - #pragma multi_compile_fwdbase - #pragma multi_compile_fog - - #pragma vertex vertBase - #pragma fragment fragBase - #include "UnityStandardCoreForward.cginc" - - ENDCG - } - // ------------------------------------------------------------------ - // Additive forward pass (one light per pass) - Pass - { - Name "FORWARD_DELTA" - Tags { "LightMode" = "ForwardAdd" } - Blend [_SrcBlend] One - Fog { Color (0,0,0,0) } // in additive pass fog should be black - ZWrite Off - ZTest LEqual - Offset 0, -1 - - CGPROGRAM - #pragma target 3.0 - - // ------------------------------------- - - - #pragma shader_feature _NORMALMAP - #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON - #pragma shader_feature _METALLICGLOSSMAP - #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A - #pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF - #pragma shader_feature ___ _DETAIL_MULX2 - #pragma shader_feature _PARALLAXMAP - - #pragma multi_compile_fwdadd_fullshadows - #pragma multi_compile_fog - - - #pragma vertex vertAdd - #pragma fragment fragAdd - #include "UnityStandardCoreForward.cginc" - - ENDCG - } - // ------------------------------------------------------------------ - // Shadow rendering pass - Pass - { - Name "ShadowCaster" - Tags { "LightMode" = "ShadowCaster" } - - ZWrite On ZTest LEqual - - CGPROGRAM - #pragma target 3.0 - - // ------------------------------------- - - - #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON - #pragma multi_compile_shadowcaster - - #pragma vertex vertShadowCaster - #pragma fragment fragShadowCaster - - #include "UnityStandardShadow.cginc" - - ENDCG - } - // ------------------------------------------------------------------ - // Deferred pass - Pass - { - Name "DEFERRED" - Tags { "LightMode" = "Deferred" } - - CGPROGRAM - #pragma target 3.0 - #pragma exclude_renderers nomrt - - - // ------------------------------------- - - #pragma shader_feature _NORMALMAP - #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON - #pragma shader_feature _EMISSION - #pragma shader_feature _METALLICGLOSSMAP - #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A - #pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF - #pragma shader_feature ___ _DETAIL_MULX2 - #pragma shader_feature _PARALLAXMAP - - #pragma multi_compile ___ UNITY_HDR_ON - #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON - #pragma multi_compile ___ DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE - #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON - - #pragma vertex vertDeferred - #pragma fragment fragDeferred - - #include "UnityStandardCore.cginc" - - ENDCG - } - - // ------------------------------------------------------------------ - // Extracts information for lightmapping, GI (emission, albedo, ...) - // This pass it not used during regular rendering. - Pass - { - Name "META" - Tags { "LightMode"="Meta" } - - Cull Off - - CGPROGRAM - #pragma vertex vert_meta - #pragma fragment frag_meta - - #pragma shader_feature _EMISSION - #pragma shader_feature _METALLICGLOSSMAP - #pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A - #pragma shader_feature ___ _DETAIL_MULX2 - - #include "UnityStandardMeta.cginc" - ENDCG - } - } - - FallBack "VertexLit" - CustomEditor "StandardShaderGUI" -} diff --git a/Shaders/StandardOverlayOpaque.shader.meta b/Shaders/StandardOverlayOpaque.shader.meta deleted file mode 100644 index 2e288636e..000000000 --- a/Shaders/StandardOverlayOpaque.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 60c2f570f19b14c4a9f0265c7d496d95 -timeCreated: 1470075377 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: From 211b182c87eaa03e9f8cdd75b8b24d0aef5c19ed Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 17:31:31 -0700 Subject: [PATCH 591/870] Save project --- Manipulators/ScaleManipulator.prefab | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Manipulators/ScaleManipulator.prefab b/Manipulators/ScaleManipulator.prefab index 8481b7f36..a334f1537 100644 --- a/Manipulators/ScaleManipulator.prefab +++ b/Manipulators/ScaleManipulator.prefab @@ -196,13 +196,13 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012986686592} - m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_Children: [] m_Father: {fileID: 4000011621453950} m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: -90, y: 90, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &23000010356371698 MeshRenderer: m_ObjectHideFlags: 1 @@ -483,11 +483,11 @@ MonoBehaviour: - {fileID: 114000013052707070} - {fileID: 114000011988091676} - {fileID: 114000011147854508} - m_LinearHandleScaleBump: 1.5 - m_PlaneHandleScaleBump: 1.1 + m_LinearHandleScaleBump: 1.8 + m_PlaneHandleScaleBump: 1.2 m_SphereHandleScaleBump: 1.1 - m_HandleAlpha: 0.39215687 - m_HandleHoverAlpha: 1 + m_HandleAlpha: 0.4 + m_HandleHoverAlpha: 0.8 m_UniformHandle: {fileID: 114000010053947466} --- !u!136 &136000010215347092 CapsuleCollider: From 03774a59279fdf19055ca5f54615b9b97074f8c5 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 18:51:23 -0700 Subject: [PATCH 592/870] Remove duplicate implementation of showing manipulator on ray selection --- Tools/TransformTool/TransformTool.cs | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index d784e19de..8e0840726 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -156,19 +156,25 @@ public List actions [SerializeField] Sprite m_OriginCenterIcon; + [SerializeField] Sprite m_OriginPivotIcon; + [SerializeField] Sprite m_RotationGlobalIcon; + [SerializeField] Sprite m_RotationLocalIcon; + [SerializeField] Sprite m_StandardManipulatorIcon; + [SerializeField] Sprite m_ScaleManipulatorIcon; [SerializeField] GameObject m_StandardManipulatorPrefab; + [SerializeField] GameObject m_ScaleManipulatorPrefab; @@ -202,7 +208,6 @@ public List actions readonly Dictionary m_GrabData = new Dictionary(); bool m_DirectSelected; - bool m_WasDirectSelected; // Hold directSelected state for a frame float m_ScaleStartDistance; Node m_ScaleFirstNode; float m_ScaleFactor; @@ -368,9 +373,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon Undo.IncrementCurrentGroup(); } - - if (transformInput.select.wasJustReleased) - m_DirectSelected = true; } GrabData leftData; @@ -469,33 +471,21 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon rightData.UpdatePositions(this); } - // Reset direct selection state in case of a ray selection - foreach (TransformTool transformTool in linkedObjects) + foreach (var linkedObject in linkedObjects) { + var transformTool = (TransformTool)linkedObject; var rayOrigin = transformTool.rayOrigin; if (!(m_Scaling || directSelection.ContainsKey(rayOrigin) || m_GrabData.ContainsKey(transformTool.node.Value))) { this.UnlockRay(rayOrigin, this); this.SetDefaultRayVisibility(rayOrigin, true, true); - - var transformInput = transformTool.m_Input; - if (transformInput != null && transformInput.select.wasJustReleased) - { - m_DirectSelected = false; - break; - } } } } // Manipulator is disabled while direct manipulation is happening - if (hasObject || m_DirectSelected || m_WasDirectSelected) - { - m_WasDirectSelected = m_DirectSelected; + if (hasObject || m_DirectSelected) return; - } - - m_WasDirectSelected = m_DirectSelected; if (Selection.gameObjects.Length > 0) { From 54c1f4c6ec1f3edf7581783fbafe7845fed3abcb Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 14 Jul 2017 19:05:35 -0700 Subject: [PATCH 593/870] Don't show ray on UI hover when creating primitives --- Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index bb8fc3cbd..c0bd155f6 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -75,7 +75,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - if (this.IsHoveringOverUI(rayOrigin)) + if (m_State == PrimitiveCreationStates.StartPoint && this.IsHoveringOverUI(rayOrigin)) { this.UnlockRay(rayOrigin, this); this.SetDefaultRayVisibility(rayOrigin, true, true); From deea537cd139cd6f279131d5c633e20c306b9044 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 14 Jul 2017 19:29:32 -0700 Subject: [PATCH 594/870] Perform additional SpatialHintModule arch changes & bug-fixes --- .../PinnedToolButton/PinnedToolButton.cs | 2 +- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 11 +- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 2 +- .../Scripts/PinnedToolsMenuUI.cs | 53 +++++---- Scripts/Core/EditorVR.Tools.cs | 30 ----- .../SpatialHintModuleConnector.cs | 8 +- .../IControlSpatialHinting.cs | 80 +++++++++---- .../SpatialHintModule/SpatialHintModule.cs | 109 ++++++++++++++++-- .../SpatialHintModule/SpatialHintModuleUI.cs | 1 + 9 files changed, 193 insertions(+), 103 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index b42c0fde2..3d53e2ec9 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -382,7 +382,7 @@ public bool highlighted else { //this.Pulse(rayOrigin, 0.005f, 0.2f); // Used for spatial selection highlighting only - Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); + Debug.LogWarning("Perform Pulse up in PinnedToolsMenu level"); } if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index caff2e03e..d191afeab 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -8,6 +8,7 @@ using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -114,13 +115,7 @@ public Transform alternateMenuOrigin */ // Spatial Hint Module implementation - public bool spatialHintVisualsVisible { get; set; } - public bool spatialHintPreScrollVisualsVisible { get; set; } - public bool spatialHintPrimaryArrowsVisible { get; set; } - public bool spatialHintSecondaryArrowsVisible { get; set; } - public Vector3 spatialHintScrollVisualsRotation { get; set; } - public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition { get; set; } - public Transform spatialHintContentContainer { get; set; } + void Awake() { @@ -335,7 +330,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, //const float kMinFineTuneVelocity = 0.000001f; if (spatialDirection == null) { - Debug.LogWarning("spatial Direction is NULL - setting new one in pricessSpatialScrolling"); + Debug.LogWarning("spatial Direction is NULL - setting new one in processSpatialScrolling"); var newDirectionVectorThreshold = 0.0175f * this.GetViewerScale(); // Initial magnitude beyond which spatial scrolling will be evaluated var dragMagnitude = Vector3.Magnitude(directionVector); var dragPercentage = dragMagnitude / newDirectionVectorThreshold; diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index 7ad8b0d87..fb2ef1b6b 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -116,7 +116,7 @@ public void PulseColor() IEnumerator AnimatePulseColor() { - Debug.LogError("Pulsing color of hint arrow : " + gameObject.name); + //Debug.LogError("Pulsing color of hint arrow : " + gameObject.name); const float kTargetDuration = 1f; var currentDuration = 0f; var currentColor = m_Icon.color; diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 1897c92b5..40b203ddc 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -46,15 +47,6 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I public Action mainMenuActivatorSelected { get; set; } public List buttons { get { return m_OrderedButtons; } } - // Spatial Hint Module implementation - public bool spatialHintVisualsVisible { get; set; } - public bool spatialHintPreScrollVisualsVisible { get; set; } - public bool spatialHintPrimaryArrowsVisible { get; set; } - public bool spatialHintSecondaryArrowsVisible { get; set; } - public Vector3 spatialHintScrollVisualsRotation { get; set; } - public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition { get; set; } - public Transform spatialHintContentContainer { get; set; } - public bool allButtonsVisible { get { return m_AllButtonsVisible; } @@ -74,9 +66,7 @@ public bool allButtonsVisible //spatialDragDistance = 0f; ShowOnlyMenuAndActiveToolButtons(); - spatialHintPreScrollVisualsVisible = false; - spatialHintPrimaryArrowsVisible = false; - spatialHintScrollVisualsRotation = Vector3.zero; + this.SetSpatialHintRotationTarget(Vector3.zero); } } } @@ -116,7 +106,7 @@ public bool spatialScrollVisualsVisible set { if (!value) - spatialHintScrollVisualsRotation = Vector3.zero; + this.SetSpatialHintRotationTarget(Vector3.zero); } } @@ -128,12 +118,15 @@ public bool beginningSpatialScrolling { Debug.LogWarning("SETTING Spatial Drag Distance : " + value); m_SpatialDragDistance = 0f; - spatialHintScrollVisualsRotation = Vector3.zero; var currentRotation = transform.rotation.eulerAngles; m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); - spatialHintPreScrollVisualsVisible = true; + //spatialHintScrollVisualsRotation = Vector3.zero; + this.SetSpatialHintRotationTarget(Vector3.zero); + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.PreDragReveal); + //SpatialHintState = SpatialHintModule.SpatialHintStateFlags.PreDragReveal; m_HintContentWorldPosition = transform.position; - spatialHintContentContainer.position = m_HintContentWorldPosition; + this.SetSpatialHintPosition(m_HintContentWorldPosition); + //spatialHintContentContainer.position = m_HintContentWorldPosition; } } } @@ -151,14 +144,17 @@ public Vector3? startingDragOrigin { set { - Debug.LogWarning("SETTING STARGIN DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); + Debug.LogWarning("SETTING STARTING DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); m_StartingDragOrigin = transform.position; - var orig = spatialHintContentContainer.rotation; - spatialHintContentContainer.LookAt(value.Value); + //var orig = spatialHintContentContainer.rotation; + //this.SetSpatialHintLookAT(value.Value); + //spatialHintContentContainer.LookAt(value.Value); Debug.LogError(value.Value.ToString("F4")); //m_SpatialScrollOrientation = Quaternion.Euler(value.Value); // Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); - spatialHintContentContainer.rotation = orig; + //this.SetSpatialHintRotation(orig); + //spatialHintContentContainer.rotation = orig; + this.SetSpatialHintLookATRotation(value.Value); } } @@ -186,8 +182,7 @@ void Update() if (Mathf.Approximately(m_SpatialDragDistance, 1f)) { m_DragTarget = transform.position; // Cache the initial drag target position, before performing any extra shapting to the target Vec3 - spatialHintPrimaryArrowsVisible = false; - spatialHintPreScrollVisualsVisible = false; + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Scrolling); } // Follow the user's input for a short additional period of time @@ -212,10 +207,12 @@ void Update() } else if (m_AllButtonsVisible && m_SpatialDragDistance > 2) { - spatialHintScrollVisualsRotation = m_DragTarget; + //spatialHintScrollVisualsRotation = m_DragTarget; + this.SetSpatialHintRotationTarget(m_DragTarget); } - spatialHintScrollVisualsDragThresholdTriggerPosition = transform.position; + //spatialHintScrollVisualsDragThresholdTriggerPosition = transform.position; + this.SetSpatialHintDragThresholdTriggerPosition(transform.position); //m_SpatialHintUI.scrollVisualsRotation = Quaternion.Euler(endingDragDefinitionPosition - startingDragDefinitionPosition); /* else if (Mathf.Approximately(m_SmoothedSpatialDragDistance, 1f)) @@ -227,7 +224,8 @@ void Update() //Debug.LogError("Hint Container" + m_HintContentContainerInitialRotation); //Debug.LogError("UI" + transform.rotation); - spatialHintContentContainer.rotation = newHintContainerRotation; + //spatialHintContentContainer.rotation = newHintContainerRotation; + this.SetSpatialHintRotation(newHintContainerRotation); //m_SpatialHintContentContainer.position = m_HintContentWorldPosition; //Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); @@ -454,7 +452,7 @@ public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) if (!button.highlighted && buttonHovered != null) { // Process haptic pulse if button was not already highlighted - this.PulseScrollArrows(); + this.PulseSpatialHintScrollArrows(); buttonHovered(); } @@ -482,7 +480,8 @@ public void SelectHighlightedButton() buttonClicked(); allButtonsVisible = false; - spatialHintVisualsVisible = false; + //SpatialHintState = SpatialHintModule.SpatialHintStateFlags.Hidden; + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); return; } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 9f01045f7..4a0339d6a 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -54,19 +54,6 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) linkedObjectList.Add(linkedObject); linkedObject.linkedObjects = linkedObjectList; } - - var controlSpatialHinting = obj as IControlSpatialHinting; - if (controlSpatialHinting != null) - { - var spatialHintModule = evr.GetModule(); - controlSpatialHinting.spatialHintContentContainer = spatialHintModule.spatialHintContentContainer; - controlSpatialHinting.spatialHintVisualsVisible = spatialHintModule.spatialHintVisualsVisible; - controlSpatialHinting.spatialHintPreScrollVisualsVisible = spatialHintModule.spatialHintPreScrollVisualsVisible; - controlSpatialHinting.spatialHintPrimaryArrowsVisible = spatialHintModule.spatialHintPrimaryArrowsVisible; - controlSpatialHinting.spatialHintSecondaryArrowsVisible = spatialHintModule.spatialHintSecondaryArrowsVisible; - controlSpatialHinting.spatialHintScrollVisualsRotation = spatialHintModule.spatialHintScrollVisualsRotation; - controlSpatialHinting.spatialHintScrollVisualsDragThresholdTriggerPosition = spatialHintModule.spatialHintScrollVisualsDragThresholdTriggerPosition; - } } public void DisconnectInterface(object obj, Transform rayOrigin = null) @@ -149,23 +136,6 @@ internal static void SpawnDefaultTools(IProxy proxy) pinnedToolsMenu.createPinnedToolButton(typeof(SelectionTool), selectionToolData.icon, deviceData.node); // Initialize PinnedToolButtons & set SelectionTool as the active tool type //pinnedTools.SetupPinnedToolButtonsForDevice(deviceData.rayOrigin, typeof(SelectionTool), deviceData.node); - - // Hook up Spatial Hinting functionality, if the PinnedToolsMenu implements the interface - /* - var spatialHintModule = evr.GetModule(); - var spatialPinnedToolsMenu = pinnedToolsMenu as IControlSpatialHinting; - if (spatialPinnedToolsMenu != null) - { - //evr.m_Interfaces.ConnectInterfaces(pinnedToolsMenu); - spatialPinnedToolsMenu.spatialHintContentContainer = spatialHintModule.spatialHintContentContainer; - spatialPinnedToolsMenu.spatialHintVisualsVisible = spatialHintModule.spatialHintVisualsVisible; - spatialPinnedToolsMenu.spatialHintPreScrollVisualsVisible = spatialHintModule.spatialHintPreScrollVisualsVisible; - spatialPinnedToolsMenu.spatialHintPrimaryArrowsVisible = spatialHintModule.spatialHintPrimaryArrowsVisible; - spatialPinnedToolsMenu.spatialHintSecondaryArrowsVisible = spatialHintModule.spatialHintSecondaryArrowsVisible; - spatialPinnedToolsMenu.spatialHintScrollVisualsRotation = spatialHintModule.spatialHintScrollVisualsRotation; - spatialPinnedToolsMenu.spatialHintScrollVisualsDragThresholdTriggerPosition = spatialHintModule.spatialHintScrollVisualsDragThresholdTriggerPosition; - } - */ } evr.GetModule().UpdatePlayerHandleMaps(); diff --git a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs index 79ea905d8..4f2057248 100644 --- a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs +++ b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs @@ -9,7 +9,13 @@ class SpatialHintModuleConnector : Nested, ILateBindInterfaceMethods public interface IControlSpatialHinting { - /// - /// Description - /// - bool spatialHintVisualsVisible { get; set; } + } + + public static class IControlSpatialHintingMethods + { + internal delegate void SetSpatialHintStateDelegate(SpatialHintModule.SpatialHintStateFlags state); + internal static SetSpatialHintStateDelegate setSpatialHintState { get; set; } /// - /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action - /// This is only enabled before the enabling of the main select visuals + /// /// - bool spatialHintPreScrollVisualsVisible { set; } + public static void SetSpatialHintState(this IControlSpatialHinting obj, SpatialHintModule.SpatialHintStateFlags state) + { + setSpatialHintState(state); + } + + internal delegate void SetSpatialHintPositionDelegate(Vector3 position); + internal static SetSpatialHintPositionDelegate setSpatialHintPosition { get; set; } /// - /// Description + /// /// - bool spatialHintPrimaryArrowsVisible { set; } + public static void SetSpatialHintPosition(this IControlSpatialHinting obj, Vector3 position) + { + setSpatialHintPosition(position); + } + + internal delegate void SetSpatialHintRotationDelegate(Quaternion rotation); + internal static SetSpatialHintRotationDelegate setSpatialHintRotation { get; set; } /// - /// Description + /// /// - bool spatialHintSecondaryArrowsVisible { set; } + public static void SetSpatialHintRotation(this IControlSpatialHinting obj, Quaternion rotation) + { + setSpatialHintRotation(rotation); + } + + internal delegate void SetSpatialHintRotationTargetDelegate(Vector3 target); + internal static SetSpatialHintRotationTargetDelegate setSpatialHintRotationTarget { get; set; } /// - /// Description + /// /// - Vector3 spatialHintScrollVisualsRotation { set; } + public static void SetSpatialHintRotationTarget(this IControlSpatialHinting obj, Vector3 target) + { + setSpatialHintRotationTarget(target); + } + + internal delegate void SetSpatialHintLookATRotationDelegate(Vector3 position); + internal static SetSpatialHintLookATRotationDelegate setSpatialHintLookAtRotation { get; set; } /// - /// Description + /// /// - Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition { set; } + public static void SetSpatialHintLookATRotation(this IControlSpatialHinting obj, Vector3 position) + { + setSpatialHintLookAtRotation(position); + } + + internal delegate void PulseSpatialHintScrollArrowsDelegate(); + internal static PulseSpatialHintScrollArrowsDelegate pulseSpatialHintScrollArrows { get; set; } /// - /// Description + /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatiatil scroll /// - Transform spatialHintContentContainer { get; set; } - } + public static void PulseSpatialHintScrollArrows(this IControlSpatialHinting obj) + { + pulseSpatialHintScrollArrows(); + } - public static class IControlSpatialHintingMethods - { - internal delegate void PulseScrollArrowsDelegate(); - internal static PulseScrollArrowsDelegate pulseScrollArrows { get; set; } + internal delegate void SetSpatialHintDragThresholdTriggerPositionDelegate(Vector3 position); + internal static SetSpatialHintDragThresholdTriggerPositionDelegate setSpatialHintDragThresholdTriggerPosition { get; set; } /// /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatiatil scroll /// - public static void PulseScrollArrows(this IControlSpatialHinting obj) + public static void SetSpatialHintDragThresholdTriggerPosition(this IControlSpatialHinting obj, Vector3 position) { - pulseScrollArrows(); + setSpatialHintDragThresholdTriggerPosition(position); } } } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index cb9478cc2..e6fb8a5b4 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -1,14 +1,57 @@ #if UNITY_EDITOR +using System; using UnityEditor.Experimental.EditorVR.Menus; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class SpatialHintModule : MonoBehaviour, IConnectInterfaces, IInstantiateUI + public sealed class SpatialHintModule : MonoBehaviour, IConnectInterfaces, IInstantiateUI { + [Flags] + public enum SpatialHintStateFlags + { + Hidden = 1 << 0, + PreDragReveal = 1 << 1, + Scrolling = 1 << 2, + } + [SerializeField] SpatialHintModuleUI m_SpatialHintModuleUI; + SpatialHintStateFlags m_State; + + public SpatialHintStateFlags state + { + get { return m_State; } + set + { + //if (m_State == value) + //return; + + m_State = value; + switch (m_State) + { + case SpatialHintStateFlags.Hidden: + Debug.LogError("SpatialHintState : Hidden"); + m_SpatialHintModuleUI.preScrollVisualsVisible = false; + m_SpatialHintModuleUI.primaryArrowsVisible = false; + m_SpatialHintModuleUI.secondaryArrowsVisible = false; + //spatialHintPrimaryArrowsVisible = false; + //spatialHintSecondaryArrowsVisible = false; + break; + case SpatialHintStateFlags.PreDragReveal: + Debug.LogError("SpatialHintState : Pre drag reveal state"); + m_SpatialHintModuleUI.preScrollVisualsVisible = true;; + m_SpatialHintModuleUI.primaryArrowsVisible = true; + m_SpatialHintModuleUI.secondaryArrowsVisible = true; + break; + case SpatialHintStateFlags.Scrolling: + break; + } + } + } + + /* /// /// Description /// @@ -22,7 +65,7 @@ public bool spatialHintVisualsVisible /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action /// This is only enabled before the enabling of the main select visuals /// - public bool spatialHintPreScrollVisualsVisible + bool spatialHintPreScrollVisualsVisible { get { return m_SpatialHintModuleUI.preScrollVisualsVisible; } set { m_SpatialHintModuleUI.preScrollVisualsVisible = value; } @@ -31,7 +74,7 @@ public bool spatialHintPreScrollVisualsVisible /// /// Description /// - public bool spatialHintPrimaryArrowsVisible + bool spatialHintPrimaryArrowsVisible { get { return m_SpatialHintModuleUI.primaryArrowsVisible; } set { m_SpatialHintModuleUI.primaryArrowsVisible = value; } @@ -40,7 +83,7 @@ public bool spatialHintPrimaryArrowsVisible /// /// Description /// - public bool spatialHintSecondaryArrowsVisible + bool spatialHintSecondaryArrowsVisible { get { return m_SpatialHintModuleUI.secondaryArrowsVisible; } set { m_SpatialHintModuleUI.secondaryArrowsVisible = value; } @@ -49,25 +92,32 @@ public bool spatialHintSecondaryArrowsVisible /// /// Description /// - public Vector3 spatialHintScrollVisualsRotation + public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition { - get { return m_SpatialHintModuleUI.scrollVisualsRotation; } - set { m_SpatialHintModuleUI.scrollVisualsRotation = value; } + get { return m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition; } + set { m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = value; } } + */ /// /// Description /// - public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition + Vector3 spatialHintScrollVisualsRotation { - get { return m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition; } - set { m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = value; } + get { return m_SpatialHintModuleUI.scrollVisualsRotation; } + set + { + if (value == Vector3.zero) + state = SpatialHintStateFlags.Hidden; // Hide the non-spatial-scrolling visuals + + m_SpatialHintModuleUI.scrollVisualsRotation = value; + } } /// /// Description /// - public Transform spatialHintContentContainer { get { return m_SpatialHintModuleUI.contentContainer; } } + Transform spatialHintContentContainer { get { return m_SpatialHintModuleUI.contentContainer; } } void Awake() { @@ -84,6 +134,43 @@ public void PulseScrollArrows() Debug.LogError("Pulse scroll arrows called !!!!!!!!!! <-------------------------------------------------"); m_SpatialHintModuleUI.PulseScrollArrows(); } + + public void SetState(SpatialHintStateFlags newState) + { + state = newState; + } + + public void SetPosition(Vector3 newPosition) + { + spatialHintContentContainer.position = newPosition; + } + + public void SetRotation(Quaternion newRotation) + { + m_SpatialHintModuleUI.transform.rotation = newRotation; + } + + public void SetRotationTarget(Vector3 target) + { + spatialHintScrollVisualsRotation = target; + } + + public void LookAt(Vector3 position) + { + var orig = spatialHintContentContainer.rotation; + spatialHintContentContainer.LookAt(position); + //this.SetSpatialHintLookAT(value.Value); + //spatialHintContentContainer.LookAt(value.Value); + //Debug.LogError(value.Value.ToString("F4")); + //m_SpatialScrollOrientation = Quaternion.Euler(value.Value); // Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); + //m_SpatialHintModuleUI.rotation (orig); + spatialHintContentContainer.rotation = orig; + } + + public void SetDragThresholdTriggerPosition(Vector3 position) + { + m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = position; + } } } #endif diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 0ab0ce546..362adbbe4 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -53,6 +53,7 @@ public bool visible get { return m_Visible; } set { + Debug.LogError("Setting Hint Module visibility to : " + value); m_Visible = value; if (m_Visible) From 25423582541909f9f8b6029bb141431ef80569f1 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 17 Jul 2017 11:36:38 -0700 Subject: [PATCH 595/870] Add a delay for showing after auto-hiding --- Scripts/Core/EditorVR.Menus.cs | 53 ++++++++++++++++++++++------------ Scripts/Core/EditorVR.Tools.cs | 14 +++++++-- Scripts/Core/EditorVR.cs | 1 + 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 0eca7177b..17465ad63 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -12,7 +12,8 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - const float k_MainMenuAutoHideDelay = 0.25f; + const float k_MainMenuAutoHideDelay = 0.125f; + const float k_MainMenuAutoShowDelay = 0.25f; [SerializeField] MainMenuActivator m_MainMenuActivatorPrefab; @@ -26,10 +27,12 @@ class Menus : Nested, IInterfaceConnector, ILateBindInterfaceMethods internal enum MenuHideFlags { Hidden = 1 << 0, - Overridden = 1 << 1, + OtherMenu = 1 << 1, OverUI = 1 << 2, OverWorkspace = 1 << 3, - HasDirectSelection = 1 << 4 + HasDirectSelection = 1 << 4, + + Temporary = OverUI | OverWorkspace | HasDirectSelection } const float k_MenuHideMargin = 0.8f; @@ -113,7 +116,7 @@ internal void UpdateMenuVisibilities() var menuHideFlags = deviceData.menuHideFlags; var mainMenuVisible = mainMenu != null && (menuHideFlags[mainMenu] & MenuHideFlags.Hidden) == 0; - var customMenuVisible = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Hidden) == 0 && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) == 0; + var customMenuVisible = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Hidden) == 0 && (menuHideFlags[customMenu] & MenuHideFlags.OtherMenu) == 0; var alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; if (alternateMenuVisible && (mainMenuVisible || customMenuVisible)) @@ -129,7 +132,7 @@ internal void UpdateMenuVisibilities() } if (customMenuVisible && (mainMenuVisible || alternateMenuVisible)) - menuHideFlags[customMenu] |= MenuHideFlags.Overridden; + menuHideFlags[customMenu] |= MenuHideFlags.OtherMenu; var hoveringWorkspace = false; var rayOrigin = deviceData.rayOrigin; @@ -146,6 +149,7 @@ internal void UpdateMenuVisibilities() var menus = menuHideFlags.Keys.ToList(); foreach (var menu in menus) { + // Only set if hidden--value is reset every frame if (hoveringWorkspace) menuHideFlags[menu] |= MenuHideFlags.OverWorkspace; } @@ -156,6 +160,7 @@ internal void UpdateMenuVisibilities() { foreach (var menu in menus) { + // Only set if hidden--value is reset every frame menuHideFlags[menu] |= MenuHideFlags.HasDirectSelection; } @@ -172,6 +177,7 @@ internal void UpdateMenuVisibilities() var otherMenus = otherHideFlags.Keys.ToList(); foreach (var menu in otherMenus) { + // Only set if hidden--value is reset every frame otherHideFlags[menu] |= MenuHideFlags.HasDirectSelection; } break; @@ -180,6 +186,22 @@ internal void UpdateMenuVisibilities() } } + // Set show/hide timings + foreach (var deviceData in m_ActiveDeviceData) + { + var menuHideFlags = deviceData.menuHideFlags; + var menus = menuHideFlags.Keys.ToList(); + foreach (var menu in menus) + { + var hideFlags = menuHideFlags[menu]; + if ((hideFlags & ~MenuHideFlags.Hidden & ~MenuHideFlags.OtherMenu) == 0) + deviceData.menuAutoHideTimes[menu] = Time.time; + + if (hideFlags != 0) + deviceData.menuAutoShowTimes[menu] = Time.time; + } + } + // Apply state to UI visibility foreach (var deviceData in m_ActiveDeviceData) { @@ -195,12 +217,8 @@ internal void UpdateMenuVisibilities() { mainMenu.visible = false; } - else - { - mainMenu.visible = true; - } } - else + else if (Time.time > deviceData.menuAutoShowTimes[mainMenu] + k_MainMenuAutoShowDelay) { mainMenu.visible = true; } @@ -220,12 +238,7 @@ internal void UpdateMenuVisibilities() var menus = menuHideFlags.Keys.ToList(); foreach (var menu in menus) { - var hideFlags = menuHideFlags[menu]; - if ((hideFlags & ~MenuHideFlags.Hidden & ~MenuHideFlags.Overridden) == 0) - deviceData.menuAutoHideTimes[menu] = Time.time; - - menuHideFlags[menu] = hideFlags & ~MenuHideFlags.OverUI & ~MenuHideFlags.HasDirectSelection - & ~MenuHideFlags.OverWorkspace; + menuHideFlags[menu] &= ~MenuHideFlags.Temporary; } } @@ -300,7 +313,7 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl if (customMenu != null && (menuHideFlags[deviceData.mainMenu] & MenuHideFlags.Hidden) != 0) { - menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; + menuHideFlags[customMenu] &= ~MenuHideFlags.OtherMenu; } } } @@ -319,6 +332,8 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform var menuHideFlags = deviceData.menuHideFlags; var alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; + deviceData.menuAutoShowTimes[mainMenu] = 0; + if (deviceData.rayOrigin == rayOrigin) { menuHideFlags[mainMenu] ^= MenuHideFlags.Hidden; @@ -329,7 +344,7 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform { menuHideFlags[mainMenu] |= MenuHideFlags.Hidden; - var customMenuOverridden = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Overridden) != 0; + var customMenuOverridden = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.OtherMenu) != 0; // Move alternate menu if overriding custom menu if (customMenuOverridden && alternateMenuVisible) { @@ -347,7 +362,7 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; var mainMenuVisible = (menuHideFlags[mainMenu] & MenuHideFlags.Hidden) == 0; if (customMenu != null && !alternateMenuVisible && !mainMenuVisible) - menuHideFlags[customMenu] &= ~MenuHideFlags.Overridden; + menuHideFlags[customMenu] &= ~MenuHideFlags.OtherMenu; } } } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index d41795eeb..14ce9a1d0 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -100,9 +100,10 @@ internal static void SpawnDefaultTools(IProxy proxy) } } + var menuHideFlags = deviceData.menuHideFlags; var mainMenu = Menus.SpawnMainMenu(typeof(MainMenu), inputDevice, false, out deviceData.mainMenuInput); deviceData.mainMenu = mainMenu; - deviceData.menuHideFlags[mainMenu] = Menus.MenuHideFlags.Hidden; + menuHideFlags[mainMenu] = Menus.MenuHideFlags.Hidden; var mainMenuActivator = Menus.SpawnMainMenuActivator(inputDevice); deviceData.mainMenuActivator = mainMenuActivator; @@ -116,8 +117,17 @@ internal static void SpawnDefaultTools(IProxy proxy) var alternateMenu = Menus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); deviceData.alternateMenu = alternateMenu; - deviceData.menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; + menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; alternateMenu.itemWasSelected += Menus.UpdateAlternateMenuOnSelectionChanged; + + var autoHideTimes = deviceData.menuAutoHideTimes; + var autoShowTimes = deviceData.menuAutoShowTimes; + foreach (var kvp in menuHideFlags) + { + var menu = kvp.Key; + autoHideTimes[menu] = 0; + autoShowTimes[menu] = 0; + } } evr.GetModule().UpdatePlayerHandleMaps(); diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 51d36e90e..734d4386c 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -80,6 +80,7 @@ class DeviceData public PinnedToolButton previousToolButton; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuAutoHideTimes = new Dictionary(); + public readonly Dictionary menuAutoShowTimes = new Dictionary(); } class Nested From d36eb4e6cebd6365481e83a23e9bf0765c98a7e5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 12:03:33 -0700 Subject: [PATCH 596/870] Take into account the number of buttons currently being scrolled through, vs the maximum number of buttons that can be scrolled through, for normalized scroll position in Spatial Scrolling. This keeps the distance needed to scroll through buttons uniform regardless of current button count. --- .../PinnedToolButton/PinnedToolButton.cs | 1 - Menus/PinnedToolMenu/PinnedToolsMenu.cs | 13 +++---------- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 3d53e2ec9..67f720075 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -7,7 +7,6 @@ using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -using UnityEngine.InputNew; using UnityEngine.UI; using UnityEngine.EventSystems; diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index d191afeab..0491171da 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -1,19 +1,12 @@ #if UNITY_EDITOR using System; -using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Text; -using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Core; -using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Helpers; -using UnityEditor.Experimental.EditorVR.Modules; -using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; -using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Menus { @@ -279,7 +272,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.15f, true); + var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.15f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { if (!m_PinnedToolsMenuUI.allButtonsVisible) @@ -321,7 +314,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // TODO ADD SUPPORT FOR VIEWERSCALE SIZE CHANGES // TODO refact into ISpatialScrolling interface; allow axis locking/selection/isolation - float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, bool velocitySensitive) + float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) { //Debug.LogError("Start position : " + startingPosition + " - Current Position : " + currentPosition); var normalizedLoopingPosition = 0f; @@ -361,7 +354,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, //Debug.LogError(directionVector.magnitude); var projectedAmount = Vector3.Project(directionVector, spatialDirection.Value).magnitude / this.GetViewerScale(); - normalizedLoopingPosition = (Mathf.Abs(projectedAmount) % repeatingScrollLengthRange) * (1 / repeatingScrollLengthRange); + normalizedLoopingPosition = (Mathf.Abs(projectedAmount * (maxItemCount / scrollableItemCount)) % repeatingScrollLengthRange) * (1 / repeatingScrollLengthRange); //Debug.LogError("" + velocity + ""); //if (velocity < kMaxFineTuneVelocity && velocity > kMinFineTuneVelocity) diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 56692f5f6..0cfc818cb 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -1,8 +1,8 @@ #if UNITY_EDITOR using System; using System.Collections.Generic; -using UnityEngine; using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEngine; namespace UnityEditor.Experimental.EditorVR { From da71d19c599e429cb894e73de8c784e27f25d870 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 12:14:46 -0700 Subject: [PATCH 597/870] Increase intensity of PinnedToolButton hover, and Spatial Scroll activation indicator --- .../HapticPulses/PinnedToolButtonHoverPulse.asset | 2 +- .../HapticPulses/PinnedToolMenuActivationPulse.asset | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset index 966119efc..fbf7c28cb 100644 --- a/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: PinnedToolButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 - m_Intensity: 0.4 + m_Intensity: 0.75 m_FadeIn: 0 m_FadeOut: 0 diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset index 82017833b..2e4a4a23c 100644 --- a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset +++ b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset @@ -12,6 +12,6 @@ MonoBehaviour: m_Name: PinnedToolMenuActivationPulse m_EditorClassIdentifier: m_Duration: 0.25 - m_Intensity: 0.075 + m_Intensity: 0.3 m_FadeIn: 0 m_FadeOut: 1 From 3f10b2b130db3d210f746154e0c91fed27c00c1b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 12:47:49 -0700 Subject: [PATCH 598/870] Add initial/proxy Spatial Scroll "bar" visuals --- .../Modules/SpatialHintModule/Materials.meta | 9 + .../Materials/SpatialScrollVisualsLine.mat | 82 ++++++ .../SpatialScrollVisualsLine.mat.meta | 8 + .../SpatialHintModule/SpatialHintModuleUI.cs | 13 + .../SpatialHintModule/SpatialHintUI.prefab | 248 +++++++++++++++++- 5 files changed, 358 insertions(+), 2 deletions(-) create mode 100644 Scripts/Modules/SpatialHintModule/Materials.meta create mode 100644 Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat create mode 100644 Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat.meta diff --git a/Scripts/Modules/SpatialHintModule/Materials.meta b/Scripts/Modules/SpatialHintModule/Materials.meta new file mode 100644 index 000000000..8797e3977 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0fd280dc6dcd958469f7ad042969a901 +folderAsset: yes +timeCreated: 1500320012 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat b/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat new file mode 100644 index 000000000..0c29dc493 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat @@ -0,0 +1,82 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: SpatialScrollVisualsLine + m_Shader: {fileID: 4800000, guid: d2d82e816970e9849bc93f1842c33050, type: 3} + m_ShaderKeywords: LINE_PERSPECTIVE_WIDTH LINE_WORLD_SPACE + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: 3000 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _lineMap: + m_Texture: {fileID: 2800000, guid: 97ccbea2599c2ef4898bce1c04becddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Glossiness: 0.5 + - _LineDepthScale: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SrcBlend: 1 + - _UVSec: 0 + - _WorldData: 1 + - _ZWrite: 1 + - _lineRadius: 0.05 + - _lineRadiusMin: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _lineColor: {r: 0, g: 0, b: 0, a: 1} + - _lineRadius: {r: 0.05, g: 0, b: 0.1, a: 1} + - _lineSettings: {r: 0.099, g: 0, b: 1, a: 1} diff --git a/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat.meta b/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat.meta new file mode 100644 index 000000000..f0bda6a36 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a46299c27b9fe7647841bdcf37587042 +timeCreated: 1465584369 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 362adbbe4..96bcf2ea7 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -30,6 +30,9 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale [SerializeField] HintIcon[] m_SecondaryDirectionalHintArrows; + [SerializeField] + private VRLineRenderer m_ScrollLineRenderer; + /* [SerializeField] HintIcon[] m_PrimaryRotationalHintArrows; @@ -188,6 +191,10 @@ void Awake() m_ScrollVisualsGameObject = m_ScrollVisualsTransform.gameObject; m_ScrollVisualsCanvasGroup.alpha = 0f; //m_ScrollVisualsGameObject.SetActive(false); + + m_ScrollLineRenderer.SetVertexCount(4); + m_ScrollLineRenderer.useWorldSpace = true; + m_ScrollLineRenderer.SetWidth(3, 3); } IEnumerator AnimateShow() @@ -260,6 +267,11 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsDragTargetArrow.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); currentDuration += Time.unscaledDeltaTime * 2f; + + var lineRendererPositions = new Vector3[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrow.position }; + m_ScrollLineRenderer.SetPositions(lineRendererPositions); + m_ScrollLineRenderer.SetWidth(shapedDuration, shapedDuration); + yield return null; } @@ -283,6 +295,7 @@ IEnumerator HideScrollVisuals() m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 0f, shapedDuration); //m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); currentDuration += Time.unscaledDeltaTime * 3.5f; + m_ScrollLineRenderer.SetWidth(1 - shapedDuration, 1 - shapedDuration); yield return null; } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index 09e1b0272..5ddd14062 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -77,6 +77,24 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1083723035257114 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4570628934814126} + - component: {fileID: 33733257108130100} + - component: {fileID: 23475728828767504} + - component: {fileID: 114922285208366486} + m_Layer: 0 + m_Name: ScrollLineRenderer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1087189506426152 GameObject: m_ObjectHideFlags: 1 @@ -135,6 +153,9 @@ GameObject: m_Component: - component: {fileID: 224457231796985382} - component: {fileID: 225476474272170592} + - component: {fileID: 33462889778113002} + - component: {fileID: 23848247030526540} + - component: {fileID: 114889182630533810} m_Layer: 5 m_Name: ScrollVisuals m_TagString: Untagged @@ -1114,6 +1135,19 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4570628934814126 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083723035257114} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224457231796985382} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4630278991888076 Transform: m_ObjectHideFlags: 1 @@ -1126,7 +1160,7 @@ Transform: m_Children: - {fileID: 224376509698512154} m_Father: {fileID: 224457231796985382} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} --- !u!4 &4656611640740372 Transform: @@ -1269,7 +1303,7 @@ Transform: m_Children: - {fileID: 224065573646462090} m_Father: {fileID: 224457231796985382} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 90.00001, y: 0, z: 90.00001} --- !u!4 &4873933386520716 Transform: @@ -1341,6 +1375,84 @@ Transform: m_Father: {fileID: 4656611640740372} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} +--- !u!23 &23475728828767504 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083723035257114} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: a46299c27b9fe7647841bdcf37587042, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23848247030526540 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138933449834660} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33462889778113002 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138933449834660} + m_Mesh: {fileID: 0} +--- !u!33 &33733257108130100 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083723035257114} + m_Mesh: {fileID: 0} --- !u!114 &114000567662040162 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2289,6 +2401,7 @@ MonoBehaviour: - {fileID: 114310382182576548} - {fileID: 114472214291358280} - {fileID: 114004058444794040} + m_ScrollLineRenderer: {fileID: 114922285208366486} --- !u!114 &114889128424409716 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2316,6 +2429,71 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114889182630533810 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138933449834660} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d580b86a6ae18014293c9b5059b2121b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Positions: + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + m_ColorStart: {r: 1, g: 0, b: 0, a: 1} + m_ColorEnd: {r: 1, g: 0, b: 0, a: 1} + m_WidthStart: 1 + m_WidthEnd: 1 + m_WorldSpaceData: 1 --- !u!114 &114894859978596498 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2343,6 +2521,71 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 +--- !u!114 &114922285208366486 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083723035257114} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d580b86a6ae18014293c9b5059b2121b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Positions: + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 0} + m_ColorStart: {r: 1, g: 1, b: 1, a: 1} + m_ColorEnd: {r: 1, g: 1, b: 1, a: 1} + m_WidthStart: 1 + m_WidthEnd: 1 + m_WorldSpaceData: 1 --- !u!114 &114929323479965660 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2941,6 +3184,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: -0.00007861798} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 4570628934814126} - {fileID: 4630278991888076} - {fileID: 4851979343048988} m_Father: {fileID: 224722201347996720} From a4abbc8ea0770b7a5fccff7eb3d94e406dd98c26 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 12:51:06 -0700 Subject: [PATCH 599/870] Increase repeatingScrollLengthRange of PinnedToolsMenu scrolling --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 0491171da..18113e4b2 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -272,7 +272,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.15f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); + var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.25f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { if (!m_PinnedToolsMenuUI.allButtonsVisible) From 3812079a09c10eb120723c578f92a717939b2f14 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 15:31:15 -0700 Subject: [PATCH 600/870] Add initial proxy visuals for line that connects the two spatial scroll arrows; this line is only shown when the user is actively spatially scrolling --- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 20 ++- Menus/PinnedToolMenu/Scripts/HintLine.cs | 168 ++++++++++++++++++ Menus/PinnedToolMenu/Scripts/HintLine.cs.meta | 12 ++ .../Materials/SpatialScrollVisualsLine.mat | 8 +- .../SpatialHintModule/SpatialHintModule.cs | 1 - .../SpatialHintModule/SpatialHintModuleUI.cs | 19 +- .../SpatialHintModule/SpatialHintUI.prefab | 32 +++- 7 files changed, 231 insertions(+), 29 deletions(-) create mode 100644 Menus/PinnedToolMenu/Scripts/HintLine.cs create mode 100644 Menus/PinnedToolMenu/Scripts/HintLine.cs.meta diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index fb2ef1b6b..0cc113b9d 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -1,4 +1,5 @@ using System.Collections; +using System.Security.Cryptography.X509Certificates; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -30,6 +31,7 @@ public class HintIcon : MonoBehaviour Vector3 m_VisibleLocalScale; Coroutine m_VisibilityCoroutine; Coroutine m_ScrollArrowPulseCoroutine; + float m_PulseDuration; public bool visible { @@ -111,32 +113,34 @@ IEnumerator AnimateHide() public void PulseColor() { - this.RestartCoroutine(ref m_ScrollArrowPulseCoroutine, AnimatePulseColor()); + if (Mathf.Approximately(m_PulseDuration, 0f) || m_PulseDuration > 0.85f) + this.RestartCoroutine(ref m_ScrollArrowPulseCoroutine, AnimatePulseColor()); } IEnumerator AnimatePulseColor() { //Debug.LogError("Pulsing color of hint arrow : " + gameObject.name); const float kTargetDuration = 1f; - var currentDuration = 0f; + m_PulseDuration = 0f; var currentColor = m_Icon.color; - while (currentDuration < kTargetDuration) + while (m_PulseDuration < kTargetDuration) { - var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(m_PulseDuration / kTargetDuration); m_Icon.color = Color.Lerp(currentColor, m_PulseColor, shapedDuration); - currentDuration += Time.unscaledDeltaTime * 5; + m_PulseDuration += Time.unscaledDeltaTime * 5; yield return null; } - while (currentDuration > 0f) + while (m_PulseDuration > 0f) { - var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(m_PulseDuration / kTargetDuration); m_Icon.color = Color.Lerp(m_VisibleColor, m_PulseColor, shapedDuration); - currentDuration -= Time.unscaledDeltaTime * 2; + m_PulseDuration -= Time.unscaledDeltaTime * 2; yield return null; } m_Icon.color = m_VisibleColor; + m_PulseDuration = 0f; } } } diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/PinnedToolMenu/Scripts/HintLine.cs new file mode 100644 index 000000000..5561efbde --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs @@ -0,0 +1,168 @@ +using System.Collections; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; +using UnityEngine.UI; +using Random = UnityEngine.Random; + +namespace UnityEditor.Experimental.EditorVR.Menus +{ + public class HintLine : MonoBehaviour + { + [SerializeField] + bool m_HideOnInitialize = true; + + //[SerializeField] + //Image m_Icon; + + [SerializeField] + VRLineRenderer m_ScrollLineRenderer; + + [SerializeField] + float m_LineWidth = 1f; + + [SerializeField] + Color m_VisibleColor = Color.white; + + [SerializeField] + Color m_HiddenColor = Color.clear; + + [SerializeField] + Color m_PulseColor = Color.white; + + readonly Vector3 k_HiddenScale = Vector3.zero; + + Transform m_IconTransform; + Vector3 m_VisibleLocalScale; + Coroutine m_VisibilityCoroutine; + Coroutine m_ScrollArrowPulseCoroutine; + float m_PulseDuration; + + public float LineWidth { set { m_ScrollLineRenderer.SetWidth(value, value); } } + public Vector3[] Positions { set { m_ScrollLineRenderer.SetPositions(value) ; } } + + /* + public bool visible + { + set + { + if (value) + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + else + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); + } + } + + public Color visibleColor + { + set + { + m_VisibleColor = value; + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + } + } + */ + + void Awake() + { + /* + m_IconTransform = m_Icon.transform; + m_VisibleLocalScale = m_IconTransform.localScale * 1.25F; + m_Icon.color = m_VisibleColor; + + if (m_HideOnInitialize) + visible = false; + */ + + m_ScrollLineRenderer.SetVertexCount(4); + m_ScrollLineRenderer.useWorldSpace = true; + m_ScrollLineRenderer.SetWidth(0f, 0f); + } + + /* + IEnumerator AnimateShow() + { + var currentDuration = 0f; + var targetDuration = 0f; + var currentLocalScale = m_IconTransform.localScale; + if (currentLocalScale == k_HiddenScale) + { + // Only perform delay if fully hidden; otherwise resume showing + targetDuration = Random.Range(0.25f, 0.35f); // Set an initial random wait duration + while (currentDuration < targetDuration) + { + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + } + + currentDuration = 0f; + targetDuration = 0.125f; // Set animated reveal duration + var currentColor = m_Icon.color; + while (currentDuration < targetDuration) + { + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / targetDuration); + m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, m_VisibleLocalScale, shapedDuration); + m_Icon.color = Color.Lerp(currentColor, m_VisibleColor, shapedDuration); + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + + m_IconTransform.localScale = m_VisibleLocalScale; + } + + IEnumerator AnimateHide() + { + var currentDuration = 0f; + var targetDuration = Random.Range(0.125f, 0.25f); // Set an initial random wait duration + var currentLocalScale = m_IconTransform.localScale; + var currentColor = m_Icon.color; + while (currentDuration < targetDuration) + { + m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, k_HiddenScale, currentDuration / targetDuration); + m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); + currentDuration += Time.unscaledDeltaTime; + yield return null; + } + + m_IconTransform.localScale = k_HiddenScale; + } + */ + + public void PulseColor() + { + if (Mathf.Approximately(m_PulseDuration, 0f) || m_PulseDuration > 0.85f) + this.RestartCoroutine(ref m_ScrollArrowPulseCoroutine, AnimatePulseColor()); + } + + IEnumerator AnimatePulseColor() + { + //Debug.LogError("Pulsing color of hint arrow : " + gameObject.name); + const float kTargetDuration = 1f; + m_PulseDuration = 0f; + var currentColor = m_ScrollLineRenderer.Colors[0]; // The line stand & end colors are the same; fetch only one of them + while (m_PulseDuration < kTargetDuration) + { + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(m_PulseDuration / kTargetDuration); + var newColor = Color.Lerp(currentColor, m_PulseColor, shapedDuration); + m_ScrollLineRenderer.SetColors(newColor, newColor); + m_PulseDuration += Time.unscaledDeltaTime * 5; + yield return null; + } + + + + while (m_PulseDuration > 0f) + { + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(m_PulseDuration / kTargetDuration); + var newColor = Color.Lerp(m_VisibleColor, m_PulseColor, shapedDuration); + m_ScrollLineRenderer.SetColors(newColor, newColor); + m_PulseDuration -= Time.unscaledDeltaTime * 2; + yield return null; + } + + m_ScrollLineRenderer.SetColors(m_VisibleColor, m_VisibleColor); + m_PulseDuration = 0f; + } + } +} diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs.meta b/Menus/PinnedToolMenu/Scripts/HintLine.cs.meta new file mode 100644 index 000000000..eac7e0075 --- /dev/null +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 432cb07647e3e974aaf3aa9c640af385 +timeCreated: 1498184947 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat b/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat index 0c29dc493..520e2fabc 100644 --- a/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat +++ b/Scripts/Modules/SpatialHintModule/Materials/SpatialScrollVisualsLine.mat @@ -7,11 +7,11 @@ Material: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: SpatialScrollVisualsLine - m_Shader: {fileID: 4800000, guid: d2d82e816970e9849bc93f1842c33050, type: 3} + m_Shader: {fileID: 4800000, guid: d689c77434e9ecb4084bd09df8d53140, type: 3} m_ShaderKeywords: LINE_PERSPECTIVE_WIDTH LINE_WORLD_SPACE m_LightmapFlags: 5 m_EnableInstancingVariants: 0 - m_CustomRenderQueue: 3000 + m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: @@ -78,5 +78,5 @@ Material: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _lineColor: {r: 0, g: 0, b: 0, a: 1} - - _lineRadius: {r: 0.05, g: 0, b: 0.1, a: 1} - - _lineSettings: {r: 0.099, g: 0, b: 1, a: 1} + - _lineRadius: {r: 0.03, g: 0, b: 0.1, a: 1} + - _lineSettings: {r: 0.576, g: 0.561, b: 1, a: 1} diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index e6fb8a5b4..816142027 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -131,7 +131,6 @@ void Awake() /// public void PulseScrollArrows() { - Debug.LogError("Pulse scroll arrows called !!!!!!!!!! <-------------------------------------------------"); m_SpatialHintModuleUI.PulseScrollArrows(); } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 96bcf2ea7..a3bef266e 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -20,6 +20,9 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale [SerializeField] HintIcon[] m_ScrollHintArrows; + [SerializeField] + HintLine m_ScrollHintLine; + //[SerializeField] //CanvasGroup m_HintArrowsCanvasGroup; // TODO: add back in later @@ -30,8 +33,8 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale [SerializeField] HintIcon[] m_SecondaryDirectionalHintArrows; - [SerializeField] - private VRLineRenderer m_ScrollLineRenderer; + //[SerializeField] + //VRLineRenderer m_ScrollLineRenderer; /* [SerializeField] @@ -191,10 +194,6 @@ void Awake() m_ScrollVisualsGameObject = m_ScrollVisualsTransform.gameObject; m_ScrollVisualsCanvasGroup.alpha = 0f; //m_ScrollVisualsGameObject.SetActive(false); - - m_ScrollLineRenderer.SetVertexCount(4); - m_ScrollLineRenderer.useWorldSpace = true; - m_ScrollLineRenderer.SetWidth(3, 3); } IEnumerator AnimateShow() @@ -269,8 +268,8 @@ IEnumerator ShowScrollVisuals() currentDuration += Time.unscaledDeltaTime * 2f; var lineRendererPositions = new Vector3[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrow.position }; - m_ScrollLineRenderer.SetPositions(lineRendererPositions); - m_ScrollLineRenderer.SetWidth(shapedDuration, shapedDuration); + m_ScrollHintLine.Positions = lineRendererPositions; + m_ScrollHintLine.LineWidth = shapedDuration; yield return null; } @@ -295,7 +294,7 @@ IEnumerator HideScrollVisuals() m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 0f, shapedDuration); //m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); currentDuration += Time.unscaledDeltaTime * 3.5f; - m_ScrollLineRenderer.SetWidth(1 - shapedDuration, 1 - shapedDuration); + m_ScrollHintLine.LineWidth = 1 - shapedDuration; yield return null; } @@ -311,6 +310,8 @@ public void PulseScrollArrows() { arrow.PulseColor(); } + + m_ScrollHintLine.PulseColor(); } } } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index 5ddd14062..ed3ee6e16 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -85,6 +85,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4570628934814126} + - component: {fileID: 114383021260469988} - component: {fileID: 33733257108130100} - component: {fileID: 23475728828767504} - component: {fileID: 114922285208366486} @@ -1141,8 +1142,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1083723035257114} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.00000005542097, y: 0, z: 0.00000005542097} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 224457231796985382} @@ -1154,8 +1155,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1535950939685256} - m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.0000075997623, w: 0.7071068} - m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0.00000000547152} + m_LocalRotation: {x: 0.7071068, y: 0.0000055134296, z: 0.0000076001843, w: 0.7071068} + m_LocalPosition: {x: -0.000080108635, y: -0.00007824039, z: 0.000000019899744} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 224376509698512154} @@ -1668,7 +1669,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 2100000, guid: 3980a4724962e184695df6cbba6e11d8, type: 2} m_Color: {r: 0, g: 0, b: 0, a: 0.428} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -1786,6 +1787,23 @@ MonoBehaviour: m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!114 &114383021260469988 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1083723035257114} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 432cb07647e3e974aaf3aa9c640af385, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HideOnInitialize: 1 + m_ScrollLineRenderer: {fileID: 114922285208366486} + m_LineWidth: 1 + m_VisibleColor: {r: 0, g: 0, b: 0, a: 0.42745098} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 1} + m_PulseColor: {r: 1, g: 1, b: 1, a: 1} --- !u!114 &114403956001920920 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2345,7 +2363,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} + m_Material: {fileID: 2100000, guid: 3980a4724962e184695df6cbba6e11d8, type: 2} m_Color: {r: 0, g: 0, b: 0, a: 0.428} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -2377,6 +2395,7 @@ MonoBehaviour: m_ScrollHintArrows: - {fileID: 114693150127021580} - {fileID: 114595085207455294} + m_ScrollHintLine: {fileID: 114383021260469988} m_PrimaryDirectionalHintArrows: - {fileID: 114650385070507634} - {fileID: 114279174847565634} @@ -2401,7 +2420,6 @@ MonoBehaviour: - {fileID: 114310382182576548} - {fileID: 114472214291358280} - {fileID: 114004058444794040} - m_ScrollLineRenderer: {fileID: 114922285208366486} --- !u!114 &114889128424409716 MonoBehaviour: m_ObjectHideFlags: 1 From 0b344b704d01505809cc6a464ff515f718cdd5f3 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 17 Jul 2017 16:00:28 -0700 Subject: [PATCH 601/870] Add disabled state for main menu activator to prevent opening/closing menu when it would be autohidden --- Prefabs/UI/MainMenuActivator.prefab | 7 +- .../UI/Materials/ActivatorBaseDisabled.mat | 83 +++++++++++++++++++ .../Materials/ActivatorBaseDisabled.mat.meta | 8 ++ .../UI/Materials/ActivatorIconDisabled.mat | 83 +++++++++++++++++++ .../Materials/ActivatorIconDisabled.mat.meta | 8 ++ Scripts/Core/EditorVR.Menus.cs | 17 ++-- Scripts/Core/EditorVR.Rays.cs | 5 +- Scripts/UI/MainMenuActivator.cs | 60 +++++++++++--- 8 files changed, 249 insertions(+), 22 deletions(-) create mode 100644 Prefabs/UI/Materials/ActivatorBaseDisabled.mat create mode 100644 Prefabs/UI/Materials/ActivatorBaseDisabled.mat.meta create mode 100644 Prefabs/UI/Materials/ActivatorIconDisabled.mat create mode 100644 Prefabs/UI/Materials/ActivatorIconDisabled.mat.meta diff --git a/Prefabs/UI/MainMenuActivator.prefab b/Prefabs/UI/MainMenuActivator.prefab index 9d4bfda1d..55924215b 100644 --- a/Prefabs/UI/MainMenuActivator.prefab +++ b/Prefabs/UI/MainMenuActivator.prefab @@ -246,6 +246,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d6f3e100bf7b5f54d9ad1b115494abed, type: 3} m_Name: m_EditorClassIdentifier: - m_Icon: {fileID: 4000010854155806} + m_Icon: {fileID: 23000012609994424} + m_Base: {fileID: 23000010303846554} m_HighlightedPRS: {fileID: 4000011430756646} m_HoverPulse: {fileID: 11400000, guid: d4ac399f781bc824c8c1392fb126398e, type: 2} + m_DisabledIconMaterial: {fileID: 2100000, guid: fef48755e9696f54c951b4b7ca22110e, + type: 2} + m_DisabledBaseMaterial: {fileID: 2100000, guid: 5dde6844012df164eb0b16b790991401, + type: 2} diff --git a/Prefabs/UI/Materials/ActivatorBaseDisabled.mat b/Prefabs/UI/Materials/ActivatorBaseDisabled.mat new file mode 100644 index 000000000..ff2101ac5 --- /dev/null +++ b/Prefabs/UI/Materials/ActivatorBaseDisabled.mat @@ -0,0 +1,83 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: ActivatorBaseDisabled + m_Shader: {fileID: 4800000, guid: b10f0b677131a2945855a113a27b7093, type: 3} + m_ShaderKeywords: _ALPHABLEND_ON _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: 9499 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRamp: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _ColorRampOffset: 0 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.03189604, g: 0.033104777, b: 0.033104777, a: 0.5019608} + - _ColorBottom: {r: 0.41176468, g: 0.41176468, b: 0.41176468, a: 1} + - _ColorTop: {r: 0, g: 0, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Prefabs/UI/Materials/ActivatorBaseDisabled.mat.meta b/Prefabs/UI/Materials/ActivatorBaseDisabled.mat.meta new file mode 100644 index 000000000..57e9ffa0b --- /dev/null +++ b/Prefabs/UI/Materials/ActivatorBaseDisabled.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5dde6844012df164eb0b16b790991401 +timeCreated: 1472245673 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Prefabs/UI/Materials/ActivatorIconDisabled.mat b/Prefabs/UI/Materials/ActivatorIconDisabled.mat new file mode 100644 index 000000000..bbc11e673 --- /dev/null +++ b/Prefabs/UI/Materials/ActivatorIconDisabled.mat @@ -0,0 +1,83 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: ActivatorIconDisabled + m_Shader: {fileID: 4800000, guid: b10f0b677131a2945855a113a27b7093, type: 3} + m_ShaderKeywords: _ALPHABLEND_ON _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: 9499 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRamp: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _ColorRampOffset: 0 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 0.49019608} + - _ColorBottom: {r: 0.41176468, g: 0.41176468, b: 0.41176468, a: 1} + - _ColorTop: {r: 0, g: 0, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Prefabs/UI/Materials/ActivatorIconDisabled.mat.meta b/Prefabs/UI/Materials/ActivatorIconDisabled.mat.meta new file mode 100644 index 000000000..475f43728 --- /dev/null +++ b/Prefabs/UI/Materials/ActivatorIconDisabled.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fef48755e9696f54c951b4b7ca22110e +timeCreated: 1472245673 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 17465ad63..07f17c843 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -35,7 +35,7 @@ internal enum MenuHideFlags Temporary = OverUI | OverWorkspace | HasDirectSelection } - const float k_MenuHideMargin = 0.8f; + const float k_MenuHideMargin = 0.075f; const float k_TwoHandHideDistance = 0.25f; readonly Dictionary, ISettingsMenuProvider> m_SettingsMenuProviders = new Dictionary, ISettingsMenuProvider>(); @@ -223,6 +223,8 @@ internal void UpdateMenuVisibilities() mainMenu.visible = true; } + deviceData.mainMenuActivator.disabled = (mainMenuHideFlags & MenuHideFlags.Temporary) != 0; + var customMenu = deviceData.customMenu; if (customMenu != null) customMenu.visible = deviceData.menuHideFlags[customMenu] == 0; @@ -250,17 +252,17 @@ static Vector3 GetPointerPositionForRayOrigin(Transform rayOrigin) return rayOrigin.position + rayOrigin.forward * DirectSelection.GetPointerLength(rayOrigin); } - internal static bool OnHover(MultipleRayInputModule.RaycastSource source) + internal static bool IsValidHover(MultipleRayInputModule.RaycastSource source) { var go = source.draggedObject; if (!go) go = source.hoveredObject; if (go == null) - return false; + return true; if (go == evr.gameObject) - return false; + return true; var eventData = source.eventData; var rayOrigin = eventData.rayOrigin; @@ -283,9 +285,11 @@ internal static bool OnHover(MultipleRayInputModule.RaycastSource source) return true; } + + return (deviceData.menuHideFlags[deviceData.mainMenu] & MenuHideFlags.Hidden) != 0; } - return false; + return true; } internal static void UpdateAlternateMenuOnSelectionChanged(Transform rayOrigin) @@ -322,6 +326,9 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetRayOrigin) { + if (evr.m_DeviceData.Any(deviceData => deviceData.rayOrigin == rayOrigin && deviceData.mainMenuActivator.disabled)) + return; + foreach (var deviceData in evr.m_DeviceData) { var mainMenu = deviceData.mainMenu; diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 205785dc5..ab457cc73 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -219,10 +219,7 @@ void OnProxyActiveChanged(IProxy proxy) return false; } - if ((deviceData.menuHideFlags[deviceData.mainMenu] & Menus.MenuHideFlags.Hidden) == 0) - return Menus.OnHover(source); - - return true; + return Menus.IsValidHover(source); }); } } diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index e42db7725..3bf9d4ed7 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IControlHaptics, IUsesHandedRayOrigin { readonly Vector3 m_OriginalActivatorLocalPosition = new Vector3(0f, 0f, -0.075f); - static readonly float kAlternateLocationOffset = 0.06f; + static readonly float k_AlternateLocationOffset = 0.06f; public Transform alternateMenuOrigin { @@ -25,11 +25,12 @@ public Transform alternateMenuOrigin transform.localRotation = Quaternion.identity; transform.localScale = Vector3.one; - m_OriginalActivatorIconLocalScale = m_Icon.localScale; - m_OriginalActivatorIconLocalPosition = m_Icon.localPosition; + var iconTransform = m_Icon.transform; + m_OriginalActivatorIconLocalScale = iconTransform.localScale; + m_OriginalActivatorIconLocalPosition = iconTransform.localPosition; m_HighlightedActivatorIconLocalScale = m_HighlightedPRS.localScale; m_HighlightedActivatorIconLocalPosition = m_HighlightedPRS.localPosition; - m_AlternateActivatorLocalPosition = m_OriginalActivatorLocalPosition + Vector3.back * kAlternateLocationOffset; + m_AlternateActivatorLocalPosition = m_OriginalActivatorLocalPosition + Vector3.back * k_AlternateLocationOffset; } } Transform m_AlternateMenuOrigin; @@ -52,7 +53,10 @@ public bool activatorButtonMoveAway bool m_ActivatorButtonMoveAway; [SerializeField] - Transform m_Icon; + Renderer m_Icon; + + [SerializeField] + Renderer m_Base; [SerializeField] Transform m_HighlightedPRS; @@ -60,6 +64,12 @@ public bool activatorButtonMoveAway [SerializeField] HapticPulse m_HoverPulse; + [SerializeField] + Material m_DisabledIconMaterial; + + [SerializeField] + Material m_DisabledBaseMaterial; + Vector3 m_OriginalActivatorIconLocalScale; Vector3 m_OriginalActivatorIconLocalPosition; Vector3 m_HighlightedActivatorIconLocalScale; @@ -68,15 +78,40 @@ public bool activatorButtonMoveAway Coroutine m_ActivatorMoveCoroutine; Vector3 m_AlternateActivatorLocalPosition; + bool m_Disabled; + Material m_IconMaterial; + Material m_BaseMaterial; + public Transform rayOrigin { private get; set; } public Transform menuOrigin { private get; set; } public Node? node { get; set; } public event Action selected; + public bool disabled + { + get { return m_Disabled; } + set + { + if (value != m_Disabled) + { + m_Icon.sharedMaterial = value ? m_DisabledIconMaterial : m_IconMaterial; + m_Base.sharedMaterial = value ? m_DisabledBaseMaterial : m_BaseMaterial; + } + + m_Disabled = value; + } + } + + void Awake() + { + m_IconMaterial = m_Icon.sharedMaterial; + m_BaseMaterial = m_Base.sharedMaterial; + } + public void OnPointerEnter(PointerEventData eventData) { - if (eventData.used) + if (eventData.used || m_Disabled) return; if (m_HighlightCoroutine != null) @@ -109,8 +144,9 @@ public void OnPointerClick(PointerEventData eventData) IEnumerator Highlight(bool transitionIn = true) { var amount = 0f; - var currentScale = m_Icon.localScale; - var currentPosition = m_Icon.localPosition; + var iconTransform = m_Icon.transform; + var currentScale = iconTransform.localScale; + var currentPosition = iconTransform.localPosition; var targetScale = transitionIn == true ? m_HighlightedActivatorIconLocalScale : m_OriginalActivatorIconLocalScale; var targetLocalPosition = transitionIn == true ? m_HighlightedActivatorIconLocalPosition : m_OriginalActivatorIconLocalPosition; var speed = (currentScale.x + 0.5f / targetScale.x) * 4; // perform faster is returning to original position @@ -118,13 +154,13 @@ IEnumerator Highlight(bool transitionIn = true) while (amount < 1f) { amount += Time.deltaTime * speed; - m_Icon.localScale = Vector3.Lerp(currentScale, targetScale, Mathf.SmoothStep(0f, 1f, amount)); - m_Icon.localPosition = Vector3.Lerp(currentPosition, targetLocalPosition, Mathf.SmoothStep(0f, 1f, amount)); + iconTransform.localScale = Vector3.Lerp(currentScale, targetScale, Mathf.SmoothStep(0f, 1f, amount)); + iconTransform.localPosition = Vector3.Lerp(currentPosition, targetLocalPosition, Mathf.SmoothStep(0f, 1f, amount)); yield return null; } - m_Icon.localScale = targetScale; - m_Icon.localPosition = targetLocalPosition; + iconTransform.localScale = targetScale; + iconTransform.localPosition = targetLocalPosition; } IEnumerator AnimateMoveActivatorButton(bool moveAway = true) From e24718b8c071da11a3785e0bd8fea172e721995e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 17 Jul 2017 16:49:00 -0700 Subject: [PATCH 602/870] Add double-tap to enable multi-select; Add interfaces for getting/setting ray color; Set ray color when multiselect is active --- Scripts/Core/EditorVR.Rays.cs | 33 +++++++- .../IGetDefaultRayColor.cs | 28 +++++++ .../IGetDefaultRayColor.cs.meta | 12 +++ .../ISetDefaultRayColor.cs | 29 +++++++ .../ISetDefaultRayColor.cs.meta | 12 +++ ...MaterialLeft.mat => HighlightMaterial.mat} | 4 +- ...ft.mat.meta => HighlightMaterial.mat.meta} | 0 .../HighlightMaterialRight.mat | 79 ------------------- .../HighlightMaterialRight.mat.meta | 8 -- .../HighlightModule/HighlightModule.cs | 44 +++-------- .../HighlightModule/HighlightModule.cs.meta | 6 +- Scripts/Proxies/DefaultProxyRay.cs | 13 ++- Tools/SelectionTool/SelectionTool.cs | 40 +++++++++- Tools/VacuumTool/VacuumTool.cs | 5 +- 14 files changed, 175 insertions(+), 138 deletions(-) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs.meta create mode 100644 Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs.meta rename Scripts/Modules/HighlightModule/{HighlightMaterialLeft.mat => HighlightMaterial.mat} (96%) rename Scripts/Modules/HighlightModule/{HighlightMaterialLeft.mat.meta => HighlightMaterial.mat.meta} (100%) delete mode 100644 Scripts/Modules/HighlightModule/HighlightMaterialRight.mat delete mode 100644 Scripts/Modules/HighlightModule/HighlightMaterialRight.mat.meta diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index ab457cc73..165cf1c1a 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -37,6 +37,8 @@ class Rays : Nested, IInterfaceConnector public Rays() { ISetDefaultRayVisibilityMethods.setDefaultRayVisibility = SetDefaultRayVisibility; + ISetDefaultRayColorMethods.setDefaultRayColor = SetDefaultRayColor; + IGetDefaultRayColorMethods.getDefaultRayColor = GetDefaultRayColor; IUsesRayLockingMethods.lockRay = LockRay; IUsesRayLockingMethods.unlockRay = UnlockRay; @@ -229,7 +231,7 @@ void OnProxyActiveChanged(IProxy proxy) rayTransform.position = rayOrigin.position; rayTransform.rotation = rayOrigin.rotation; var dpr = rayTransform.GetComponent(); - dpr.SetColor(node == Node.LeftHand ? highlightModule.leftColor : highlightModule.rightColor); + dpr.SetColor(highlightModule.highlightColor); m_DefaultRays.Add(rayOrigin, dpr); keyboardModule.SpawnKeyboardMallet(rayOrigin); @@ -476,6 +478,35 @@ internal void PreProcessRaycastSource(Transform rayOrigin) return null; } + + static void SetDefaultRayColor(Transform rayOrigin, Color color) + { + if (rayOrigin) + { + var dpr = rayOrigin.GetComponentInChildren(); + if (dpr) + { + dpr.SetColor(color); + } + } + + var highlightModule = evr.GetModule(); + highlightModule.highlightColor = color; + } + + static Color GetDefaultRayColor(Transform rayOrigin) + { + if (rayOrigin) + { + var dpr = rayOrigin.GetComponentInChildren(); + if (dpr) + { + return dpr.GetColor(); + } + } + + return default(Color); + } } } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs b/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs new file mode 100644 index 000000000..39cd7d4b2 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs @@ -0,0 +1,28 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Implementors can get the color of the default ray + /// + public interface IGetDefaultRayColor + { + } + + public static class IGetDefaultRayColorMethods + { + internal static Func getDefaultRayColor { get; set; } + + /// + /// Get the color of the default ray + /// The ray to set the color on + /// + public static Color GetDefaultRayColor(this IGetDefaultRayColor obj, Transform rayOrigin) + { + return getDefaultRayColor(rayOrigin); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs.meta new file mode 100644 index 000000000..c07f2a3ed --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aa5e27d794d234e43bba8cdd4c360275 +timeCreated: 1469056752 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs new file mode 100644 index 000000000..1306db39f --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs @@ -0,0 +1,29 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Implementors can set the color of the default ray + /// + public interface ISetDefaultRayColor : IUsesRayLocking + { + } + + public static class ISetDefaultRayColorMethods + { + internal static Action setDefaultRayColor { get; set; } + + /// + /// Set the color of the default ray + /// + /// The ray to get the color of + /// The color to set on the default ray + public static void SetDefaultRayColor(this ISetDefaultRayColor obj, Transform rayOrigin, Color color) + { + setDefaultRayColor(rayOrigin, color); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs.meta b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs.meta new file mode 100644 index 000000000..a9a9d1381 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b46bd157b1d56d0428681371a56be2f6 +timeCreated: 1469056752 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/HighlightModule/HighlightMaterialLeft.mat b/Scripts/Modules/HighlightModule/HighlightMaterial.mat similarity index 96% rename from Scripts/Modules/HighlightModule/HighlightMaterialLeft.mat rename to Scripts/Modules/HighlightModule/HighlightMaterial.mat index 844c08a3e..1d9a6572c 100644 --- a/Scripts/Modules/HighlightModule/HighlightMaterialLeft.mat +++ b/Scripts/Modules/HighlightModule/HighlightMaterial.mat @@ -6,7 +6,7 @@ Material: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_Name: HighlightMaterialLeft + m_Name: HighlightMaterial m_Shader: {fileID: 4800000, guid: 9c58ee7b67645404e9542c09f160ccb9, type: 3} m_ShaderKeywords: ROTATE_GRADIENT _ALPHAPREMULTIPLY_ON _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF @@ -79,7 +79,7 @@ Material: - g_flCornerAdjust: 1.3 - g_flOutlineWidth: 0.003 m_Colors: - - _Color: {r: 0.011764706, g: 0.6627451, b: 0.95686275, a: 1} + - _Color: {r: 1, g: 0.4, b: 0, a: 0} - _ColorBottom: {r: 0, g: 0.76256925, b: 0.83137256, a: 1} - _ColorTop: {r: 0, g: 0.79697084, b: 0.83137256, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Scripts/Modules/HighlightModule/HighlightMaterialLeft.mat.meta b/Scripts/Modules/HighlightModule/HighlightMaterial.mat.meta similarity index 100% rename from Scripts/Modules/HighlightModule/HighlightMaterialLeft.mat.meta rename to Scripts/Modules/HighlightModule/HighlightMaterial.mat.meta diff --git a/Scripts/Modules/HighlightModule/HighlightMaterialRight.mat b/Scripts/Modules/HighlightModule/HighlightMaterialRight.mat deleted file mode 100644 index fde1d8eeb..000000000 --- a/Scripts/Modules/HighlightModule/HighlightMaterialRight.mat +++ /dev/null @@ -1,79 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: HighlightMaterialRight - m_Shader: {fileID: 4800000, guid: 9c58ee7b67645404e9542c09f160ccb9, type: 3} - m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF - m_LightmapFlags: 1 - m_EnableInstancingVariants: 0 - m_CustomRenderQueue: 9001 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 10 - - _GlossMapScale: 1 - - _Glossiness: 1 - - _GlossyReflections: 0 - - _Metallic: 0 - - _Mode: 3 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 0 - - _SrcBlend: 1 - - _StencilRef: 3 - - _UVSec: 0 - - _ZWrite: 0 - - g_flCornerAdjust: 1.3 - - g_flOutlineWidth: 0.003 - m_Colors: - - _Color: {r: 0.5411765, g: 0.7607843, b: 0.28627452, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - g_vOutlineColor: {r: 0.5411765, g: 0.7607843, b: 0.28627452, a: 1} diff --git a/Scripts/Modules/HighlightModule/HighlightMaterialRight.mat.meta b/Scripts/Modules/HighlightModule/HighlightMaterialRight.mat.meta deleted file mode 100644 index 31b609dc8..000000000 --- a/Scripts/Modules/HighlightModule/HighlightMaterialRight.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 455d777fd601af149ab2da220d5bd435 -timeCreated: 1468622805 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs b/Scripts/Modules/HighlightModule/HighlightModule.cs index 71cf1d635..a14467fd7 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -1,11 +1,11 @@ #if UNITY_EDITOR using System; using System.Collections.Generic; -using System.Linq; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -namespace UnityEditor.Experimental.EditorVR.Modules { +namespace UnityEditor.Experimental.EditorVR.Modules +{ sealed class HighlightModule : MonoBehaviour, IUsesGameObjectLocking { const string k_SelectionOutlinePrefsKey = "Scene/Selected Outline"; @@ -14,10 +14,7 @@ sealed class HighlightModule : MonoBehaviour, IUsesGameObjectLocking Material m_DefaultHighlightMaterial; [SerializeField] - Material m_LeftHighlightMaterial; - - [SerializeField] - Material m_RightHighlightMaterial; + Material m_RayHighlightMaterial; readonly Dictionary> m_Highlights = new Dictionary>(); readonly Dictionary> m_NodeMap = new Dictionary>(); @@ -31,14 +28,10 @@ public event Func customHighlight } readonly List> m_CustomHighlightFuncs = new List>(); - public Color leftColor + public Color highlightColor { - get { return m_LeftHighlightMaterial.GetVector("_Color"); } - } - - public Color rightColor - { - get { return m_RightHighlightMaterial.GetVector("_Color"); } + get { return m_RayHighlightMaterial.GetVector("_Color"); } + set { m_RayHighlightMaterial.color = value; } } void Awake() @@ -50,10 +43,8 @@ void Awake() var selectionColor = MaterialUtils.PrefToColor(EditorPrefs.GetString(k_SelectionOutlinePrefsKey)); selectionColor.a = 1; - m_LeftHighlightMaterial = Instantiate(m_LeftHighlightMaterial); - m_LeftHighlightMaterial.color = selectionColor.gamma; - m_RightHighlightMaterial = Instantiate(m_RightHighlightMaterial); - m_RightHighlightMaterial.color = selectionColor.gamma; + m_RayHighlightMaterial = Instantiate(m_RayHighlightMaterial); + m_RayHighlightMaterial.color = selectionColor.gamma; } } @@ -136,24 +127,7 @@ public void SetHighlight(GameObject go, bool active, Transform rayOrigin = null, if (material == null) { - if (rayOrigin) - { - var node = Node.LeftHand; - foreach (var kvp in m_NodeMap) - { - if (kvp.Value.Contains(rayOrigin)) - { - node = kvp.Key; - break; - } - } - - material = node == Node.LeftHand ? m_LeftHighlightMaterial : m_RightHighlightMaterial; - } - else - { - material = m_DefaultHighlightMaterial; - } + material = rayOrigin ? m_RayHighlightMaterial : m_DefaultHighlightMaterial; } if (active) // Highlight diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs.meta b/Scripts/Modules/HighlightModule/HighlightModule.cs.meta index 6e8c57879..668613c11 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs.meta +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs.meta @@ -1,15 +1,13 @@ fileFormatVersion: 2 guid: 1fcda1e082c52714f97ebe326889ed79 -timeCreated: 1490053335 +timeCreated: 1500334212 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - m_DefaultHighlightMaterial: {fileID: 2100000, guid: debb0327296a96e42886209b1b1cfd4f, type: 2} - - m_LeftHighlightMaterial: {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, - type: 2} - - m_RightHighlightMaterial: {fileID: 2100000, guid: 455d777fd601af149ab2da220d5bd435, + - m_RayHighlightMaterial: {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, type: 2} executionOrder: 0 icon: {instanceID: 0} diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 174b46c2b..f255ee7fc 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -149,20 +149,20 @@ public void SetColor(Color c) m_RayMaterial.color = c; } - private void Awake() + void Awake() { m_RayMaterial = MaterialUtils.GetMaterialClone(m_LineRenderer.GetComponent()); m_ConeTransform = m_Cone.transform; m_OriginalConeLocalScale = m_ConeTransform.localScale; } - private void Start() + void Start() { m_TipStartScale = m_Tip.transform.localScale; rayVisible = true; } - private IEnumerator HideRay() + IEnumerator HideRay() { m_Tip.transform.localScale = Vector3.zero; @@ -184,7 +184,7 @@ private IEnumerator HideRay() m_RayVisibilityCoroutine = null; } - private IEnumerator ShowRay() + IEnumerator ShowRay() { m_Tip.transform.localScale = m_TipStartScale; @@ -246,6 +246,11 @@ IEnumerator ShowCone() m_ConeVisibilityCoroutine = null; } + public Color GetColor() + { + return m_RayMaterial.color; + } + void OnDestroy() { ObjectUtils.Destroy(m_RayMaterial); diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 6692bb176..9789c089b 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Core; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -10,8 +11,11 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject, IGetManipulatorDragState, IUsesNode, IIsRayActive, IIsMainMenuVisible, IIsInMiniWorld, IRayToNode + ICanGrabObject, IGetManipulatorDragState, IUsesNode, IIsRayActive, IIsMainMenuVisible, IIsInMiniWorld, IRayToNode, + IGetDefaultRayColor, ISetDefaultRayColor { + const float k_MultiselectSaturationDrop = 0.5f; + [SerializeField] ActionMap m_ActionMap; @@ -19,6 +23,11 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR SelectionInput m_SelectionInput; + float m_LastMultiSelectClickTime; + Color m_NormalRayColor; + Color m_MultiselectRayColor; + bool m_MultiSelect; + readonly Dictionary m_HoverGameObjects = new Dictionary(); readonly Dictionary m_SelectionHoverGameObjects = new Dictionary(); @@ -32,6 +41,16 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR public List linkedObjects { get; set; } + void Start() + { + m_NormalRayColor = this.GetDefaultRayColor(rayOrigin); + m_MultiselectRayColor = m_NormalRayColor; + Vector3 hsv; + Color.RGBToHSV(m_MultiselectRayColor, out hsv.x, out hsv.y, out hsv.z); + hsv.y -= k_MultiselectSaturationDrop; + m_MultiselectRayColor = Color.HSVToRGB(hsv.x, hsv.y, hsv.z); + } + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { if (this.GetManipulatorDragState()) @@ -39,15 +58,28 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_SelectionInput = (SelectionInput)input; + var multiSelectControl = m_SelectionInput.multiSelect; + if (multiSelectControl.wasJustPressed) + { + var realTime = Time.realtimeSinceStartup; + if (UIUtils.IsDoubleClick(realTime - m_LastMultiSelectClickTime)) + { + m_MultiSelect = !m_MultiSelect; + consumeControl(multiSelectControl); + } + + m_LastMultiSelectClickTime = realTime; + } + var multiSelect = false; foreach (var linkedObject in linkedObjects) { var selectionTool = (SelectionTool)linkedObject; - var toolInput = selectionTool.m_SelectionInput; - if (toolInput != null && toolInput.multiSelect.isHeld) - multiSelect = true; + multiSelect |= selectionTool.m_MultiSelect; } + this.SetDefaultRayColor(rayOrigin, multiSelect ? m_MultiselectRayColor : m_NormalRayColor); + if (this.IsSharedUpdater(this)) { this.SetManipulatorsVisible(this, !multiSelect); diff --git a/Tools/VacuumTool/VacuumTool.cs b/Tools/VacuumTool/VacuumTool.cs index 07caecf55..54db93ba6 100644 --- a/Tools/VacuumTool/VacuumTool.cs +++ b/Tools/VacuumTool/VacuumTool.cs @@ -32,6 +32,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var realTime = Time.realtimeSinceStartup; if (UIUtils.IsDoubleClick(realTime - m_LastClickTime)) { + var hit = false; foreach (var vacuumable in vacuumables) { var vacuumableTransform = vacuumable.transform; @@ -40,6 +41,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon ray.direction = vacuumableTransform.InverseTransformDirection(ray.direction); if (vacuumable.vacuumBounds.IntersectRay(ray)) { + hit = true; Coroutine coroutine; if (m_VacuumingCoroutines.TryGetValue(vacuumableTransform, out coroutine)) StopCoroutine(coroutine); @@ -48,7 +50,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } } - consumeControl(vacuumInput.vacuum); + if (hit) + consumeControl(vacuumInput.vacuum); } m_LastClickTime = realTime; From b8ebefdb8271365b09b6f76292ec5243f064b3d6 Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Mon, 17 Jul 2017 18:44:55 -0500 Subject: [PATCH 603/870] add unit tests for common extension methods & utilities --- Tests/Editor/Unit/Extension Methods.meta | 9 + .../MonoBehaviourExtensionsTests.cs | 30 ++++ .../MonoBehaviourExtensionsTests.cs.meta | 12 ++ .../TransformExtensionsTests.cs | 31 ++++ .../TransformExtensionsTests.cs.meta | 12 ++ .../Extension Methods/Vec2ExtensionsTests.cs | 23 +++ .../Vec2ExtensionsTests.cs.meta | 12 ++ .../Extension Methods/Vec3ExtensionsTests.cs | 45 +++++ .../Vec3ExtensionsTests.cs.meta | 12 ++ Tests/Editor/Unit/Utilities.meta | 9 + .../Unit/Utilities/GradientPairTests.cs | 52 ++++++ .../Unit/Utilities/GradientPairTests.cs.meta | 12 ++ .../Unit/Utilities/MaterialUtilsTests.cs | 70 ++++++++ .../Unit/Utilities/MaterialUtilsTests.cs.meta | 12 ++ .../Unit/Utilities/MathUtilsExtTests.cs | 48 ++++++ .../Unit/Utilities/MathUtilsExtTests.cs.meta | 12 ++ .../Editor/Unit/Utilities/ObjectUtilsTests.cs | 161 ++++++++++++++++++ .../Unit/Utilities/ObjectUtilsTests.cs.meta | 12 ++ Tests/Test Helpers.meta | 9 + Tests/Test Helpers/TestImage.cs | 13 ++ Tests/Test Helpers/TestImage.cs.meta | 12 ++ 21 files changed, 608 insertions(+) create mode 100644 Tests/Editor/Unit/Extension Methods.meta create mode 100644 Tests/Editor/Unit/Extension Methods/MonoBehaviourExtensionsTests.cs create mode 100644 Tests/Editor/Unit/Extension Methods/MonoBehaviourExtensionsTests.cs.meta create mode 100644 Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs create mode 100644 Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs.meta create mode 100644 Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs create mode 100644 Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs.meta create mode 100644 Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs create mode 100644 Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs.meta create mode 100644 Tests/Editor/Unit/Utilities.meta create mode 100644 Tests/Editor/Unit/Utilities/GradientPairTests.cs create mode 100644 Tests/Editor/Unit/Utilities/GradientPairTests.cs.meta create mode 100644 Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs create mode 100644 Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs.meta create mode 100644 Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs create mode 100644 Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs.meta create mode 100644 Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs create mode 100644 Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs.meta create mode 100644 Tests/Test Helpers.meta create mode 100644 Tests/Test Helpers/TestImage.cs create mode 100644 Tests/Test Helpers/TestImage.cs.meta diff --git a/Tests/Editor/Unit/Extension Methods.meta b/Tests/Editor/Unit/Extension Methods.meta new file mode 100644 index 000000000..d85751c9d --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 020094575c74b3443afe5751ebe5e183 +folderAsset: yes +timeCreated: 1500329146 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Extension Methods/MonoBehaviourExtensionsTests.cs b/Tests/Editor/Unit/Extension Methods/MonoBehaviourExtensionsTests.cs new file mode 100644 index 000000000..6c857ad64 --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods/MonoBehaviourExtensionsTests.cs @@ -0,0 +1,30 @@ +using System.Collections; +using NUnit.Framework; +using UnityEngine; +using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Proxies; + +namespace UnityEditor.Experimental.EditorVR.Tests.Extensions +{ + public class MonoBehaviourExtensionsTests + { + MonoBehaviour mb; + int coIndex = 0; + IEnumerator routine() { yield return coIndex++; } + + [OneTimeSetUp] + public void Setup() + { + mb = new GameObject().AddComponent(); + } + + [Test] + public void StopCoroutineOverload_NullifiesCoroutine() + { + Coroutine coroutine = mb.StartCoroutine(routine()); + Assert.IsNotNull(coroutine); + mb.StopCoroutine(ref coroutine); + Assert.IsNull(coroutine); + } + } +} diff --git a/Tests/Editor/Unit/Extension Methods/MonoBehaviourExtensionsTests.cs.meta b/Tests/Editor/Unit/Extension Methods/MonoBehaviourExtensionsTests.cs.meta new file mode 100644 index 000000000..23f1b5eae --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods/MonoBehaviourExtensionsTests.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6fc75e02c5521d94a93863239b592009 +timeCreated: 1500329146 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs b/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs new file mode 100644 index 000000000..43d75bc68 --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using UnityEngine; +using UnityEditor.Experimental.EditorVR.Extensions; + +namespace UnityEditor.Experimental.EditorVR.Tests.Extensions +{ + [TestFixture] + public class TransformExtensionsTests + { + GameObject go; + + [OneTimeSetUp] + public void Setup() + { + go = new GameObject(); + } + + [Test] + public void TransformBounds_TranslatesLocalBoundsToWorld() + { + var size = new Vector3(2, 2, 2); + var offset = new Vector3(1, 2, 3); + go.transform.position += offset; + var localBounds = new Bounds(go.transform.position, size); + var worldBounds = go.transform.TransformBounds(localBounds); + + Assert.AreEqual(localBounds.center, worldBounds.center - offset); + Assert.AreEqual(localBounds.extents, worldBounds.extents); + } + } +} diff --git a/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs.meta b/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs.meta new file mode 100644 index 000000000..b86465fc4 --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 882677a9c86d1fe41b1ba633d5492fa1 +timeCreated: 1500329146 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs b/Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs new file mode 100644 index 000000000..1b6f779bb --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs @@ -0,0 +1,23 @@ +using NUnit.Framework; +using UnityEngine; +using UnityEditor.Experimental.EditorVR.Extensions; + +// MinComponent, MaxComponent, & Inverse are unused presently +namespace UnityEditor.Experimental.EditorVR.Tests.Extensions +{ + [InitializeOnLoad] + public class Vec2ExtensionsTests + { + [Test] + public void Abs_NegativeValues_AreInverted() + { + Assert.AreEqual(new Vector2(2f, 1f), new Vector2(-2f, -1f).Abs()); + } + + [Test] + public void Abs_PositiveValues_AreUnchanged() + { + Assert.AreEqual(new Vector2(2f, 1f), new Vector2(2f, 1f).Abs()); + } + } +} diff --git a/Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs.meta b/Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs.meta new file mode 100644 index 000000000..ae7f2ed88 --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods/Vec2ExtensionsTests.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1551c5f8d457e1347898b759b29bae28 +timeCreated: 1500329146 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs b/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs new file mode 100644 index 000000000..ae3d994c0 --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs @@ -0,0 +1,45 @@ +using NUnit.Framework; +using UnityEngine; +using UnityEditor.Experimental.EditorVR.Extensions; + +// MinComponent() has no uses in the project currently, so no test for it +namespace UnityEditor.Experimental.EditorVR.Tests.Extensions +{ + public class Vec3ExtensionsTests + { + [Test] + public void MaxComponent_ReturnsMaxAxisValue() + { + var maxX = new Vector3(2f, 1f, 0f); + Assert.AreEqual(maxX.MaxComponent(), maxX.x); + var maxY = new Vector3(0f, 2f, 1f); + Assert.AreEqual(maxY.MaxComponent(), maxY.y); + var maxZ = new Vector3(0f, 1f, 2f); + Assert.AreEqual(maxZ.MaxComponent(), maxZ.z); + } + + [Test] + public void AveragedComponents() + { + var vec3 = new Vector3(4f, 2f, 6f); + Assert.AreEqual(vec3.AveragedComponents(), 4f); + vec3 = new Vector3(-4f, 0f, 1f); + Assert.AreEqual(vec3.AveragedComponents(), -1f); + } + + [Test] + public void Inverse_PositiveValues() + { + var vec3 = new Vector3(2f, 4f, 10f); + Assert.AreEqual(new Vector3(.5f, .25f, .1f), vec3.Inverse()); + } + + [Test] + public void Inverse_NegativeValues() + { + var vec3 = new Vector3(-10f, -4f, -2f); + Assert.AreEqual(new Vector3(-.1f, -.25f, -.5f), vec3.Inverse()); + } + + } +} diff --git a/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs.meta b/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs.meta new file mode 100644 index 000000000..3b0bf59dc --- /dev/null +++ b/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f83fd35d544febe46b03a8fa48dc0000 +timeCreated: 1500329146 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Utilities.meta b/Tests/Editor/Unit/Utilities.meta new file mode 100644 index 000000000..79cc48ac4 --- /dev/null +++ b/Tests/Editor/Unit/Utilities.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5854272062229354295787e9d34a4880 +folderAsset: yes +timeCreated: 1500329146 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Utilities/GradientPairTests.cs b/Tests/Editor/Unit/Utilities/GradientPairTests.cs new file mode 100644 index 000000000..afa3911c2 --- /dev/null +++ b/Tests/Editor/Unit/Utilities/GradientPairTests.cs @@ -0,0 +1,52 @@ +using UnityEngine; +using NUnit.Framework; +using UnityEditor.Experimental.EditorVR.Helpers; + +namespace UnityEditor.Experimental.EditorVR.Tests.Utilities +{ + [TestFixture] + public class GradientPairTests + { + Color colorA, colorB, colorC, colorD, defaultColor; + + [OneTimeSetUp] + public void Setup() + { + defaultColor = new Color(0f, 0f, 0f, 0f); + colorA = new Color(0.2f, 0.4f, 0.8f); + colorB = new Color(0.4f, 0.8f, 0.2f); + colorC = new Color(0.5f, 0.6f, 0.7f); + colorD = new Color(0.1f, 0.2f, 0.3f); + } + + [Test] + public void Construct_Parameterless_HasDefaultColors() + { + var pair = new GradientPair(); + Assert.AreEqual(defaultColor, pair.a); + Assert.AreEqual(defaultColor, pair.b); + } + + [Test] + public void Construct_FromTwoColors() + { + var pair = new GradientPair(colorA, colorB); + Assert.AreEqual(colorA, pair.a); + Assert.AreEqual(colorB, pair.b); + } + + [Test] + public void Lerp_Interpolates_StartAndEndColors() + { + var x = new GradientPair(colorA, colorB); + var y = new GradientPair(colorC, colorD); + var lerped = GradientPair.Lerp(x, y, .1f); + Assert.AreEqual(Color.Lerp(x.a, y.a, .1f), lerped.a); + Assert.AreEqual(Color.Lerp(x.b, y.b, .1f), lerped.b); + } + + [TearDown] + public void Cleanup() { } + } +} + diff --git a/Tests/Editor/Unit/Utilities/GradientPairTests.cs.meta b/Tests/Editor/Unit/Utilities/GradientPairTests.cs.meta new file mode 100644 index 000000000..72a27db66 --- /dev/null +++ b/Tests/Editor/Unit/Utilities/GradientPairTests.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a65a19f0694c18b4694e6140bf1acb30 +timeCreated: 1500329146 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs b/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs new file mode 100644 index 000000000..5c45d05c0 --- /dev/null +++ b/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs @@ -0,0 +1,70 @@ +using UnityEngine; +using UnityEngine.UI; +using NUnit.Framework; +using System; +using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEditor.Experimental.EditorVR.Tests.TestHelpers; + +namespace UnityEditor.Experimental.EditorVR.Tests.Utilities +{ + public class MaterialUtilsTests + { + GameObject go; + Renderer renderer; + Graphic graphic; + Material clone; + + [OneTimeSetUp] + public void Setup() + { + go = new GameObject("renderer object"); + Shader shader = Shader.Find("Standard"); + + renderer = go.AddComponent(); + renderer.sharedMaterial = new Material(shader); + graphic = go.AddComponent(); + graphic.material = renderer.sharedMaterial; + } + + [Test] + public void GetMaterialClone_ClonesRendererSharedMaterial() + { + clone = MaterialUtils.GetMaterialClone(renderer); + Assert.AreEqual(renderer.sharedMaterial, clone); + ObjectUtils.Destroy(clone); + } + + [Test] + public void GetMaterialClone_ClonesGraphicMaterial() + { + clone = MaterialUtils.GetMaterialClone(graphic); + Assert.AreEqual(graphic.material, clone); + ObjectUtils.Destroy(clone); + } + + // normally you can directly assert equality on Colors, but + // creating them based on the float coming from this results in mismatches due to rounding + private void AssertColorsEqual(Color expected, Color actual) + { + Assert.AreEqual(Math.Round(expected.r, 3), Math.Round(actual.r, 3)); + Assert.AreEqual(Math.Round(expected.g, 3), Math.Round(actual.g, 3)); + Assert.AreEqual(Math.Round(expected.b, 3), Math.Round(actual.b, 3)); + Assert.AreEqual(Math.Round(expected.a, 3), Math.Round(actual.a, 3)); + } + + [TestCase("#000000", 0f, 0f, 0f, 1f)] // rgb: 0, 0, 0 + [TestCase("#002244", 0f, 0.133f, 0.267f, 1f)] // rgb: 136, 221, 102 + [TestCase("#4488BBBB", 0.267f, 0.533f, 0.733f, 0.733f)] // rgb: 68, 136, 187 + [TestCase("#FFFFFF", 1f, 1f, 1f, 1f)] // rgb: 255,255,255 + public void HextoColor_DoesValidConversion(string hex, float r, float g, float b, float a) + { + Color expected = new Color(r, g, b, a); + Color output = MaterialUtils.HexToColor(hex); + AssertColorsEqual(expected, output); + } + + [TearDown] + public void Cleanup() {} + } + +} diff --git a/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs.meta b/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs.meta new file mode 100644 index 000000000..35078798c --- /dev/null +++ b/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c71d550c95f034e499c511a5e57017d4 +timeCreated: 1500329146 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs b/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs new file mode 100644 index 000000000..063f07ae1 --- /dev/null +++ b/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs @@ -0,0 +1,48 @@ +using UnityEngine; +using NUnit.Framework; +using UnityEditor.Experimental.EditorVR.Utilities; + +namespace UnityEditor.Experimental.EditorVR.Tests.Utilities +{ + [TestFixture] + public class MathUtilsExtTests + { + [OneTimeSetUp] + public void Setup() {} + + [Test] + public void SmoothDamp_DividesSmoothTimeBy3_Float() + { + var velocity = 1f; + var damped = MathUtilsExt.SmoothDamp(2f, 8f, ref velocity, .3f, 10f, .1f); + velocity = 1f; + var dampedExpected = Mathf.SmoothDamp(2f, 8f, ref velocity, .1f, 10f, .1f); + + Assert.AreEqual(dampedExpected, damped); + } + + [Test] + public void SmoothDamp_DividesSmoothTimeBy3_Vector3() + { + var velocity = new Vector3(2, 1, 0); + var current = new Vector3(0, 0, 0); + var target = new Vector3(2, 4, 8); + var damped = MathUtilsExt.SmoothDamp(current, target, ref velocity, .3f, 10f, .1f); + velocity = new Vector3(2, 1, 0); + var dampedExpected = Vector3.SmoothDamp(current, target, ref velocity, .1f, 10f, .1f); + + Assert.AreEqual(dampedExpected, damped); + } + + [Test] + public void ConstrainYawRotation () + { + var rotation = new Quaternion(4, 3, 2, 1); + var newRotation = MathUtilsExt.ConstrainYawRotation(rotation); + Assert.AreEqual(new Quaternion(0, rotation.y, 0, rotation.w), newRotation); + } + + [TearDown] + public void Cleanup() { } + } +} diff --git a/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs.meta b/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs.meta new file mode 100644 index 000000000..2bd992568 --- /dev/null +++ b/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5179400e20fc7d24d9cdb3b3aa0c9c42 +timeCreated: 1500329146 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs new file mode 100644 index 000000000..38f757450 --- /dev/null +++ b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs @@ -0,0 +1,161 @@ +using UnityEngine; +using UnityEditor; +using NUnit.Framework; +using System.Collections; +using UnityEngine.TestTools; +using UnityEditor.Experimental.EditorVR.Utilities; + +namespace UnityEditor.Experimental.EditorVR.Tests.Utilities +{ + [TestFixture] + public class ObjectUtilsTests + { + GameObject go, parent, other; + + [SetUp] + public void BeforeEach() + { + go = new GameObject("object utils test"); + parent = new GameObject("parent"); + parent.transform.position += new Vector3(2, 4, 8); + other = new GameObject("other"); + other.transform.position += new Vector3(-5, 1, 2); + } + + [Test] + public void Instantiate_OneArg_ClonesActiveAtOrigin() + { + var clone = ObjectUtils.Instantiate(go); + Assert.IsTrue(clone.activeSelf); + Assert.AreEqual(new Vector3(0, 0, 0), clone.transform.position); + } + + [Test] + public void Instantiate_InactiveClone() + { + var clone = ObjectUtils.Instantiate(go, null, true, true, false); + Assert.IsFalse(clone.activeSelf); + } + + [Test] + public void Instantiate_WithParent_WorldPositionStays() + { + var clone = ObjectUtils.Instantiate(go, parent.transform); + Assert.AreEqual(parent.transform, clone.transform.parent); + Assert.AreNotEqual(parent.transform.position, clone.transform.position); + } + + [Test] + public void Instantiate_WithParent_WorldPositionMoves() + { + var clone = ObjectUtils.Instantiate(go, parent.transform, false); + Assert.AreEqual(parent.transform, clone.transform.parent); + Assert.AreEqual(parent.transform.position, clone.transform.position); + Assert.AreEqual(parent.transform.rotation, clone.transform.rotation); + } + + [TestCase(true)] + [TestCase(false)] + public void Instantiate_SetRunInEditMode(bool expected) + { + Assert.IsFalse(Application.isPlaying); + var clone = ObjectUtils.Instantiate(go, null, true, expected); + AssertRunInEditModeSet(clone, expected); + } + + [UnityTest] + public IEnumerator Destroy_OneArg_DestroysImmediately_InEditMode() + { + Assert.IsFalse(Application.isPlaying); + ObjectUtils.Destroy(other); + yield return null; // skip frame to allow destruction to run + Assert.IsTrue(other == null); + } + + // here, we could test the other types of calls to Destroy / Instantiate, but that + // would require refactor / making some things "internal" instead of private, + // as well as figuring out how we want to do mocking / stubs - hard to test coroutines + + [Test] + public void CreateGameObjectWithComponent_OneArg_TypeAsGeneric() + { + var renderer = ObjectUtils.CreateGameObjectWithComponent(); + // the object name assigned is based on the component's type name + var foundObject = GameObject.Find(typeof(MeshRenderer).Name); + Assert.IsInstanceOf(renderer); + Assert.IsInstanceOf(foundObject.GetComponent()); + } + + [Test] + public void CreateGameObjectWithComponent_SetsParent_WorldPositionStays() + { + var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform); + Assert.AreEqual(parent.transform, comp.transform.parent); + Assert.AreNotEqual(parent.transform.position, comp.transform.position); + } + + [Test] + public void CreateGameObjectWithComponent_SetsParent_WorldPositionMoves() + { + var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform, false); + Assert.AreEqual(parent.transform, comp.transform.parent); + Assert.AreEqual(parent.transform.position, comp.transform.position); + } + + [Test] + public void AddComponent_AddsToObject_TypeAsGeneric() + { + var instance = ObjectUtils.AddComponent(other); + var onObject = other.GetComponent(); + Assert.IsInstanceOf(instance); + Assert.AreEqual(instance, onObject); + AssertRunInEditModeSet(other, true); + } + + [Test] + public void AddComponent_AddsToObject_TypeAsArg() + { + var instance = ObjectUtils.AddComponent(typeof(MeshRenderer), other); + var onObject = other.GetComponent(); + Assert.IsInstanceOf(instance); + Assert.AreEqual((MeshRenderer)instance, onObject); + AssertRunInEditModeSet(other, true); + } + + [Test] + public void GetBounds_WithoutExtents() + { + var localBounds = new Bounds(other.transform.position, new Vector3(0, 0, 0)); + var bounds = ObjectUtils.GetBounds(other.transform); + + Assert.AreEqual(localBounds, bounds); + } + + [Test] + public void GetBounds_Array() + { + var gameObjectA = new GameObject(); + gameObjectA.transform.position += new Vector3(-5, -2, 8); + var gameObjectB = new GameObject(); + gameObjectB.transform.position += new Vector3(2, 6, 4); + var transforms = new Transform[] { gameObjectA.transform, gameObjectB.transform }; + + var bounds = ObjectUtils.GetBounds(transforms); + Bounds expected = new Bounds(new Vector3(-1.5f, 2f, 6f), new Vector3(7f, 8f, 4f)); + Assert.AreEqual(expected, bounds); + } + + [TearDown] + public void Cleanup() { } + + // this doesn't actually do it recursively yet + private void AssertRunInEditModeSet(GameObject go, bool expected) + { + var MBs = go.GetComponents(); + foreach (var mb in MBs) + { + Assert.AreEqual(expected, mb.runInEditMode); + } + } + } +} diff --git a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs.meta b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs.meta new file mode 100644 index 000000000..7cbb63ad1 --- /dev/null +++ b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0909d0d41dcc485479441e0c5063aeb1 +timeCreated: 1500329146 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Test Helpers.meta b/Tests/Test Helpers.meta new file mode 100644 index 000000000..2b8685147 --- /dev/null +++ b/Tests/Test Helpers.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f9d6a31ffbe20694bb23ed7f8c506aa2 +folderAsset: yes +timeCreated: 1500335530 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/Test Helpers/TestImage.cs b/Tests/Test Helpers/TestImage.cs new file mode 100644 index 000000000..52009c451 --- /dev/null +++ b/Tests/Test Helpers/TestImage.cs @@ -0,0 +1,13 @@ +using UnityEngine.UI; + +// if you create a custom class in a file that doesn't match the class name, +// after the tests run Unity will complain that the compiler that imported +// "TestImage" isn't available anymore, so they go in their own files +namespace UnityEditor.Experimental.EditorVR.Tests.TestHelpers +{ + public class TestImage : Graphic + { + protected override void OnPopulateMesh(VertexHelper vh) { } + } +} + diff --git a/Tests/Test Helpers/TestImage.cs.meta b/Tests/Test Helpers/TestImage.cs.meta new file mode 100644 index 000000000..3534a2049 --- /dev/null +++ b/Tests/Test Helpers/TestImage.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a4635ef6f23cf1f4a96b2a0feecf278b +timeCreated: 1500335545 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 411a999d000e7c0f44b42930a74a701be6d69dea Mon Sep 17 00:00:00 2001 From: mtschoen-unity Date: Mon, 17 Jul 2017 17:49:05 -0700 Subject: [PATCH 604/870] WIP --- Tools/LocomotionTool/LocomotionInput.asset | 4 ++-- Tools/LocomotionTool/LocomotionTool.cs | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionInput.asset b/Tools/LocomotionTool/LocomotionInput.asset index 710e81d24..4773c678b 100644 --- a/Tools/LocomotionTool/LocomotionInput.asset +++ b/Tools/LocomotionTool/LocomotionInput.asset @@ -42,7 +42,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 22 + - controlIndex: 3 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -51,7 +51,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 3 + - controlIndex: 22 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index de9fcc7c7..c04b7732c 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -75,6 +75,8 @@ class Preferences bool m_Rotating; bool m_Crawling; + float m_CrawlStartTime; + Vector3 m_ActualRayOriginStartPosition; Vector3 m_RayOriginStartPosition; Vector3 m_RayOriginStartForward; Vector3 m_RayOriginStartRight; @@ -299,22 +301,34 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) { if (!m_LocomotionInput.forward.isHeld && !m_LocomotionInput.blink.isHeld && m_LocomotionInput.crawl.isHeld) { - consumeControl(m_LocomotionInput.crawl); + //consumeControl(m_LocomotionInput.crawl); // Also consume thumbstick axes to disable radial menu - consumeControl(m_LocomotionInput.horizontal); - consumeControl(m_LocomotionInput.vertical); + //consumeControl(m_LocomotionInput.horizontal); + //consumeControl(m_LocomotionInput.vertical); if (!m_Crawling) { m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; + m_ActualRayOriginStartPosition = m_RayOriginStartPosition; + m_CrawlStartTime = Time.time; this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); } + var localRayPosition = cameraRig.position - rayOrigin.position; - cameraRig.position = m_RigStartPosition + (localRayPosition - m_RayOriginStartPosition); + var delta = m_ActualRayOriginStartPosition - localRayPosition; + if (Time.time > m_CrawlStartTime + UIUtils.DoubleClickIntervalMax || delta.magnitude > 0.015f * this.GetViewerScale()) + { + cameraRig.position = m_RigStartPosition + localRayPosition - m_RayOriginStartPosition; + } + else + { + m_RigStartPosition = cameraRig.position; + m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; + } return true; } From 55856544cc9fc0b66bfa15bf7456aef2bfa294a1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 18:45:44 -0700 Subject: [PATCH 605/870] Hide ray when spatially scrolling --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 15 ++++++++++++++- Scripts/Core/EditorVR.cs | 2 +- Scripts/UI/Interfaces/IPinnedToolButton.cs | 1 - 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 18113e4b2..3c5c8651a 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics, IUsesViewerScale, IControlSpatialHinting + sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics, IUsesViewerScale, IControlSpatialHinting, ISetDefaultRayVisibility { const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation @@ -115,6 +115,11 @@ void Awake() createPinnedToolButton = CreatePinnedToolButton; } + void OnDestroy() + { + this.SetDefaultRayVisibility(rayOrigin, true); + } + void CreatePinnedToolsUI() { Debug.LogWarning("Spawing pinned tools menu UI"); @@ -221,6 +226,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (pinnedToolInput.select.wasJustPressed) Debug.LogError("SELECT pressed in PinnedToolButton"); + if (pinnedToolInput.cancel.wasJustPressed) + Debug.LogError("CANCELLING SPATIAL SELECTION!!!!"); + if (allowSpatialScrollBeforeThisTime != null && spatialDirection == null && Time.realtimeSinceStartup > allowSpatialScrollBeforeThisTime.Value) { // Hide if no direction as been defined after a given duration @@ -232,6 +240,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (pinnedToolInput.show.wasJustPressed) { + this.SetDefaultRayVisibility(rayOrigin, false); + this.LockRay(rayOrigin, this); //consumeControl(pinnedToolInput.show); //m_PinnedToolsMenuUI.allButtonsVisible = true; m_SpatialScrollStartPosition = m_AlternateMenuOrigin.position; @@ -306,6 +316,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_PinnedToolsMenuUI.SelectNextExistingToolButton(); OnButtonClick(); } + + this.SetDefaultRayVisibility(rayOrigin, true); + this.UnlockRay(rayOrigin, this); } // cache current position for delta comparison on next frame for fine tuned scrolling with low velocity diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index c69ab187f..358a7181f 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -204,8 +204,8 @@ void Awake() return false; }; - AddModule(); AddModule(); + AddModule(); viewer.AddPlayerModel(); diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 476083004..372ad1f64 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -1,7 +1,6 @@ #if UNITY_EDITOR using System; using UnityEngine; -using UnityEditor.Experimental.EditorVR.Helpers; namespace UnityEditor.Experimental.EditorVR { From eb4f8554d0c57e18cfe08ec958c580366d4a0b4b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 19:06:10 -0700 Subject: [PATCH 606/870] Scale the spatial scroll "bar" with the ViewerScale --- .../Modules/SpatialHintModule/SpatialHintModuleUI.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index a3bef266e..b57755f07 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale + public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHaptics { readonly Color k_PrimaryArrowColor = Color.white; @@ -18,10 +18,10 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale Transform m_ScrollVisualsDragTargetArrow; [SerializeField] - HintIcon[] m_ScrollHintArrows; + HintLine m_ScrollHintLine; [SerializeField] - HintLine m_ScrollHintLine; + HintIcon[] m_ScrollHintArrows; //[SerializeField] //CanvasGroup m_HintArrowsCanvasGroup; // TODO: add back in later @@ -269,7 +269,7 @@ IEnumerator ShowScrollVisuals() var lineRendererPositions = new Vector3[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrow.position }; m_ScrollHintLine.Positions = lineRendererPositions; - m_ScrollHintLine.LineWidth = shapedDuration; + m_ScrollHintLine.LineWidth = shapedDuration * this.GetViewerScale(); yield return null; } @@ -294,7 +294,7 @@ IEnumerator HideScrollVisuals() m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 0f, shapedDuration); //m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); currentDuration += Time.unscaledDeltaTime * 3.5f; - m_ScrollHintLine.LineWidth = 1 - shapedDuration; + m_ScrollHintLine.LineWidth = (1 - shapedDuration) * this.GetViewerScale(); yield return null; } From 512384463703e8e6a2fc15d96115854d214f383b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 20:04:31 -0700 Subject: [PATCH 607/870] Increase spatial pre-scroll auto-hide visuals duration --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 3c5c8651a..02efd00b8 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -207,7 +207,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (buttonCount <= k_ActiveToolOrderPosition + 1) return; - const float kAutoHideDuration = 1f; + const float kAutoHideDuration = 10f; const float kAllowToggleDuration = 0.25f; var pinnedToolInput = (PinnedToolslMenuInput) input; /* @@ -232,6 +232,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (allowSpatialScrollBeforeThisTime != null && spatialDirection == null && Time.realtimeSinceStartup > allowSpatialScrollBeforeThisTime.Value) { // Hide if no direction as been defined after a given duration + Debug.LogWarning("Perform an increasing visual presence of visuals as time progresses, and the drag threshold hasn't been met."); m_PinnedToolsMenuUI.allButtonsVisible = false; allowSpatialScrollBeforeThisTime = null; m_PinnedToolsMenuUI.spatialScrollVisualsVisible = false; From 8069d69578900be95c3b56fb656814761f3455eb Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 17 Jul 2017 20:06:44 -0700 Subject: [PATCH 608/870] Add cancel button to PinnedToolsMenuInput --- .../PinnedToolslMenuInput.asset | 33 +++++++++++++++++-- Menus/PinnedToolMenu/PinnedToolslMenuInput.cs | 1 + 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset b/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset index 6726bbba2..4fe628316 100644 --- a/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset +++ b/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset @@ -11,10 +11,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} m_Name: PinnedToolslMenuInput m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Actions: - {fileID: 114000014192420456} - {fileID: 114000013122567660} + - {fileID: 114836735327238322} m_ControlSchemes: - m_Name: PinnedToolsMenu m_DeviceSlots: @@ -43,6 +43,15 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 + - sources: + - controlIndex: 18 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 m_MapTypeName: PinnedToolslMenuInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: @@ -57,7 +66,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} m_Name: Select m_EditorClassIdentifier: - m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} m_ActionIndex: 1 m_ControlData: @@ -78,7 +86,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} m_Name: Show m_EditorClassIdentifier: - m_RunInEditMode: 0 m_ActionMap: {fileID: 11400000} m_ActionIndex: 0 m_ControlData: @@ -88,3 +95,23 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Show defaultValue: 0 +--- !u!114 &114836735327238322 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Cancel + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 2 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Cancel + defaultValue: 0 diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs b/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs index 80a0d052c..96fa19a16 100644 --- a/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs +++ b/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs @@ -9,5 +9,6 @@ public PinnedToolslMenuInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @show { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @select { get { return (ButtonInputControl)this[1]; } } + public ButtonInputControl @cancel { get { return (ButtonInputControl)this[2]; } } } } From 554d46cb3c4161ba2ff5831d0a0e3b63e2c8d0bd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 14:02:30 -0700 Subject: [PATCH 609/870] Add new SpatialScrollDragDefine haptic pulse; used when initially defining/dragging-out a spatial scroll bar --- .../SpatialScrollDragDefinePulse.asset | 17 +++++++++++++++++ .../SpatialScrollDragDefinePulse.asset.meta | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset create mode 100644 Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset.meta diff --git a/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset b/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset new file mode 100644 index 000000000..e7945a156 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} + m_Name: WorkspaceMovePulse + m_EditorClassIdentifier: + m_Duration: 0.25 + m_Intensity: 0.15 + m_FadeIn: 0 + m_FadeOut: 1 diff --git a/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset.meta b/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset.meta new file mode 100644 index 000000000..17c1d4717 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ab0ad30bb9a141c44a3beea4c62c510e +timeCreated: 1497398097 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 01d64c0ca5e9ec66c562f645fb3133f2acb834ee Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 14:03:04 -0700 Subject: [PATCH 610/870] Add SpatialHintModule HapticPulses folder meta --- Scripts/Modules/SpatialHintModule/HapticPulses.meta | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Scripts/Modules/SpatialHintModule/HapticPulses.meta diff --git a/Scripts/Modules/SpatialHintModule/HapticPulses.meta b/Scripts/Modules/SpatialHintModule/HapticPulses.meta new file mode 100644 index 000000000..f52453c65 --- /dev/null +++ b/Scripts/Modules/SpatialHintModule/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 620b56aa40f75dd46becaa7b455d3be5 +folderAsset: yes +timeCreated: 1500408546 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: From cbb26ffeb4127f87372d8cdc19b18cf016bd4a9e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 14:03:49 -0700 Subject: [PATCH 611/870] Remove extra line in DefaultProxyRay's LockRay property --- Scripts/Proxies/DefaultProxyRay.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 61ec6c550..b92c0383d 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -36,7 +36,6 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale private object m_LockRayObject; public bool LockRay(object lockCaller) - { // Allow the caller to lock the ray // If the reference to the lockCaller is destroyed, and the ray was not properly From 8dffbdfcdb0074a767868a36ee12de3ced36810b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 14:05:20 -0700 Subject: [PATCH 612/870] Process PinnedToolsMenu input before tools in EVR ProcessInput --- Scripts/Core/EditorVR.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 358a7181f..21ce27ed8 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -359,6 +359,11 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate if (altMenuInput != null && altMenu.visible) altMenuInput.ProcessInput(deviceData.alternateMenuInput, consumeControl); + var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; + if (pinnedToolsMenuInput != null) + pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); + foreach (var toolData in deviceData.toolData) { var process = toolData.tool as IProcessInput; @@ -366,11 +371,6 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate && processedInputs.Add(process)) // Only process inputs for an instance of a tool once (e.g. two-handed tools) process.ProcessInput(toolData.input, consumeControl); } - - var pinnedToolsMenu = deviceData.pinnedToolsMenu; - var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; - if (pinnedToolsMenuInput != null) - pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); } } From 24c61888eaee157e6d133b7202ea48c3b859649d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 14:06:09 -0700 Subject: [PATCH 613/870] Refine HintIcon show/hide timing --- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index 0cc113b9d..a24597d11 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -71,7 +71,7 @@ IEnumerator AnimateShow() if (currentLocalScale == k_HiddenScale) { // Only perform delay if fully hidden; otherwise resume showing - targetDuration = Random.Range(0.25f, 0.35f); // Set an initial random wait duration + targetDuration = Random.Range(0.125f, 0.175f); // Set an initial random wait duration while (currentDuration < targetDuration) { currentDuration += Time.unscaledDeltaTime; @@ -85,9 +85,10 @@ IEnumerator AnimateShow() while (currentDuration < targetDuration) { var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / targetDuration); + shapedDuration = Mathf.Pow(shapedDuration, 4); m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, m_VisibleLocalScale, shapedDuration); m_Icon.color = Color.Lerp(currentColor, m_VisibleColor, shapedDuration); - currentDuration += Time.unscaledDeltaTime; + currentDuration += Time.unscaledDeltaTime * 1.5f; yield return null; } @@ -97,7 +98,7 @@ IEnumerator AnimateShow() IEnumerator AnimateHide() { var currentDuration = 0f; - var targetDuration = Random.Range(0.125f, 0.25f); // Set an initial random wait duration + var targetDuration = Random.Range(0.125f, 0.2f); // Set an initial random wait duration var currentLocalScale = m_IconTransform.localScale; var currentColor = m_Icon.color; while (currentDuration < targetDuration) From c69f7764c42588870a27791c01064c67e6e146b1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 14:26:32 -0700 Subject: [PATCH 614/870] Add Node/RayOrigin support to SpatialHintModule; used for performing node-specific haptic pulses; simplify state-handling throughout SpatialHint arch; add haptic pulse that gradually fades in as the user defines the spatial scroll drag "bar" --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 11 +++- .../Scripts/PinnedToolsMenuUI.cs | 17 +----- .../SpatialHintModuleConnector.cs | 1 + .../IControlSpatialHinting.cs | 13 ++++- .../SpatialScrollDragDefinePulse.asset | 4 +- .../SpatialHintModule/SpatialHintModule.cs | 48 +++++++++++++++-- .../SpatialHintModule/SpatialHintModuleUI.cs | 52 ++++++++++++++++--- .../SpatialHintModule/SpatialHintUI.prefab | 8 +-- 8 files changed, 119 insertions(+), 35 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 02efd00b8..9fa4e3d26 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -4,6 +4,7 @@ using System.Linq; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -235,7 +236,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon Debug.LogWarning("Perform an increasing visual presence of visuals as time progresses, and the drag threshold hasn't been met."); m_PinnedToolsMenuUI.allButtonsVisible = false; allowSpatialScrollBeforeThisTime = null; - m_PinnedToolsMenuUI.spatialScrollVisualsVisible = false; + + this.SetSpatialHintControlObject(null); // Hide Spatial Hint Visuals + return; } @@ -249,6 +252,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon Debug.LogError("Start position : " + m_SpatialScrollStartPosition + ""); allowSpatialScrollBeforeThisTime = Time.realtimeSinceStartup + kAutoHideDuration; allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; + this.SetSpatialHintControlObject(rayOrigin); m_PinnedToolsMenuUI.beginningSpatialScrolling = true; // Triggers the display of the directional hint arrows //Dont show if the user hasnt passed the threshold in the given duration @@ -287,7 +291,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { if (!m_PinnedToolsMenuUI.allButtonsVisible) + { + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Scrolling); m_PinnedToolsMenuUI.allButtonsVisible = true; + } m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int) (buttonCount * normalizedRepeatingPosition) + 1); consumeControl(pinnedToolInput.show); @@ -320,6 +327,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.SetDefaultRayVisibility(rayOrigin, true); this.UnlockRay(rayOrigin, this); + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); } // cache current position for delta comparison on next frame for fine tuned scrolling with low velocity @@ -386,6 +394,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, void OnButtonClick() { this.Pulse(node, m_ButtonClickPulse); + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); } void OnButtonHover() diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 40b203ddc..9c30958dc 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Tools; @@ -11,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI, IConnectInterfaces, IControlSpatialHinting + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI, IConnectInterfaces, IControlSpatialHinting, IControlHaptics { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation @@ -101,15 +102,6 @@ private bool aboveMinimumButtonCount } } - public bool spatialScrollVisualsVisible - { - set - { - if (!value) - this.SetSpatialHintRotationTarget(Vector3.zero); - } - } - public bool beginningSpatialScrolling { set @@ -120,10 +112,6 @@ public bool beginningSpatialScrolling m_SpatialDragDistance = 0f; var currentRotation = transform.rotation.eulerAngles; m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); - //spatialHintScrollVisualsRotation = Vector3.zero; - this.SetSpatialHintRotationTarget(Vector3.zero); - this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.PreDragReveal); - //SpatialHintState = SpatialHintModule.SpatialHintStateFlags.PreDragReveal; m_HintContentWorldPosition = transform.position; this.SetSpatialHintPosition(m_HintContentWorldPosition); //spatialHintContentContainer.position = m_HintContentWorldPosition; @@ -481,7 +469,6 @@ public void SelectHighlightedButton() allButtonsVisible = false; //SpatialHintState = SpatialHintModule.SpatialHintStateFlags.Hidden; - this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); return; } diff --git a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs index 4f2057248..784a789b1 100644 --- a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs +++ b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs @@ -16,6 +16,7 @@ public void LateBindInterfaceMethods(SpatialHintModule provider) IControlSpatialHintingMethods.setSpatialHintLookAtRotation = provider.LookAt; IControlSpatialHintingMethods.setSpatialHintDragThresholdTriggerPosition = provider.SetDragThresholdTriggerPosition; IControlSpatialHintingMethods.pulseSpatialHintScrollArrows = provider.PulseScrollArrows; + IControlSpatialHintingMethods.setSpatialHintControlObject = provider.SetSpatialHintControlObject; } } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs index 984a4815f..c9e7538d5 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs @@ -83,12 +83,23 @@ public static void PulseSpatialHintScrollArrows(this IControlSpatialHinting obj) internal static SetSpatialHintDragThresholdTriggerPositionDelegate setSpatialHintDragThresholdTriggerPosition { get; set; } /// - /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatiatil scroll + /// /// public static void SetSpatialHintDragThresholdTriggerPosition(this IControlSpatialHinting obj, Vector3 position) { setSpatialHintDragThresholdTriggerPosition(position); } + + internal delegate void SetSpatialHintControlObjectDelegate(Transform controlObject); + internal static SetSpatialHintControlObjectDelegate setSpatialHintControlObject { get; set; } + + /// + /// Set reference to the object, RayOrigin, controlling the Spatial Hint visuals + /// + public static void SetSpatialHintControlObject(this IControlSpatialHinting obj, Transform controlObject) + { + setSpatialHintControlObject(controlObject); + } } } #endif diff --git a/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset b/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset index e7945a156..a415e1229 100644 --- a/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset +++ b/Scripts/Modules/SpatialHintModule/HapticPulses/SpatialScrollDragDefinePulse.asset @@ -9,9 +9,9 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: WorkspaceMovePulse + m_Name: SpatialScrollDragDefinePulse m_EditorClassIdentifier: m_Duration: 0.25 - m_Intensity: 0.15 + m_Intensity: 0.05 m_FadeIn: 0 m_FadeOut: 1 diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index 816142027..ebd34f76c 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -1,11 +1,12 @@ #if UNITY_EDITOR using System; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Menus; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Modules { - public sealed class SpatialHintModule : MonoBehaviour, IConnectInterfaces, IInstantiateUI + public sealed class SpatialHintModule : MonoBehaviour, IConnectInterfaces, IInstantiateUI, IRayToNode { [Flags] public enum SpatialHintStateFlags @@ -19,6 +20,7 @@ public enum SpatialHintStateFlags SpatialHintModuleUI m_SpatialHintModuleUI; SpatialHintStateFlags m_State; + Transform m_ControllingRayOrigin; public SpatialHintStateFlags state { @@ -36,21 +38,51 @@ public SpatialHintStateFlags state m_SpatialHintModuleUI.preScrollVisualsVisible = false; m_SpatialHintModuleUI.primaryArrowsVisible = false; m_SpatialHintModuleUI.secondaryArrowsVisible = false; + controllingRayOrigin = null; //spatialHintPrimaryArrowsVisible = false; //spatialHintSecondaryArrowsVisible = false; break; case SpatialHintStateFlags.PreDragReveal: Debug.LogError("SpatialHintState : Pre drag reveal state"); - m_SpatialHintModuleUI.preScrollVisualsVisible = true;; + m_SpatialHintModuleUI.preScrollVisualsVisible = true; m_SpatialHintModuleUI.primaryArrowsVisible = true; m_SpatialHintModuleUI.secondaryArrowsVisible = true; break; case SpatialHintStateFlags.Scrolling: + m_SpatialHintModuleUI.preScrollVisualsVisible = false; + m_SpatialHintModuleUI.scrollVisualsVisible = true; + Debug.LogError("SpatialHintState : Scrolling"); break; } } } + private Transform controllingRayOrigin + { + get + { + return m_ControllingRayOrigin; + } + + set + { + if (value == m_ControllingRayOrigin) + return; + + m_ControllingRayOrigin = value; + if (m_ControllingRayOrigin == null) + { + m_SpatialHintModuleUI.controllingNode = null; + } + else + { + state = SpatialHintModule.SpatialHintStateFlags.PreDragReveal; + m_SpatialHintModuleUI.controllingNode = this.RequestNodeFromRayOrigin(m_ControllingRayOrigin); + //spatialHintScrollVisualsRotation = Vector3.zero; + } + } + } + /* /// /// Description @@ -105,10 +137,11 @@ public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition Vector3 spatialHintScrollVisualsRotation { get { return m_SpatialHintModuleUI.scrollVisualsRotation; } + set { - if (value == Vector3.zero) - state = SpatialHintStateFlags.Hidden; // Hide the non-spatial-scrolling visuals + //if (value == Vector3.zero) + //state = SpatialHintStateFlags.Hidden; // Hide the non-spatial-scrolling visuals m_SpatialHintModuleUI.scrollVisualsRotation = value; } @@ -166,10 +199,15 @@ public void LookAt(Vector3 position) spatialHintContentContainer.rotation = orig; } - public void SetDragThresholdTriggerPosition(Vector3 position) + public void SetDragThresholdTriggerPosition (Vector3 position) { m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = position; } + + public void SetSpatialHintControlObject(Transform controlObject) + { + controllingRayOrigin = controlObject; + } } } #endif diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index b57755f07..7c57158b4 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -1,12 +1,13 @@ #if UNITY_EDITOR using System.Collections; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Menus { - public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHaptics + public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHaptics, IRayToNode { readonly Color k_PrimaryArrowColor = Color.white; @@ -23,6 +24,9 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt [SerializeField] HintIcon[] m_ScrollHintArrows; + [SerializeField] + HapticPulse m_ScrollBarDefineHapticPulse; // Haptic pulse performed when dragging out the spatial scroll bar + //[SerializeField] //CanvasGroup m_HintArrowsCanvasGroup; // TODO: add back in later @@ -102,8 +106,6 @@ public bool preScrollVisualsVisible { m_PreScrollVisualsVisible = value; - transform.localScale = Vector3.one * this.GetViewerScale(); - this.RestartCoroutine(ref m_VisibilityCoroutine, m_PreScrollVisualsVisible ? AnimateShow() : AnimateHide()); var semiTransparentWhite = new Color(1f, 1f, 1f, 0.5f); @@ -119,6 +121,18 @@ public bool preScrollVisualsVisible } } + public bool scrollVisualsVisible + { + set + { + if (value) + { + Debug.LogError("scrollVisualsRotation was set to a Vec3 non-zero value' beginning showing of scroll visuals : " + m_ScrollVisualsRotation); + this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, ShowScrollVisuals()); + } + } + } + public bool primaryArrowsVisible { get { return m_PrimaryArrowsVisible; } @@ -172,14 +186,33 @@ public Vector3 scrollVisualsRotation return; m_ScrollVisualsRotation = value; - if (m_ScrollVisualsRotation != Vector3.zero) + } + } + + Node? m_ControllingNode; + public Node? controllingNode + { + get + { + return m_ControllingNode; + } + + set + { + //if (m_ControllingNode == value.Value) + //return; + + m_ControllingNode = value; + + if (m_ControllingNode != null) { - Debug.LogError("scrollVisualsRotation was set to a Vec3 non-zero value' beginning showing of scroll visuals : " + m_ScrollVisualsRotation); - this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, ShowScrollVisuals()); + Debug.LogError("Setting Spatial Hinting Control node to : " + m_ControllingNode); } else { + scrollVisualsRotation = Vector3.zero; this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, HideScrollVisuals()); + scrollVisualsVisible = false; } } } @@ -200,13 +233,14 @@ IEnumerator AnimateShow() { //m_SpatialHintUI.enablePreviewVisuals = true; + transform.localScale = Vector3.zero; var currentScale = transform.localScale; var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals var targetScale = Vector3.one * this.GetViewerScale(); while (timeElapsed < 1f) { - timeElapsed += Time.unscaledDeltaTime * 5f; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(timeElapsed), 2); + timeElapsed += Time.unscaledDeltaTime * 3f; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(timeElapsed), 6); transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); yield return null; } @@ -271,6 +305,8 @@ IEnumerator ShowScrollVisuals() m_ScrollHintLine.Positions = lineRendererPositions; m_ScrollHintLine.LineWidth = shapedDuration * this.GetViewerScale(); + this.Pulse(controllingNode, m_ScrollBarDefineHapticPulse, 1f, 1f + 8 * currentDuration); + yield return null; } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index ed3ee6e16..40fd52284 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -1124,7 +1124,7 @@ Transform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4542884266341674 Transform: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1789767321393858} @@ -2381,7 +2381,7 @@ MonoBehaviour: m_FillOrigin: 2 --- !u!114 &114885606894613528 MonoBehaviour: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1789767321393858} @@ -2392,10 +2392,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_ScrollVisualsCanvasGroup: {fileID: 225476474272170592} m_ScrollVisualsDragTargetArrow: {fileID: 4630278991888076} + m_ScrollHintLine: {fileID: 114383021260469988} m_ScrollHintArrows: - {fileID: 114693150127021580} - {fileID: 114595085207455294} - m_ScrollHintLine: {fileID: 114383021260469988} + m_ScrollBarDefineHapticPulse: {fileID: 11400000, guid: ab0ad30bb9a141c44a3beea4c62c510e, + type: 2} m_PrimaryDirectionalHintArrows: - {fileID: 114650385070507634} - {fileID: 114279174847565634} From 939025b58f2c58da9ce39fbee18b6c8500b1bc92 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 18 Jul 2017 14:50:15 -0700 Subject: [PATCH 615/870] Add rule to prevent auto-hiding menu while ray is hovering; Add colliders to workspace and menu bounds to main menus, check overlaps instead of point in bounds for workspace hiding; Re-order workspace resize handles for UI priority --- Menus/MainMenu/MainMenu.cs | 4 +++ Menus/MainMenu/Prefabs/MainMenu.prefab | 4 +-- Menus/MainMenu/Scripts/MainMenuUI.cs | 36 +++++++++++++++++++------- Scripts/Core/EditorVR.Menus.cs | 25 +++++++++++------- Scripts/Interfaces/Entity/IMainMenu.cs | 10 +++++++ Workspaces/Base/Workspace.cs | 15 +++++++++++ Workspaces/Base/WorkspaceBase.prefab | 14 +++++----- Workspaces/Base/WorkspaceUI.cs | 15 ++++++++--- 8 files changed, 91 insertions(+), 32 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index f4a06e147..f647c6118 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -99,6 +99,10 @@ public bool visible public float hideDistance { get { return m_MainMenuUI.menuHeight; } } + public Bounds localBounds { get { return m_MainMenuUI.localBounds; } } + + public bool hovering { get { return m_MainMenuUI.hovering; } } + void Start() { m_MainMenuUI = this.InstantiateUI(m_MainMenuPrefab.gameObject).GetComponent(); diff --git a/Menus/MainMenu/Prefabs/MainMenu.prefab b/Menus/MainMenu/Prefabs/MainMenu.prefab index c0064b0ff..725364bf1 100644 --- a/Menus/MainMenu/Prefabs/MainMenu.prefab +++ b/Menus/MainMenu/Prefabs/MainMenu.prefab @@ -543,6 +543,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e42a33a060806cc4d9f35476fbc32b84, type: 3} m_Name: m_EditorClassIdentifier: + m_MenuHeight: 0.277 m_ButtonTemplatePrefab: {fileID: 114000012845136458, guid: 489a926cc8991484cbc6c611717af0d2, type: 2} m_MenuFaceContainers: @@ -555,9 +556,6 @@ MonoBehaviour: m_MenuFaceRotationOrigin: {fileID: 4000012948932736} m_MenuFrameRenderer: {fileID: 137000013719920994} m_AlternateMenu: {fileID: 4000011216484522} - m_RotatePulse: {fileID: 11400000, guid: f5f56317312943d4da218b9b2e6ea9d0, type: 2} - m_ShowPulse: {fileID: 11400000, guid: 7c69a56582b55ec41b36b49c44a42905, type: 2} - m_HidePulse: {fileID: 11400000, guid: 29832200cc7e1744b9e98febd6d30db8, type: 2} --- !u!137 &137000013719920994 SkinnedMeshRenderer: m_ObjectHideFlags: 1 diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 2a4e48444..5c4760fa4 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -4,13 +4,13 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IConnectInterfaces + sealed class MainMenuUI : MonoBehaviour, IInstantiateUI, IConnectInterfaces, IRayEnterHandler, IRayExitHandler { public class ButtonData { @@ -39,6 +39,9 @@ enum VisibilityState TransitioningOut } + [SerializeField] + float m_MenuHeight = 0.2f; + [SerializeField] MainMenuButton m_ButtonTemplatePrefab; @@ -94,7 +97,6 @@ public int targetFaceIndex Coroutine m_VisibilityCoroutine; Coroutine m_FrameRevealCoroutine; int m_Direction; - float m_MenuHeight; Transform[] m_MenuFaceContentTransforms; Vector3[] m_MenuFaceContentOriginalLocalPositions; @@ -102,6 +104,10 @@ public int targetFaceIndex Vector3 m_MenuFaceContentOriginalLocalScale; Vector3 m_MenuFaceContentHiddenLocalScale; + Bounds m_LocalBounds; + + bool m_Hovering; + readonly Dictionary> m_FaceSubmenus = new Dictionary>(); public Transform menuOrigin @@ -176,10 +182,11 @@ int currentFaceIndex } } - float currentRotation - { - get { return m_MenuFaceRotationOrigin.localRotation.eulerAngles.y; } - } + float currentRotation { get { return m_MenuFaceRotationOrigin.localRotation.eulerAngles.y; } } + + public Bounds localBounds { get { return m_LocalBounds; } } + + public bool hovering { get { return m_Hovering; } } public event Action buttonHovered; public event Action buttonClicked; @@ -188,6 +195,8 @@ void Awake() { m_MenuFacesMaterial = MaterialUtils.GetMaterialClone(m_MenuFaceRotationOrigin.GetComponent()); m_MenuFacesColor = m_MenuFacesMaterial.color; + + m_LocalBounds = ObjectUtils.GetBounds(transform); } public void Setup() @@ -216,9 +225,6 @@ public void Setup() m_MenuFaceContentOriginalLocalScale = m_MenuFaceContentTransforms[0].localScale; m_MenuFaceContentHiddenLocalScale = new Vector3(0f, m_MenuFaceContentOriginalLocalScale.y * 0.5f, m_MenuFaceContentOriginalLocalScale.z); - var bounds = ObjectUtils.GetBounds(gameObject.transform); - m_MenuHeight = bounds.size.y; - transform.localScale = Vector3.zero; m_AlternateMenu.localScale = Vector3.zero; } @@ -622,6 +628,16 @@ void OnButtonClick(Transform rayOrigin) if (buttonClicked != null) buttonClicked(rayOrigin); } + + public void OnRayEnter(RayEventData eventData) + { + m_Hovering = true; + } + + public void OnRayExit(RayEventData eventData) + { + m_Hovering = false; + } } } #endif diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 07f17c843..6af2c8eaa 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -37,6 +37,7 @@ internal enum MenuHideFlags const float k_MenuHideMargin = 0.075f; const float k_TwoHandHideDistance = 0.25f; + const int k_PossibleOverlaps = 16; readonly Dictionary, ISettingsMenuProvider> m_SettingsMenuProviders = new Dictionary, ISettingsMenuProvider>(); readonly Dictionary, ISettingsMenuItemProvider> m_SettingsMenuItemProviders = new Dictionary, ISettingsMenuItemProvider>(); @@ -44,6 +45,7 @@ internal enum MenuHideFlags // Local method use only -- created here to reduce garbage collection readonly List m_ActiveDeviceData = new List(); + readonly Collider[] m_WorkspaceOverlaps = new Collider[k_PossibleOverlaps]; public Menus() { @@ -135,15 +137,18 @@ internal void UpdateMenuVisibilities() menuHideFlags[customMenu] |= MenuHideFlags.OtherMenu; var hoveringWorkspace = false; - var rayOrigin = deviceData.rayOrigin; - var rayOriginPosition = rayOrigin.position; - foreach (var workspace in evr.GetModule().workspaces) + var menuTransform = mainMenu.menuContent.transform; + var menuBounds = mainMenu.localBounds; + var menuRotation = menuTransform.rotation; + var center = menuTransform.position + menuRotation * menuBounds.center; + Array.Clear(m_WorkspaceOverlaps, 0, m_WorkspaceOverlaps.Length); + if (Physics.OverlapBoxNonAlloc(center, menuBounds.extents, m_WorkspaceOverlaps, menuRotation) > 0) { - var workspaceTransform = workspace.transform; - var localPosition = workspaceTransform.InverseTransformPoint(rayOriginPosition); - var localPointerPosition = workspaceTransform.InverseTransformPoint(GetPointerPositionForRayOrigin(rayOrigin)); - if (workspace.outerBounds.Contains(localPosition) || workspace.outerBounds.Contains(localPointerPosition)) - hoveringWorkspace = true; + foreach (var overlap in m_WorkspaceOverlaps) + { + if (overlap && overlap.GetComponent() != null) + hoveringWorkspace = true; + } } var menus = menuHideFlags.Keys.ToList(); @@ -154,6 +159,8 @@ internal void UpdateMenuVisibilities() menuHideFlags[menu] |= MenuHideFlags.OverWorkspace; } + var rayOrigin = deviceData.rayOrigin; + var rayOriginPosition = rayOrigin.position; var heldObjects = directSelection.GetHeldObjects(rayOrigin); var hasDirectSelection = directSelection != null && heldObjects != null && heldObjects.Count > 0; if (hasDirectSelection) @@ -207,7 +214,7 @@ internal void UpdateMenuVisibilities() { var mainMenu = deviceData.mainMenu; var mainMenuHideFlags = deviceData.menuHideFlags[mainMenu]; - if (mainMenuHideFlags != 0) + if (mainMenuHideFlags != 0 && !mainMenu.hovering) { if ((mainMenuHideFlags & MenuHideFlags.Hidden) != 0) { diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 86077ffe4..0e36d4f39 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -35,6 +35,16 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Transform targetRayOrigin { set; } + /// + /// The local bounds of this menu + /// + Bounds localBounds { get; } + + /// + /// Is the UI pointer hovering over the menu? + /// + bool hovering { get; } + /// /// Send a haptic pulse indicating the menu visibility has changed /// diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index e0714ccab..688d2dead 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -42,6 +42,8 @@ abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStenc HapticPulse m_MovePulse; Bounds m_ContentBounds; + BoxCollider m_OuterCollider; + BoxCollider m_FrameCollider; Coroutine m_VisibilityCoroutine; Coroutine m_ResetSizeCoroutine; @@ -159,6 +161,11 @@ public virtual void Setup() m_WorkspaceUI.sceneContainer.transform.localPosition = Vector3.zero; + m_OuterCollider = gameObject.AddComponent(); + m_OuterCollider.isTrigger = true; + m_FrameCollider = gameObject.AddComponent(); + m_FrameCollider.isTrigger = true; + var startingBounds = m_CustomStartingBounds ?? DefaultBounds; //Do not set bounds directly, in case OnBoundsChanged requires Setup override to complete m_ContentBounds = new Bounds(Vector3.up * startingBounds.y * 0.5f, startingBounds); // If custom bounds have been set, use them as the initial bounds @@ -202,6 +209,10 @@ public void SetUIHighlightsVisible(bool value) void UpdateBounds() { m_WorkspaceUI.bounds = contentBounds; + + var outerBounds = this.outerBounds; + m_OuterCollider.size = outerBounds.size; + m_OuterCollider.center = outerBounds.center; } protected virtual void OnDestroy() @@ -281,6 +292,10 @@ IEnumerator AnimateResetSize() public virtual void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { m_WorkspaceUI.ProcessInput((WorkspaceInput)input, consumeControl); + + var frameBounds = m_WorkspaceUI.adjustedBounds; + m_FrameCollider.size = frameBounds.size; + m_FrameCollider.center = frameBounds.center; } protected void OnButtonClicked(Transform rayOrigin) diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index 17a811a9f..f4762b823 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -1056,7 +1056,7 @@ Transform: m_Children: - {fileID: 4000012169316234} m_Father: {fileID: 4000011687496624} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000011687496624 Transform: @@ -1068,12 +1068,12 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 224000013367414678} - {fileID: 4000012021209696} - {fileID: 4000012340493516} - {fileID: 4000011607955888} - {fileID: 224000012325241496} - {fileID: 224000012061990890} - - {fileID: 224000013367414678} - {fileID: 4000013817173492} m_Father: {fileID: 224000010300040132} m_RootOrder: 0 @@ -1116,7 +1116,7 @@ Transform: m_Children: - {fileID: 4000014022192516} m_Father: {fileID: 4000011687496624} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012074834286 Transform: @@ -1185,7 +1185,7 @@ Transform: m_Children: - {fileID: 4000013784733574} m_Father: {fileID: 4000011687496624} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012425375176 Transform: @@ -3195,7 +3195,7 @@ RectTransform: - {fileID: 224000011486730110} - {fileID: 224000011903391784} m_Father: {fileID: 4000011687496624} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -3254,7 +3254,7 @@ RectTransform: - {fileID: 224000012325450348} - {fileID: 224000013655961458} m_Father: {fileID: 4000011687496624} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -3389,7 +3389,7 @@ RectTransform: - {fileID: 224000011119542530} - {fileID: 224000014142508226} m_Father: {fileID: 4000011687496624} - m_RootOrder: 5 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 961339fe3..1047d9ddd 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -407,6 +407,17 @@ public Bounds bounds } } + public Bounds adjustedBounds + { + get + { + var adjustedBounds = bounds; + adjustedBounds.size += Vector3.forward * m_FrontZOffset; + adjustedBounds.center += Vector3.back * m_FrontZOffset * 0.5f; + return adjustedBounds; + } + } + void Awake() { foreach (var icon in m_ResizeIcons) @@ -668,9 +679,6 @@ public void ProcessInput(WorkspaceInput input, ConsumeControlDelegate consumeCon return; } - var adjustedBounds = bounds; - adjustedBounds.size += Vector3.forward * m_FrontZOffset; - adjustedBounds.center += Vector3.back * m_FrontZOffset * 0.5f; Transform dragRayOrigin = null; Image dragResizeIcon = null; var resizing = false; @@ -746,6 +754,7 @@ public void ProcessInput(WorkspaceInput input, ConsumeControlDelegate consumeCon iconTransform.localPosition = iconPosition; } + var adjustedBounds = this.adjustedBounds; if (!dragRayOrigin) { var leftPosition = transform.InverseTransformPoint(leftRayOrigin.position); From c6f74ef7f31b819604a2ec00589b860aa7df3a3f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 16:21:35 -0700 Subject: [PATCH 616/870] Eliminate need to control primary spatial scroll arrows; simplify state-handling further; clean up HintIcon animation timing --- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 21 ++- .../SpatialHintModule/SpatialHintModule.cs | 12 +- .../SpatialHintModule/SpatialHintModuleUI.cs | 27 +++- .../SpatialHintModule/SpatialHintUI.prefab | 126 ++++++++++++++---- 4 files changed, 143 insertions(+), 43 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index a24597d11..7940b41df 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -25,6 +25,15 @@ public class HintIcon : MonoBehaviour [SerializeField] Color m_PulseColor = Color.white; + [SerializeField] + float m_ShowDuration = 0.125f; + + [SerializeField] + float m_HideDuration = 0.25f; + + [SerializeField] + bool m_SlightlyRandomizeHideDuration = true; + readonly Vector3 k_HiddenScale = Vector3.zero; Transform m_IconTransform; @@ -80,7 +89,7 @@ IEnumerator AnimateShow() } currentDuration = 0f; - targetDuration = 0.125f; // Set animated reveal duration + targetDuration = m_ShowDuration; // Set animated reveal duration var currentColor = m_Icon.color; while (currentDuration < targetDuration) { @@ -88,7 +97,7 @@ IEnumerator AnimateShow() shapedDuration = Mathf.Pow(shapedDuration, 4); m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, m_VisibleLocalScale, shapedDuration); m_Icon.color = Color.Lerp(currentColor, m_VisibleColor, shapedDuration); - currentDuration += Time.unscaledDeltaTime * 1.5f; + currentDuration += Time.unscaledDeltaTime; yield return null; } @@ -98,13 +107,15 @@ IEnumerator AnimateShow() IEnumerator AnimateHide() { var currentDuration = 0f; - var targetDuration = Random.Range(0.125f, 0.2f); // Set an initial random wait duration + var targetDuration = m_HideDuration + (m_SlightlyRandomizeHideDuration ? 0f : Random.Range(0.125f, 0.2f)); // Set an initial random wait duration var currentLocalScale = m_IconTransform.localScale; var currentColor = m_Icon.color; while (currentDuration < targetDuration) { - m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, k_HiddenScale, currentDuration / targetDuration); - m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); + var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / targetDuration); + shapedDuration = Mathf.Pow(shapedDuration, 4); + m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, k_HiddenScale, shapedDuration); + m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration * 3); currentDuration += Time.unscaledDeltaTime; yield return null; } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index ebd34f76c..dd6c2ae71 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -35,8 +35,8 @@ public SpatialHintStateFlags state { case SpatialHintStateFlags.Hidden: Debug.LogError("SpatialHintState : Hidden"); - m_SpatialHintModuleUI.preScrollVisualsVisible = false; - m_SpatialHintModuleUI.primaryArrowsVisible = false; + //m_SpatialHintModuleUI.preScrollVisualsVisible = false; + m_SpatialHintModuleUI.preScrollArrowsVisible = false; m_SpatialHintModuleUI.secondaryArrowsVisible = false; controllingRayOrigin = null; //spatialHintPrimaryArrowsVisible = false; @@ -44,12 +44,13 @@ public SpatialHintStateFlags state break; case SpatialHintStateFlags.PreDragReveal: Debug.LogError("SpatialHintState : Pre drag reveal state"); - m_SpatialHintModuleUI.preScrollVisualsVisible = true; - m_SpatialHintModuleUI.primaryArrowsVisible = true; + //m_SpatialHintModuleUI.preScrollVisualsVisible = true; + m_SpatialHintModuleUI.preScrollArrowsVisible = true; m_SpatialHintModuleUI.secondaryArrowsVisible = true; break; case SpatialHintStateFlags.Scrolling: - m_SpatialHintModuleUI.preScrollVisualsVisible = false; + //m_SpatialHintModuleUI.preScrollVisualsVisible = false; + m_SpatialHintModuleUI.preScrollArrowsVisible = false; m_SpatialHintModuleUI.scrollVisualsVisible = true; Debug.LogError("SpatialHintState : Scrolling"); break; @@ -140,6 +141,7 @@ Vector3 spatialHintScrollVisualsRotation set { + Debug.LogError("Spatial Rotation target being set to : " + value); //if (value == Vector3.zero) //state = SpatialHintStateFlags.Hidden; // Hide the non-spatial-scrolling visuals diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 7c57158b4..272e20c73 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -50,7 +50,7 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt bool m_Visible; bool m_PreScrollVisualsVisible; - bool m_PrimaryArrowsVisible; + bool m_PreScrollArrowsVisible; bool m_SecondaryArrowsVisible; Vector3 m_ScrollVisualsRotation; Transform m_ScrollVisualsTransform; @@ -95,6 +95,7 @@ public bool visible } } + /* /// /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action /// This is only enabled before the enabling of the main select visuals @@ -120,6 +121,7 @@ public bool preScrollVisualsVisible } } } + */ public bool scrollVisualsVisible { @@ -133,13 +135,13 @@ public bool scrollVisualsVisible } } - public bool primaryArrowsVisible + public bool preScrollArrowsVisible { - get { return m_PrimaryArrowsVisible; } + get { return m_PreScrollArrowsVisible; } set { - m_PrimaryArrowsVisible = value; - if (m_PrimaryArrowsVisible) + m_PreScrollArrowsVisible = value; + if (m_PreScrollArrowsVisible) { foreach (var arrow in m_PrimaryDirectionalHintArrows) { @@ -170,6 +172,17 @@ public bool secondaryArrowsVisible } } + bool scrollArrowsVisible + { + set + { + foreach (var arrow in m_ScrollHintArrows) + { + arrow.visible = value; + } + } + } + /// /// If non-null, enable and set the world rotation of the scroll visuals /// @@ -275,7 +288,8 @@ IEnumerator ShowScrollVisuals() Debug.LogError("SHOWING SPATIAL SCROLL VISUALS : viewscale is " + this.GetViewerScale()); // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector //m_ScrollVisualsGameObject.SetActive(true); - primaryArrowsVisible = false; + scrollArrowsVisible = true; + preScrollArrowsVisible = false; secondaryArrowsVisible = false; m_ScrollVisualsTransform.localScale = Vector3.one; m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. @@ -317,6 +331,7 @@ IEnumerator HideScrollVisuals() { Debug.LogError("HIDING SPATIAL SCROLL VISUALS"); // Hide the scroll visuals + scrollArrowsVisible = false; const float kTargetDuration = 1f; var hiddenLocalScale = Vector3.zero; diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index 40fd52284..593bcc07f 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -988,7 +988,7 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1477005998831424} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} m_LocalPosition: {x: 0, y: 0, z: 0.35741758} m_LocalScale: {x: 1.0000002, y: 1.0000002, z: 1} m_Children: @@ -1072,8 +1072,8 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1278946252185714} - m_LocalRotation: {x: -0.27060428, y: -0.27060556, z: -0.0000000074505797, w: 0.9238756} - m_LocalPosition: {x: -0.05239579, y: -0.3051027, z: 0.17873496} + m_LocalRotation: {x: -0.27060425, y: -0.27060556, z: -0, w: 0.9238756} + m_LocalPosition: {x: -0.052380234, y: -0.30514538, z: 0.17879039} m_LocalScale: {x: 1.0000012, y: 1.0000001, z: 1.0000013} m_Children: - {fileID: 224935697657075864} @@ -1124,7 +1124,7 @@ Transform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4542884266341674 Transform: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1789767321393858} @@ -1468,8 +1468,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114066956829426356} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114004058444794040 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1484,8 +1487,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114817553842003248} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114006901110602492 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1529,6 +1535,9 @@ MonoBehaviour: m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114041376699156020 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1543,8 +1552,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114291859005184956} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114066956829426356 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1642,6 +1654,9 @@ MonoBehaviour: m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114201708188467934 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1656,8 +1671,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114974932015195176} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114261942396204950 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1669,7 +1687,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 3980a4724962e184695df6cbba6e11d8, type: 2} + m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 0.428} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -1728,6 +1746,9 @@ MonoBehaviour: m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114291859005184956 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1769,8 +1790,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114894859978596498} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114347973994711784 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1785,8 +1809,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114502893213131780} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114383021260469988 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1872,8 +1899,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114929323479965660} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114478667145759116 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1888,8 +1918,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114757945073081772} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114502893213131780 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1931,8 +1964,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114790131153619060} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114534977170210908 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1976,6 +2012,9 @@ MonoBehaviour: m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114549952638618038 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1990,8 +2029,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114403956001920920} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114595085207455294 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2005,9 +2047,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_HideOnInitialize: 0 m_Icon: {fileID: 114261942396204950} - m_VisibleColor: {r: 0, g: 0, b: 0, a: 0.42745098} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 1} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.5 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114602193729648712 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2022,8 +2067,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114719726697718162} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114647227679990130 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2038,8 +2086,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114006901110602492} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114650107410517210 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2083,6 +2134,9 @@ MonoBehaviour: m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114693150127021580 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2096,9 +2150,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_HideOnInitialize: 0 m_Icon: {fileID: 114878598031735610} - m_VisibleColor: {r: 0, g: 0, b: 0, a: 0.42745098} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 1} + m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} + m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.5 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114699673652902324 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2167,8 +2224,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114889128424409716} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114728711746979180 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2318,8 +2378,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114992378279027252} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114873114538619666 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2336,6 +2399,9 @@ MonoBehaviour: m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114873812632177310 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2350,8 +2416,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114439371215997622} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114878598031735610 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2363,7 +2432,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 3980a4724962e184695df6cbba6e11d8, type: 2} + m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 0.428} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -2381,7 +2450,7 @@ MonoBehaviour: m_FillOrigin: 2 --- !u!114 &114885606894613528 MonoBehaviour: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1789767321393858} @@ -2647,8 +2716,11 @@ MonoBehaviour: m_HideOnInitialize: 1 m_Icon: {fileID: 114106693815540416} m_VisibleColor: {r: 1, g: 1, b: 1, a: 1} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 0} + m_HiddenColor: {r: 0, g: 0, b: 0, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_ShowDuration: 0.125 + m_HideDuration: 0.25 + m_SlightlyRandomizeHideDuration: 1 --- !u!114 &114973295192596792 MonoBehaviour: m_ObjectHideFlags: 1 From 12ce37dde7e90d748473eb9e9a87620869dd174f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 18 Jul 2017 17:20:55 -0700 Subject: [PATCH 617/870] Adjust menu bounds by viewerScale; Change disabled visuals to grey icon; Shift pointer hue instead of saturation; Block crawling input when rotating --- Menus/MainMenu/Scripts/MainMenuUI.cs | 1 - Prefabs/UI/MainMenuActivator.prefab | 6 +- .../UI/Materials/ActivatorBaseDisabled.mat | 83 ------------------- .../Materials/ActivatorBaseDisabled.mat.meta | 8 -- .../UI/Materials/ActivatorIconDisabled.mat | 83 ------------------- .../Materials/ActivatorIconDisabled.mat.meta | 8 -- Scripts/Core/EditorVR.Menus.cs | 14 ++-- Scripts/Core/EditorVR.Rays.cs | 1 + Scripts/UI/MainMenuActivator.cs | 34 ++++---- Tools/LocomotionTool/LocomotionTool.cs | 60 +++++++------- Tools/SelectionTool/SelectionTool.cs | 26 +++--- Tools/TransformTool/TransformTool.cs | 2 +- 12 files changed, 67 insertions(+), 259 deletions(-) delete mode 100644 Prefabs/UI/Materials/ActivatorBaseDisabled.mat delete mode 100644 Prefabs/UI/Materials/ActivatorBaseDisabled.mat.meta delete mode 100644 Prefabs/UI/Materials/ActivatorIconDisabled.mat delete mode 100644 Prefabs/UI/Materials/ActivatorIconDisabled.mat.meta diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 5c4760fa4..5bfca3cb9 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -195,7 +195,6 @@ void Awake() { m_MenuFacesMaterial = MaterialUtils.GetMaterialClone(m_MenuFaceRotationOrigin.GetComponent()); m_MenuFacesColor = m_MenuFacesMaterial.color; - m_LocalBounds = ObjectUtils.GetBounds(transform); } diff --git a/Prefabs/UI/MainMenuActivator.prefab b/Prefabs/UI/MainMenuActivator.prefab index 55924215b..aeecc7b9f 100644 --- a/Prefabs/UI/MainMenuActivator.prefab +++ b/Prefabs/UI/MainMenuActivator.prefab @@ -247,10 +247,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Icon: {fileID: 23000012609994424} - m_Base: {fileID: 23000010303846554} m_HighlightedPRS: {fileID: 4000011430756646} m_HoverPulse: {fileID: 11400000, guid: d4ac399f781bc824c8c1392fb126398e, type: 2} - m_DisabledIconMaterial: {fileID: 2100000, guid: fef48755e9696f54c951b4b7ca22110e, - type: 2} - m_DisabledBaseMaterial: {fileID: 2100000, guid: 5dde6844012df164eb0b16b790991401, - type: 2} + m_DisabledColor: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 0} diff --git a/Prefabs/UI/Materials/ActivatorBaseDisabled.mat b/Prefabs/UI/Materials/ActivatorBaseDisabled.mat deleted file mode 100644 index ff2101ac5..000000000 --- a/Prefabs/UI/Materials/ActivatorBaseDisabled.mat +++ /dev/null @@ -1,83 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: ActivatorBaseDisabled - m_Shader: {fileID: 4800000, guid: b10f0b677131a2945855a113a27b7093, type: 3} - m_ShaderKeywords: _ALPHABLEND_ON _EMISSION - m_LightmapFlags: 1 - m_EnableInstancingVariants: 0 - m_CustomRenderQueue: 9499 - stringTagMap: - RenderType: Transparent - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ColorRamp: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _ColorRampOffset: 0 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 10 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 2 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 5 - - _UVSec: 0 - - _ZWrite: 0 - m_Colors: - - _Color: {r: 0.03189604, g: 0.033104777, b: 0.033104777, a: 0.5019608} - - _ColorBottom: {r: 0.41176468, g: 0.41176468, b: 0.41176468, a: 1} - - _ColorTop: {r: 0, g: 0, b: 0, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Prefabs/UI/Materials/ActivatorBaseDisabled.mat.meta b/Prefabs/UI/Materials/ActivatorBaseDisabled.mat.meta deleted file mode 100644 index 57e9ffa0b..000000000 --- a/Prefabs/UI/Materials/ActivatorBaseDisabled.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5dde6844012df164eb0b16b790991401 -timeCreated: 1472245673 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Prefabs/UI/Materials/ActivatorIconDisabled.mat b/Prefabs/UI/Materials/ActivatorIconDisabled.mat deleted file mode 100644 index bbc11e673..000000000 --- a/Prefabs/UI/Materials/ActivatorIconDisabled.mat +++ /dev/null @@ -1,83 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: ActivatorIconDisabled - m_Shader: {fileID: 4800000, guid: b10f0b677131a2945855a113a27b7093, type: 3} - m_ShaderKeywords: _ALPHABLEND_ON _EMISSION - m_LightmapFlags: 1 - m_EnableInstancingVariants: 0 - m_CustomRenderQueue: 9499 - stringTagMap: - RenderType: Transparent - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ColorRamp: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _ColorRampOffset: 0 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 10 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 2 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 5 - - _UVSec: 0 - - _ZWrite: 0 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 0.49019608} - - _ColorBottom: {r: 0.41176468, g: 0.41176468, b: 0.41176468, a: 1} - - _ColorTop: {r: 0, g: 0, b: 0, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Prefabs/UI/Materials/ActivatorIconDisabled.mat.meta b/Prefabs/UI/Materials/ActivatorIconDisabled.mat.meta deleted file mode 100644 index 475f43728..000000000 --- a/Prefabs/UI/Materials/ActivatorIconDisabled.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fef48755e9696f54c951b4b7ca22110e -timeCreated: 1472245673 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 6af2c8eaa..d286c1180 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -136,13 +136,14 @@ internal void UpdateMenuVisibilities() if (customMenuVisible && (mainMenuVisible || alternateMenuVisible)) menuHideFlags[customMenu] |= MenuHideFlags.OtherMenu; + Array.Clear(m_WorkspaceOverlaps, 0, m_WorkspaceOverlaps.Length); var hoveringWorkspace = false; var menuTransform = mainMenu.menuContent.transform; var menuBounds = mainMenu.localBounds; var menuRotation = menuTransform.rotation; - var center = menuTransform.position + menuRotation * menuBounds.center; - Array.Clear(m_WorkspaceOverlaps, 0, m_WorkspaceOverlaps.Length); - if (Physics.OverlapBoxNonAlloc(center, menuBounds.extents, m_WorkspaceOverlaps, menuRotation) > 0) + var viewerScale = Viewer.GetViewerScale(); + var center = menuTransform.position + menuRotation * menuBounds.center * viewerScale; + if (Physics.OverlapBoxNonAlloc(center, menuBounds.extents * viewerScale, m_WorkspaceOverlaps, menuRotation) > 0) { foreach (var overlap in m_WorkspaceOverlaps) { @@ -178,7 +179,7 @@ internal void UpdateMenuVisibilities() var otherRayOrigin = otherDeviceData.rayOrigin; if (directSelection.IsHovering(otherRayOrigin) || directSelection.IsScaling(otherRayOrigin) - || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * Viewer.GetViewerScale()) + || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * viewerScale) { var otherHideFlags = otherDeviceData.menuHideFlags; var otherMenus = otherHideFlags.Keys.ToList(); @@ -254,11 +255,6 @@ internal void UpdateMenuVisibilities() evr.GetModule().UpdatePlayerHandleMaps(); } - static Vector3 GetPointerPositionForRayOrigin(Transform rayOrigin) - { - return rayOrigin.position + rayOrigin.forward * DirectSelection.GetPointerLength(rayOrigin); - } - internal static bool IsValidHover(MultipleRayInputModule.RaycastSource source) { var go = source.draggedObject; diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 165cf1c1a..dc7f0bbcf 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR && UNITY_EDITORVR +using System; using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Helpers; diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index 3bf9d4ed7..25ae1102d 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -4,6 +4,7 @@ using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Modules; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.EventSystems; @@ -55,9 +56,6 @@ public bool activatorButtonMoveAway [SerializeField] Renderer m_Icon; - [SerializeField] - Renderer m_Base; - [SerializeField] Transform m_HighlightedPRS; @@ -65,10 +63,7 @@ public bool activatorButtonMoveAway HapticPulse m_HoverPulse; [SerializeField] - Material m_DisabledIconMaterial; - - [SerializeField] - Material m_DisabledBaseMaterial; + Color m_DisabledColor; Vector3 m_OriginalActivatorIconLocalScale; Vector3 m_OriginalActivatorIconLocalPosition; @@ -80,7 +75,7 @@ public bool activatorButtonMoveAway bool m_Disabled; Material m_IconMaterial; - Material m_BaseMaterial; + Color m_EnabledColor; public Transform rayOrigin { private get; set; } public Transform menuOrigin { private get; set; } @@ -95,8 +90,10 @@ public bool disabled { if (value != m_Disabled) { - m_Icon.sharedMaterial = value ? m_DisabledIconMaterial : m_IconMaterial; - m_Base.sharedMaterial = value ? m_DisabledBaseMaterial : m_BaseMaterial; + m_Icon.sharedMaterial.color = value ? m_DisabledColor : m_EnabledColor; + + if (value) + SetHighlight(false); } m_Disabled = value; @@ -105,8 +102,8 @@ public bool disabled void Awake() { - m_IconMaterial = m_Icon.sharedMaterial; - m_BaseMaterial = m_Base.sharedMaterial; + m_IconMaterial = MaterialUtils.GetMaterialClone(m_Icon); + m_EnabledColor = m_IconMaterial.color; } public void OnPointerEnter(PointerEventData eventData) @@ -114,11 +111,7 @@ public void OnPointerEnter(PointerEventData eventData) if (eventData.used || m_Disabled) return; - if (m_HighlightCoroutine != null) - StopCoroutine(m_HighlightCoroutine); - - m_HighlightCoroutine = null; - m_HighlightCoroutine = StartCoroutine(Highlight()); + SetHighlight(true); this.Pulse(node, m_HoverPulse); } @@ -127,11 +120,16 @@ public void OnPointerExit(PointerEventData eventData) if (eventData.used) return; + SetHighlight(false); + } + + void SetHighlight(bool highlighted) + { if (m_HighlightCoroutine != null) StopCoroutine(m_HighlightCoroutine); m_HighlightCoroutine = null; - m_HighlightCoroutine = StartCoroutine(Highlight(false)); + m_HighlightCoroutine = StartCoroutine(Highlight(highlighted)); } public void OnPointerClick(PointerEventData eventData) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index c04b7732c..5b04ae900 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -18,6 +18,7 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const float k_SlowMoveSpeed = 1f; const float k_RotationDamping = 0.2f; const float k_RotationThreshold = 0.75f; + const float k_DistanceThreshold = 0.02f; //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; @@ -74,7 +75,9 @@ class Preferences float m_StartYaw; bool m_Rotating; + bool m_StartCrawling; bool m_Crawling; + bool m_WasRotating; float m_CrawlStartTime; Vector3 m_ActualRayOriginStartPosition; Vector3 m_RayOriginStartPosition; @@ -242,11 +245,12 @@ bool DoFlying(ConsumeControlDelegate consumeControl) if (!m_Rotating) { m_Rotating = true; + m_WasRotating = true; m_RigStartPosition = cameraRig.position; m_RigStartRotation = cameraRig.rotation; m_RayOriginStartForward = localRayForward; - m_RayOriginStartRight = localRayRotation * (reverse ? Vector3.left : Vector3.right); + m_RayOriginStartRight = localRayRotation * (reverse ? Vector3.right : Vector3.left); m_RayOriginStartRight.y = 0; m_RayOriginStartRight.Normalize(); @@ -254,7 +258,6 @@ bool DoFlying(ConsumeControlDelegate consumeControl) m_LastRotationDiff = Quaternion.identity; } - consumeControl(m_LocomotionInput.rotate); var startOffset = m_RigStartPosition - m_CameraStartPosition; var angle = Vector3.Angle(m_RayOriginStartForward, localRayForward); @@ -269,6 +272,9 @@ bool DoFlying(ConsumeControlDelegate consumeControl) cameraRig.position = m_CameraStartPosition + segmentedRotation * startOffset; m_LastRotationDiff = filteredRotation; + + m_StartCrawling = false; + m_Crawling = false; } else { @@ -293,6 +299,9 @@ bool DoFlying(ConsumeControlDelegate consumeControl) return true; } + if (!m_LocomotionInput.rotate.isHeld) + m_WasRotating = false; + m_Rotating = false; return false; } @@ -301,41 +310,36 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) { if (!m_LocomotionInput.forward.isHeld && !m_LocomotionInput.blink.isHeld && m_LocomotionInput.crawl.isHeld) { - //consumeControl(m_LocomotionInput.crawl); - // Also consume thumbstick axes to disable radial menu - //consumeControl(m_LocomotionInput.horizontal); - //consumeControl(m_LocomotionInput.vertical); - if (!m_Crawling) + if (!m_StartCrawling && !m_WasRotating) { - m_Crawling = true; - m_RigStartPosition = cameraRig.position; - m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; + m_StartCrawling = true; m_ActualRayOriginStartPosition = m_RayOriginStartPosition; m_CrawlStartTime = Time.time; - - this.SetDefaultRayVisibility(rayOrigin, false); - this.LockRay(rayOrigin, this); } - var localRayPosition = cameraRig.position - rayOrigin.position; - var delta = m_ActualRayOriginStartPosition - localRayPosition; - if (Time.time > m_CrawlStartTime + UIUtils.DoubleClickIntervalMax || delta.magnitude > 0.015f * this.GetViewerScale()) - { - cameraRig.position = m_RigStartPosition + localRayPosition - m_RayOriginStartPosition; - } - else + var distance = Vector3.Distance(m_ActualRayOriginStartPosition, localRayPosition); + var distanceThreshold = distance > k_DistanceThreshold * this.GetViewerScale(); + var timeThreshold = Time.time > m_CrawlStartTime + UIUtils.DoubleClickIntervalMax; + if (!m_Crawling && m_StartCrawling && (timeThreshold || distanceThreshold)) { + m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; + this.SetDefaultRayVisibility(rayOrigin, false); + this.LockRay(rayOrigin, this); } + if (m_Crawling) + cameraRig.position = m_RigStartPosition + localRayPosition - m_RayOriginStartPosition; + return true; } this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); + this.SetDefaultRayVisibility(rayOrigin, true); + m_StartCrawling = false; m_Crawling = false; return false; } @@ -376,8 +380,6 @@ bool DoBlink(ConsumeControlDelegate consumeControl) bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) { - var result = false; - if (this.IsSharedUpdater(this)) { var crawl = m_LocomotionInput.crawl; @@ -433,7 +435,7 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) m_StartYaw = cameraRig.rotation.eulerAngles.y; locomotionTool.m_Scaling = true; - locomotionTool.m_Crawling = false; + locomotionTool.m_StartCrawling = false; m_ViewerScaleVisuals.leftHand = rayOrigin; m_ViewerScaleVisuals.rightHand = otherRayOrigin; @@ -441,6 +443,7 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) } m_Scaling = true; + m_StartCrawling = false; m_Crawling = false; var currentScale = Mathf.Clamp(m_StartScale * (m_StartDistance / distance), k_MinScale, k_MaxScale); @@ -507,8 +510,6 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) Shader.SetGlobalFloat(k_WorldScaleProperty, 1f / currentScale); } - - result = true; break; } } @@ -523,7 +524,7 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) } } - return result; + return m_Scaling; } void ResetViewerScale() @@ -542,14 +543,15 @@ void CancelScale() foreach (var linkedObject in linkedObjects) { var locomotionTool = (LocomotionTool)linkedObject; - locomotionTool.m_Scaling = false; - if (!locomotionTool.m_Crawling) + if (!locomotionTool.m_StartCrawling && locomotionTool.m_Scaling) { var rayOrigin = locomotionTool.rayOrigin; this.UnlockRay(rayOrigin, this); this.SetDefaultRayVisibility(rayOrigin, true); } + + locomotionTool.m_Scaling = false; } diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 9789c089b..32756e648 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -14,7 +14,7 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR ICanGrabObject, IGetManipulatorDragState, IUsesNode, IIsRayActive, IIsMainMenuVisible, IIsInMiniWorld, IRayToNode, IGetDefaultRayColor, ISetDefaultRayColor { - const float k_MultiselectSaturationDrop = 0.5f; + const float k_MultiselectHueShift = 0.5f; [SerializeField] ActionMap m_ActionMap; @@ -47,7 +47,7 @@ void Start() m_MultiselectRayColor = m_NormalRayColor; Vector3 hsv; Color.RGBToHSV(m_MultiselectRayColor, out hsv.x, out hsv.y, out hsv.z); - hsv.y -= k_MultiselectSaturationDrop; + hsv.x = Mathf.Repeat(hsv.x + k_MultiselectHueShift, 1f); m_MultiselectRayColor = Color.HSVToRGB(hsv.x, hsv.y, hsv.z); } @@ -64,25 +64,23 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var realTime = Time.realtimeSinceStartup; if (UIUtils.IsDoubleClick(realTime - m_LastMultiSelectClickTime)) { - m_MultiSelect = !m_MultiSelect; + foreach (var linkedObject in linkedObjects) + { + var selectionTool = (SelectionTool)linkedObject; + selectionTool.m_MultiSelect = !selectionTool.m_MultiSelect; + } + consumeControl(multiSelectControl); } m_LastMultiSelectClickTime = realTime; } - var multiSelect = false; - foreach (var linkedObject in linkedObjects) - { - var selectionTool = (SelectionTool)linkedObject; - multiSelect |= selectionTool.m_MultiSelect; - } - - this.SetDefaultRayColor(rayOrigin, multiSelect ? m_MultiselectRayColor : m_NormalRayColor); + this.SetDefaultRayColor(rayOrigin, m_MultiSelect ? m_MultiselectRayColor : m_NormalRayColor); if (this.IsSharedUpdater(this)) { - this.SetManipulatorsVisible(this, !multiSelect); + this.SetManipulatorsVisible(this, !m_MultiSelect); var directSelection = this.GetDirectSelection(); @@ -155,7 +153,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // Only overwrite an existing selection if it does not contain the hovered object // In the case of multi-select, only add, do not remove if (selectionTool.m_SelectionInput.select.wasJustPressed && !Selection.objects.Contains(directHoveredObject)) - this.SelectObject(directHoveredObject, directRayOrigin, multiSelect); + this.SelectObject(directHoveredObject, directRayOrigin, m_MultiSelect); GameObject lastHover; if (m_HoverGameObjects.TryGetValue(directRayOrigin, out lastHover) && lastHover != directHoveredObject) @@ -192,7 +190,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { if (m_PressedObject == hoveredObject) { - this.SelectObject(m_PressedObject, rayOrigin, multiSelect, true); + this.SelectObject(m_PressedObject, rayOrigin, m_MultiSelect, true); this.ResetDirectSelectionState(); if (m_PressedObject != null) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 8e0840726..30379c18a 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -335,7 +335,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var transformInput = transformTool.m_Input; - this.SetDefaultRayVisibility(directRayOrigin, false, true); // This will also unhighlight the object + this.SetDefaultRayVisibility(directRayOrigin, false, true); // This will also unhighlight the object this.LockRay(directRayOrigin, this); if (transformInput.select.wasJustPressed) From 0a2e7cf2a9dcfecf08389434fc582c082d9b2a95 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 18 Jul 2017 17:59:36 -0700 Subject: [PATCH 618/870] Add tooltip on controller to indicate multiselect state; Fix pop in two handed scaling; Fix issue where objects on EVR that implement ITooltip show their tooltip on every hover --- Scripts/Core/EditorVR.Rays.cs | 1 - Scripts/Modules/TooltipModule/TooltipModule.cs | 8 +++++--- Tools/LocomotionTool/LocomotionTool.cs | 5 +++-- Tools/SelectionTool/SelectionTool.cs | 18 +++++++++++++++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index dc7f0bbcf..165cf1c1a 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR && UNITY_EDITORVR -using System; using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Helpers; diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index 10ccd4ce5..1e326e465 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using System; using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Utilities; @@ -64,7 +63,7 @@ void Update() var tooltipUI = tooltipData.tooltipUI; if (!tooltipUI) { - var tooltipObject = (GameObject)Instantiate(m_TooltipPrefab, m_TooltipCanvas); + var tooltipObject = Instantiate(m_TooltipPrefab, m_TooltipCanvas); tooltipUI = tooltipObject.GetComponent(); tooltipData.tooltipUI = tooltipUI; tooltipUI.highlight.material = m_HighlightMaterial; @@ -177,6 +176,9 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa public void OnRayEntered(GameObject gameObject, RayEventData eventData) { + if (gameObject == this.gameObject) + return; + var tooltip = gameObject.GetComponent(); if (tooltip != null) ShowTooltip(tooltip); @@ -184,7 +186,7 @@ public void OnRayEntered(GameObject gameObject, RayEventData eventData) public void OnRayExited(GameObject gameObject, RayEventData eventData) { - if (gameObject) + if (gameObject && gameObject != this.gameObject) { var tooltip = gameObject.GetComponent(); if (tooltip != null) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 5b04ae900..5cda38a52 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -11,8 +11,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ISetDefaultRayVisibility, ICustomActionMap, - ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences + sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ISetDefaultRayVisibility, + ICustomActionMap, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences { const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 1f; @@ -435,6 +435,7 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) m_StartYaw = cameraRig.rotation.eulerAngles.y; locomotionTool.m_Scaling = true; + locomotionTool.m_Crawling = false; locomotionTool.m_StartCrawling = false; m_ViewerScaleVisuals.leftHand = rayOrigin; diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 32756e648..f5386033a 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -12,9 +12,11 @@ namespace UnityEditor.Experimental.EditorVR.Tools sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, ICanGrabObject, IGetManipulatorDragState, IUsesNode, IIsRayActive, IIsMainMenuVisible, IIsInMiniWorld, IRayToNode, - IGetDefaultRayColor, ISetDefaultRayColor + IGetDefaultRayColor, ISetDefaultRayColor, ITooltip, ITooltipPlacement, ISetTooltipVisibility { const float k_MultiselectHueShift = 0.5f; + static readonly Vector3 k_TooltipPosition = new Vector3(0, 0.05f, -0.03f); + static readonly Quaternion k_TooltipRotation = Quaternion.AngleAxis(90, Vector3.right); [SerializeField] ActionMap m_ActionMap; @@ -27,6 +29,7 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR Color m_NormalRayColor; Color m_MultiselectRayColor; bool m_MultiSelect; + Transform m_TooltipTarget; readonly Dictionary m_HoverGameObjects = new Dictionary(); @@ -41,6 +44,11 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR public List linkedObjects { get; set; } + public string tooltipText { get { return m_MultiSelect ? "Multi-Select Enabled" : ""; } } + public Transform tooltipTarget { get { return m_TooltipTarget; } } + public Transform tooltipSource { get { return rayOrigin; } } + public TextAlignment tooltipAlignment { get { return TextAlignment.Center; } } + void Start() { m_NormalRayColor = this.GetDefaultRayColor(rayOrigin); @@ -49,6 +57,10 @@ void Start() Color.RGBToHSV(m_MultiselectRayColor, out hsv.x, out hsv.y, out hsv.z); hsv.x = Mathf.Repeat(hsv.x + k_MultiselectHueShift, 1f); m_MultiselectRayColor = Color.HSVToRGB(hsv.x, hsv.y, hsv.z); + + m_TooltipTarget = ObjectUtils.CreateEmptyGameObject("SelectionTool Tooltip Target", rayOrigin).transform; + m_TooltipTarget.localPosition = k_TooltipPosition; + m_TooltipTarget.localRotation = k_TooltipRotation; } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -68,8 +80,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { var selectionTool = (SelectionTool)linkedObject; selectionTool.m_MultiSelect = !selectionTool.m_MultiSelect; + this.HideTooltip(selectionTool); } + if (m_MultiSelect) + this.ShowTooltip(this); + consumeControl(multiSelectControl); } From 40d58cd9fa400ff28ed60b38ea6e06a8a983d788 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 18:37:39 -0700 Subject: [PATCH 619/870] Prevent drag threshold assignment from triggering visuals when SpatialHintUI is in Hidden state --- Scripts/Modules/SpatialHintModule/SpatialHintModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index dd6c2ae71..39106a762 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -141,7 +141,7 @@ Vector3 spatialHintScrollVisualsRotation set { - Debug.LogError("Spatial Rotation target being set to : " + value); + //Debug.LogError("Spatial Rotation target being set to : " + value); //if (value == Vector3.zero) //state = SpatialHintStateFlags.Hidden; // Hide the non-spatial-scrolling visuals @@ -203,6 +203,9 @@ public void LookAt(Vector3 position) public void SetDragThresholdTriggerPosition (Vector3 position) { + if (state == SpatialHintStateFlags.Hidden || position == m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition) + return; + m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = position; } From 967ba829772c451de53a5c920ca7a1a926d4bcc2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 18:40:19 -0700 Subject: [PATCH 620/870] Set HintLine radius when performing pulse --- Menus/PinnedToolMenu/Scripts/HintLine.cs | 24 +++++++++++++++---- .../SpatialHintModule/SpatialHintUI.prefab | 3 ++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/PinnedToolMenu/Scripts/HintLine.cs index 5561efbde..c3b16ca58 100644 --- a/Menus/PinnedToolMenu/Scripts/HintLine.cs +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs @@ -2,13 +2,13 @@ using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -using UnityEngine.UI; -using Random = UnityEngine.Random; namespace UnityEditor.Experimental.EditorVR.Menus { public class HintLine : MonoBehaviour { + const string k_ShaderLineRadiusPropertyName = "_lineRadius"; + [SerializeField] bool m_HideOnInitialize = true; @@ -30,6 +30,9 @@ public class HintLine : MonoBehaviour [SerializeField] Color m_PulseColor = Color.white; + [SerializeField] + MeshRenderer m_MeshRenderer; + readonly Vector3 k_HiddenScale = Vector3.zero; Transform m_IconTransform; @@ -37,6 +40,7 @@ public class HintLine : MonoBehaviour Coroutine m_VisibilityCoroutine; Coroutine m_ScrollArrowPulseCoroutine; float m_PulseDuration; + Material m_HintLineMaterial; public float LineWidth { set { m_ScrollLineRenderer.SetWidth(value, value); } } public Vector3[] Positions { set { m_ScrollLineRenderer.SetPositions(value) ; } } @@ -77,6 +81,12 @@ void Awake() m_ScrollLineRenderer.SetVertexCount(4); m_ScrollLineRenderer.useWorldSpace = true; m_ScrollLineRenderer.SetWidth(0f, 0f); + m_HintLineMaterial = MaterialUtils.GetMaterialClone(m_MeshRenderer); + } + + void OnDestroy() + { + ObjectUtils.Destroy(m_HintLineMaterial); } /* @@ -140,24 +150,28 @@ IEnumerator AnimatePulseColor() //Debug.LogError("Pulsing color of hint arrow : " + gameObject.name); const float kTargetDuration = 1f; m_PulseDuration = 0f; + var maxShaderLineRadius = new Vector3 (0.03f, 0f, 100f); + var minShaderLineRadius = new Vector3 (0.005f, 0f, 100f); + var currentVector3ShaderLineRadius = m_HintLineMaterial.GetVector(k_ShaderLineRadiusPropertyName); var currentColor = m_ScrollLineRenderer.Colors[0]; // The line stand & end colors are the same; fetch only one of them + var currentShaderLineRadius = m_HintLineMaterial.GetFloat(k_ShaderLineRadiusPropertyName); while (m_PulseDuration < kTargetDuration) { var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(m_PulseDuration / kTargetDuration); var newColor = Color.Lerp(currentColor, m_PulseColor, shapedDuration); m_ScrollLineRenderer.SetColors(newColor, newColor); m_PulseDuration += Time.unscaledDeltaTime * 5; + m_HintLineMaterial.SetVector(k_ShaderLineRadiusPropertyName, Vector3.Lerp(currentVector3ShaderLineRadius, maxShaderLineRadius, shapedDuration)); yield return null; } - - while (m_PulseDuration > 0f) { var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(m_PulseDuration / kTargetDuration); var newColor = Color.Lerp(m_VisibleColor, m_PulseColor, shapedDuration); m_ScrollLineRenderer.SetColors(newColor, newColor); - m_PulseDuration -= Time.unscaledDeltaTime * 2; + m_PulseDuration -= Time.unscaledDeltaTime * 1.5f; + m_HintLineMaterial.SetVector(k_ShaderLineRadiusPropertyName, Vector3.Lerp(minShaderLineRadius, maxShaderLineRadius, shapedDuration)); yield return null; } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index 593bcc07f..ca77ade62 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -1143,7 +1143,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1083723035257114} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.00000005542097, y: 0, z: 0.00000005542097} + m_LocalPosition: {x: -0.000000055602868, y: 0, z: 0.000000055602868} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 224457231796985382} @@ -1831,6 +1831,7 @@ MonoBehaviour: m_VisibleColor: {r: 0, g: 0, b: 0, a: 0.42745098} m_HiddenColor: {r: 1, g: 1, b: 1, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} + m_MeshRenderer: {fileID: 23475728828767504} --- !u!114 &114403956001920920 MonoBehaviour: m_ObjectHideFlags: 1 From 84b41df6fb03b60bdc98611efc59e1bf20e15d3e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 18:41:52 -0700 Subject: [PATCH 621/870] Prevent hint target position & rotation spamming in PinnedToolsMenuUI --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 9c30958dc..cd64ddfec 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -176,6 +176,8 @@ void Update() // Follow the user's input for a short additional period of time // Update the dragTarget with the current device position, to allow for visuals to better match the expected rotation/position m_DragTarget = transform.position; + this.SetSpatialHintDragThresholdTriggerPosition(transform.position); + this.SetSpatialHintRotation(newHintContainerRotation); // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold m_SpatialDragDistance += Time.unscaledDeltaTime * 8; // Continue to increase the amount @@ -196,11 +198,13 @@ void Update() else if (m_AllButtonsVisible && m_SpatialDragDistance > 2) { //spatialHintScrollVisualsRotation = m_DragTarget; + this.SetSpatialHintDragThresholdTriggerPosition(transform.position); + this.SetSpatialHintRotation(newHintContainerRotation); this.SetSpatialHintRotationTarget(m_DragTarget); } //spatialHintScrollVisualsDragThresholdTriggerPosition = transform.position; - this.SetSpatialHintDragThresholdTriggerPosition(transform.position); + //m_SpatialHintUI.scrollVisualsRotation = Quaternion.Euler(endingDragDefinitionPosition - startingDragDefinitionPosition); /* else if (Mathf.Approximately(m_SmoothedSpatialDragDistance, 1f)) @@ -213,7 +217,7 @@ void Update() //Debug.LogError("UI" + transform.rotation); //spatialHintContentContainer.rotation = newHintContainerRotation; - this.SetSpatialHintRotation(newHintContainerRotation); + //m_SpatialHintContentContainer.position = m_HintContentWorldPosition; //Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); From f4303bc099053c0bdccd4f89cc9338243bacedd2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 18 Jul 2017 20:10:51 -0700 Subject: [PATCH 622/870] Allow for individual control of spatial scroll hint arrows; disable drag direction vector checking for now --- .../SpatialHintModule/SpatialHintModuleUI.cs | 56 ++++++++----------- .../SpatialHintModule/SpatialHintUI.prefab | 16 +++--- 2 files changed, 29 insertions(+), 43 deletions(-) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 272e20c73..548a2e9c4 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -16,20 +16,17 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt CanvasGroup m_ScrollVisualsCanvasGroup; [SerializeField] - Transform m_ScrollVisualsDragTargetArrow; + HintIcon m_ScrollVisualsDragSourceArrow; [SerializeField] - HintLine m_ScrollHintLine; + HintIcon m_ScrollVisualsDragTargetArrow; [SerializeField] - HintIcon[] m_ScrollHintArrows; + HintLine m_ScrollHintLine; [SerializeField] HapticPulse m_ScrollBarDefineHapticPulse; // Haptic pulse performed when dragging out the spatial scroll bar - //[SerializeField] - //CanvasGroup m_HintArrowsCanvasGroup; // TODO: add back in later - [Header("Primary Directional Visuals")] [SerializeField] HintIcon[] m_PrimaryDirectionalHintArrows; @@ -37,17 +34,6 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt [SerializeField] HintIcon[] m_SecondaryDirectionalHintArrows; - //[SerializeField] - //VRLineRenderer m_ScrollLineRenderer; - - /* - [SerializeField] - HintIcon[] m_PrimaryRotationalHintArrows; - - [SerializeField] - HintIcon[] m_SecondaryRotationalHintArrows; - */ - bool m_Visible; bool m_PreScrollVisualsVisible; bool m_PreScrollArrowsVisible; @@ -57,6 +43,8 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt GameObject m_ScrollVisualsGameObject; Coroutine m_ScrollVisualsVisibilityCoroutine; Coroutine m_VisibilityCoroutine; + Transform m_ScrollVisualsDragTargetArrowTransform; + Transform m_ScrollVisualsDragSourceArrowTransform; public bool visible { @@ -172,14 +160,12 @@ public bool secondaryArrowsVisible } } - bool scrollArrowsVisible + private bool scrollArrowsVisible { set { - foreach (var arrow in m_ScrollHintArrows) - { - arrow.visible = value; - } + m_ScrollVisualsDragSourceArrow.visible = value; + m_ScrollVisualsDragTargetArrow.visible = value; } } @@ -240,6 +226,9 @@ void Awake() m_ScrollVisualsGameObject = m_ScrollVisualsTransform.gameObject; m_ScrollVisualsCanvasGroup.alpha = 0f; //m_ScrollVisualsGameObject.SetActive(false); + + m_ScrollVisualsDragSourceArrowTransform = m_ScrollVisualsDragSourceArrow.transform; + m_ScrollVisualsDragTargetArrowTransform = m_ScrollVisualsDragTargetArrow.transform; } IEnumerator AnimateShow() @@ -292,15 +281,15 @@ IEnumerator ShowScrollVisuals() preScrollArrowsVisible = false; secondaryArrowsVisible = false; m_ScrollVisualsTransform.localScale = Vector3.one; - m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. + m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, Vector3.up);// CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. m_ScrollVisualsCanvasGroup.alpha = 1f; // remove - m_ScrollVisualsDragTargetArrow.localPosition = Vector3.zero; + m_ScrollVisualsDragTargetArrowTransform.localPosition = Vector3.zero; const float kTargetDuration = 1f; var currentDuration = 0f; var currentLocalScale = m_ScrollVisualsTransform.localScale; var currentAlpha = m_ScrollVisualsCanvasGroup.alpha; - var secondArrowCurrentPosition = m_ScrollVisualsDragTargetArrow.position; + var secondArrowCurrentPosition = m_ScrollVisualsDragTargetArrowTransform.position; var normalizedScrollVisualsForward = Vector3.Normalize(m_ScrollVisualsTransform.forward); while (currentDuration < kTargetDuration) @@ -309,13 +298,15 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 1f, shapedDuration); // Only validate movement in the initial direction with which the user began the drag - var movingAwayFromSource = Vector3.Dot(normalizedScrollVisualsForward, Vector3.Normalize(scrollVisualsDragThresholdTriggerPosition - secondArrowCurrentPosition)) > 0; - if (movingAwayFromSource && (scrollVisualsDragThresholdTriggerPosition - secondArrowCurrentPosition).magnitude >= (m_ScrollVisualsDragTargetArrow.position - secondArrowCurrentPosition).magnitude) - m_ScrollVisualsDragTargetArrow.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); + //var movingAwayFromSource = Vector3.Dot(normalizedScrollVisualsForward, Vector3.Normalize(scrollVisualsDragThresholdTriggerPosition - secondArrowCurrentPosition)) > 0; + //if (movingAwayFromSource && (scrollVisualsDragThresholdTriggerPosition - secondArrowCurrentPosition).magnitude >= (m_ScrollVisualsDragTargetArrow.position - secondArrowCurrentPosition).magnitude) + m_ScrollVisualsDragTargetArrowTransform.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); currentDuration += Time.unscaledDeltaTime * 2f; - var lineRendererPositions = new Vector3[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrow.position }; + m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsDragTargetArrowTransform.position - m_ScrollVisualsTransform.position); + m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsTransform.position - m_ScrollVisualsDragTargetArrowTransform.position); + var lineRendererPositions = new Vector3[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrowTransform.position }; m_ScrollHintLine.Positions = lineRendererPositions; m_ScrollHintLine.LineWidth = shapedDuration * this.GetViewerScale(); @@ -357,11 +348,8 @@ IEnumerator HideScrollVisuals() public void PulseScrollArrows() { - foreach (var arrow in m_ScrollHintArrows) - { - arrow.PulseColor(); - } - + m_ScrollVisualsDragSourceArrow.PulseColor(); + m_ScrollVisualsDragTargetArrow.PulseColor(); m_ScrollHintLine.PulseColor(); } } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index ca77ade62..35952b926 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -224,7 +224,7 @@ GameObject: - component: {fileID: 4851979343048988} - component: {fileID: 114595085207455294} m_Layer: 5 - m_Name: ScrollLeftArrow + m_Name: ScrollTargetLeftArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -533,7 +533,7 @@ GameObject: - component: {fileID: 4630278991888076} - component: {fileID: 114693150127021580} m_Layer: 5 - m_Name: ScrollRightArrow + m_Name: ScrollSourceRightArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1143,7 +1143,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1083723035257114} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0.000000055602868, y: 0, z: 0.000000055602868} + m_LocalPosition: {x: -0.00000005630136, y: 0, z: 0.00000005630136} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 224457231796985382} @@ -2461,11 +2461,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_ScrollVisualsCanvasGroup: {fileID: 225476474272170592} - m_ScrollVisualsDragTargetArrow: {fileID: 4630278991888076} + m_ScrollVisualsDragSourceArrow: {fileID: 114595085207455294} + m_ScrollVisualsDragTargetArrow: {fileID: 114693150127021580} m_ScrollHintLine: {fileID: 114383021260469988} - m_ScrollHintArrows: - - {fileID: 114693150127021580} - - {fileID: 114595085207455294} m_ScrollBarDefineHapticPulse: {fileID: 11400000, guid: ab0ad30bb9a141c44a3beea4c62c510e, type: 2} m_PrimaryDirectionalHintArrows: @@ -3041,7 +3039,7 @@ RectTransform: m_GameObject: {fileID: 1981198264515682} m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_LocalScale: {x: 3, y: 3, z: 7.719844} m_Children: [] m_Father: {fileID: 4851979343048988} m_RootOrder: 0 @@ -3221,7 +3219,7 @@ RectTransform: m_GameObject: {fileID: 1404278696444272} m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} + m_LocalScale: {x: 3, y: 3, z: 7.719844} m_Children: [] m_Father: {fileID: 4630278991888076} m_RootOrder: 0 From 411d7643056838ccb7ff95464cfaef51d9ac7be5 Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Wed, 19 Jul 2017 11:25:03 -0500 Subject: [PATCH 623/870] convert Vector3 comparisons to using a small delta instead of exact equality --- .../Extension Methods/TransformExtensionsTests.cs | 9 +++++---- .../Unit/Extension Methods/Vec3ExtensionsTests.cs | 12 ++++++++---- Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs | 4 +++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs b/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs index 43d75bc68..5f080f9df 100644 --- a/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs +++ b/Tests/Editor/Unit/Extension Methods/TransformExtensionsTests.cs @@ -8,6 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Tests.Extensions public class TransformExtensionsTests { GameObject go; + float delta = 0.00000001f; [OneTimeSetUp] public void Setup() @@ -21,11 +22,11 @@ public void TransformBounds_TranslatesLocalBoundsToWorld() var size = new Vector3(2, 2, 2); var offset = new Vector3(1, 2, 3); go.transform.position += offset; - var localBounds = new Bounds(go.transform.position, size); - var worldBounds = go.transform.TransformBounds(localBounds); + var local = new Bounds(go.transform.position, size); + var world = go.transform.TransformBounds(local); - Assert.AreEqual(localBounds.center, worldBounds.center - offset); - Assert.AreEqual(localBounds.extents, worldBounds.extents); + Assert.That(local.center, Is.EqualTo(world.center - offset).Within(delta)); + Assert.That(local.extents, Is.EqualTo(world.extents).Within(delta)); } } } diff --git a/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs b/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs index ae3d994c0..ce1b2884a 100644 --- a/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs +++ b/Tests/Editor/Unit/Extension Methods/Vec3ExtensionsTests.cs @@ -7,6 +7,8 @@ namespace UnityEditor.Experimental.EditorVR.Tests.Extensions { public class Vec3ExtensionsTests { + float delta = 0.00000001f; + [Test] public void MaxComponent_ReturnsMaxAxisValue() { @@ -22,23 +24,25 @@ public void MaxComponent_ReturnsMaxAxisValue() public void AveragedComponents() { var vec3 = new Vector3(4f, 2f, 6f); - Assert.AreEqual(vec3.AveragedComponents(), 4f); + Assert.That(vec3.AveragedComponents(), Is.EqualTo(4f).Within(delta)); vec3 = new Vector3(-4f, 0f, 1f); - Assert.AreEqual(vec3.AveragedComponents(), -1f); + Assert.That(vec3.AveragedComponents(), Is.EqualTo(-1f).Within(delta)); } [Test] public void Inverse_PositiveValues() { var vec3 = new Vector3(2f, 4f, 10f); - Assert.AreEqual(new Vector3(.5f, .25f, .1f), vec3.Inverse()); + var expected = new Vector3(.5f, .25f, .1f); + Assert.That(vec3.Inverse(), Is.EqualTo(expected).Within(delta)); } [Test] public void Inverse_NegativeValues() { var vec3 = new Vector3(-10f, -4f, -2f); - Assert.AreEqual(new Vector3(-.1f, -.25f, -.5f), vec3.Inverse()); + var expected = new Vector3(-.1f, -.25f, -.5f); + Assert.That(vec3.Inverse(), Is.EqualTo(expected).Within(delta)); } } diff --git a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs index 38f757450..9530de710 100644 --- a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs +++ b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs @@ -11,6 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Tests.Utilities public class ObjectUtilsTests { GameObject go, parent, other; + float delta = 0.00000001f; [SetUp] public void BeforeEach() @@ -142,7 +143,8 @@ public void GetBounds_Array() var bounds = ObjectUtils.GetBounds(transforms); Bounds expected = new Bounds(new Vector3(-1.5f, 2f, 6f), new Vector3(7f, 8f, 4f)); - Assert.AreEqual(expected, bounds); + + Assert.That(bounds, Is.EqualTo(expected).Within(delta)); } [TearDown] From d1d448cccddcc9bdb4c675a7efff3d8e8dcc04db Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Wed, 19 Jul 2017 11:40:21 -0500 Subject: [PATCH 624/870] convert Color comparison to 'assert with tolerance' pattern --- Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs b/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs index 5c45d05c0..6d7481396 100644 --- a/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs +++ b/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs @@ -1,7 +1,6 @@ using UnityEngine; using UnityEngine.UI; using NUnit.Framework; -using System; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEditor.Experimental.EditorVR.Tests.TestHelpers; @@ -46,10 +45,11 @@ public void GetMaterialClone_ClonesGraphicMaterial() // creating them based on the float coming from this results in mismatches due to rounding private void AssertColorsEqual(Color expected, Color actual) { - Assert.AreEqual(Math.Round(expected.r, 3), Math.Round(actual.r, 3)); - Assert.AreEqual(Math.Round(expected.g, 3), Math.Round(actual.g, 3)); - Assert.AreEqual(Math.Round(expected.b, 3), Math.Round(actual.b, 3)); - Assert.AreEqual(Math.Round(expected.a, 3), Math.Round(actual.a, 3)); + float tolerance = 0.334f; + Assert.That(actual.r, Is.EqualTo(expected.r).Within(tolerance)); + Assert.That(actual.g, Is.EqualTo(expected.g).Within(tolerance)); + Assert.That(actual.b, Is.EqualTo(expected.b).Within(tolerance)); + Assert.That(actual.a, Is.EqualTo(expected.a).Within(tolerance)); } [TestCase("#000000", 0f, 0f, 0f, 1f)] // rgb: 0, 0, 0 @@ -58,9 +58,7 @@ private void AssertColorsEqual(Color expected, Color actual) [TestCase("#FFFFFF", 1f, 1f, 1f, 1f)] // rgb: 255,255,255 public void HextoColor_DoesValidConversion(string hex, float r, float g, float b, float a) { - Color expected = new Color(r, g, b, a); - Color output = MaterialUtils.HexToColor(hex); - AssertColorsEqual(expected, output); + AssertColorsEqual(new Color(r, g, b, a), MaterialUtils.HexToColor(hex)); } [TearDown] From ce2050a935c2fd84e774b5c7979abf3714270142 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 19 Jul 2017 11:22:44 -0700 Subject: [PATCH 625/870] Try priority based locking with SortedList. SortedList won't work because I want multiple elements with the same value of TKey --- Scripts/Core/EditorVR.MiniWorlds.cs | 6 +- Scripts/Core/EditorVR.Rays.cs | 14 ++--- .../ISetDefaultRayVisibility.cs | 7 ++- .../FunctionalityInjection/IUsesRayLocking.cs | 7 ++- Scripts/Modules/KeyboardModule.cs | 6 +- Scripts/Proxies/DefaultProxyRay.cs | 59 ++++++++++++------- .../CreatePrimitiveTool.cs | 6 +- Tools/LocomotionTool/LocomotionTool.cs | 16 ++--- .../MoveWorkspacesTool/MoveWorkspacesTool.cs | 4 +- Tools/TransformTool/TransformTool.cs | 6 +- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 4 +- 11 files changed, 77 insertions(+), 58 deletions(-) diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index c76c8ff16..d51b3b65f 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -476,14 +476,14 @@ internal void UpdateMiniWorlds() if (isContained && !wasContained) { - Rays.SetDefaultRayVisibility(rayOrigin, false, true); Rays.LockRay(rayOrigin, this); + Rays.SetDefaultRayVisibility(rayOrigin, this, false, true); } if (!isContained && wasContained) { + Rays.SetDefaultRayVisibility(rayOrigin, this, true, true); Rays.UnlockRay(rayOrigin, this); - Rays.SetDefaultRayVisibility(rayOrigin, true, true); } m_RayWasContained[rayOrigin] = isContained; @@ -593,8 +593,8 @@ void OnObjectsDropped(Transform rayOrigin, Transform[] grabbedObjects) if (!miniWorldRay.isContained) { + Rays.SetDefaultRayVisibility(rayOrigin, this, true, true); Rays.UnlockRay(rayOrigin, this); - Rays.SetDefaultRayVisibility(rayOrigin, true, true); } } } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 165cf1c1a..98aab66c8 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -111,13 +111,13 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig var customMenu = deviceData.customMenu; if (mainMenu.visible || (customMenu != null && customMenu.visible)) { - SetDefaultRayVisibility(rayOrigin, false); LockRay(rayOrigin, mainMenu); + SetDefaultRayVisibility(rayOrigin, mainMenu, false); } else { + SetDefaultRayVisibility(rayOrigin, mainMenu, true); UnlockRay(rayOrigin, mainMenu); - SetDefaultRayVisibility(rayOrigin, true); } } @@ -410,7 +410,7 @@ internal static bool IsRayActive(Transform rayOrigin) return dpr == null || dpr.rayVisible; } - internal static void SetDefaultRayVisibility(Transform rayOrigin, bool visible, bool rayOnly = false) + internal static void SetDefaultRayVisibility(Transform rayOrigin, object caller, bool visible, bool rayOnly = false) { if (rayOrigin) { @@ -418,17 +418,17 @@ internal static void SetDefaultRayVisibility(Transform rayOrigin, bool visible, if (dpr) { if (visible) - dpr.Show(rayOnly); + dpr.Show(caller, rayOnly); else - dpr.Hide(rayOnly); + dpr.Hide(caller, rayOnly); } } } - internal static bool LockRay(Transform rayOrigin, object obj) + internal static bool LockRay(Transform rayOrigin, object obj, int priority = 0) { var dpr = rayOrigin.GetComponentInChildren(); - return dpr && dpr.LockRay(obj); + return dpr && dpr.LockRay(obj, priority); } internal static bool UnlockRay(Transform rayOrigin, object obj) diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs index 50476b279..c98e3d78e 100644 --- a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs +++ b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs @@ -12,7 +12,7 @@ public interface ISetDefaultRayVisibility : IUsesRayLocking public static class ISetDefaultRayVisibilityMethods { - internal delegate void DefaultRayVisibilityDelegate(Transform rayOrigin, bool visible, bool rayOnly = false); + internal delegate void DefaultRayVisibilityDelegate(Transform rayOrigin, object caller, bool visible, bool rayOnly = false); internal static DefaultRayVisibilityDelegate setDefaultRayVisibility { get; set; } @@ -20,11 +20,12 @@ public static class ISetDefaultRayVisibilityMethods /// Show the default proxy ray/cone /// /// The ray to hide or show + /// The object which has locked the ray /// Show or hide /// An optional parameter to hide or show only the ray and not the cone - public static void SetDefaultRayVisibility(this ISetDefaultRayVisibility customRay, Transform rayOrigin, bool visible, bool rayOnly = false) + public static void SetDefaultRayVisibility(this ISetDefaultRayVisibility customRay, Transform rayOrigin, object caller, bool visible, bool rayOnly = false) { - setDefaultRayVisibility(rayOrigin, visible, rayOnly); + setDefaultRayVisibility(rayOrigin, caller, visible, rayOnly); } } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs index 371db8c2f..15e075d85 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs @@ -13,17 +13,18 @@ public interface IUsesRayLocking public static class IUsesRayLockingMethods { - internal delegate bool RayLockingDelegate(Transform rayOrigin, object obj); + internal delegate bool RayLockingDelegate(Transform rayOrigin, object obj, int priority = 0); internal static RayLockingDelegate lockRay { get; set; } - internal static RayLockingDelegate unlockRay { get; set; } + internal static Func unlockRay { get; set; } /// /// Lock the default ray's show/hide state. /// /// The ray to lock /// The object performing the lock is passed in and must be used for unlocking - public static void LockRay(this IUsesRayLocking customRay, Transform rayOrigin, object obj) + /// The priority used for locking (higher is more important) + public static void LockRay(this IUsesRayLocking customRay, Transform rayOrigin, object obj, int priority = 0) { lockRay(rayOrigin, obj); } diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index a2604db44..7d0289a1c 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -97,10 +97,12 @@ public void UpdateKeyboardMallets() if (mallet.visible != malletVisible) { mallet.visible = malletVisible; - this.SetDefaultRayVisibility(rayOrigin, !malletVisible); if (malletVisible) this.LockRay(rayOrigin, this); - else + + this.SetDefaultRayVisibility(rayOrigin, this, !malletVisible); + + if (!malletVisible) this.UnlockRay(rayOrigin, this); } diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 6e8b2f5c1..79e0334d7 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -1,28 +1,34 @@ #if UNITY_EDITOR -using System; using System.Collections; -using UnityEngine; +using System.Collections.Generic; +using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Proxies { sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale { + //class LockObject + //{ + // public object lockObject; + // public int priority; + //} [SerializeField] - private VRLineRenderer m_LineRenderer; + VRLineRenderer m_LineRenderer; [SerializeField] - private GameObject m_Tip; + GameObject m_Tip; [SerializeField] - private float m_LineWidth; + float m_LineWidth; [SerializeField] - private MeshFilter m_Cone; + MeshFilter m_Cone; - private Vector3 m_TipStartScale; + Vector3 m_TipStartScale; Transform m_ConeTransform; Vector3 m_OriginalConeLocalScale; Coroutine m_RayVisibilityCoroutine; @@ -36,33 +42,42 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale /// As long as this reference is set, and the ray is locked, only that object can unlock the ray. /// If the object reference becomes null, the ray will be free to show/hide/lock/unlock until another locking entity takes ownership. /// - private object m_LockRayObject; - - public bool LockRay(object lockCaller) + readonly SortedList m_LockRayObjects = new SortedList(); + public bool LockRay(object lockCaller, int priority = 0) { // Allow the caller to lock the ray // If the reference to the lockCaller is destroyed, and the ray was not properly // unlocked by the original locking caller, then allow locking by another object - if (m_LockRayObject == null) + if (!m_LockRayObjects.ContainsValue(lockCaller)) + m_LockRayObjects.Add(priority, lockCaller); + + return HasLock(lockCaller); + } + + public bool UnlockRay(object caller) + { + var index = m_LockRayObjects.IndexOfValue(caller); + if (index >= 0) { - m_LockRayObject = lockCaller; + m_LockRayObjects.RemoveAt(index); return true; } return false; } - public bool UnlockRay(object unlockCaller) + bool HasLock(object caller) { - // Only allow unlocking if the original lock caller is null or there is no locker caller set - if (m_LockRayObject == unlockCaller) - { - m_LockRayObject = null; + if (m_LockRayObjects.Count == 0) return true; + + while (m_LockRayObjects.Count > 0 && m_LockRayObjects.Last().Value == null) + { + m_LockRayObjects.RemoveAt(m_LockRayObjects.Count - 1); } - return false; + return m_LockRayObjects.Last().Value == caller; } /// @@ -89,9 +104,9 @@ void OnDisable() this.StopCoroutine(ref m_ConeVisibilityCoroutine); } - public void Hide(bool rayOnly = false) + public void Hide(object caller, bool rayOnly = false) { - if (isActiveAndEnabled && m_LockRayObject == null) + if (isActiveAndEnabled && HasLock(caller)) { if (rayVisible) { @@ -109,9 +124,9 @@ public void Hide(bool rayOnly = false) } } - public void Show(bool rayOnly = false) + public void Show(object caller, bool rayOnly = false) { - if (isActiveAndEnabled && m_LockRayObject == null) + if (isActiveAndEnabled && HasLock(caller)) { if (!rayVisible) { diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index c0bd155f6..7b9992686 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -78,11 +78,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_State == PrimitiveCreationStates.StartPoint && this.IsHoveringOverUI(rayOrigin)) { this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true, true); + this.SetDefaultRayVisibility(rayOrigin, this, true, true); } else { - this.SetDefaultRayVisibility(rayOrigin, false, true); + this.SetDefaultRayVisibility(rayOrigin, this, false, true); this.LockRay(rayOrigin, this); } } @@ -170,8 +170,8 @@ void OnDestroy() if (rayOrigin == null) return; + this.SetDefaultRayVisibility(rayOrigin, this, true, true); this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true, true); } } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 5cda38a52..c6a05f344 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -187,7 +187,7 @@ void OnDisable() void OnDestroy() { - this.SetDefaultRayVisibility(rayOrigin, true); + this.SetDefaultRayVisibility(rayOrigin, this, true); if (m_ViewerScaleVisuals) ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); @@ -326,8 +326,8 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, this, false); } if (m_Crawling) @@ -336,8 +336,8 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) return true; } + this.SetDefaultRayVisibility(rayOrigin, this, true); this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); m_StartCrawling = false; m_Crawling = false; @@ -349,8 +349,8 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, this, false); m_BlinkVisuals.ShowVisuals(); @@ -360,8 +360,8 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_State == State.Aiming && m_LocomotionInput.blink.wasJustReleased) { + this.SetDefaultRayVisibility(rayOrigin, this, true); this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); if (!m_BlinkVisuals.outOfMaxRange) { @@ -413,10 +413,10 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); - this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(otherRayOrigin, false); + this.SetDefaultRayVisibility(rayOrigin, this, false); this.LockRay(otherRayOrigin, this); + this.SetDefaultRayVisibility(otherRayOrigin, this, false); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; @@ -548,8 +548,8 @@ void CancelScale() if (!locomotionTool.m_StartCrawling && locomotionTool.m_Scaling) { var rayOrigin = locomotionTool.rayOrigin; + this.SetDefaultRayVisibility(rayOrigin, this, true); this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); } locomotionTool.m_Scaling = false; diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index d62a40e8a..13703857b 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -158,8 +158,8 @@ void StartMove() m_State = State.MoveWorkspaces; - this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, this, false); foreach (var ws in allWorkspaces) { @@ -193,8 +193,8 @@ void EndMove() { m_State = State.WaitingForInput; + this.SetDefaultRayVisibility(rayOrigin, this, true); this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); foreach (var ws in allWorkspaces) { diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 30379c18a..eb2a2c779 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -335,8 +335,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var transformInput = transformTool.m_Input; - this.SetDefaultRayVisibility(directRayOrigin, false, true); // This will also unhighlight the object this.LockRay(directRayOrigin, this); + this.SetDefaultRayVisibility(directRayOrigin, this, false, true); // This will also unhighlight the object if (transformInput.select.wasJustPressed) { @@ -477,8 +477,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var rayOrigin = transformTool.rayOrigin; if (!(m_Scaling || directSelection.ContainsKey(rayOrigin) || m_GrabData.ContainsKey(transformTool.node.Value))) { + this.SetDefaultRayVisibility(rayOrigin, this, true, true); this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true, true); } } } @@ -581,8 +581,8 @@ public void DropHeldObjects(Node node) m_GrabData.Remove(node); + this.SetDefaultRayVisibility(grabData.rayOrigin, this, true, true); this.UnlockRay(grabData.rayOrigin, this); - this.SetDefaultRayVisibility(grabData.rayOrigin, true, true); this.ClearSnappingState(rayOrigin); } diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index d32e17656..89391cbc5 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -298,8 +298,8 @@ protected override void OnDragStarted(BaseHandle handle, HandleEventData eventDa base.OnDragStarted(handle, eventData); var rayOrigin = eventData.rayOrigin; - this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, this, false); var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); @@ -349,8 +349,8 @@ protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData var gridItem = m_DragObject.GetComponent(); var rayOrigin = eventData.rayOrigin; + this.SetDefaultRayVisibility(rayOrigin, this, true); this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); if (!this.IsOverShoulder(eventData.rayOrigin)) { From f7aea09814dcc47048d72c6cb160bd6f3f097102 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 19 Jul 2017 14:11:27 -0700 Subject: [PATCH 626/870] Split tester and visuals into separate objects; Try using delay to set ray/cone visibility --- Prefabs/DefaultProxyRay.prefab | 83 ++++++--- Scripts/Core/EditorVR.MiniWorlds.cs | 3 - Scripts/Core/EditorVR.Rays.cs | 26 +-- .../ISetDefaultRayVisibility.cs | 11 +- .../FunctionalityInjection/IUsesRayLocking.cs | 4 +- .../IntersectionModule/IntersectionTester.cs | 25 ++- Scripts/Modules/KeyboardModule.cs | 2 +- Scripts/Proxies/DefaultProxyRay.cs | 163 ++++++++++++------ Tools/LocomotionTool/LocomotionTool.cs | 18 +- .../MoveWorkspacesTool/MoveWorkspacesTool.cs | 4 +- Tools/TransformTool/TransformTool.cs | 4 +- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 4 +- 12 files changed, 210 insertions(+), 137 deletions(-) diff --git a/Prefabs/DefaultProxyRay.prefab b/Prefabs/DefaultProxyRay.prefab index 72e60d5d0..bfcb37129 100644 --- a/Prefabs/DefaultProxyRay.prefab +++ b/Prefabs/DefaultProxyRay.prefab @@ -19,8 +19,6 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000010180546296} - - component: {fileID: 23000011735347024} - - component: {fileID: 33000010516254212} - component: {fileID: 114000011242546424} m_Layer: 0 m_Name: Cone @@ -155,6 +153,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1710442353883546 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4383798261414802} + - component: {fileID: 33334494943464630} + - component: {fileID: 23785330087816092} + m_Layer: 0 + m_Name: Visuals + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4000010180546296 Transform: m_ObjectHideFlags: 1 @@ -165,6 +180,7 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.23306262, y: 0.23306271, z: 0.7565495} m_Children: + - {fileID: 4383798261414802} - {fileID: 4000012406520210} - {fileID: 4000014067871910} - {fileID: 4000011675168902} @@ -184,7 +200,7 @@ Transform: m_LocalScale: {x: 1, y: 1.0000011, z: 1.000001} m_Children: [] m_Father: {fileID: 4000010180546296} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 90, y: 90, z: 90} --- !u!4 &4000011852083516 Transform: @@ -193,7 +209,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011746881238} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.536, z: 1.438} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4000014099484278} @@ -213,7 +229,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4000010180546296} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012435676692 Transform: @@ -239,7 +255,7 @@ Transform: m_LocalScale: {x: 1.0000001, y: 1.0000012, z: 1.000001} m_Children: [] m_Father: {fileID: 4000010180546296} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 180, y: 90, z: 90} --- !u!4 &4000013624557752 Transform: @@ -252,7 +268,7 @@ Transform: m_LocalScale: {x: 1.0000002, y: 1.0000012, z: 1.000001} m_Children: [] m_Father: {fileID: 4000010180546296} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 270, y: 90, z: 90} --- !u!4 &4000014067871910 Transform: @@ -265,7 +281,7 @@ Transform: m_LocalScale: {x: 1, y: 1.0000001, z: 1.0000001} m_Children: [] m_Father: {fileID: 4000010180546296} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 90} --- !u!4 &4000014099484278 Transform: @@ -280,12 +296,25 @@ Transform: m_Father: {fileID: 4000011852083516} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23000011735347024 +--- !u!4 &4383798261414802 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1710442353883546} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000010180546296} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23000012336601264 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010368043762} + m_GameObject: {fileID: 1000012922463866} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -293,7 +322,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 414bf0b08e4c4fe469729b12c1c9949f, type: 2} + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -301,7 +330,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 - m_PreserveUVs: 0 + m_PreserveUVs: 1 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_SelectedEditorRenderState: 3 @@ -312,12 +341,12 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000012336601264 +--- !u!23 &23000013472560402 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012922463866} + m_GameObject: {fileID: 1000012538428404} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -325,7 +354,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 2100000, guid: 4e4f62804e6ac65489a5f4ecca81bbe9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -333,7 +362,7 @@ MeshRenderer: m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 - m_PreserveUVs: 1 + m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_SelectedEditorRenderState: 3 @@ -344,12 +373,12 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000013472560402 +--- !u!23 &23785330087816092 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012538428404} + m_GameObject: {fileID: 1710442353883546} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -357,7 +386,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 4e4f62804e6ac65489a5f4ecca81bbe9, type: 2} + - {fileID: 2100000, guid: 414bf0b08e4c4fe469729b12c1c9949f, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -376,13 +405,6 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!33 &33000010516254212 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010368043762} - m_Mesh: {fileID: 4300000, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} --- !u!33 &33000011528900180 MeshFilter: m_ObjectHideFlags: 1 @@ -397,6 +419,13 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012538428404} m_Mesh: {fileID: 0} +--- !u!33 &33334494943464630 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1710442353883546} + m_Mesh: {fileID: 4300000, guid: cdace0cf368873c4796b9f9ade156c53, type: 3} --- !u!114 &114000010564953552 MonoBehaviour: m_ObjectHideFlags: 1 @@ -411,7 +440,7 @@ MonoBehaviour: m_LineRenderer: {fileID: 114000010982492852} m_Tip: {fileID: 1000012922463866} m_LineWidth: 0.02 - m_Cone: {fileID: 33000010516254212} + m_Cone: {fileID: 33334494943464630} --- !u!114 &114000010982492852 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index d51b3b65f..f8a366f0f 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -475,10 +475,7 @@ internal void UpdateMiniWorlds() } if (isContained && !wasContained) - { - Rays.LockRay(rayOrigin, this); Rays.SetDefaultRayVisibility(rayOrigin, this, false, true); - } if (!isContained && wasContained) { diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 98aab66c8..e0f6267c2 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -40,7 +40,6 @@ public Rays() ISetDefaultRayColorMethods.setDefaultRayColor = SetDefaultRayColor; IGetDefaultRayColorMethods.getDefaultRayColor = GetDefaultRayColor; - IUsesRayLockingMethods.lockRay = LockRay; IUsesRayLockingMethods.unlockRay = UnlockRay; IForEachRayOriginMethods.forEachRayOrigin = ForEachRayOrigin; @@ -111,12 +110,11 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig var customMenu = deviceData.customMenu; if (mainMenu.visible || (customMenu != null && customMenu.visible)) { - LockRay(rayOrigin, mainMenu); - SetDefaultRayVisibility(rayOrigin, mainMenu, false); + SetDefaultRayVisibility(rayOrigin, mainMenu, false, false); } else { - SetDefaultRayVisibility(rayOrigin, mainMenu, true); + SetDefaultRayVisibility(rayOrigin, mainMenu, true, true); UnlockRay(rayOrigin, mainMenu); } } @@ -410,31 +408,21 @@ internal static bool IsRayActive(Transform rayOrigin) return dpr == null || dpr.rayVisible; } - internal static void SetDefaultRayVisibility(Transform rayOrigin, object caller, bool visible, bool rayOnly = false) + internal static void SetDefaultRayVisibility(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) { if (rayOrigin) { var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - { - if (visible) - dpr.Show(caller, rayOnly); - else - dpr.Hide(caller, rayOnly); - } + dpr.SetVisibility(caller, rayVisible, coneVisible, priority); } } - internal static bool LockRay(Transform rayOrigin, object obj, int priority = 0) - { - var dpr = rayOrigin.GetComponentInChildren(); - return dpr && dpr.LockRay(obj, priority); - } - - internal static bool UnlockRay(Transform rayOrigin, object obj) + internal static void UnlockRay(Transform rayOrigin, object obj) { var dpr = rayOrigin.GetComponentInChildren(); - return dpr && dpr.UnlockRay(obj); + if (dpr) + dpr.UnlockRay(obj); } internal void PreProcessRaycastSource(Transform rayOrigin) diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs index c98e3d78e..9170cf4de 100644 --- a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs +++ b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs @@ -12,7 +12,7 @@ public interface ISetDefaultRayVisibility : IUsesRayLocking public static class ISetDefaultRayVisibilityMethods { - internal delegate void DefaultRayVisibilityDelegate(Transform rayOrigin, object caller, bool visible, bool rayOnly = false); + internal delegate void DefaultRayVisibilityDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); internal static DefaultRayVisibilityDelegate setDefaultRayVisibility { get; set; } @@ -21,11 +21,12 @@ public static class ISetDefaultRayVisibilityMethods /// /// The ray to hide or show /// The object which has locked the ray - /// Show or hide - /// An optional parameter to hide or show only the ray and not the cone - public static void SetDefaultRayVisibility(this ISetDefaultRayVisibility customRay, Transform rayOrigin, object caller, bool visible, bool rayOnly = false) + /// Show or hide + /// An optional parameter to hide or show only the ray and not the cone + /// The priority level of this request + public static void SetDefaultRayVisibility(this ISetDefaultRayVisibility customRay, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) { - setDefaultRayVisibility(rayOrigin, caller, visible, rayOnly); + setDefaultRayVisibility(rayOrigin, caller, rayVisible, coneVisible, priority); } } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs index 15e075d85..8dba0c662 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs @@ -16,7 +16,7 @@ public static class IUsesRayLockingMethods internal delegate bool RayLockingDelegate(Transform rayOrigin, object obj, int priority = 0); internal static RayLockingDelegate lockRay { get; set; } - internal static Func unlockRay { get; set; } + internal static Action unlockRay { get; set; } /// /// Lock the default ray's show/hide state. @@ -26,7 +26,7 @@ public static class IUsesRayLockingMethods /// The priority used for locking (higher is more important) public static void LockRay(this IUsesRayLocking customRay, Transform rayOrigin, object obj, int priority = 0) { - lockRay(rayOrigin, obj); + //lockRay(rayOrigin, obj); } /// diff --git a/Scripts/Modules/IntersectionModule/IntersectionTester.cs b/Scripts/Modules/IntersectionModule/IntersectionTester.cs index 4afd5e81e..aef664d07 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionTester.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionTester.cs @@ -6,17 +6,22 @@ namespace UnityEditor.Experimental.EditorVR.Modules sealed class IntersectionTester : MonoBehaviour { [SerializeField] - private Transform[] m_RayTransforms; + Transform[] m_RayTransforms; [SerializeField] - private bool m_ShowRays = false; + bool m_ShowRays; + + bool m_Active = true; + Ray[] m_Rays; + int[] m_Triangles; + Vector3[] m_Vertices; + Renderer m_Renderer; public bool active { get { return m_Active && gameObject.activeInHierarchy; } set { m_Active = value; } } - private bool m_Active = true; public Ray[] rays { @@ -35,7 +40,6 @@ public Ray[] rays return m_Rays; } } - private Ray[] m_Rays; public int[] triangles { @@ -43,7 +47,7 @@ public int[] triangles { if (m_Triangles == null) { - var mf = GetComponent(); + var mf = GetComponentInChildren(); var mesh = mf.sharedMesh; m_Triangles = mesh.triangles; } @@ -51,7 +55,6 @@ public int[] triangles return m_Triangles; } } - private int[] m_Triangles; public Vector3[] vertices { @@ -59,7 +62,7 @@ public Vector3[] vertices { if (m_Vertices == null) { - var mf = GetComponent(); + var mf = GetComponentInChildren(); var mesh = mf.sharedMesh; m_Vertices = mesh.vertices; } @@ -67,7 +70,6 @@ public Vector3[] vertices return m_Vertices; } } - private Vector3[] m_Vertices; #if !UNITY_EDITOR #pragma warning disable 109 @@ -77,15 +79,12 @@ public Vector3[] vertices get { if (!m_Renderer) - m_Renderer = GetComponent(); + m_Renderer = GetComponentInChildren(); return m_Renderer; } } - private Renderer m_Renderer; - - public Renderer grabbedObject { get; set; } - private void OnDrawGizmos() + void OnDrawGizmos() { if (m_ShowRays) { diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index 7d0289a1c..50b8e830c 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -100,7 +100,7 @@ public void UpdateKeyboardMallets() if (malletVisible) this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, !malletVisible); + this.SetDefaultRayVisibility(rayOrigin, this, !malletVisible, !malletVisible); if (!malletVisible) this.UnlockRay(rayOrigin, this); diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 79e0334d7..c649d7f75 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -11,11 +11,14 @@ namespace UnityEditor.Experimental.EditorVR.Proxies { sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale { - //class LockObject - //{ - // public object lockObject; - // public int priority; - //} + const float k_SetVisibilityDelay = 0.125f; + + class LockObject + { + public object lockObject; + public int priority; + } + [SerializeField] VRLineRenderer m_LineRenderer; @@ -37,47 +40,85 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale IntersectionTester m_Tester; float m_LastPointerLength; + float m_SetVisibilityTime = Mathf.Infinity; + bool m_SetRayVisibile; + bool m_SetConeVisibile; + /// /// The object that is set when LockRay is called while the ray is unlocked. /// As long as this reference is set, and the ray is locked, only that object can unlock the ray. /// If the object reference becomes null, the ray will be free to show/hide/lock/unlock until another locking entity takes ownership. /// - readonly SortedList m_LockRayObjects = new SortedList(); + readonly List m_Locks = new List(); + readonly HashSet m_LockCallers = new HashSet(); - public bool LockRay(object lockCaller, int priority = 0) + void LockRay(object caller, int priority = 0) { - // Allow the caller to lock the ray - // If the reference to the lockCaller is destroyed, and the ray was not properly - // unlocked by the original locking caller, then allow locking by another object - if (!m_LockRayObjects.ContainsValue(lockCaller)) - m_LockRayObjects.Add(priority, lockCaller); + if (m_LockCallers.Add(caller)) + { + var maxPriority = 0; + var firstIndex = -1; + var count = m_Locks.Count; + for (var i = 0; i < count; i++) + { + var lockObject = m_Locks[i]; + var lockObjectPriority = lockObject.priority; + if (lockObjectPriority >= maxPriority) + maxPriority = lockObjectPriority; - return HasLock(lockCaller); - } + if (firstIndex < 0 && lockObjectPriority >= priority) + firstIndex = i; + } - public bool UnlockRay(object caller) - { - var index = m_LockRayObjects.IndexOfValue(caller); - if (index >= 0) + var newLock = new LockObject { lockObject = caller, priority = priority }; + if (priority > maxPriority || firstIndex == -1) + m_Locks.Add(newLock); + else + m_Locks.Insert(firstIndex, newLock); + } + else { - m_LockRayObjects.RemoveAt(index); - return true; + var previousLock = m_Locks.FirstOrDefault(lockObject => lockObject.lockObject == caller); + if (previousLock.priority != priority) + { + m_LockCallers.Remove(caller); + m_Locks.Remove(previousLock); + LockRay(caller, priority); + } } + } - return false; + public void UnlockRay(object caller) + { + if (m_LockCallers.Remove(caller)) + m_Locks.RemoveAll(o => o.lockObject == caller); } bool HasLock(object caller) { - if (m_LockRayObjects.Count == 0) + if (m_Locks.Count == 0) return true; - while (m_LockRayObjects.Count > 0 && m_LockRayObjects.Last().Value == null) + var topLock = m_Locks.Last(); + while (m_Locks.Count > 0 && topLock.lockObject == null) { - m_LockRayObjects.RemoveAt(m_LockRayObjects.Count - 1); + m_LockCallers.Remove(topLock.lockObject); + m_Locks.Remove(topLock); + + if (m_Locks.Count > 0) + { + topLock = m_Locks.Last(); + } + else + { + break; + } } - return m_LockRayObjects.Last().Value == caller; + if (m_Locks.Count == 0) + return true; + + return topLock.lockObject == caller; } /// @@ -104,42 +145,29 @@ void OnDisable() this.StopCoroutine(ref m_ConeVisibilityCoroutine); } - public void Hide(object caller, bool rayOnly = false) - { - if (isActiveAndEnabled && HasLock(caller)) - { - if (rayVisible) - { - rayVisible = false; - this.StopCoroutine(ref m_RayVisibilityCoroutine); - m_RayVisibilityCoroutine = StartCoroutine(HideRay()); - } - - if (!rayOnly && coneVisible) - { - coneVisible = false; - this.StopCoroutine(ref m_ConeVisibilityCoroutine); - m_ConeVisibilityCoroutine = StartCoroutine(HideCone()); - } - } - } - - public void Show(object caller, bool rayOnly = false) + public void SetVisibility(object caller, bool rayVisible, bool coneVisible, int priority = 0) { + LockRay(caller, priority); if (isActiveAndEnabled && HasLock(caller)) { - if (!rayVisible) + Debug.Log("presetvis ray:" + rayVisible + ", cone:" + coneVisible + ", " + this.rayVisible + ", " + this.coneVisible); + var time = Time.time; + if (this.rayVisible != rayVisible) { - rayVisible = true; - this.StopCoroutine(ref m_RayVisibilityCoroutine); - m_RayVisibilityCoroutine = StartCoroutine(ShowRay()); + if (m_SetVisibilityTime == Mathf.Infinity) + { + m_SetRayVisibile = rayVisible; + m_SetVisibilityTime = time; + } } - if (!rayOnly && !coneVisible) + if (this.coneVisible != coneVisible) { - coneVisible = true; - this.StopCoroutine(ref m_ConeVisibilityCoroutine); - m_ConeVisibilityCoroutine = StartCoroutine(ShowCone()); + if (m_SetVisibilityTime == Mathf.Infinity) + { + m_SetVisibilityTime = time; + m_SetConeVisibile = coneVisible; + } } } } @@ -172,6 +200,9 @@ void Awake() m_ConeTransform = m_Cone.transform; m_OriginalConeLocalScale = m_ConeTransform.localScale; m_Tester = GetComponentInChildren(); + + rayVisible = true; + coneVisible = true; } void Start() @@ -180,6 +211,30 @@ void Start() rayVisible = true; } + void Update() + { + if (Time.time > m_SetVisibilityTime + k_SetVisibilityDelay) + { + if (rayVisible != m_SetRayVisibile) + { + rayVisible = m_SetRayVisibile; + this.StopCoroutine(ref m_RayVisibilityCoroutine); + m_RayVisibilityCoroutine = StartCoroutine(rayVisible ? ShowRay() : HideRay()); + } + + if (coneVisible != m_SetConeVisibile) + { + coneVisible = m_SetConeVisibile; + this.StopCoroutine(ref m_ConeVisibilityCoroutine); + m_ConeVisibilityCoroutine = StartCoroutine(coneVisible ? ShowCone() : HideCone()); + } + + Debug.Log("setvis ray:" + rayVisible + ", cone:" + coneVisible); + + m_SetVisibilityTime = Mathf.Infinity; + } + } + IEnumerator HideRay() { m_Tip.transform.localScale = Vector3.zero; diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index c6a05f344..6a3ccac71 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -20,6 +20,8 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const float k_RotationThreshold = 0.75f; const float k_DistanceThreshold = 0.02f; + const int k_RayHidePriority = 2; + //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; const float k_MaxScale = 1000f; @@ -187,7 +189,7 @@ void OnDisable() void OnDestroy() { - this.SetDefaultRayVisibility(rayOrigin, this, true); + this.SetDefaultRayVisibility(rayOrigin, this, true, true); if (m_ViewerScaleVisuals) ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); @@ -327,7 +329,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false); + this.SetDefaultRayVisibility(rayOrigin, this, false, false, k_RayHidePriority); } if (m_Crawling) @@ -336,7 +338,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) return true; } - this.SetDefaultRayVisibility(rayOrigin, this, true); + this.SetDefaultRayVisibility(rayOrigin, this, true, true); this.UnlockRay(rayOrigin, this); m_StartCrawling = false; @@ -350,7 +352,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) { m_State = State.Aiming; this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false); + this.SetDefaultRayVisibility(rayOrigin, this, false, false, k_RayHidePriority); m_BlinkVisuals.ShowVisuals(); @@ -360,7 +362,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_State == State.Aiming && m_LocomotionInput.blink.wasJustReleased) { - this.SetDefaultRayVisibility(rayOrigin, this, true); + this.SetDefaultRayVisibility(rayOrigin, this, true, true); this.UnlockRay(rayOrigin, this); if (!m_BlinkVisuals.outOfMaxRange) @@ -414,9 +416,9 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var distance = Vector3.Distance(thisPosition, otherPosition); this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false); + this.SetDefaultRayVisibility(rayOrigin, this, false, false, k_RayHidePriority); this.LockRay(otherRayOrigin, this); - this.SetDefaultRayVisibility(otherRayOrigin, this, false); + this.SetDefaultRayVisibility(otherRayOrigin, this, false, false, k_RayHidePriority); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; @@ -548,7 +550,7 @@ void CancelScale() if (!locomotionTool.m_StartCrawling && locomotionTool.m_Scaling) { var rayOrigin = locomotionTool.rayOrigin; - this.SetDefaultRayVisibility(rayOrigin, this, true); + this.SetDefaultRayVisibility(rayOrigin, this, true, true); this.UnlockRay(rayOrigin, this); } diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index 13703857b..85bbc5ee4 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -159,7 +159,7 @@ void StartMove() m_State = State.MoveWorkspaces; this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false); + this.SetDefaultRayVisibility(rayOrigin, this, false, false); foreach (var ws in allWorkspaces) { @@ -193,7 +193,7 @@ void EndMove() { m_State = State.WaitingForInput; - this.SetDefaultRayVisibility(rayOrigin, this, true); + this.SetDefaultRayVisibility(rayOrigin, this, true, true); this.UnlockRay(rayOrigin, this); foreach (var ws in allWorkspaces) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index eb2a2c779..bf9c595e2 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -20,6 +20,8 @@ sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChang const float k_DirectLazyFollowTranslate = 20f; const float k_DirectLazyFollowRotate = 30f; + const int k_RayHidePriority = 1; + class GrabData { Vector3[] m_PositionOffsets; @@ -336,7 +338,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var transformInput = transformTool.m_Input; this.LockRay(directRayOrigin, this); - this.SetDefaultRayVisibility(directRayOrigin, this, false, true); // This will also unhighlight the object + this.SetDefaultRayVisibility(directRayOrigin, this, false, true, k_RayHidePriority); // This will also unhighlight the object if (transformInput.select.wasJustPressed) { diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index 89391cbc5..5f1d74d9e 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -299,7 +299,7 @@ protected override void OnDragStarted(BaseHandle handle, HandleEventData eventDa var rayOrigin = eventData.rayOrigin; this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false); + this.SetDefaultRayVisibility(rayOrigin, this, false, false); var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); @@ -349,7 +349,7 @@ protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData var gridItem = m_DragObject.GetComponent(); var rayOrigin = eventData.rayOrigin; - this.SetDefaultRayVisibility(rayOrigin, this, true); + this.SetDefaultRayVisibility(rayOrigin, this, true, true); this.UnlockRay(rayOrigin, this); if (!this.IsOverShoulder(eventData.rayOrigin)) From b29db5394925806c138e2c3d14380b9644f1ce8b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 17:09:01 -0700 Subject: [PATCH 627/870] Add highlightStart and End events to GradientButton --- Scripts/UI/GradientButton.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 90e7c4441..24306813e 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -20,6 +20,8 @@ sealed class GradientButton : MonoBehaviour, IPointerEnterHandler, IPointerExitH public event Action click; public event Action hoverEnter; public event Action hoverExit; + public event Action highlightStart; + public event Action highlightEnd; public Sprite iconSprite { @@ -67,7 +69,20 @@ public bool highlighted if (!gameObject.activeInHierarchy) return; - m_HighlightCoroutine = m_Highlighted ? StartCoroutine(BeginHighlight()) : StartCoroutine(EndHighlight()); + if (m_Highlighted) + { + m_HighlightCoroutine = StartCoroutine(BeginHighlight()); + + if (highlightStart != null) + highlightStart(); + } + else + { + m_HighlightCoroutine = StartCoroutine(EndHighlight()); + + if (highlightEnd != null) + highlightEnd(); + } } } bool m_Highlighted; From 3c3a4386ef5ffb86918984a48b164054cb3f0a5a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 17:11:05 -0700 Subject: [PATCH 628/870] Add new darkGrayscaleSessionGradient to UnityBrandColorScheme; used in inset backgrounds in RadialMenuSlot & PinnedToolsButton --- Scripts/Utilities/UnityBrandColorScheme.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index f3b8817de..9af218355 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -162,6 +162,12 @@ public static GradientPair sessionGradient /// public static GradientPair grayscaleSessionGradient { get; private set; } + /// + /// A darker low-contrast grayscale Unity brand color gradient, having no chroma + /// UI elements (or otherwise) can fetch this common gradient, for a uniform appearance across various elements (Gradient Button insets, etc) + /// + public static GradientPair darkGrayscaleSessionGradient { get; private set; } + /// /// Static Constructor that sets up the swatch and gradient data /// @@ -243,6 +249,7 @@ private static void SetupUnityBrandColors() // Setup grayscale light/dark contrasting session gradient grayscaleSessionGradient = new GradientPair(MaterialUtils.HexToColor("898A8AFF"), s_Light); + darkGrayscaleSessionGradient = new GradientPair(MaterialUtils.HexToColor("636565FF"), MaterialUtils.HexToColor("484949FF")); // Setup neutral-luma curated gradient pairs s_CuratedGradientPairs.Add(new GradientPair(cyan, blueDark)); From 364a2b6315bff453abaab4c0c3a19349a66bbb68 Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Wed, 19 Jul 2017 20:06:06 -0500 Subject: [PATCH 629/870] make comment in TestImage.cs clearer --- Tests/Test Helpers/TestImage.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Tests/Test Helpers/TestImage.cs b/Tests/Test Helpers/TestImage.cs index 52009c451..1e50b090a 100644 --- a/Tests/Test Helpers/TestImage.cs +++ b/Tests/Test Helpers/TestImage.cs @@ -1,8 +1,7 @@ using UnityEngine.UI; -// if you create a custom class in a file that doesn't match the class name, -// after the tests run Unity will complain that the compiler that imported -// "TestImage" isn't available anymore, so they go in their own files +// this class exists to allow testing of the overload for +// MaterialUtils.GetMaterialClone that takes a Graphic-derived class namespace UnityEditor.Experimental.EditorVR.Tests.TestHelpers { public class TestImage : Graphic From d3271cc38f72626669a8675d01a1b1e991d0e67c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 19 Jul 2017 18:31:27 -0700 Subject: [PATCH 630/870] Remove RayLocking and switch to IRegisterRayVisibilitySettings --- Scripts/Core/EditorVR.MiniWorlds.cs | 10 +- Scripts/Core/EditorVR.Rays.cs | 16 +- .../IRegisterRayVisibilitySettings.cs | 45 ++++++ ...=> IRegisterRayVisibilitySettings.cs.meta} | 0 .../ISetDefaultRayColor.cs | 2 +- .../ISetDefaultRayVisibility.cs | 33 ---- .../FunctionalityInjection/IUsesRayLocking.cs | 44 ----- .../IUsesRayLocking.cs.meta | 12 -- Scripts/Modules/KeyboardModule.cs | 11 +- Scripts/Proxies/DefaultProxyRay.cs | 151 +++++------------- .../CreatePrimitiveTool.cs | 11 +- Tools/LocomotionTool/LocomotionTool.cs | 25 ++- .../MoveWorkspacesTool/MoveWorkspacesTool.cs | 8 +- Tools/TransformTool/TransformTool.cs | 15 +- .../MiniWorldWorkspace/MiniWorldWorkspace.cs | 12 +- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 8 +- 16 files changed, 132 insertions(+), 271 deletions(-) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs rename Scripts/Interfaces/FunctionalityInjection/{ISetDefaultRayVisibility.cs.meta => IRegisterRayVisibilitySettings.cs.meta} (100%) delete mode 100644 Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs delete mode 100644 Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs delete mode 100644 Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs.meta diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index f8a366f0f..f7d129260 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -475,12 +475,12 @@ internal void UpdateMiniWorlds() } if (isContained && !wasContained) - Rays.SetDefaultRayVisibility(rayOrigin, this, false, true); + Rays.RegisterVisibilitySettings(rayOrigin, this, false, true); if (!isContained && wasContained) { - Rays.SetDefaultRayVisibility(rayOrigin, this, true, true); - Rays.UnlockRay(rayOrigin, this); + Rays.RegisterVisibilitySettings(rayOrigin, this, true, true); + Rays.UnregisterVisibilitySettings(rayOrigin, this); } m_RayWasContained[rayOrigin] = isContained; @@ -590,8 +590,8 @@ void OnObjectsDropped(Transform rayOrigin, Transform[] grabbedObjects) if (!miniWorldRay.isContained) { - Rays.SetDefaultRayVisibility(rayOrigin, this, true, true); - Rays.UnlockRay(rayOrigin, this); + Rays.RegisterVisibilitySettings(rayOrigin, this, true, true); + Rays.UnregisterVisibilitySettings(rayOrigin, this); } } } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index e0f6267c2..035a2bce9 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -36,11 +36,11 @@ class Rays : Nested, IInterfaceConnector public Rays() { - ISetDefaultRayVisibilityMethods.setDefaultRayVisibility = SetDefaultRayVisibility; ISetDefaultRayColorMethods.setDefaultRayColor = SetDefaultRayColor; IGetDefaultRayColorMethods.getDefaultRayColor = GetDefaultRayColor; - IUsesRayLockingMethods.unlockRay = UnlockRay; + IRegisterRayVisibilitySettingsMethods.registerRayVisibilitySettings = RegisterVisibilitySettings; + IRegisterRayVisibilitySettingsMethods.unregisterRayVisibilitySettings = UnregisterVisibilitySettings; IForEachRayOriginMethods.forEachRayOrigin = ForEachRayOrigin; IGetFieldGrabOriginMethods.getFieldGrabOriginForRayOrigin = GetFieldGrabOriginForRayOrigin; @@ -110,12 +110,12 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig var customMenu = deviceData.customMenu; if (mainMenu.visible || (customMenu != null && customMenu.visible)) { - SetDefaultRayVisibility(rayOrigin, mainMenu, false, false); + RegisterVisibilitySettings(rayOrigin, mainMenu, false, false); } else { - SetDefaultRayVisibility(rayOrigin, mainMenu, true, true); - UnlockRay(rayOrigin, mainMenu); + RegisterVisibilitySettings(rayOrigin, mainMenu, true, true); + UnregisterVisibilitySettings(rayOrigin, mainMenu); } } @@ -408,7 +408,7 @@ internal static bool IsRayActive(Transform rayOrigin) return dpr == null || dpr.rayVisible; } - internal static void SetDefaultRayVisibility(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) + internal static void RegisterVisibilitySettings(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) { if (rayOrigin) { @@ -418,11 +418,11 @@ internal static void SetDefaultRayVisibility(Transform rayOrigin, object caller, } } - internal static void UnlockRay(Transform rayOrigin, object obj) + internal static void UnregisterVisibilitySettings(Transform rayOrigin, object obj) { var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - dpr.UnlockRay(obj); + dpr.UnsetRayVisibility(obj); } internal void PreProcessRaycastSource(Transform rayOrigin) diff --git a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs new file mode 100644 index 000000000..50ae41637 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs @@ -0,0 +1,45 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Implementors can show & hide the default ray + /// + public interface IRegisterRayVisibilitySettings + { + } + + public static class IRegisterRayVisibilitySettingsMethods + { + internal delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); + + internal static RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } + internal static Action unregisterRayVisibilitySettings { get; set; } + + /// + /// Register visibility settings to try and show/hide the ray/cone + /// + /// The ray to hide or show + /// The object which has locked the ray + /// Show or hide + /// An optional parameter to hide or show only the ray and not the cone + /// The priority level of this request + public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) + { + registerRayVisibilitySettings(rayOrigin, caller, rayVisible, coneVisible, priority); + } + + /// + /// Unregister visibility settings + /// + /// The ray to hide or show + /// The object which has locked the ray + public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) + { + unregisterRayVisibilitySettings(rayOrigin, caller); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs.meta similarity index 100% rename from Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs.meta diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs index 1306db39f..f6a5cb61a 100644 --- a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs +++ b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR /// /// Implementors can set the color of the default ray /// - public interface ISetDefaultRayColor : IUsesRayLocking + public interface ISetDefaultRayColor { } diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs deleted file mode 100644 index 9170cf4de..000000000 --- a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayVisibility.cs +++ /dev/null @@ -1,33 +0,0 @@ -#if UNITY_EDITOR -using UnityEngine; - -namespace UnityEditor.Experimental.EditorVR -{ - /// - /// Implementors can show & hide the default ray - /// - public interface ISetDefaultRayVisibility : IUsesRayLocking - { - } - - public static class ISetDefaultRayVisibilityMethods - { - internal delegate void DefaultRayVisibilityDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); - - internal static DefaultRayVisibilityDelegate setDefaultRayVisibility { get; set; } - - /// - /// Show the default proxy ray/cone - /// - /// The ray to hide or show - /// The object which has locked the ray - /// Show or hide - /// An optional parameter to hide or show only the ray and not the cone - /// The priority level of this request - public static void SetDefaultRayVisibility(this ISetDefaultRayVisibility customRay, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) - { - setDefaultRayVisibility(rayOrigin, caller, rayVisible, coneVisible, priority); - } - } -} -#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs b/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs deleted file mode 100644 index 8dba0c662..000000000 --- a/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs +++ /dev/null @@ -1,44 +0,0 @@ -#if UNITY_EDITOR -using System; -using UnityEngine; - -namespace UnityEditor.Experimental.EditorVR -{ - /// - /// Gives decorated class the ability to lock and unlock the default ray - /// - public interface IUsesRayLocking - { - } - - public static class IUsesRayLockingMethods - { - internal delegate bool RayLockingDelegate(Transform rayOrigin, object obj, int priority = 0); - - internal static RayLockingDelegate lockRay { get; set; } - internal static Action unlockRay { get; set; } - - /// - /// Lock the default ray's show/hide state. - /// - /// The ray to lock - /// The object performing the lock is passed in and must be used for unlocking - /// The priority used for locking (higher is more important) - public static void LockRay(this IUsesRayLocking customRay, Transform rayOrigin, object obj, int priority = 0) - { - //lockRay(rayOrigin, obj); - } - - /// - /// Unlock the default ray's show/hide state. - /// - /// The ray to unlock - /// The object performing the unlock must be passed in and match the one that locked it or null to override - public static void UnlockRay(this IUsesRayLocking customRay, Transform rayOrigin, object obj) - { - unlockRay(rayOrigin, obj); - } - } - -} -#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs.meta deleted file mode 100644 index a8c728a65..000000000 --- a/Scripts/Interfaces/FunctionalityInjection/IUsesRayLocking.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3932c7a7252eef044af4b7e0b94f9205 -timeCreated: 1471382179 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index 50b8e830c..19574b725 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class KeyboardModule : MonoBehaviour, ISetDefaultRayVisibility, IForEachRayOrigin, IConnectInterfaces + sealed class KeyboardModule : MonoBehaviour, IRegisterRayVisibilitySettings, IForEachRayOrigin, IConnectInterfaces { [SerializeField] KeyboardMallet m_KeyboardMalletPrefab; @@ -98,12 +98,9 @@ public void UpdateKeyboardMallets() { mallet.visible = malletVisible; if (malletVisible) - this.LockRay(rayOrigin, this); - - this.SetDefaultRayVisibility(rayOrigin, this, !malletVisible, !malletVisible); - - if (!malletVisible) - this.UnlockRay(rayOrigin, this); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); + else + this.UnregisterRayVisibilitySettings(rayOrigin, this); } // TODO remove this after physics is in diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index c649d7f75..30c3ed2c7 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -13,10 +13,11 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale { const float k_SetVisibilityDelay = 0.125f; - class LockObject + class VisibilitySettings { - public object lockObject; public int priority; + public bool rayVisible; + public bool coneVisible; } [SerializeField] @@ -40,85 +41,17 @@ class LockObject IntersectionTester m_Tester; float m_LastPointerLength; - float m_SetVisibilityTime = Mathf.Infinity; - bool m_SetRayVisibile; - bool m_SetConeVisibile; - /// /// The object that is set when LockRay is called while the ray is unlocked. /// As long as this reference is set, and the ray is locked, only that object can unlock the ray. /// If the object reference becomes null, the ray will be free to show/hide/lock/unlock until another locking entity takes ownership. /// - readonly List m_Locks = new List(); - readonly HashSet m_LockCallers = new HashSet(); - - void LockRay(object caller, int priority = 0) - { - if (m_LockCallers.Add(caller)) - { - var maxPriority = 0; - var firstIndex = -1; - var count = m_Locks.Count; - for (var i = 0; i < count; i++) - { - var lockObject = m_Locks[i]; - var lockObjectPriority = lockObject.priority; - if (lockObjectPriority >= maxPriority) - maxPriority = lockObjectPriority; - - if (firstIndex < 0 && lockObjectPriority >= priority) - firstIndex = i; - } + readonly Dictionary m_VisibilitySettings = new Dictionary(); - var newLock = new LockObject { lockObject = caller, priority = priority }; - if (priority > maxPriority || firstIndex == -1) - m_Locks.Add(newLock); - else - m_Locks.Insert(firstIndex, newLock); - } - else - { - var previousLock = m_Locks.FirstOrDefault(lockObject => lockObject.lockObject == caller); - if (previousLock.priority != priority) - { - m_LockCallers.Remove(caller); - m_Locks.Remove(previousLock); - LockRay(caller, priority); - } - } - } - public void UnlockRay(object caller) + public void UnsetRayVisibility(object caller) { - if (m_LockCallers.Remove(caller)) - m_Locks.RemoveAll(o => o.lockObject == caller); - } - - bool HasLock(object caller) - { - if (m_Locks.Count == 0) - return true; - - var topLock = m_Locks.Last(); - while (m_Locks.Count > 0 && topLock.lockObject == null) - { - m_LockCallers.Remove(topLock.lockObject); - m_Locks.Remove(topLock); - - if (m_Locks.Count > 0) - { - topLock = m_Locks.Last(); - } - else - { - break; - } - } - - if (m_Locks.Count == 0) - return true; - - return topLock.lockObject == caller; + m_VisibilitySettings.Remove(caller); } /// @@ -147,29 +80,16 @@ void OnDisable() public void SetVisibility(object caller, bool rayVisible, bool coneVisible, int priority = 0) { - LockRay(caller, priority); - if (isActiveAndEnabled && HasLock(caller)) + VisibilitySettings settings; + if (!m_VisibilitySettings.TryGetValue(caller, out settings)) { - Debug.Log("presetvis ray:" + rayVisible + ", cone:" + coneVisible + ", " + this.rayVisible + ", " + this.coneVisible); - var time = Time.time; - if (this.rayVisible != rayVisible) - { - if (m_SetVisibilityTime == Mathf.Infinity) - { - m_SetRayVisibile = rayVisible; - m_SetVisibilityTime = time; - } - } - - if (this.coneVisible != coneVisible) - { - if (m_SetVisibilityTime == Mathf.Infinity) - { - m_SetVisibilityTime = time; - m_SetConeVisibile = coneVisible; - } - } + settings = new VisibilitySettings(); + m_VisibilitySettings[caller] = settings; } + + settings.rayVisible = rayVisible; + settings.coneVisible = coneVisible; + settings.priority = priority; } public void SetLength(float length) @@ -213,25 +133,40 @@ void Start() void Update() { - if (Time.time > m_SetVisibilityTime + k_SetVisibilityDelay) - { - if (rayVisible != m_SetRayVisibile) - { - rayVisible = m_SetRayVisibile; - this.StopCoroutine(ref m_RayVisibilityCoroutine); - m_RayVisibilityCoroutine = StartCoroutine(rayVisible ? ShowRay() : HideRay()); - } + UpdateVisibility(); + } - if (coneVisible != m_SetConeVisibile) + void UpdateVisibility() + { + var coneVisible = true; + var rayVisible = true; + + if (m_VisibilitySettings.Count > 0) + { + var maxPriority = m_VisibilitySettings.Select(setting => setting.Value.priority).Max(); + foreach (var kvp in m_VisibilitySettings) { - coneVisible = m_SetConeVisibile; - this.StopCoroutine(ref m_ConeVisibilityCoroutine); - m_ConeVisibilityCoroutine = StartCoroutine(coneVisible ? ShowCone() : HideCone()); + var settings = kvp.Value; + if (settings.priority == maxPriority) + { + rayVisible &= settings.rayVisible; + coneVisible &= settings.coneVisible; + } } + } - Debug.Log("setvis ray:" + rayVisible + ", cone:" + coneVisible); + if (this.rayVisible != rayVisible) + { + this.rayVisible = rayVisible; + this.StopCoroutine(ref m_RayVisibilityCoroutine); + m_RayVisibilityCoroutine = StartCoroutine(rayVisible ? ShowRay() : HideRay()); + } - m_SetVisibilityTime = Mathf.Infinity; + if (this.coneVisible != coneVisible) + { + this.coneVisible = rayVisible; + this.StopCoroutine(ref m_ConeVisibilityCoroutine); + m_ConeVisibilityCoroutine = StartCoroutine(coneVisible ? ShowCone() : HideCone()); } } diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index 7b9992686..a7f5d0448 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Primitive", "Create", "Create primitives in the scene")] sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, IConnectInterfaces, IInstantiateMenuUI, - IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, ISetDefaultRayVisibility, IIsHoveringOverUI, + IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, IRegisterRayVisibilitySettings, IIsHoveringOverUI, IIsMainMenuVisible { [SerializeField] @@ -77,13 +77,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (m_State == PrimitiveCreationStates.StartPoint && this.IsHoveringOverUI(rayOrigin)) { - this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, true, true); + this.UnregisterRayVisibilitySettings(rayOrigin, this); } else { - this.SetDefaultRayVisibility(rayOrigin, this, false, true); - this.LockRay(rayOrigin, this); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, true); } } @@ -170,8 +168,7 @@ void OnDestroy() if (rayOrigin == null) return; - this.SetDefaultRayVisibility(rayOrigin, this, true, true); - this.UnlockRay(rayOrigin, this); + this.UnregisterRayVisibilitySettings(rayOrigin, this); } } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 6a3ccac71..248eabdd2 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ISetDefaultRayVisibility, + sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, IRegisterRayVisibilitySettings, ICustomActionMap, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences { const float k_FastMoveSpeed = 20f; @@ -189,7 +189,7 @@ void OnDisable() void OnDestroy() { - this.SetDefaultRayVisibility(rayOrigin, this, true, true); + this.RegisterRayVisibilitySettings(rayOrigin, this, true, true); if (m_ViewerScaleVisuals) ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); @@ -328,8 +328,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false, false, k_RayHidePriority); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); } if (m_Crawling) @@ -338,8 +337,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) return true; } - this.SetDefaultRayVisibility(rayOrigin, this, true, true); - this.UnlockRay(rayOrigin, this); + this.UnregisterRayVisibilitySettings(rayOrigin, this); m_StartCrawling = false; m_Crawling = false; @@ -351,8 +349,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false, false, k_RayHidePriority); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); m_BlinkVisuals.ShowVisuals(); @@ -362,8 +359,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_State == State.Aiming && m_LocomotionInput.blink.wasJustReleased) { - this.SetDefaultRayVisibility(rayOrigin, this, true, true); - this.UnlockRay(rayOrigin, this); + this.UnregisterRayVisibilitySettings(rayOrigin, this); if (!m_BlinkVisuals.outOfMaxRange) { @@ -415,10 +411,8 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); - this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false, false, k_RayHidePriority); - this.LockRay(otherRayOrigin, this); - this.SetDefaultRayVisibility(otherRayOrigin, this, false, false, k_RayHidePriority); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + this.RegisterRayVisibilitySettings(otherRayOrigin, this, false, false, k_RayHidePriority); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; @@ -550,8 +544,7 @@ void CancelScale() if (!locomotionTool.m_StartCrawling && locomotionTool.m_Scaling) { var rayOrigin = locomotionTool.rayOrigin; - this.SetDefaultRayVisibility(rayOrigin, this, true, true); - this.UnlockRay(rayOrigin, this); + this.UnregisterRayVisibilitySettings(rayOrigin, this); } locomotionTool.m_Scaling = false; diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index 85bbc5ee4..732424a17 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -7,7 +7,7 @@ using UnityEngine.InputNew; [ExecuteInEditMode] -public class MoveWorkspacesTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, ISetDefaultRayVisibility, IUsesViewerBody, +public class MoveWorkspacesTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IRegisterRayVisibilitySettings, IUsesViewerBody, IResetWorkspaces, IAllWorkspaces, IUsesViewerScale { enum State @@ -158,8 +158,7 @@ void StartMove() m_State = State.MoveWorkspaces; - this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false, false); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); foreach (var ws in allWorkspaces) { @@ -193,8 +192,7 @@ void EndMove() { m_State = State.WaitingForInput; - this.SetDefaultRayVisibility(rayOrigin, this, true, true); - this.UnlockRay(rayOrigin, this); + this.UnregisterRayVisibilitySettings(rayOrigin, this); foreach (var ws in allWorkspaces) { diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index bf9c595e2..dc7e66b4f 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, - IGrabObjects, ISetDefaultRayVisibility, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, + IGrabObjects, IRegisterRayVisibilitySettings, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, ILinkedObject, IRayToNode, IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible { @@ -337,8 +337,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var transformInput = transformTool.m_Input; - this.LockRay(directRayOrigin, this); - this.SetDefaultRayVisibility(directRayOrigin, this, false, true, k_RayHidePriority); // This will also unhighlight the object + this.RegisterRayVisibilitySettings(directRayOrigin, this, false, true, k_RayHidePriority); // This will also disable ray selection if (transformInput.select.wasJustPressed) { @@ -479,8 +478,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var rayOrigin = transformTool.rayOrigin; if (!(m_Scaling || directSelection.ContainsKey(rayOrigin) || m_GrabData.ContainsKey(transformTool.node.Value))) { - this.SetDefaultRayVisibility(rayOrigin, this, true, true); - this.UnlockRay(rayOrigin, this); + this.UnregisterRayVisibilitySettings(rayOrigin, this); } } } @@ -558,8 +556,8 @@ public Transform[] GetHeldObjects(Node node) grabData.UpdatePositions(this); // Prevent lock from getting stuck - this.UnlockRay(rayOrigin, this); - this.LockRay(destRayOrigin, this); + this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RegisterRayVisibilitySettings(destRayOrigin, this, false, true); if (objectsTransferred != null) objectsTransferred(rayOrigin, destRayOrigin); @@ -583,8 +581,7 @@ public void DropHeldObjects(Node node) m_GrabData.Remove(node); - this.SetDefaultRayVisibility(grabData.rayOrigin, this, true, true); - this.UnlockRay(grabData.rayOrigin, this); + this.UnregisterRayVisibilitySettings(grabData.rayOrigin, this); this.ClearSnappingState(rayOrigin); } diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs index ed112b496..f7188b9b6 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs @@ -14,7 +14,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { [MainMenuItem("MiniWorld", "Workspaces", "Edit a smaller version of your scene(s)", typeof(MiniWorldTooltip))] - sealed class MiniWorldWorkspace : Workspace, IUsesRayLocking, ISerializeWorkspace + sealed class MiniWorldWorkspace : Workspace, ISerializeWorkspace, IRegisterRayVisibilitySettings { class MiniWorldTooltip : ITooltip { @@ -366,16 +366,6 @@ void OnPanZoomDragEnded(Transform rayOrigin) } } - void DragStarted(BaseHandle handle, HandleEventData handleEventData) - { - this.LockRay(handleEventData.rayOrigin, this); - } - - void DragEnded(BaseHandle handle, HandleEventData handleEventData) - { - this.UnlockRay(handleEventData.rayOrigin, this); - } - void RecenterOnPlayer() { this.RestartCoroutine(ref m_UpdateLocationCoroutine, UpdateLocation(CameraUtils.GetMainCamera().transform.position)); diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index 5f1d74d9e..c0cd0f9b6 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { sealed class AssetGridItem : DraggableListItem, IPlaceSceneObject, IUsesSpatialHash, - IUsesViewerBody, ISetDefaultRayVisibility + IUsesViewerBody, IRegisterRayVisibilitySettings { const float k_PreviewDuration = 0.1f; const float k_MinPreviewScale = 0.01f; @@ -298,8 +298,7 @@ protected override void OnDragStarted(BaseHandle handle, HandleEventData eventDa base.OnDragStarted(handle, eventData); var rayOrigin = eventData.rayOrigin; - this.LockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, this, false, false); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); @@ -349,8 +348,7 @@ protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData var gridItem = m_DragObject.GetComponent(); var rayOrigin = eventData.rayOrigin; - this.SetDefaultRayVisibility(rayOrigin, this, true, true); - this.UnlockRay(rayOrigin, this); + this.UnregisterRayVisibilitySettings(rayOrigin, this); if (!this.IsOverShoulder(eventData.rayOrigin)) { From d9b3be4e70b3025bf2e5396afbf598bf6e23364c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 19:27:04 -0700 Subject: [PATCH 631/870] Add new saturated session gradient; refactor session gradient removal from gradient collections; used in radial and primary pinned tool buttons --- Scripts/Core/EditorVR.cs | 1 + Scripts/Utilities/UnityBrandColorScheme.cs | 30 +++++++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 21ce27ed8..bfac6b4b2 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -182,6 +182,7 @@ void Awake() workspaceModule.workspaceDestroyed += miniWorlds.OnWorkspaceDestroyed; UnityBrandColorScheme.sessionGradient = UnityBrandColorScheme.GetRandomCuratedLightGradient(); + UnityBrandColorScheme.saturatedSessionGradient = UnityBrandColorScheme.GetRandomCuratedGradient(); var sceneObjectModule = AddModule(); sceneObjectModule.tryPlaceObject = (obj, targetScale) => diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 9af218355..fd7658136 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -42,6 +42,7 @@ public static class UnityBrandColorScheme static int s_RandomCuratedDarkGradientPairPosition = -1; static GradientPair s_SessionGradient; + static GradientPair s_SaturatedSessionGradient; static Color s_Red; static Color s_RedLight; @@ -150,9 +151,23 @@ public static GradientPair sessionGradient s_SessionGradient = value; // In order to more easily differentiate curated gradients, they should not match the session gradient - RemoveSessionGradientFromCollection(s_CuratedGradientPairs); - RemoveSessionGradientFromCollection(s_CuratedLightGradientPairs); - RemoveSessionGradientFromCollection(s_CuratedDarkGradientPairs); + RemoveGradientFromCollection(s_SessionGradient, s_CuratedGradientPairs); + RemoveGradientFromCollection(s_SessionGradient, s_CuratedLightGradientPairs); + RemoveGradientFromCollection(s_SessionGradient, s_CuratedDarkGradientPairs); + } + } + + public static GradientPair saturatedSessionGradient + { + get { return s_SaturatedSessionGradient; } + set + { + s_SaturatedSessionGradient = value; + + // In order to more easily differentiate curated gradients, they should not match the session gradient + RemoveGradientFromCollection(s_SaturatedSessionGradient, s_CuratedGradientPairs); + RemoveGradientFromCollection(s_SaturatedSessionGradient, s_CuratedLightGradientPairs); + RemoveGradientFromCollection(s_SaturatedSessionGradient, s_CuratedDarkGradientPairs); } } @@ -431,14 +446,15 @@ public static GradientPair GetRandomCuratedDarkGradient() } /// - /// Remove the session gradient from a GradientPair collection, if it is found in the collection + /// Remove a gradient from a GradientPair collection, if it is found in the collection /// - /// Collection from which the SessionGradient will be removed - static void RemoveSessionGradientFromCollection(List gradientPairCollection) + /// Gradient Pair to remove from the target collection + /// Collection from which the Gradient Pair will be removed + static void RemoveGradientFromCollection(GradientPair gradientPair, List gradientPairCollection) { foreach (GradientPair pair in gradientPairCollection) { - if (SwatchesSimilar(pair.a, s_SessionGradient.a, 0f) && SwatchesSimilar(pair.b, s_SessionGradient.b, 0f)) + if (SwatchesSimilar(pair.a, gradientPair.a, 0f) && SwatchesSimilar(pair.b, gradientPair.b, 0f)) { gradientPairCollection.Remove(pair); break; From d05ec9c3d8620cedcaa9a032203661a380cab107 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 19:31:29 -0700 Subject: [PATCH 632/870] Scale spatial scroll arrows with ViewerScale --- Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 548a2e9c4..20e703d17 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -280,7 +280,7 @@ IEnumerator ShowScrollVisuals() scrollArrowsVisible = true; preScrollArrowsVisible = false; secondaryArrowsVisible = false; - m_ScrollVisualsTransform.localScale = Vector3.one; + m_ScrollVisualsTransform.localScale = Vector3.one * this.GetViewerScale(); m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, Vector3.up);// CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. m_ScrollVisualsCanvasGroup.alpha = 1f; // remove m_ScrollVisualsDragTargetArrowTransform.localPosition = Vector3.zero; From a12daa600c47e114a1a441e9c279b7c7d91f4427 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 19:32:46 -0700 Subject: [PATCH 633/870] Set the new saturatedSessionGradient as the gradient used in RadialMenuUI --- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index 5444feea0..b9fd5ceae 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -234,7 +234,7 @@ void SetupRadialSlotPositions() void UpdateRadialSlots() { - var gradientPair = UnityBrandColorScheme.sessionGradient; + var gradientPair = UnityBrandColorScheme.saturatedSessionGradient; for (int i = 0; i < m_Actions.Count; ++i) { From 36f7cb4619b08837c036b54c819b64fcc834054c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 19:38:16 -0700 Subject: [PATCH 634/870] Cleanup IPinnedToolButton interface structure --- Scripts/UI/Interfaces/IPinnedToolButton.cs | 37 ++++------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 372ad1f64..1979ecc70 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -10,45 +10,22 @@ namespace UnityEditor.Experimental.EditorVR public interface IPinnedToolButton { Type previewToolType { set; } - int order { get; set; } Type toolType { get; set; } + int order { get; set; } + int maxButtonCount { get; set; } bool highlighted { get; set; } bool secondaryButtonHighlighted { get; } - int maxButtonCount { get; set; } - Func visibileButtonCount { get; set; } bool activeTool { get; set; } - Action selectTool { get; set; } - Func closeButton { get; set; } bool toolTipVisible { set; } - Action destroy { get; } bool implementsSecondaryButton { get; set; } + Vector3 primaryUIContentContainerLocalScale { get; set; } + Action destroy { get; } + Action selectTool { get; set; } + Func visibileButtonCount { get; set; } + Func closeButton { get; set; } Action showAllButtons { get; set; } Action hoverExit { get; set; } event Action hovered; - - /* - int menuButtonOrderPosition { get; } - int activeToolOrderPosition { get; } - int activeButtonCount { set; } - bool revealed { set; } - bool moveToAlternatePosition { get; set; } - Transform rayOrigin { get; set; } - Vector3 toolButtonActivePosition { get; } // Shared active button offset from the alternate menu - Sprite icon { set; } - Node node { set; } - GradientPair gradientPair { get; } - - event Action hoverEnter; - event Action hoverExit; - event Action selected; - - Action selectTool { set; } - Action deletePinnedToolButton { set; } - Action revealAllToolButtons { set; } - Action dighlightSingleButton { set; } - Action selectHighlightedButton { set; } - Action deleteHighlightedButton { set; } - */ } public static class IPinnedToolButtonMethods From 154528e0da162e8de9802b8a6172baaf4f8b7afa Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 20:01:59 -0700 Subject: [PATCH 635/870] Scale primary pinned tool button container contents (icon/text-abbreviation) down when setting buttons to the alternate position (when radial menu is displaying on same hand) --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index cd64ddfec..cfa54834f 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -522,8 +522,11 @@ int VisibleButtonCount() IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) { + const float kPrimaryButtonUIAlternatePositionScalar = 0.65f; var currentPosition = transform.localPosition; var currentScale = transform.localScale; + var currentPrimaryButtonUIContainerLocalScale = m_OrderedButtons[0].primaryUIContentContainerLocalScale; + var targetPrimaryButtonUIContainerLocalScale = Vector3.one * (m_MoveToAlternatePosition ? kPrimaryButtonUIAlternatePositionScalar : 1f); var duration = 0f; while (duration < 1) { @@ -531,6 +534,11 @@ IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); + + var newPrimaryButtonScale = Vector3.Lerp(currentPrimaryButtonUIContainerLocalScale, targetPrimaryButtonUIContainerLocalScale, durationShaped); + for (int i = 0; i < m_OrderedButtons.Count; ++i) + m_OrderedButtons[i].primaryUIContentContainerLocalScale = newPrimaryButtonScale; + yield return null; } From d6df6cec37225c8385e192f758e8a3ca42d3f2ba Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 20:14:44 -0700 Subject: [PATCH 636/870] Add partial display of the secondary PinnedToolButton on hover, hide on hoverExit for UX visual hinting; add new saturatedSessionGradient to PinnedToolButtons; swap gradient order for highlights --- .../PinnedToolButton/PinnedToolButton.cs | 84 +++- .../PinnedToolButton/PinnedToolButton.prefab | 469 ++++++++++-------- 2 files changed, 325 insertions(+), 228 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 67f720075..9348774b3 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -43,7 +43,7 @@ public Type toolType if (m_ToolType != null) { Debug.LogError("Setting up button type : " + m_ToolType.ToString()); - gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair + gradientPair = UnityBrandColorScheme.saturatedSessionGradient; if (isSelectionTool || isMainMenu) { //order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; @@ -214,7 +214,10 @@ public Transform alternateMenuOrigin //PinnedToolActionButton m_RightPinnedToolActionButton; [SerializeField] - Transform m_IconContainer; + Transform m_IconContainer; // TODO: eliminate the reference to the icon container, use only the primary UI content container for any transformation + + [SerializeField] + Transform m_PrimaryUIContentContainer; [SerializeField] CanvasGroup m_IconContainerCanvasGroup; @@ -342,8 +345,8 @@ public bool activeTool m_ActiveTool = value; - m_GradientButton.normalGradientPair = !m_ActiveTool ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.highlightGradientPair = !m_ActiveTool ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; + m_GradientButton.normalGradientPair = m_ActiveTool ? gradientPair : UnityBrandColorScheme.darkGrayscaleSessionGradient; + m_GradientButton.highlightGradientPair = m_ActiveTool ? UnityBrandColorScheme.darkGrayscaleSessionGradient : gradientPair; //if (activeTool) // TODO REMOVE IF NOT NEEDED //m_GradientButton.invertHighlightScale = value; @@ -519,6 +522,8 @@ public bool moveToAlternatePosition } } + public Vector3 primaryUIContentContainerLocalScale { get { return m_PrimaryUIContentContainer.localScale; } set { m_PrimaryUIContentContainer.localScale = value; } } + void Awake() { m_OriginalLocalPosition = transform.localPosition; @@ -563,6 +568,8 @@ void Start() m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions m_GradientButton.hoverExit += OnActionButtonHoverExit; m_GradientButton.click += OnBackgroundButtonClick; + m_GradientButton.highlightStart += OnPrimaryButtonHighlightStart; + m_GradientButton.highlightEnd += OnPrimaryButtonHighlightEnd; m_GradientButton.containerContentsAnimationSpeedMultiplier = 2.5f; m_FrameRenderer.SetBlendShapeWeight(1, 0f); @@ -1167,25 +1174,24 @@ IEnumerator ShowSecondaryButton() //Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; const float kSecondaryButtonVisibleBlendShapeWeight = 46f; - - var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); - var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; - var amount = 0f; - while (amount < 0.25f) + var delayDuration = 0f; + while (delayDuration < 0.25f) { - amount += Time.unscaledDeltaTime; + delayDuration += Time.unscaledDeltaTime; yield return null; } - //Debug.LogError("SHOWING SECONDARY BUTTON"); this.ShowTooltip(this); + this.StopCoroutine(ref m_HighlightCoroutine); - amount = 0f; - while (amount < 1f) + var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); + var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + var currentDuration = 0f; + while (currentDuration < 1f) { - amount += Time.unscaledDeltaTime * 10f; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + currentDuration += Time.unscaledDeltaTime * 10f; + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kFrameSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); @@ -1214,6 +1220,8 @@ IEnumerator HideSecondaryButton() yield break; } + this.StopCoroutine(ref m_HighlightCoroutine); + amount += Time.unscaledDeltaTime * 8f; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); @@ -1224,6 +1232,50 @@ IEnumerator HideSecondaryButton() m_SecondaryButtonVisibilityCoroutine = null; } + + void OnPrimaryButtonHighlightStart () + { + if (!isMainMenu) + this.RestartCoroutine(ref m_HighlightCoroutine, PerformPrimaryButtonHighlightStart()); + } + + void OnPrimaryButtonHighlightEnd () + { + if (m_HighlightCoroutine != null) + this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, PerformPrimaryButtonHighlightEnd()); + } + + IEnumerator PerformPrimaryButtonHighlightStart() + { + const float kSecondaryButtonFrameVisibleBlendShapeWeight = 16f; + const float kTargetDuration = 1f; + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + this.ShowTooltip(this); + var currentDuration = 0f; + while (currentDuration < kTargetDuration) + { + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * 25); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kSecondaryButtonFrameVisibleBlendShapeWeight, shapedAmount)); + yield return null; + } + } + + IEnumerator PerformPrimaryButtonHighlightEnd() + { + const float kSecondaryButtonFrameHiddenBlendShapeWeight = 0f; + const float kTargetDuration = 1f; + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + this.ShowTooltip(this); + var currentDuration = 0f; + while (currentDuration < kTargetDuration) + { + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * 5); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kSecondaryButtonFrameHiddenBlendShapeWeight, shapedAmount)); + yield return null; + } + + m_HighlightCoroutine = null; + } } } #endif diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab index 44140fae3..d425d82c5 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab @@ -16,11 +16,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010289694770} - - 222: {fileID: 222000010473341124} - - 114: {fileID: 114000011650556854} + - component: {fileID: 224000010289694770} + - component: {fileID: 222000010473341124} + - component: {fileID: 114000011650556854} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -33,9 +33,9 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012648346800} + - component: {fileID: 4000012648346800} m_Layer: 5 m_Name: RotationOffsetContainer m_TagString: Untagged @@ -48,10 +48,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012504767854} - - 114: {fileID: 114000011260412956} + - component: {fileID: 4000012504767854} + - component: {fileID: 114000011260412956} m_Layer: 5 m_Name: PinnedToolButton m_TagString: Untagged @@ -64,11 +64,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010555036514} - - 222: {fileID: 222000012771696822} - - 114: {fileID: 114000013054965370} + - component: {fileID: 224000010555036514} + - component: {fileID: 222000012771696822} + - component: {fileID: 114000013054965370} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -81,10 +81,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012609671830} - - 137: {fileID: 137000012108747896} + - component: {fileID: 4000012609671830} + - component: {fileID: 137000012108747896} m_Layer: 0 m_Name: PinnedToolButtonFrame m_TagString: Untagged @@ -97,19 +97,19 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011571037388} - - 33: {fileID: 33000012601387000} - - 23: {fileID: 23000013593520400} - - 114: {fileID: 114000014181189902} - - 65: {fileID: 65000012469590154} - - 65: {fileID: 65000012136550866} - - 65: {fileID: 65000010544999880} - - 65: {fileID: 65000012534630730} - - 65: {fileID: 65000011774431502} - - 65: {fileID: 65000013092476136} - - 65: {fileID: 65000013413917816} + - component: {fileID: 224000011571037388} + - component: {fileID: 33000012601387000} + - component: {fileID: 23000013593520400} + - component: {fileID: 114000014181189902} + - component: {fileID: 65000012469590154} + - component: {fileID: 65000012136550866} + - component: {fileID: 65000010544999880} + - component: {fileID: 65000012534630730} + - component: {fileID: 65000011774431502} + - component: {fileID: 65000013092476136} + - component: {fileID: 65000013413917816} m_Layer: 5 m_Name: PrimaryGradientButton m_TagString: Untagged @@ -122,11 +122,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000013614942004} - - 33: {fileID: 33000012298580722} - - 23: {fileID: 23000013623333764} + - component: {fileID: 4000013614942004} + - component: {fileID: 33000012298580722} + - component: {fileID: 23000013623333764} m_Layer: 0 m_Name: PinnedToolButtonInset m_TagString: Untagged @@ -139,11 +139,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000011771676402} - - 33: {fileID: 33000012558278368} - - 23: {fileID: 23000012760767544} + - component: {fileID: 4000011771676402} + - component: {fileID: 33000012558278368} + - component: {fileID: 23000012760767544} m_Layer: 0 m_Name: PinnedToolButtonFaceMask m_TagString: Untagged @@ -156,9 +156,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000010683372396} + - component: {fileID: 4000010683372396} m_Layer: 5 m_Name: TooltipTarget m_TagString: Untagged @@ -171,10 +171,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012079080268} - - 225: {fileID: 225000012815828682} + - component: {fileID: 4000012079080268} + - component: {fileID: 225000012815828682} m_Layer: 5 m_Name: SecondaryUIContainer m_TagString: Untagged @@ -187,11 +187,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010919883134} - - 222: {fileID: 222000013364307902} - - 114: {fileID: 114000013366903114} + - component: {fileID: 224000010919883134} + - component: {fileID: 222000013364307902} + - component: {fileID: 114000013366903114} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -204,9 +204,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000010261126032} + - component: {fileID: 4000010261126032} m_Layer: 0 m_Name: PinnedToolButtonMesh m_TagString: Untagged @@ -219,10 +219,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000011872301252} - - 225: {fileID: 225000010727404378} + - component: {fileID: 4000011872301252} + - component: {fileID: 225000010727404378} m_Layer: 5 m_Name: IconContainer m_TagString: Untagged @@ -235,9 +235,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000013378434912} + - component: {fileID: 4000013378434912} m_Layer: 5 m_Name: TooltipSource m_TagString: Untagged @@ -250,9 +250,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000013747407424} + - component: {fileID: 4000013747407424} m_Layer: 5 m_Name: RotatedUIContainer m_TagString: Untagged @@ -265,11 +265,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013307387580} - - 222: {fileID: 222000013531508252} - - 114: {fileID: 114000013859744370} + - component: {fileID: 224000013307387580} + - component: {fileID: 222000013531508252} + - component: {fileID: 114000013859744370} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -282,9 +282,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000013373873342} + - component: {fileID: 4000013373873342} m_Layer: 0 m_Name: PinnedToolButtonMeshOld m_TagString: Untagged @@ -297,11 +297,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011657560110} - - 222: {fileID: 222000011737525400} - - 114: {fileID: 114000011928962840} + - component: {fileID: 224000011657560110} + - component: {fileID: 222000011737525400} + - component: {fileID: 114000011928962840} m_Layer: 5 m_Name: Background m_TagString: Untagged @@ -314,10 +314,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000013243584372} - - 137: {fileID: 137000012837336366} + - component: {fileID: 4000013243584372} + - component: {fileID: 137000012837336366} m_Layer: 0 m_Name: PinnedToolSecondaryButtonInset m_TagString: Untagged @@ -330,10 +330,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000011544681006} - - 137: {fileID: 137000013542685126} + - component: {fileID: 4000011544681006} + - component: {fileID: 137000013542685126} m_Layer: 0 m_Name: PinnedToolButtonInset m_TagString: Untagged @@ -346,10 +346,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013167097666} - - 223: {fileID: 223000013382208598} + - component: {fileID: 224000013167097666} + - component: {fileID: 223000013382208598} m_Layer: 5 m_Name: UIContainer m_TagString: Untagged @@ -362,10 +362,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000011352500524} - - 137: {fileID: 137000011420067172} + - component: {fileID: 4000011352500524} + - component: {fileID: 137000011420067172} m_Layer: 0 m_Name: PinnedToolButtonFaceMask m_TagString: Untagged @@ -378,11 +378,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012246060254} - - 222: {fileID: 222000013219081446} - - 114: {fileID: 114000012344975988} + - component: {fileID: 224000012246060254} + - component: {fileID: 222000013219081446} + - component: {fileID: 114000012344975988} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -395,12 +395,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012388631740} - - 114: {fileID: 114000011926581952} - - 225: {fileID: 225000011672881634} - - 65: {fileID: 65000010916098064} + - component: {fileID: 224000012388631740} + - component: {fileID: 114000011926581952} + - component: {fileID: 225000011672881634} + - component: {fileID: 65000010916098064} m_Layer: 5 m_Name: LeftActionButton m_TagString: Untagged @@ -413,10 +413,10 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012297013730} - - 137: {fileID: 137000010072420284} + - component: {fileID: 4000012297013730} + - component: {fileID: 137000010072420284} m_Layer: 0 m_Name: PinnedToolSecondaryButtonFaceMask m_TagString: Untagged @@ -429,11 +429,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013975901740} - - 222: {fileID: 222000012834606604} - - 114: {fileID: 114000013055861932} + - component: {fileID: 224000013975901740} + - component: {fileID: 222000012834606604} + - component: {fileID: 114000013055861932} m_Layer: 5 m_Name: Background m_TagString: Untagged @@ -446,11 +446,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013910327088} - - 222: {fileID: 222000011018194712} - - 114: {fileID: 114000012662170858} + - component: {fileID: 224000013910327088} + - component: {fileID: 222000011018194712} + - component: {fileID: 114000012662170858} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -463,11 +463,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013933582366} - - 222: {fileID: 222000011708094976} - - 114: {fileID: 114000010635728284} + - component: {fileID: 224000013933582366} + - component: {fileID: 222000011708094976} + - component: {fileID: 114000010635728284} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -480,13 +480,13 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000012760332454} - - 222: {fileID: 222000011673250278} - - 114: {fileID: 114000011796366970} - - 114: {fileID: 114000013866165818} - - 114: {fileID: 114000013570860828} + - component: {fileID: 224000012760332454} + - component: {fileID: 222000011673250278} + - component: {fileID: 114000011796366970} + - component: {fileID: 114000013866165818} + - component: {fileID: 114000013570860828} m_Layer: 5 m_Name: ActionButtonsMask m_TagString: Untagged @@ -499,12 +499,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000014065128128} - - 114: {fileID: 114000013773965116} - - 225: {fileID: 225000013730456080} - - 65: {fileID: 65000012740030200} + - component: {fileID: 224000014065128128} + - component: {fileID: 114000013773965116} + - component: {fileID: 225000013730456080} + - component: {fileID: 65000012740030200} m_Layer: 5 m_Name: RightActionButton m_TagString: Untagged @@ -517,11 +517,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013218953584} - - 222: {fileID: 222000014289754014} - - 114: {fileID: 114000013828986210} + - component: {fileID: 224000013218953584} + - component: {fileID: 222000014289754014} + - component: {fileID: 114000013828986210} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -534,11 +534,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012190781878} - - 33: {fileID: 33000011006197312} - - 23: {fileID: 23000013664958186} + - component: {fileID: 4000012190781878} + - component: {fileID: 33000011006197312} + - component: {fileID: 23000013664958186} m_Layer: 0 m_Name: ButtonMesh m_TagString: Untagged @@ -551,17 +551,17 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011060550722} - - 114: {fileID: 114000010373680160} - - 65: {fileID: 65000011941282114} - - 65: {fileID: 65000012371166842} - - 65: {fileID: 65000010009342954} - - 65: {fileID: 65000011946148642} - - 65: {fileID: 65000012409633396} - - 65: {fileID: 65000010321053192} - - 65: {fileID: 65000011573248474} + - component: {fileID: 224000011060550722} + - component: {fileID: 114000010373680160} + - component: {fileID: 65000011941282114} + - component: {fileID: 65000012371166842} + - component: {fileID: 65000010009342954} + - component: {fileID: 65000011946148642} + - component: {fileID: 65000012409633396} + - component: {fileID: 65000010321053192} + - component: {fileID: 65000011573248474} m_Layer: 5 m_Name: SecondaryGradientButton m_TagString: Untagged @@ -574,11 +574,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 4: {fileID: 4000012896115128} - - 33: {fileID: 33000012464504980} - - 23: {fileID: 23000013529982034} + - component: {fileID: 4000012896115128} + - component: {fileID: 33000012464504980} + - component: {fileID: 23000013529982034} m_Layer: 0 m_Name: PinnedToolButtonFrame m_TagString: Untagged @@ -586,6 +586,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1431581445204510 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4181584002966386} + m_Layer: 5 + m_Name: PrimaryUIContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4000010261126032 Transform: m_ObjectHideFlags: 1 @@ -595,7 +610,6 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0.05} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000011352500524} - {fileID: 4000012609671830} @@ -604,6 +618,7 @@ Transform: - {fileID: 4000013243584372} m_Father: {fileID: 4000012648346800} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000010683372396 Transform: m_ObjectHideFlags: 1 @@ -613,10 +628,10 @@ Transform: m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.24310015} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012648346800} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!4 &4000011352500524 Transform: m_ObjectHideFlags: 1 @@ -626,10 +641,10 @@ Transform: m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000010261126032} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000011544681006 Transform: m_ObjectHideFlags: 1 @@ -639,10 +654,10 @@ Transform: m_LocalRotation: {x: -0, y: 0.09801716, z: -0, w: 0.9951847} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000010261126032} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000011771676402 Transform: m_ObjectHideFlags: 1 @@ -652,10 +667,10 @@ Transform: m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000013373873342} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000011872301252 Transform: m_ObjectHideFlags: 1 @@ -663,14 +678,14 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011490841208} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -2.0372681e-10, y: -0.0027, z: 0} - m_LocalScale: {x: 0.85, y: 0.85, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 224000010289694770} - {fileID: 224000013307387580} - m_Father: {fileID: 224000013167097666} - m_RootOrder: 1 + m_Father: {fileID: 4181584002966386} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012079080268 Transform: m_ObjectHideFlags: 1 @@ -680,12 +695,12 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -2.0372681e-10, y: -0.0624, z: -0} m_LocalScale: {x: 0.9999999, y: 1.0000001, z: 1.0000001} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000012246060254} - {fileID: 224000013933582366} m_Father: {fileID: 224000013167097666} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012190781878 Transform: m_ObjectHideFlags: 1 @@ -695,10 +710,10 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -2.0372681e-10, y: -0.00120008, z: 0} m_LocalScale: {x: 2.7019417, y: 2.7019417, z: 2.7019417} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000013167097666} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012297013730 Transform: m_ObjectHideFlags: 1 @@ -708,10 +723,10 @@ Transform: m_LocalRotation: {x: -0, y: 0.09801716, z: -0, w: 0.9951847} m_LocalPosition: {x: -0.00034302473, y: 0.002743939, z: -0.24102153} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000010261126032} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012504767854 Transform: m_ObjectHideFlags: 1 @@ -721,11 +736,11 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0.025} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000012648346800} m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012609671830 Transform: m_ObjectHideFlags: 1 @@ -735,10 +750,10 @@ Transform: m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000010261126032} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012648346800 Transform: m_ObjectHideFlags: 1 @@ -748,7 +763,6 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.05} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000010683372396} - {fileID: 4000013378434912} @@ -759,6 +773,7 @@ Transform: - {fileID: 4000013747407424} m_Father: {fileID: 4000012504767854} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012896115128 Transform: m_ObjectHideFlags: 1 @@ -768,10 +783,10 @@ Transform: m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000013373873342} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013243584372 Transform: m_ObjectHideFlags: 1 @@ -781,10 +796,10 @@ Transform: m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000010261126032} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013373873342 Transform: m_ObjectHideFlags: 1 @@ -794,13 +809,13 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0.05} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 4000011771676402} - {fileID: 4000012896115128} - {fileID: 4000013614942004} m_Father: {fileID: 4000012648346800} m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013378434912 Transform: m_ObjectHideFlags: 1 @@ -810,10 +825,10 @@ Transform: m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.18990004} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012648346800} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!4 &4000013614942004 Transform: m_ObjectHideFlags: 1 @@ -823,10 +838,10 @@ Transform: m_LocalRotation: {x: -0, y: 0.09801716, z: -0, w: 0.9951847} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000013373873342} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013747407424 Transform: m_ObjectHideFlags: 1 @@ -836,11 +851,25 @@ Transform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.000000026077032} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013167097666} m_Father: {fileID: 4000012648346800} m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4181584002966386 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1431581445204510} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.0027000012, z: 0} + m_LocalScale: {x: 0.85, y: 0.8500005, z: 1} + m_Children: + - {fileID: 4000011872301252} + m_Father: {fileID: 224000013167097666} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!23 &23000012760767544 MeshRenderer: m_ObjectHideFlags: 1 @@ -855,7 +884,9 @@ MeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -863,12 +894,13 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!23 &23000013529982034 MeshRenderer: @@ -884,7 +916,9 @@ MeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: 5c092e872a72dd144a84ae7da8095049, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -892,12 +926,13 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!23 &23000013593520400 MeshRenderer: @@ -913,7 +948,9 @@ MeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: 6adae681ad457e140ac31a9ac83c3a11, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -921,12 +958,13 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!23 &23000013623333764 MeshRenderer: @@ -942,7 +980,9 @@ MeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -950,12 +990,13 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!23 &23000013664958186 MeshRenderer: @@ -972,7 +1013,9 @@ MeshRenderer: m_Materials: - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -980,12 +1023,13 @@ MeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!33 &33000011006197312 MeshFilter: @@ -1225,7 +1269,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_NormalGradientPair: a: {r: 1, g: 0.92156863, b: 0.93333334, a: 1} b: {r: 0.7176471, g: 0.10980392, b: 0.10980392, a: 1} @@ -1256,7 +1299,6 @@ MonoBehaviour: m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 0 @@ -1290,10 +1332,10 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d327b5d520391fe4da32c92a940cfbfa, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_GradientButton: {fileID: 114000014181189902} m_SmoothMotion: {fileID: 0} m_IconContainer: {fileID: 4000011872301252} + m_PrimaryUIContentContainer: {fileID: 4181584002966386} m_IconContainerCanvasGroup: {fileID: 225000010727404378} m_FrameRenderer: {fileID: 137000012108747896} m_InsetMeshRenderer: {fileID: 137000013542685126} @@ -1327,7 +1369,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -1355,7 +1396,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} m_RaycastTarget: 0 @@ -1383,7 +1423,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_IconSprite: {fileID: 21300000, guid: fc47de3bcfede8d49b869829e6ff0c0a, type: 3} m_IconContainer: {fileID: 224000012388631740} m_ContentContainer: {fileID: 224000012388631740} @@ -1407,7 +1446,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} m_RaycastTarget: 0 @@ -1435,7 +1473,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -1463,7 +1500,6 @@ MonoBehaviour: m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -1497,7 +1533,6 @@ MonoBehaviour: m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 @@ -1531,7 +1566,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0.5411765, g: 0.7607843, b: 0.28627452, a: 1} m_RaycastTarget: 0 @@ -1559,7 +1593,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} m_RaycastTarget: 0 @@ -1587,7 +1620,6 @@ MonoBehaviour: m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Padding: m_Left: 0 m_Right: 0 @@ -1597,6 +1629,8 @@ MonoBehaviour: m_Spacing: 0 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 --- !u!114 &114000013773965116 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1608,7 +1642,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_IconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, type: 3} m_IconContainer: {fileID: 224000014065128128} m_ContentContainer: {fileID: 224000014065128128} @@ -1632,7 +1665,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} m_RaycastTarget: 0 @@ -1660,7 +1692,6 @@ MonoBehaviour: m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 0 @@ -1694,7 +1725,6 @@ MonoBehaviour: m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_ShowMaskGraphic: 0 --- !u!114 &114000014181189902 MonoBehaviour: @@ -1707,7 +1737,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_NormalGradientPair: a: {r: 0, g: 0, b: 0, a: 0} b: {r: 0, g: 0, b: 0, a: 0} @@ -1721,7 +1750,7 @@ MonoBehaviour: m_Text: {fileID: 114000013859744370} m_Icon: {fileID: 114000011650556854} m_AlternateIconSprite: {fileID: 0} - m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + m_NormalContentColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItems: - {fileID: 114000011650556854} @@ -1742,7 +1771,9 @@ SkinnedMeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -1750,12 +1781,13 @@ SkinnedMeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 serializedVersion: 2 m_Quality: 0 @@ -1784,7 +1816,9 @@ SkinnedMeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -1792,12 +1826,13 @@ SkinnedMeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 serializedVersion: 2 m_Quality: 0 @@ -1825,7 +1860,9 @@ SkinnedMeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: 5c092e872a72dd144a84ae7da8095049, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -1833,12 +1870,13 @@ SkinnedMeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 serializedVersion: 2 m_Quality: 0 @@ -1868,7 +1906,9 @@ SkinnedMeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: ef6d03792ba2890479b324aa1f065715, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -1876,12 +1916,13 @@ SkinnedMeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 serializedVersion: 2 m_Quality: 0 @@ -1910,7 +1951,9 @@ SkinnedMeshRenderer: m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} - m_SubsetIndices: + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} @@ -1918,12 +1961,13 @@ SkinnedMeshRenderer: m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_SelectedWireframeHidden: 0 + m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 serializedVersion: 2 m_Quality: 0 @@ -2011,7 +2055,7 @@ Canvas: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012194113842} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 2 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -2020,6 +2064,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -2032,10 +2077,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.000027384143} m_LocalScale: {x: 2.7019417, y: 2.7019424, z: 2.7019436} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000011872301252} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -7.8898665e-11, y: 0.00000038940925} @@ -2050,10 +2095,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.000010134187} m_LocalScale: {x: 0.00008000002, y: 0.00008000015, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000014065128128} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} @@ -2068,10 +2113,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.0017} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000014065128128} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: -0.0002999992} @@ -2086,10 +2131,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.15000011} m_LocalScale: {x: 0.42501074, y: 0.49999997, z: 0.42501074} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012648346800} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} @@ -2104,10 +2149,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.15000011} m_LocalScale: {x: 0.425, y: 0.50000024, z: 0.42500025} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012648346800} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} @@ -2122,10 +2167,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.0008} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000014065128128} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0.0000032186508, y: -0.000000029802322} @@ -2140,10 +2185,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.000027384143} m_LocalScale: {x: 2.7019417, y: 2.7019424, z: 2.7019436} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012079080268} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -7.8898665e-11, y: 0.00000038940925} @@ -2158,13 +2203,13 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0.001} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013975901740} - {fileID: 224000013218953584} - {fileID: 224000013910327088} m_Father: {fileID: 224000012760332454} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0.017025, y: -0.03575} @@ -2179,12 +2224,12 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.0030222163} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000012388631740} - {fileID: 224000014065128128} m_Father: {fileID: 224000013167097666} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -2.3283064e-10, y: -0.0012286394} @@ -2199,14 +2244,14 @@ RectTransform: m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: -0.1471} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_Children: - {fileID: 224000012760332454} - - {fileID: 4000011872301252} + - {fileID: 4181584002966386} - {fileID: 4000012190781878} - {fileID: 4000012079080268} m_Father: {fileID: 4000013747407424} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -0.00039896322, y: -9.1830804e-10} @@ -2221,10 +2266,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.0017} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000012388631740} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: -0.0002999992} @@ -2239,10 +2284,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.00021615531, y: 0.00021615547, z: 2.7019436} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000011872301252} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0.00020984784, y: 0.0013569929} @@ -2257,10 +2302,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.000010134187} m_LocalScale: {x: 0.00008000002, y: 0.00008000015, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000012388631740} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} @@ -2275,10 +2320,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.00021615531, y: 0.00021615547, z: 2.7019436} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 4000012079080268} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0.00020984784, y: 0.0013569929} @@ -2293,10 +2338,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -0.0008} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000012388631740} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0.0000032186508, y: -0.000000029802322} @@ -2311,13 +2356,13 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0.001} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000011657560110} - {fileID: 224000010919883134} - {fileID: 224000010555036514} m_Father: {fileID: 224000012760332454} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0.051074997, y: -0.03575} From 775522d7c2e127d7b525c826c6f60429f3c15411 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 19 Jul 2017 20:33:57 -0700 Subject: [PATCH 637/870] Expose GradientButton's IconHighlightLocalZOffset in inspector; set to greater value in PinnedToolButton prefab in order to better accentuate the highlight state of PinnedToolButtons --- .../PinnedToolButton/PinnedToolButton.prefab | 2 ++ Scripts/UI/GradientButton.cs | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab index d425d82c5..8ee8b42e7 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab @@ -1269,6 +1269,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} m_Name: m_EditorClassIdentifier: + m_IconHighlightedLocalZOffset: -0.0015 m_NormalGradientPair: a: {r: 1, g: 0.92156863, b: 0.93333334, a: 1} b: {r: 0.7176471, g: 0.10980392, b: 0.10980392, a: 1} @@ -1737,6 +1738,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} m_Name: m_EditorClassIdentifier: + m_IconHighlightedLocalZOffset: -0.0155 m_NormalGradientPair: a: {r: 0, g: 0, b: 0, a: 0} b: {r: 0, g: 0, b: 0, a: 0} diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 24306813e..95714c668 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -12,11 +12,13 @@ namespace UnityEditor.Experimental.EditorVR.UI { sealed class GradientButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler { - const float k_IconHighlightedLocalZOffset = -0.0015f; const string k_MaterialAlphaProperty = "_Alpha"; const string k_MaterialColorTopProperty = "_ColorTop"; const string k_MaterialColorBottomProperty = "_ColorBottom"; + [SerializeField] + float m_IconHighlightedLocalZOffset = -0.0015f; + public event Action click; public event Action hoverEnter; public event Action hoverExit; @@ -223,8 +225,8 @@ void Awake() m_OriginalIconLocalPosition = m_IconContainer.localPosition; m_OriginalContentContainerLocalScale = m_ContentContainer.localScale; m_HighlightContentContainerLocalScale = new Vector3(m_OriginalContentContainerLocalScale.x, m_OriginalContentContainerLocalScale.y, m_OriginalContentContainerLocalScale.z * m_highlightZScaleMultiplier); - m_IconHighlightedLocalPosition = m_OriginalIconLocalPosition + Vector3.forward * k_IconHighlightedLocalZOffset; - m_IconPressedLocalPosition = m_OriginalIconLocalPosition + Vector3.back * k_IconHighlightedLocalZOffset; + m_IconHighlightedLocalPosition = m_OriginalIconLocalPosition + Vector3.forward * m_IconHighlightedLocalZOffset; + m_IconPressedLocalPosition = m_OriginalIconLocalPosition + Vector3.back * m_IconHighlightedLocalZOffset; m_Icon.color = m_NormalContentColor; m_Text.color = m_NormalContentColor; From bf413323a4b1285918af4aa20368990aaec833dc Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 19 Jul 2017 20:54:50 -0700 Subject: [PATCH 638/870] WIP --- .../IRegisterRayVisibilitySettings.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs index 50ae41637..333cc21df 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs @@ -4,18 +4,17 @@ namespace UnityEditor.Experimental.EditorVR { + public delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, T settings, int priority = 0); /// /// Implementors can show & hide the default ray /// - public interface IRegisterRayVisibilitySettings + public interface IRegisterRayVisibilitySettings { + RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { set; } } public static class IRegisterRayVisibilitySettingsMethods { - internal delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); - - internal static RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } internal static Action unregisterRayVisibilitySettings { get; set; } /// @@ -26,9 +25,9 @@ public static class IRegisterRayVisibilitySettingsMethods /// Show or hide /// An optional parameter to hide or show only the ray and not the cone /// The priority level of this request - public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) + public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, T settings, int priority = 0) { - registerRayVisibilitySettings(rayOrigin, caller, rayVisible, coneVisible, priority); + customRay.registerRayVisibilitySettings(rayOrigin, caller, settings, priority); } /// @@ -36,7 +35,7 @@ public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySett /// /// The ray to hide or show /// The object which has locked the ray - public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) + public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) { unregisterRayVisibilitySettings(rayOrigin, caller); } From f78ee6af3cd53a0cd8f8fae0b8273abf288b0a72 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 01:17:10 -0700 Subject: [PATCH 639/870] Refactor IRegisterRayVisibilitySettings to take generic settings object --- Scripts/Core/EditorVR.MiniWorlds.cs | 11 ++----- Scripts/Core/EditorVR.Rays.cs | 16 ++++++---- .../IRegisterRayVisibilitySettings.cs | 12 ++++---- Scripts/Modules/KeyboardModule.cs | 9 ++++-- Scripts/Proxies/DefaultProxyRay.cs | 30 +++++++++---------- .../CreatePrimitiveTool.cs | 10 +++++-- Tools/LocomotionTool/LocomotionTool.cs | 21 ++++++++----- .../MoveWorkspacesTool/MoveWorkspacesTool.cs | 11 +++++-- Tools/TransformTool/TransformTool.cs | 15 ++++++---- .../MiniWorldWorkspace/MiniWorldWorkspace.cs | 6 ++-- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 9 ++++-- 11 files changed, 91 insertions(+), 59 deletions(-) diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index f7d129260..da75ad718 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -7,7 +7,6 @@ using UnityEditor.Experimental.EditorVR.Utilities; using UnityEditor.Experimental.EditorVR.Workspaces; using UnityEngine; -using UnityEngine.InputNew; namespace UnityEditor.Experimental.EditorVR.Core { @@ -16,6 +15,8 @@ partial class EditorVR class MiniWorlds : Nested, ILateBindInterfaceMethods, IPlaceSceneObjects, IUsesViewerScale, IUsesSpatialHash { + static readonly DefaultRayVisibilitySettings k_HideRayettings = new DefaultRayVisibilitySettings { coneVisible = true }; + internal class MiniWorldRay { readonly List m_GrabData = new List(); @@ -475,13 +476,10 @@ internal void UpdateMiniWorlds() } if (isContained && !wasContained) - Rays.RegisterVisibilitySettings(rayOrigin, this, false, true); + Rays.RegisterVisibilitySettings(rayOrigin, this, k_HideRayettings); if (!isContained && wasContained) - { - Rays.RegisterVisibilitySettings(rayOrigin, this, true, true); Rays.UnregisterVisibilitySettings(rayOrigin, this); - } m_RayWasContained[rayOrigin] = isContained; }); @@ -589,10 +587,7 @@ void OnObjectsDropped(Transform rayOrigin, Transform[] grabbedObjects) miniWorldRay.dragStartedOutside = false; if (!miniWorldRay.isContained) - { - Rays.RegisterVisibilitySettings(rayOrigin, this, true, true); Rays.UnregisterVisibilitySettings(rayOrigin, this); - } } } } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 035a2bce9..baa4ad932 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -20,6 +20,8 @@ partial class EditorVR class Rays : Nested, IInterfaceConnector { + static readonly DefaultRayVisibilitySettings k_HideSettings = new DefaultRayVisibilitySettings(); + internal delegate void ForEachProxyDeviceCallback(DeviceData deviceData); const float k_DefaultRayLength = 100f; @@ -39,7 +41,6 @@ public Rays() ISetDefaultRayColorMethods.setDefaultRayColor = SetDefaultRayColor; IGetDefaultRayColorMethods.getDefaultRayColor = GetDefaultRayColor; - IRegisterRayVisibilitySettingsMethods.registerRayVisibilitySettings = RegisterVisibilitySettings; IRegisterRayVisibilitySettingsMethods.unregisterRayVisibilitySettings = UnregisterVisibilitySettings; IForEachRayOriginMethods.forEachRayOrigin = ForEachRayOrigin; @@ -98,6 +99,12 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) selectionModule.getGroupRoot = GetGroupRoot; selectionModule.overrideSelectObject = OverrideSelectObject; } + + var registerVisibility = obj as IRegisterRayVisibilitySettings; + if (registerVisibility != null) + { + registerVisibility.registerRayVisibilitySettings = RegisterVisibilitySettings; + } } public void DisconnectInterface(object obj, Transform rayOrigin = null) @@ -110,11 +117,10 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig var customMenu = deviceData.customMenu; if (mainMenu.visible || (customMenu != null && customMenu.visible)) { - RegisterVisibilitySettings(rayOrigin, mainMenu, false, false); + RegisterVisibilitySettings(rayOrigin, mainMenu, k_HideSettings); } else { - RegisterVisibilitySettings(rayOrigin, mainMenu, true, true); UnregisterVisibilitySettings(rayOrigin, mainMenu); } } @@ -408,13 +414,13 @@ internal static bool IsRayActive(Transform rayOrigin) return dpr == null || dpr.rayVisible; } - internal static void RegisterVisibilitySettings(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) + internal static void RegisterVisibilitySettings(Transform rayOrigin, object caller, DefaultRayVisibilitySettings settings) { if (rayOrigin) { var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - dpr.SetVisibility(caller, rayVisible, coneVisible, priority); + dpr.SetVisibility(caller, settings); } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs index 333cc21df..2a735e6a1 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs @@ -4,7 +4,7 @@ namespace UnityEditor.Experimental.EditorVR { - public delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, T settings, int priority = 0); + public delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, T settings); /// /// Implementors can show & hide the default ray /// @@ -25,17 +25,17 @@ public static class IRegisterRayVisibilitySettingsMethods /// Show or hide /// An optional parameter to hide or show only the ray and not the cone /// The priority level of this request - public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, T settings, int priority = 0) - { - customRay.registerRayVisibilitySettings(rayOrigin, caller, settings, priority); - } + //public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, T settings, int priority = 0) + //{ + // customRay.registerRayVisibilitySettings(rayOrigin, caller, settings, priority); + //} /// /// Unregister visibility settings /// /// The ray to hide or show /// The object which has locked the ray - public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) + public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) { unregisterRayVisibilitySettings(rayOrigin, caller); } diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index 19574b725..71b1dfe1c 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -2,14 +2,17 @@ using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class KeyboardModule : MonoBehaviour, IRegisterRayVisibilitySettings, IForEachRayOrigin, IConnectInterfaces + sealed class KeyboardModule : MonoBehaviour, IRegisterRayVisibilitySettings, IForEachRayOrigin, IConnectInterfaces { + static readonly DefaultRayVisibilitySettings k_HideSettings = new DefaultRayVisibilitySettings(); + [SerializeField] KeyboardMallet m_KeyboardMalletPrefab; @@ -23,6 +26,8 @@ sealed class KeyboardModule : MonoBehaviour, IRegisterRayVisibilitySettings, IFo KeyboardUI m_NumericKeyboard; KeyboardUI m_StandardKeyboard; + public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { private get; set; } + public KeyboardUI SpawnNumericKeyboard() { if (m_StandardKeyboard != null) @@ -98,7 +103,7 @@ public void UpdateKeyboardMallets() { mallet.visible = malletVisible; if (malletVisible) - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); + registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); else this.UnregisterRayVisibilitySettings(rayOrigin, this); } diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 30c3ed2c7..80074e1e7 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -9,17 +9,15 @@ namespace UnityEditor.Experimental.EditorVR.Proxies { - sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale + public struct DefaultRayVisibilitySettings { - const float k_SetVisibilityDelay = 0.125f; - - class VisibilitySettings - { - public int priority; - public bool rayVisible; - public bool coneVisible; - } + public int priority; + public bool rayVisible; + public bool coneVisible; + } + sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale + { [SerializeField] VRLineRenderer m_LineRenderer; @@ -46,7 +44,7 @@ class VisibilitySettings /// As long as this reference is set, and the ray is locked, only that object can unlock the ray. /// If the object reference becomes null, the ray will be free to show/hide/lock/unlock until another locking entity takes ownership. /// - readonly Dictionary m_VisibilitySettings = new Dictionary(); + readonly Dictionary m_VisibilitySettings = new Dictionary(); public void UnsetRayVisibility(object caller) @@ -78,18 +76,18 @@ void OnDisable() this.StopCoroutine(ref m_ConeVisibilityCoroutine); } - public void SetVisibility(object caller, bool rayVisible, bool coneVisible, int priority = 0) + public void SetVisibility(object caller, DefaultRayVisibilitySettings newSettings) { - VisibilitySettings settings; + DefaultRayVisibilitySettings settings; if (!m_VisibilitySettings.TryGetValue(caller, out settings)) { - settings = new VisibilitySettings(); + settings = new DefaultRayVisibilitySettings(); m_VisibilitySettings[caller] = settings; } - settings.rayVisible = rayVisible; - settings.coneVisible = coneVisible; - settings.priority = priority; + settings.rayVisible = newSettings.rayVisible; + settings.coneVisible = newSettings.coneVisible; + settings.priority = newSettings.priority; } public void SetLength(float length) diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index a7f5d0448..3b45e30cf 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -7,8 +8,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { [MainMenuItem("Primitive", "Create", "Create primitives in the scene")] sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, IConnectInterfaces, IInstantiateMenuUI, - IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, IRegisterRayVisibilitySettings, IIsHoveringOverUI, - IIsMainMenuVisible + IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, IIsHoveringOverUI, IIsMainMenuVisible, + IRegisterRayVisibilitySettings { [SerializeField] CreatePrimitiveMenu m_MenuPrefab; @@ -26,6 +27,7 @@ sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, ICo Vector3 m_EndPoint = Vector3.zero; PrimitiveCreationStates m_State = PrimitiveCreationStates.StartPoint; + readonly DefaultRayVisibilitySettings m_Settings = new DefaultRayVisibilitySettings { rayVisible = false, coneVisible = true }; public Transform rayOrigin { get; set; } @@ -36,6 +38,8 @@ enum PrimitiveCreationStates Freeform, } + public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } + void Start() { m_ToolMenu = this.InstantiateMenuUI(rayOrigin, m_MenuPrefab); @@ -81,7 +85,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else { - this.RegisterRayVisibilitySettings(rayOrigin, this, false, true); + registerRayVisibilitySettings(rayOrigin, this, m_Settings); } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 248eabdd2..25a60b80c 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -11,8 +12,9 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, IRegisterRayVisibilitySettings, - ICustomActionMap, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences + sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ICustomActionMap, ILinkedObject, + IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences, + IRegisterRayVisibilitySettings { const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 1f; @@ -101,6 +103,9 @@ class Preferences Toggle m_BlinkToggle; bool m_BlockValueChangedListener; + readonly DefaultRayVisibilitySettings m_Settings = new DefaultRayVisibilitySettings + { rayVisible = false, coneVisible = true, priority = k_RayHidePriority }; + public ActionMap actionMap { get { return m_BlinkActionMap; } } public Transform rayOrigin { get; set; } @@ -111,6 +116,8 @@ class Preferences public GameObject settingsMenuItemPrefab { get { return m_SettingsMenuItemPrefab; } } + public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } + public GameObject settingsMenuItemInstance { set @@ -189,7 +196,7 @@ void OnDisable() void OnDestroy() { - this.RegisterRayVisibilitySettings(rayOrigin, this, true, true); + this.UnregisterRayVisibilitySettings(rayOrigin, this); if (m_ViewerScaleVisuals) ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); @@ -328,7 +335,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + registerRayVisibilitySettings(rayOrigin, this, m_Settings); } if (m_Crawling) @@ -349,7 +356,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + registerRayVisibilitySettings(rayOrigin, this, m_Settings); m_BlinkVisuals.ShowVisuals(); @@ -411,8 +418,8 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); - this.RegisterRayVisibilitySettings(otherRayOrigin, this, false, false, k_RayHidePriority); + registerRayVisibilitySettings(rayOrigin, this, m_Settings); + registerRayVisibilitySettings(otherRayOrigin, this, m_Settings); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index 732424a17..008422387 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -1,15 +1,18 @@ #if UNITY_EDITOR using System.Collections.Generic; using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEditor.Experimental.EditorVR.Workspaces; using UnityEngine; using UnityEngine.InputNew; [ExecuteInEditMode] -public class MoveWorkspacesTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IRegisterRayVisibilitySettings, IUsesViewerBody, - IResetWorkspaces, IAllWorkspaces, IUsesViewerScale +public class MoveWorkspacesTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesViewerBody, + IResetWorkspaces, IAllWorkspaces, IUsesViewerScale, IRegisterRayVisibilitySettings { + static readonly DefaultRayVisibilitySettings k_HideSettings = new DefaultRayVisibilitySettings(); + enum State { WaitingForInput, @@ -37,6 +40,8 @@ enum State public Transform rayOrigin { private get; set; } public List allWorkspaces { private get; set; } + public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var action = ((Standard)input).action; @@ -158,7 +163,7 @@ void StartMove() m_State = State.MoveWorkspaces; - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); + registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); foreach (var ws in allWorkspaces) { diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index dc7e66b4f..464a717e1 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -4,6 +4,7 @@ using System.Linq; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Manipulators; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -11,9 +12,9 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, - IGrabObjects, IRegisterRayVisibilitySettings, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, - ILinkedObject, IRayToNode, IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, - IIsMainMenuVisible + IGrabObjects, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, ILinkedObject, IRayToNode, + IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, + IRegisterRayVisibilitySettings { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -22,6 +23,8 @@ sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChang const int k_RayHidePriority = 1; + static readonly DefaultRayVisibilitySettings k_HideRaySettings = new DefaultRayVisibilitySettings { coneVisible = true, priority = k_RayHidePriority }; + class GrabData { Vector3[] m_PositionOffsets; @@ -245,6 +248,8 @@ public bool manipulatorDragging public ActionMap actionMap { get { return m_ActionMap; } } + public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } + void Start() { if (!this.IsSharedUpdater(this)) @@ -337,7 +342,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var transformInput = transformTool.m_Input; - this.RegisterRayVisibilitySettings(directRayOrigin, this, false, true, k_RayHidePriority); // This will also disable ray selection + registerRayVisibilitySettings(directRayOrigin, this, k_HideRaySettings); // This will also disable ray selection if (transformInput.select.wasJustPressed) { @@ -557,7 +562,7 @@ public Transform[] GetHeldObjects(Node node) // Prevent lock from getting stuck this.UnregisterRayVisibilitySettings(rayOrigin, this); - this.RegisterRayVisibilitySettings(destRayOrigin, this, false, true); + registerRayVisibilitySettings(destRayOrigin, this, k_HideRaySettings); if (objectsTransferred != null) objectsTransferred(rayOrigin, destRayOrigin); diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs index f7188b9b6..8cd344b44 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs @@ -3,7 +3,7 @@ using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Handles; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -14,7 +14,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { [MainMenuItem("MiniWorld", "Workspaces", "Edit a smaller version of your scene(s)", typeof(MiniWorldTooltip))] - sealed class MiniWorldWorkspace : Workspace, ISerializeWorkspace, IRegisterRayVisibilitySettings + sealed class MiniWorldWorkspace : Workspace, ISerializeWorkspace, IRegisterRayVisibilitySettings { class MiniWorldTooltip : ITooltip { @@ -104,6 +104,8 @@ public float zoomSliderMax set { m_ZoomSliderUI.zoomSlider.maxValue = Mathf.Log10(value); } } + public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } + public override void Setup() { const float yBounds = 0.5f; diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index c0cd0f9b6..24f39c8be 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -5,6 +5,7 @@ using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Handles; using UnityEditor.Experimental.EditorVR.Helpers; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.UI; @@ -12,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { sealed class AssetGridItem : DraggableListItem, IPlaceSceneObject, IUsesSpatialHash, - IUsesViewerBody, IRegisterRayVisibilitySettings + IUsesViewerBody, IRegisterRayVisibilitySettings { const float k_PreviewDuration = 0.1f; const float k_MinPreviewScale = 0.01f; @@ -64,6 +65,8 @@ sealed class AssetGridItem : DraggableListItem, IPlaceSceneOb Material m_SphereMaterial; + readonly DefaultRayVisibilitySettings m_HideConeSettings = new DefaultRayVisibilitySettings { rayVisible = false, coneVisible = true }; + public GameObject icon { private get @@ -159,6 +162,8 @@ public Texture fallbackTexture public float scaleFactor { private get; set; } + public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } + public override void Setup(AssetData listData) { base.Setup(listData); @@ -298,7 +303,7 @@ protected override void OnDragStarted(BaseHandle handle, HandleEventData eventDa base.OnDragStarted(handle, eventData); var rayOrigin = eventData.rayOrigin; - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); + registerRayVisibilitySettings(rayOrigin, this, m_HideConeSettings); var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); From a46303ee215e47e6272e0a46a5281bee1a27459a Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 10:07:09 -0700 Subject: [PATCH 640/870] Fix RegisterRayVisibilitySettings --- Scripts/Core/EditorVR.Rays.cs | 7 +++-- .../IRegisterRayVisibilitySettings.cs | 6 ++-- Scripts/Proxies/DefaultProxyRay.cs | 31 ++++++++----------- Tools/LocomotionTool/LocomotionTool.cs | 12 +++---- Tools/TransformTool/TransformTool.cs | 1 + 5 files changed, 27 insertions(+), 30 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index baa4ad932..9822d457e 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -420,15 +420,18 @@ internal static void RegisterVisibilitySettings(Transform rayOrigin, object call { var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - dpr.SetVisibility(caller, settings); + dpr.RegisterVisibilitySettings(caller, settings); } } internal static void UnregisterVisibilitySettings(Transform rayOrigin, object obj) { + if (!rayOrigin) // Prevent MissingReferenceException on closing EVR + return; + var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - dpr.UnsetRayVisibility(obj); + dpr.UnregisterVisibilitySettings(obj); } internal void PreProcessRaycastSource(Transform rayOrigin) diff --git a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs index 2a735e6a1..fdf42bbbc 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs @@ -4,11 +4,11 @@ namespace UnityEditor.Experimental.EditorVR { - public delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, T settings); + public delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, T settings); /// /// Implementors can show & hide the default ray /// - public interface IRegisterRayVisibilitySettings + public interface IRegisterRayVisibilitySettings where T : struct { RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { set; } } @@ -35,7 +35,7 @@ public static class IRegisterRayVisibilitySettingsMethods /// /// The ray to hide or show /// The object which has locked the ray - public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) + public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) where T : struct { unregisterRayVisibilitySettings(rayOrigin, caller); } diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 80074e1e7..eaa565b30 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -46,12 +46,6 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale /// readonly Dictionary m_VisibilitySettings = new Dictionary(); - - public void UnsetRayVisibility(object caller) - { - m_VisibilitySettings.Remove(caller); - } - /// /// The length of the direct selection pointer /// @@ -76,18 +70,14 @@ void OnDisable() this.StopCoroutine(ref m_ConeVisibilityCoroutine); } - public void SetVisibility(object caller, DefaultRayVisibilitySettings newSettings) + public void RegisterVisibilitySettings(object caller, DefaultRayVisibilitySettings newSettings) { - DefaultRayVisibilitySettings settings; - if (!m_VisibilitySettings.TryGetValue(caller, out settings)) - { - settings = new DefaultRayVisibilitySettings(); - m_VisibilitySettings[caller] = settings; - } + m_VisibilitySettings[caller] = newSettings; + } - settings.rayVisible = newSettings.rayVisible; - settings.coneVisible = newSettings.coneVisible; - settings.priority = newSettings.priority; + public void UnregisterVisibilitySettings(object caller) + { + m_VisibilitySettings.Remove(caller); } public void SetLength(float length) @@ -147,11 +137,16 @@ void UpdateVisibility() var settings = kvp.Value; if (settings.priority == maxPriority) { + Debug.Log(kvp.Key + ", " + settings.rayVisible + ", " + settings.coneVisible + ", " + settings.priority + ", " + Time.frameCount); rayVisible &= settings.rayVisible; coneVisible &= settings.coneVisible; } } } + else + { + Debug.Log("no settings"); + } if (this.rayVisible != rayVisible) { @@ -218,7 +213,7 @@ IEnumerator ShowRay() IEnumerator HideCone() { - m_Tester.active = false; + //m_Tester.active = false; var currentScale = m_ConeTransform.localScale; var smoothVelocity = Vector3.one; const float kSmoothTime = 0.1875f; @@ -251,7 +246,7 @@ IEnumerator ShowCone() m_ConeTransform.localScale = m_OriginalConeLocalScale; m_ConeVisibilityCoroutine = null; - m_Tester.active = true; + //m_Tester.active = true; } public Color GetColor() diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 25a60b80c..6e003f554 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -23,6 +23,7 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const float k_DistanceThreshold = 0.02f; const int k_RayHidePriority = 2; + static readonly DefaultRayVisibilitySettings k_HideSettings = new DefaultRayVisibilitySettings { priority = k_RayHidePriority }; //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; @@ -103,9 +104,6 @@ class Preferences Toggle m_BlinkToggle; bool m_BlockValueChangedListener; - readonly DefaultRayVisibilitySettings m_Settings = new DefaultRayVisibilitySettings - { rayVisible = false, coneVisible = true, priority = k_RayHidePriority }; - public ActionMap actionMap { get { return m_BlinkActionMap; } } public Transform rayOrigin { get; set; } @@ -335,7 +333,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - registerRayVisibilitySettings(rayOrigin, this, m_Settings); + registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); } if (m_Crawling) @@ -356,7 +354,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - registerRayVisibilitySettings(rayOrigin, this, m_Settings); + registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); m_BlinkVisuals.ShowVisuals(); @@ -418,8 +416,8 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); - registerRayVisibilitySettings(rayOrigin, this, m_Settings); - registerRayVisibilitySettings(otherRayOrigin, this, m_Settings); + registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); + registerRayVisibilitySettings(otherRayOrigin, this, k_HideSettings); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 464a717e1..e2b59444b 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -342,6 +342,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var transformInput = transformTool.m_Input; + Debug.Log("direct " + Time.frameCount); registerRayVisibilitySettings(directRayOrigin, this, k_HideRaySettings); // This will also disable ray selection if (transformInput.select.wasJustPressed) From 6e7d7748d485dd065c68728bda690a8d1d861776 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 12:30:49 -0700 Subject: [PATCH 641/870] Keep intersection testers on at all time; Disable hover and transform when cone is hidden --- Prefabs/DefaultProxyRay.prefab | Bin 13712 -> 13528 bytes Scripts/Core/EditorVR.Rays.cs | 9 ++++++++- .../FunctionalityInjection/IIsRayActive.cs | 10 ++++++++++ .../IntersectionModule/IntersectionModule.cs | 4 ++-- .../IntersectionModule/IntersectionTester.cs | 10 +++++----- Scripts/Proxies/DefaultProxyRay.cs | 8 ++++---- Tools/SelectionTool/SelectionTool.cs | 7 +++++++ Tools/TransformTool/TransformTool.cs | 12 ++++++++---- 8 files changed, 44 insertions(+), 16 deletions(-) diff --git a/Prefabs/DefaultProxyRay.prefab b/Prefabs/DefaultProxyRay.prefab index bfcb37129afa745c7ed636f9f5bb2a3f27f54f2b..fb863e84231993c3b6ed86cc61d7ff6cf14cc491 100644 GIT binary patch literal 13528 zcmeHN3v^V)8JmB#ET^7hPmi}9 z?#y>*{`u#h|NrKnjY^drrPSn?lu}<)s;nMwHD%&46DM`eY>sDAUQ@$__Hwnox3@R4 z8$P{TjDLE2PZ=}nuo4`V2svW%QTstNTo{r)tCkuz9zL(j9& zrk=xz>oO#y=Lie8_2d}Sf3P|cb9!h~pFN0Y`E5u@&ymEV#D|9T97SB0p=us&!n|hAU z;o<%IW)2VU*S9R3`$9WVpZ#+9;LyH|v2a_T{d0IkT>?3Gp-njlr&0}CGnV(iKmjP zZDC%s(Q}gNB`L41-tpXI1|4R_6K>56RO+2ftFG8X(vX^JcfCxvjjD{}wYVA8?tkM@ z)#)TUT$NgUrW?yNxJz8fkGYWB;I^eY-RA04TYD;rIn#PB&TbTDmsBb<+i7!8)`J1m zq|G;9OIic2aO&x!*FSLnHQ#<<>zfl_`PW`D=x=62MUEyMjYl*=jYpjh&pE10|4`tQ za13q;PzZ{IBREM>9G-+@@Ik5+jyD}`u9wB&CJbNLDy!`l(q9u!lz3QwO*j}r+$OGoaE$y$^r3tbPJi+>;Y9n&4+tkLKOmfl zdIa`a1hKRY35QR)O}Z+UiFdkMd02X{-&f3geL{KTpB`_!XwH!O3l4#f*Z8_-u-~D0)A-I0`2VGN zBN2D{acjj}DE@M^D^FST;^rG8QjRPM~m`xy!9iW@n*{r z`HVLk7x|1gk+%=0#P7C?rdK#}vYF*%5`%bToPXk$nU(hBv>NE#3K%EpqaYY>{Ih**l{Uk&{m$ zBFCnXT7^&m6;Z$7ju26+5h7E3y?4i(5A8#|TGxFF!9c-zL{g5SkN|J?ar?-o965S4 zg+xt%hUOLM&(Jg!LOdLrhC+ykL(@=*!Dm{bX()ua2~Dw&KC-oLgLJMd_F?GCe%*lj zT`1f`x|P9;)H3L~9&NajKC*56Ngof6Y!l*}fzy_x5b4iUP4o$lY(x2?4=F_SA?3X7 z%OQpEVJO>jYziUeh@5~z%w6CUjHNy$D17qejMbRIZ8?TQh(|Pq>iqi9j?MeF?`Qd$;ki!l2zV6GPXyGNW|3|>-Cr4_WvLcFj1R(KA#G^_v z9cplsAU052;k;Vyq%-qdo#xazyxlaoF&Al60Mw<(t4+8Vr95`1jkmPo_LExdE=W5q z=907|fzRj_g6o`&>&2Z!TFobC$EG`(SZhskNeV*pktJ~tN^~sd5>(o}t5Y5Nl4tcL zb7QogrYae0O))nN6lzK(I&cx|bUiQLOwIHuP?OX>+MISh)J?lyr@NquYpH2Trabo~ zTq&XEtdv*X>UfzMZpN&J9dPgSGEOoxyN2RiuG4Kc>8&v}wc}KE@npQMqfJYgA3v8+ zRYxYZpsCL3nh{S!hQ3hdFn!#ZT@v+hVZ=QWMoTkc?u$|bXoDCrFpNzmZ1g8hh#Y>4=n`HR zk9OkpUEFf8e+37h4pNTehHKxCLJ;=spph#UJ-p#pXFhS$bGMxIe7cH9%C#sAcRt*+ z6HOI0&cEY5`+rS6m|o05>2J^ENX*}}Bha6|D0@b`)xv@cfN>A))PuOBHcUMtRmRT5 z9lyW1y#)A~KCV-bsKM8ue;07ZMv!_$)J14tg|a(Jka~oV4yGQ|OJeB=)T#fzK2D#h zP9+kcyIu6U`qu7rJSH5i{m#&_%l`nCPr{@|1Wp zemm>y#2&Q6Q!(bwsXY^#D-I}Mdi#5Cy3033o9@Zpvi|P3dX{}}O6j^c$Dz+s6fSTm z4#-`}r!i!QM8sg}kBH>T!*9l@JI|*@PCgNdoI;66t4nvdjRGB2Il^f$yM^J=Ho-}?Rp7RhQkp(`z&nt4Wk-b|-9 z^20w-(WymG{=`-eJ(-tlr_N^aEu5EYr;ZX2=jB`nhH88sf(b#ErCgIw6OX9zXbXY= zH$Q>ZLC!)H+LQS-pL}};`E=Nx%%^3&YoMcxHuviQ6h74RY`iZ-p?vNGpM3cx8Z)?k z znfGM0Id3V7vgFIW=HeX4mwENY+3GLzmO)B?^Ku_#-Zfb7X=qcQLs9t94#ZnfCw>?~ zJjCh$q>l*7;RLJjN5F#rb|63ZrIq;|kbIO#dAN*u8L(1|TC5yRQUGTrn^DzFX1@Ck zA5VFS=K1YT%$?z69K&cus(w_>+7XvtJ@*F>O{$D;yKcq57w)m{?LoI}zbv-w+Lh`B zy`zo3_Fpktu%ln4E?*v_k%hvH#(nAg*91l!aXYoJQx`@i8G-#YqwP{;HaOk6ztiIn z@Qmov9Kgh3erxI+bV^J5v%2MfXUd8*B^K_u~TuUzStjoZcp(Y#I^$K z_ObSlCjFAwqT*nVig6FWP3+geMBa_v?>67I_YgH6OxNL${q&i4KKy*jNVOW+gTNqG zUGl;9Iop7pidDD!SjE{(7Z7_A*fl=3y!+ZtVvBJ7kbe7|F~5u0vliBM*5Vb!qC|fc>}m^Je%?XLhp)ihV7H*(y`#(SiLITd+JR9& zEL-i>vE>6|!-fags=sVlyC&PHR$Ex(m5;r@U|NToit7ybmj}W9FTFjw30S*@t*w3S z-DPc^>P`#0XzQkT)=Ya#Z3R|~adebt-Thx^DOwqsgp)ggHg9M5FI9ghwi?*wXk*#x z)7!J#bw6B-PDL9_)Oy1O)Yk5w;a{^KQs2H zYs=P+9kZ(DGlPmq`O$*yM0~O5c-=;LNi+VVnvO)KBsZy2TYfk4^Vns_)?T;vv%CH} z?};g4O(B8yDddqj+gX2!ZJ9*kf%0X4SeJcfo&Leg1@~Y1J82gjR5JdkL$zOgQS(U5avu6%ofA)Do`UD#IQx-x$bJh?u#dz6>vXUg zX0P$vcvttX%qcda9C>73`6e90?;-mgUAX;3w*8iQxaWL?k60IeVO{t_*Zo*$9pSF* z+ijsf!?E@wdWfG2&$5s37wf`5BwI|&+@|eb7%929dl<1<`I79oN`XE&h<6L(;fUnQ6VV28*3jnaAKv*fDO1OBvug>^od6Sia?wBz}hb18Lc!ShMJ zj6qyquE<=JMw@btET)Zoz|WO~xGBt!C6A}jpagP_e72<+ME1|Lf`13vKgsih5v&b7 zpR6xDZeU&z{}jFWrVmt(&zCe%oAx$2u<;=Uo7@Mk=>L)V?5}p*h~1?h-}IG|5heDJ z0_w(gYi|9inu?jUlA%d<1TB%kEZ7jTS7 pkhk&0haak_-28l_&lyVDZR#X?anwNih&`nr{XAbE`DW)G{{glF2jc($ literal 13712 zcmeHOTW{M&7Jm1yU>_Rn0=6(W4mo;r>?9RnrG}ljC>9H2L=Ghu5@}GB6Svs^zGr55 zmnfx<3(-X#gc66txt#CZ=jg{@&!<-o9^sQ8Kb?PYe%Sori~P6@(z zd~$Ynrk`Sju=7S=k^Vcm&Qv64;}geO-TyrMO$GT+aj4!e<$OJMFf^}K7RzP)y9)1A zwvN+e>=4s?nuc){2Qt@f(4t59l*wcrrP=CQW-7_Y&L2^{RFliGgZ@`^X}$(i{O7+# z`;A(qk1D)KR}X0d@0QP2_jasep`8&|_cv*pe~>F>7vGrCY!G9Qao@*;`g#GY`^nl4 zR4x!#gfUdnbfMfwjC!1$G{!YAZxINY=H`f7%P<>|6jA z=Ju1E-{x7I%*W2>1UPK2LeoA8G)J^yUfq9`k5jc?vA){@W`-eZG-x#wc;3q*Pe{8p~jjeK(ch5vn2I%6VyU>)%d zOg}t26Nb1;5W$78wfN35@>IqN(D|q|u2j)sULKxe!9Gyfr@+sL6$^4X6E1b#e!jm1 zv$I*|*ID}Y>BzVc%slQ<cCqzH3D;-0Qs$+;teMWqSzCo7{kN+7Gg2DPd z<4Ei_tb`gHOqoYqj+j;ZySq}`l@Km~`w%gjYj@YuTqEHVCcqx{BYhPo>P97@%2akt zRYwFNj8mWU*Qn|Uqb~P2w<5J0lmb8O5-{)D>FU>t1y>MCIY*fAes2pD;kzWfPU9p$ zCVCVLfX?%M|1f&Pa|XZ{@O%%8JfqCxR8^{EF6pJRrZzu%Hj%9wzE6k<6}_i7>!qA9REzUN~O&VFxL zau=^Ra=AW&gfQn#H6fYV1t?nCL=+=b7U&qcF zI(44x$M5#z3k0`~?$_x$uDjdbaD~og1fvJNh5ry0{{bVS5tt9e2`6Uc^47!lrIF`y z7hG;T#l<3ChLC@;xq>P-XFFM{er$Y~b|`gLZ{C8^R<2u*+X3&^W76_fw;p%3%6pkF zbV8!D#C9ZNGeAFQ;PaH3sVhyqcblck&Xf64t$zZ0T9DCFucUO56RTLRUjDFHuFirq zc&N>CXyhSKc-(L9@YDgmtDZF8-Nk=rXoTF7GCGrD$k^aP;5A@sJkopuDMiz@yz4NY zP3x`hdk}0Vsagn9qjLHY6joUD2S|$maoGZ~3RDLMVio>3farj@1>ScljRG(WR0km- z^OpQ|L!6G>b=~65<1VOM*cYlzCu|FGwNYL_*d4{#MY`5i14Ft>roBAUqb5ge3+GO( zpD&HpBl-@2%0OyZ0M+5?iv!dH59n5{TtR;p-?XXMZ5^>Z0M#DT_q|Y6rg>mcRmr)2 zs798uV8E>XvR{npE9h%DxNYrho z`%uHev5t59aWs1aTq;inXxzNjh&JAC<5}2>Lq3f4UXXR8O91~OIPKA0zxE{FK{#uF zdsuMRDWV1-9cQKx%Tg-M=K-O#F6cp-G>p=a%vu&vp?|9o=zv1)IxP+7#GZ2ZqxTKi zl^Nqv*sA@5p%#$=zAE7)6$n-wVE*3J&FI8?yTCRHnr8QYDll;S^Y`RsN z>?*XyE0zoO_Fy$OUonl7c(qxX0dJvJYV257?tGJ{pYNvf>t(!#Ap=d?k#!5IM5*An=RN|N_2UA;R-n?zJRtvXnRk&S5&xf?sa^ZCU{e#a>W|UKD88 zb(AO5G)dp8g?x)?TUg(*9M)BC{Fa~y3W6+tXvP8CD&aFR z<5C3?nFW$UJqH|bRut1=mM!iz{;!?!Vky__NeDk6fFCF5BjLiUuIu6&{&Yp>PG#Mv z7{Z8#h{6itNT)1mD`IjewfiLwa~%VXkWCipYWc>C6#hDu8HL!kQLbhm9?IQZ(F>s* zx;~ouTmrU`)5eSl8i<*TTrne<;Mwy~F0&qG2(0TSOkM-7`n*L02Zx@W<}zcLF4GL0 z@l10k@Qs#X4XsC^n3I9mKGSzT#rmF~IufEv%Ly0yO{m-Zv+o)1DQ2u#$TXV4>ZUYX zhPMx(NiJm$)1p%Ox45YOF~{(@s9Q4gLR=($8Y)+yAOK|{UFHfAfN~XX1lc_rK2ujf e5oT3yRB}@JD<)e6Q=dCq2Dn|MU*Ij1z4<@(`sGUi diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 9822d457e..0e65202bb 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -49,6 +49,7 @@ public Rays() IUsesRaycastResultsMethods.getFirstGameObject = GetFirstGameObject; IRayToNodeMethods.requestNodeFromRayOrigin = RequestNodeFromRayOrigin; IIsRayActiveMethods.isRayActive = IsRayActive; + IIsRayActiveMethods.isConeActive = IsConeActive; } internal override void OnDestroy() @@ -408,12 +409,18 @@ Transform GetFieldGrabOriginForRayOrigin(Transform rayOrigin) return null; } - internal static bool IsRayActive(Transform rayOrigin) + static bool IsRayActive(Transform rayOrigin) { var dpr = rayOrigin.GetComponentInChildren(); return dpr == null || dpr.rayVisible; } + static bool IsConeActive(Transform rayOrigin) + { + var dpr = rayOrigin.GetComponentInChildren(); + return dpr == null || dpr.coneVisible; + } + internal static void RegisterVisibilitySettings(Transform rayOrigin, object caller, DefaultRayVisibilitySettings settings) { if (rayOrigin) diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs b/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs index 885be5f0a..b2c2fc8a2 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs @@ -14,6 +14,7 @@ public interface IIsRayActive public static class IIsRayActiveMethods { internal static Func isRayActive { get; set; } + internal static Func isConeActive { get; set; } /// /// Returns whether the specified ray is active @@ -23,6 +24,15 @@ public static bool IsRayActive(this IIsRayActive obj, Transform rayOrigin) { return isRayActive(rayOrigin); } + + /// + /// Returns whether the specified cone is active + /// + /// The rayOrigin that is being checked + public static bool IsConeActive(this IIsRayActive obj, Transform rayOrigin) + { + return isConeActive(rayOrigin); + } } } #endif \ No newline at end of file diff --git a/Scripts/Modules/IntersectionModule/IntersectionModule.cs b/Scripts/Modules/IntersectionModule/IntersectionModule.cs index ca403d176..f8c6e8567 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionModule.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionModule.cs @@ -74,9 +74,9 @@ void Update() { var intersectionFound = false; m_Intersections.Clear(); - if (m_SpatialHash.GetIntersections(m_Intersections, tester.renderer.bounds)) + if (m_SpatialHash.GetIntersections(m_Intersections, tester.collider.bounds)) { - var testerBounds = tester.renderer.bounds; + var testerBounds = tester.collider.bounds; var testerBoundsCenter = testerBounds.center; m_SortedIntersections.Clear(); diff --git a/Scripts/Modules/IntersectionModule/IntersectionTester.cs b/Scripts/Modules/IntersectionModule/IntersectionTester.cs index aef664d07..43f79f5d6 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionTester.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionTester.cs @@ -15,7 +15,7 @@ sealed class IntersectionTester : MonoBehaviour Ray[] m_Rays; int[] m_Triangles; Vector3[] m_Vertices; - Renderer m_Renderer; + Collider m_Collider; public bool active { @@ -74,13 +74,13 @@ public Vector3[] vertices #if !UNITY_EDITOR #pragma warning disable 109 #endif - public new Renderer renderer + public new Collider collider { get { - if (!m_Renderer) - m_Renderer = GetComponentInChildren(); - return m_Renderer; + if (!m_Collider) + m_Collider = GetComponentInChildren(); + return m_Collider; } } diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index eaa565b30..5e1a0df38 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -137,7 +137,7 @@ void UpdateVisibility() var settings = kvp.Value; if (settings.priority == maxPriority) { - Debug.Log(kvp.Key + ", " + settings.rayVisible + ", " + settings.coneVisible + ", " + settings.priority + ", " + Time.frameCount); + //Debug.Log(kvp.Key + ", " + settings.rayVisible + ", " + settings.coneVisible + ", " + settings.priority + ", " + Time.frameCount); rayVisible &= settings.rayVisible; coneVisible &= settings.coneVisible; } @@ -145,7 +145,7 @@ void UpdateVisibility() } else { - Debug.Log("no settings"); + //Debug.Log("no settings"); } if (this.rayVisible != rayVisible) @@ -157,7 +157,7 @@ void UpdateVisibility() if (this.coneVisible != coneVisible) { - this.coneVisible = rayVisible; + this.coneVisible = coneVisible; this.StopCoroutine(ref m_ConeVisibilityCoroutine); m_ConeVisibilityCoroutine = StartCoroutine(coneVisible ? ShowCone() : HideCone()); } @@ -232,6 +232,7 @@ IEnumerator HideCone() IEnumerator ShowCone() { + //m_Tester.active = true; var currentScale = m_ConeTransform.localScale; var smoothVelocity = Vector3.zero; const float kSmoothTime = 0.3125f; @@ -246,7 +247,6 @@ IEnumerator ShowCone() m_ConeTransform.localScale = m_OriginalConeLocalScale; m_ConeVisibilityCoroutine = null; - //m_Tester.active = true; } public Color GetColor() diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index f5386033a..6c946ae2c 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -164,7 +164,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon continue; if (!selectionTool.IsDirectActive()) + { + m_HoverGameObjects.Remove(directRayOrigin); + this.SetHighlight(directHoveredObject, false, directRayOrigin); continue; + } // Only overwrite an existing selection if it does not contain the hovered object // In the case of multi-select, only add, do not remove @@ -239,6 +243,9 @@ bool IsDirectActive() if (rayOrigin == null) return false; + if (!this.IsConeActive(rayOrigin)) + return false; + if (this.IsInMiniWorld(rayOrigin)) return true; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index e2b59444b..9a11db93c 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, ILinkedObject, IRayToNode, - IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, + IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, IIsRayActive, IRegisterRayVisibilitySettings { const float k_LazyFollowTranslate = 8f; @@ -314,6 +314,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (manipulatorGameObject.activeSelf && (hoveringSelection || hasLeft || hasRight)) manipulatorGameObject.SetActive(false); + //Debug.Log(directSelection.Count); + foreach (var kvp in directSelection) { var directRayOrigin = kvp.Key; @@ -335,6 +337,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; + registerRayVisibilitySettings(directRayOrigin, this, k_HideRaySettings); // This will also disable ray selection + + if (!this.IsConeActive(directRayOrigin)) + continue; + var grabbingNode = this.RequestNodeFromRayOrigin(directRayOrigin); var transformTool = linkedObjects.Cast().FirstOrDefault(linkedObject => linkedObject.node == grabbingNode); if (transformTool == null) @@ -342,9 +349,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var transformInput = transformTool.m_Input; - Debug.Log("direct " + Time.frameCount); - registerRayVisibilitySettings(directRayOrigin, this, k_HideRaySettings); // This will also disable ray selection - if (transformInput.select.wasJustPressed) { this.ClearSnappingState(directRayOrigin); From 5671bd6f6bbae45a2fccba56c9c786c0f06656b1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 20 Jul 2017 16:06:50 -0700 Subject: [PATCH 642/870] Alter means of fetching colors from VRLineRenderer due to the changes made in recent PR on that branch. --- Menus/PinnedToolMenu/Scripts/HintLine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/PinnedToolMenu/Scripts/HintLine.cs index c3b16ca58..66d41a088 100644 --- a/Menus/PinnedToolMenu/Scripts/HintLine.cs +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs @@ -153,7 +153,7 @@ IEnumerator AnimatePulseColor() var maxShaderLineRadius = new Vector3 (0.03f, 0f, 100f); var minShaderLineRadius = new Vector3 (0.005f, 0f, 100f); var currentVector3ShaderLineRadius = m_HintLineMaterial.GetVector(k_ShaderLineRadiusPropertyName); - var currentColor = m_ScrollLineRenderer.Colors[0]; // The line stand & end colors are the same; fetch only one of them + var currentColor = m_ScrollLineRenderer.colorStart; // The line stand & end colors are the same; fetch only one of them var currentShaderLineRadius = m_HintLineMaterial.GetFloat(k_ShaderLineRadiusPropertyName); while (m_PulseDuration < kTargetDuration) { From 7552e1480e61c5f24392dfd3b23613a189336aa6 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 16:41:58 -0700 Subject: [PATCH 643/870] Fix generic implementation of IRegisterRayVisibilitySettings; Switch miniworld pan/zoom back to grips --- Scripts/Core/EditorVR.MiniWorlds.cs | 2 +- Scripts/Core/EditorVR.Rays.cs | 7 +------ .../IRegisterRayVisibilitySettings.cs | 16 ++++++++++------ .../IntersectionModule/IntersectionTester.cs | 4 ++-- Scripts/Modules/KeyboardModule.cs | 4 +--- Scripts/Proxies/DefaultProxyRay.cs | 3 --- .../CreatePrimitiveTool.cs | 4 +--- Tools/LocomotionTool/LocomotionTool.cs | 10 ++++------ .../MoveWorkspacesTool/MoveWorkspacesTool.cs | 4 +--- Tools/TransformTool/TransformTool.cs | 6 ++---- .../Base/ActionMaps/WorkspaceInput.asset | Bin 4494 -> 5772 bytes .../MiniWorldWorkspace/MiniWorldWorkspace.cs | 4 +--- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 4 +--- 13 files changed, 25 insertions(+), 43 deletions(-) diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index da75ad718..53e525246 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -230,7 +230,7 @@ static Transform InstantiateMiniWorldRay() var renderers = miniWorldRay.GetComponentsInChildren(); foreach (var renderer in renderers) { - if (!renderer.GetComponent()) + if (!renderer.GetComponentInParent()) ObjectUtils.Destroy(renderer.gameObject); else renderer.enabled = false; diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 0e65202bb..aede5c5eb 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -42,6 +42,7 @@ public Rays() IGetDefaultRayColorMethods.getDefaultRayColor = GetDefaultRayColor; IRegisterRayVisibilitySettingsMethods.unregisterRayVisibilitySettings = UnregisterVisibilitySettings; + IRegisterRayVisibilitySettingsMethods.registerRayVisibilitySettings = RegisterVisibilitySettings; IForEachRayOriginMethods.forEachRayOrigin = ForEachRayOrigin; IGetFieldGrabOriginMethods.getFieldGrabOriginForRayOrigin = GetFieldGrabOriginForRayOrigin; @@ -100,12 +101,6 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) selectionModule.getGroupRoot = GetGroupRoot; selectionModule.overrideSelectObject = OverrideSelectObject; } - - var registerVisibility = obj as IRegisterRayVisibilitySettings; - if (registerVisibility != null) - { - registerVisibility.registerRayVisibilitySettings = RegisterVisibilitySettings; - } } public void DisconnectInterface(object obj, Transform rayOrigin = null) diff --git a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs index fdf42bbbc..b7e244471 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs @@ -8,9 +8,13 @@ namespace UnityEditor.Experimental.EditorVR /// /// Implementors can show & hide the default ray /// - public interface IRegisterRayVisibilitySettings where T : struct + public interface IRegisterRayVisibilitySettings where T : struct { - RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { set; } + } + + public static class IRegisterRayVisibilitySettingsMethods + { + public static RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings; } public static class IRegisterRayVisibilitySettingsMethods @@ -25,10 +29,10 @@ public static class IRegisterRayVisibilitySettingsMethods /// Show or hide /// An optional parameter to hide or show only the ray and not the cone /// The priority level of this request - //public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, T settings, int priority = 0) - //{ - // customRay.registerRayVisibilitySettings(rayOrigin, caller, settings, priority); - //} + public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, T settings, int priority = 0) where T : struct + { + IRegisterRayVisibilitySettingsMethods.registerRayVisibilitySettings(rayOrigin, caller, settings); + } /// /// Unregister visibility settings diff --git a/Scripts/Modules/IntersectionModule/IntersectionTester.cs b/Scripts/Modules/IntersectionModule/IntersectionTester.cs index 43f79f5d6..f9eac4a10 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionTester.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionTester.cs @@ -30,9 +30,9 @@ public Ray[] rays if (m_Rays == null || m_Rays.Length != m_RayTransforms.Length) { m_Rays = new Ray[m_RayTransforms.Length]; - for (int i = 0; i < m_RayTransforms.Length; i++) + for (var i = 0; i < m_RayTransforms.Length; i++) { - Transform t = m_RayTransforms[i]; + var t = m_RayTransforms[i]; m_Rays[i] = new Ray(transform.InverseTransformPoint(t.position), transform.InverseTransformDirection(t.forward)); } } diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index 71b1dfe1c..94d41bace 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -26,8 +26,6 @@ sealed class KeyboardModule : MonoBehaviour, IRegisterRayVisibilitySettings registerRayVisibilitySettings { private get; set; } - public KeyboardUI SpawnNumericKeyboard() { if (m_StandardKeyboard != null) @@ -103,7 +101,7 @@ public void UpdateKeyboardMallets() { mallet.visible = malletVisible; if (malletVisible) - registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); else this.UnregisterRayVisibilitySettings(rayOrigin, this); } diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 5e1a0df38..d86977a34 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -36,7 +35,6 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale Coroutine m_RayVisibilityCoroutine; Coroutine m_ConeVisibilityCoroutine; Material m_RayMaterial; - IntersectionTester m_Tester; float m_LastPointerLength; /// @@ -107,7 +105,6 @@ void Awake() m_RayMaterial = MaterialUtils.GetMaterialClone(m_LineRenderer.GetComponent()); m_ConeTransform = m_Cone.transform; m_OriginalConeLocalScale = m_ConeTransform.localScale; - m_Tester = GetComponentInChildren(); rayVisible = true; coneVisible = true; diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index 3b45e30cf..d6dd2bd1f 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -38,8 +38,6 @@ enum PrimitiveCreationStates Freeform, } - public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } - void Start() { m_ToolMenu = this.InstantiateMenuUI(rayOrigin, m_MenuPrefab); @@ -85,7 +83,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else { - registerRayVisibilitySettings(rayOrigin, this, m_Settings); + this.RegisterRayVisibilitySettings(rayOrigin, this, m_Settings); } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 6e003f554..ca59f5054 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -114,8 +114,6 @@ class Preferences public GameObject settingsMenuItemPrefab { get { return m_SettingsMenuItemPrefab; } } - public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } - public GameObject settingsMenuItemInstance { set @@ -333,7 +331,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); } if (m_Crawling) @@ -354,7 +352,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); m_BlinkVisuals.ShowVisuals(); @@ -416,8 +414,8 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); - registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); - registerRayVisibilitySettings(otherRayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(otherRayOrigin, this, k_HideSettings); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index 008422387..61b484db9 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -40,8 +40,6 @@ enum State public Transform rayOrigin { private get; set; } public List allWorkspaces { private get; set; } - public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var action = ((Standard)input).action; @@ -163,7 +161,7 @@ void StartMove() m_State = State.MoveWorkspaces; - registerRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); foreach (var ws in allWorkspaces) { diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 9a11db93c..2459b7ed0 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -248,8 +248,6 @@ public bool manipulatorDragging public ActionMap actionMap { get { return m_ActionMap; } } - public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } - void Start() { if (!this.IsSharedUpdater(this)) @@ -337,7 +335,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; - registerRayVisibilitySettings(directRayOrigin, this, k_HideRaySettings); // This will also disable ray selection + this.RegisterRayVisibilitySettings(directRayOrigin, this, k_HideRaySettings); // This will also disable ray selection if (!this.IsConeActive(directRayOrigin)) continue; @@ -567,7 +565,7 @@ public Transform[] GetHeldObjects(Node node) // Prevent lock from getting stuck this.UnregisterRayVisibilitySettings(rayOrigin, this); - registerRayVisibilitySettings(destRayOrigin, this, k_HideRaySettings); + this.RegisterRayVisibilitySettings(destRayOrigin, this, k_HideRaySettings); if (objectsTransferred != null) objectsTransferred(rayOrigin, destRayOrigin); diff --git a/Workspaces/Base/ActionMaps/WorkspaceInput.asset b/Workspaces/Base/ActionMaps/WorkspaceInput.asset index 7c5d53d87e4dda2ed12776c65a9fe2fc96871446..78f6447b417e53f1ba6fcafc9580d01b6f160f1a 100644 GIT binary patch literal 5772 zcmeI0U2GIp6vyvuw=J{+7Av2AECQmqEMNhpQs^gA+hS=;i6m;KyF)v$omppQOWVXa z!9Tj2Ip?A($8=0gVrm@Ia7gj8M=2-nrAcZ9|(#>>Z6U`eVf!^B-Z% zCy60`wGXbbcMF(*l+MKoVx8#tWb7>Q+vtcb1&^_Fq%n);SYHs~Dbl%@=2L=mQs<=@ z^G^mkg^~49ouUYj>J*1uW2;D~FVMjrHT;}v&(sKy>Xd|BV~5Djr%4C)l|qArWE`4^ z!!P(O?eC#|F9!QgBaWs~M56Xj=S=YEzB59uu}!q^VbVeTaepE7}o_B{_V+}NJrw)7Wp(B|; z${swAf~)=}z^Ne)(1AVBSpevR$CdkaU&srUcrGL^?pKj=zZQY>UZmWw#UYQg42^B- z*!O-qihWi6B_UV!aUak$R>XCr{SN~A;KkgY=V=;KI=yCX#uYac`y#I11zr##R36A^xh@|a1S{#X-u4aUX%yqG(3(C-14gxrA*11-P-rZv1N;%gOTAxT2O0R z8Pn>fQ^Ck(+|ax|yyw|gO~2{3 z^D9`_2;efy=+-^6&tN&*HTj_1(fdqqfVqe#5k9u`9LqUoukH*qy2G+$D|r)fxGwK{ zb}zhlb9&kkg&d{3_U`ZhEW32RogGKU~PEek}?0RljgAgnnGn zM6Wgz0{twL&h@F*R zJjGc7V}As!^2ASTrmsAp;Yod9?eOtqzx+C{?%-FS4_)<=`vm2uChr4&phf+`ug`6^vx~n` z_-*7%_ydEHj2*@@wiwI!VJzbYUBs)CN)8z}`m(XD7QN;gtZvgXQhbZe#_m*S8y||7 zelk(xx<+qTc3@dudynqql8H{kLB&zEBE|nD6Loa+^Nvwv8F|mqv&lqjzAI~{>7CqR z?=q|^E1%8MX4J6v|Glq_t$Zf&g#*Kl$MKDW2ZKU;u%5BOdbwV%fz9Ks`L8;iw1;}H zZ*JU4enL(94xi83e3o{bT6 zZ#a}bME%DvrKtbS#*WZ^>AMu24Bu~LpR{Yd<5+&~tLj?d-u_nqv2>hw<$uH(x7sB?n$vOOfp%+ENJODC*T5m#*sW4}_X)$}UH zE_$UtEd8qV1s8`fCs#~liC;k|p1cpf0+nxB2yY@XOMPVJe-9Fvl3+j*;L@1*=*N^r z&^uBlKR0Z8TtdQ0w7q^pV%T->F(*L;p^tFx>NsRlBwJAoX~GtA!!yQSo=FwWGN$gf zUGM^GwOX`I2?VYiP}gobA$4pVSdLRga=8E>IVR#W6_JlVisUj~5DGoM$mGWU-H4=V zFH|YBDTBmE`C5lcCU~mLRa@7fs42FaO~-Z}x82fPlo(*oYuOFQa!L#u*tI>o;aY8M z;ZlQEv)#a6qiJK$X%%(v3N8~74e1Q(iGw#TGqP5IY|~(G=?Nql{&EM z`MY}K8KG_#$t-~b4w+0yR7Ha$$A>g?s$HI%BuNljz5K@CyU@S-SAQ3Zs;yvMhi8UhI~ z1Xn1x>MO$_lTz@`HA{zuXY~0?;bfL5GLRY-njiFb2&KSNCfWA?T&H0&Luiq(m?X=W zx60K)(SM1EDg|2c`SX)g4+7E*+`tA02v(xj#*_xrsW)|-)TXUcIqi!pKc^FZeU~W1OjniYP<_!e3tq5u=BIp%!MPQf3%@K0LUycz2`m_S4Y|8h4@bL1bA! OUi=quTvcxykG}xp&s!A$ diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs index 8cd344b44..6298e8b7f 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs @@ -14,7 +14,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { [MainMenuItem("MiniWorld", "Workspaces", "Edit a smaller version of your scene(s)", typeof(MiniWorldTooltip))] - sealed class MiniWorldWorkspace : Workspace, ISerializeWorkspace, IRegisterRayVisibilitySettings + sealed class MiniWorldWorkspace : Workspace, ISerializeWorkspace { class MiniWorldTooltip : ITooltip { @@ -104,8 +104,6 @@ public float zoomSliderMax set { m_ZoomSliderUI.zoomSlider.maxValue = Mathf.Log10(value); } } - public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } - public override void Setup() { const float yBounds = 0.5f; diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index 24f39c8be..efa73e02d 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -162,8 +162,6 @@ public Texture fallbackTexture public float scaleFactor { private get; set; } - public RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings { get; set; } - public override void Setup(AssetData listData) { base.Setup(listData); @@ -303,7 +301,7 @@ protected override void OnDragStarted(BaseHandle handle, HandleEventData eventDa base.OnDragStarted(handle, eventData); var rayOrigin = eventData.rayOrigin; - registerRayVisibilitySettings(rayOrigin, this, m_HideConeSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, m_HideConeSettings); var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); From 232daf3648b2a58e472fe16cd0419103a36dd59a Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 17:46:38 -0700 Subject: [PATCH 644/870] Roll back DefaultRayVisibilitySettings --- Scripts/Core/EditorVR.MiniWorlds.cs | 4 +-- Scripts/Core/EditorVR.Rays.cs | 10 +++---- .../IRegisterRayVisibilitySettings.cs | 27 +++++++++---------- Scripts/Modules/KeyboardModule.cs | 6 ++--- Scripts/Proxies/DefaultProxyRay.cs | 27 ++++++++++++------- .../CreatePrimitiveTool.cs | 10 ++----- Tools/LocomotionTool/LocomotionTool.cs | 13 ++++----- .../MoveWorkspacesTool/MoveWorkspacesTool.cs | 6 ++--- Tools/TransformTool/TransformTool.cs | 8 +++--- .../MiniWorldWorkspace/MiniWorldWorkspace.cs | 1 - .../ProjectWorkspace/Scripts/AssetGridItem.cs | 6 ++--- 11 files changed, 51 insertions(+), 67 deletions(-) diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index 53e525246..b17d7cb24 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -15,8 +15,6 @@ partial class EditorVR class MiniWorlds : Nested, ILateBindInterfaceMethods, IPlaceSceneObjects, IUsesViewerScale, IUsesSpatialHash { - static readonly DefaultRayVisibilitySettings k_HideRayettings = new DefaultRayVisibilitySettings { coneVisible = true }; - internal class MiniWorldRay { readonly List m_GrabData = new List(); @@ -476,7 +474,7 @@ internal void UpdateMiniWorlds() } if (isContained && !wasContained) - Rays.RegisterVisibilitySettings(rayOrigin, this, k_HideRayettings); + Rays.RegisterVisibilitySettings(rayOrigin, this, false, true); if (!isContained && wasContained) Rays.UnregisterVisibilitySettings(rayOrigin, this); diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index aede5c5eb..3fafbf086 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -20,8 +20,6 @@ partial class EditorVR class Rays : Nested, IInterfaceConnector { - static readonly DefaultRayVisibilitySettings k_HideSettings = new DefaultRayVisibilitySettings(); - internal delegate void ForEachProxyDeviceCallback(DeviceData deviceData); const float k_DefaultRayLength = 100f; @@ -42,7 +40,7 @@ public Rays() IGetDefaultRayColorMethods.getDefaultRayColor = GetDefaultRayColor; IRegisterRayVisibilitySettingsMethods.unregisterRayVisibilitySettings = UnregisterVisibilitySettings; - IRegisterRayVisibilitySettingsMethods.registerRayVisibilitySettings = RegisterVisibilitySettings; + IRegisterRayVisibilitySettingsMethods.registerRayVisibilitySettings = RegisterVisibilitySettings; IForEachRayOriginMethods.forEachRayOrigin = ForEachRayOrigin; IGetFieldGrabOriginMethods.getFieldGrabOriginForRayOrigin = GetFieldGrabOriginForRayOrigin; @@ -113,7 +111,7 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig var customMenu = deviceData.customMenu; if (mainMenu.visible || (customMenu != null && customMenu.visible)) { - RegisterVisibilitySettings(rayOrigin, mainMenu, k_HideSettings); + RegisterVisibilitySettings(rayOrigin, mainMenu, false, false); } else { @@ -416,13 +414,13 @@ static bool IsConeActive(Transform rayOrigin) return dpr == null || dpr.coneVisible; } - internal static void RegisterVisibilitySettings(Transform rayOrigin, object caller, DefaultRayVisibilitySettings settings) + internal static void RegisterVisibilitySettings(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) { if (rayOrigin) { var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - dpr.RegisterVisibilitySettings(caller, settings); + dpr.RegisterVisibilitySettings(caller, rayVisible, coneVisible, priority); } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs index b7e244471..5ec71db5a 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs @@ -4,42 +4,39 @@ namespace UnityEditor.Experimental.EditorVR { - public delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, T settings); /// /// Implementors can show & hide the default ray /// - public interface IRegisterRayVisibilitySettings where T : struct + public interface IRegisterRayVisibilitySettings { } - public static class IRegisterRayVisibilitySettingsMethods - { - public static RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings; - } - public static class IRegisterRayVisibilitySettingsMethods { + public delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); + internal static Action unregisterRayVisibilitySettings { get; set; } + public static RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings; /// /// Register visibility settings to try and show/hide the ray/cone /// /// The ray to hide or show - /// The object which has locked the ray - /// Show or hide - /// An optional parameter to hide or show only the ray and not the cone + /// The object which is adding settings + /// Show or hide the ray + /// Show or hide the cone /// The priority level of this request - public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, T settings, int priority = 0) where T : struct + public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) { - IRegisterRayVisibilitySettingsMethods.registerRayVisibilitySettings(rayOrigin, caller, settings); + registerRayVisibilitySettings(rayOrigin, caller, rayVisible, coneVisible, priority); } /// /// Unregister visibility settings /// - /// The ray to hide or show - /// The object which has locked the ray - public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) where T : struct + /// The ray to remove settings from + /// The object whose settings to remove + public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) { unregisterRayVisibilitySettings(rayOrigin, caller); } diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index 94d41bace..275e4d26a 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -9,10 +9,8 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class KeyboardModule : MonoBehaviour, IRegisterRayVisibilitySettings, IForEachRayOrigin, IConnectInterfaces + sealed class KeyboardModule : MonoBehaviour, IRegisterRayVisibilitySettings, IForEachRayOrigin, IConnectInterfaces { - static readonly DefaultRayVisibilitySettings k_HideSettings = new DefaultRayVisibilitySettings(); - [SerializeField] KeyboardMallet m_KeyboardMalletPrefab; @@ -101,7 +99,7 @@ public void UpdateKeyboardMallets() { mallet.visible = malletVisible; if (malletVisible) - this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); else this.UnregisterRayVisibilitySettings(rayOrigin, this); } diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index d86977a34..11444323c 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -8,15 +8,15 @@ namespace UnityEditor.Experimental.EditorVR.Proxies { - public struct DefaultRayVisibilitySettings - { - public int priority; - public bool rayVisible; - public bool coneVisible; - } - sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale { + struct DefaultRayVisibilitySettings + { + public int priority; + public bool rayVisible; + public bool coneVisible; + } + [SerializeField] VRLineRenderer m_LineRenderer; @@ -62,15 +62,24 @@ public float pointerLength public bool rayVisible { get; private set; } public bool coneVisible { get; private set; } + [MenuItem("Tools/test")] + public static void Test() + { + var settings = new Dictionary(); + var obj = new object(); + for(int i =0; i<1000;i++) + settings[obj] = new DefaultRayVisibilitySettings { rayVisible = true, coneVisible = false, priority = 1 }; + } + void OnDisable() { this.StopCoroutine(ref m_RayVisibilityCoroutine); this.StopCoroutine(ref m_ConeVisibilityCoroutine); } - public void RegisterVisibilitySettings(object caller, DefaultRayVisibilitySettings newSettings) + public void RegisterVisibilitySettings(object caller, bool rayVisible, bool coneVisible, int priority = 0) { - m_VisibilitySettings[caller] = newSettings; + m_VisibilitySettings[caller] = new DefaultRayVisibilitySettings { rayVisible = rayVisible, coneVisible = coneVisible, priority = priority }; } public void UnregisterVisibilitySettings(object caller) diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index d6dd2bd1f..3601b1306 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -9,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools [MainMenuItem("Primitive", "Create", "Create primitives in the scene")] sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, IConnectInterfaces, IInstantiateMenuUI, IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, IIsHoveringOverUI, IIsMainMenuVisible, - IRegisterRayVisibilitySettings + IRegisterRayVisibilitySettings { [SerializeField] CreatePrimitiveMenu m_MenuPrefab; @@ -27,7 +26,6 @@ sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, ICo Vector3 m_EndPoint = Vector3.zero; PrimitiveCreationStates m_State = PrimitiveCreationStates.StartPoint; - readonly DefaultRayVisibilitySettings m_Settings = new DefaultRayVisibilitySettings { rayVisible = false, coneVisible = true }; public Transform rayOrigin { get; set; } @@ -78,13 +76,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } if (m_State == PrimitiveCreationStates.StartPoint && this.IsHoveringOverUI(rayOrigin)) - { this.UnregisterRayVisibilitySettings(rayOrigin, this); - } else - { - this.RegisterRayVisibilitySettings(rayOrigin, this, m_Settings); - } + this.RegisterRayVisibilitySettings(rayOrigin, this, false, true); } void SetSelectedPrimitive(PrimitiveType type, bool isFreeform) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index ca59f5054..b1cd81277 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -3,7 +3,6 @@ using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -13,8 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ICustomActionMap, ILinkedObject, - IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences, - IRegisterRayVisibilitySettings + IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences, IRegisterRayVisibilitySettings { const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 1f; @@ -23,7 +21,6 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const float k_DistanceThreshold = 0.02f; const int k_RayHidePriority = 2; - static readonly DefaultRayVisibilitySettings k_HideSettings = new DefaultRayVisibilitySettings { priority = k_RayHidePriority }; //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; @@ -331,7 +328,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); } if (m_Crawling) @@ -352,7 +349,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); m_BlinkVisuals.ShowVisuals(); @@ -414,8 +411,8 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); - this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); - this.RegisterRayVisibilitySettings(otherRayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + this.RegisterRayVisibilitySettings(otherRayOrigin, this, false, false, k_RayHidePriority); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index 61b484db9..71e669994 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -9,10 +9,8 @@ [ExecuteInEditMode] public class MoveWorkspacesTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesViewerBody, - IResetWorkspaces, IAllWorkspaces, IUsesViewerScale, IRegisterRayVisibilitySettings + IResetWorkspaces, IAllWorkspaces, IUsesViewerScale, IRegisterRayVisibilitySettings { - static readonly DefaultRayVisibilitySettings k_HideSettings = new DefaultRayVisibilitySettings(); - enum State { WaitingForInput, @@ -161,7 +159,7 @@ void StartMove() m_State = State.MoveWorkspaces; - this.RegisterRayVisibilitySettings(rayOrigin, this, k_HideSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); foreach (var ws in allWorkspaces) { diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 2459b7ed0..d14b288bc 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -14,7 +14,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, ILinkedObject, IRayToNode, IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, IIsRayActive, - IRegisterRayVisibilitySettings + IRegisterRayVisibilitySettings { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -23,8 +23,6 @@ sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChang const int k_RayHidePriority = 1; - static readonly DefaultRayVisibilitySettings k_HideRaySettings = new DefaultRayVisibilitySettings { coneVisible = true, priority = k_RayHidePriority }; - class GrabData { Vector3[] m_PositionOffsets; @@ -335,7 +333,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; - this.RegisterRayVisibilitySettings(directRayOrigin, this, k_HideRaySettings); // This will also disable ray selection + this.RegisterRayVisibilitySettings(directRayOrigin, this, false, true, k_RayHidePriority); // This will also disable ray selection if (!this.IsConeActive(directRayOrigin)) continue; @@ -565,7 +563,7 @@ public Transform[] GetHeldObjects(Node node) // Prevent lock from getting stuck this.UnregisterRayVisibilitySettings(rayOrigin, this); - this.RegisterRayVisibilitySettings(destRayOrigin, this, k_HideRaySettings); + this.RegisterRayVisibilitySettings(destRayOrigin, this, false, true, k_RayHidePriority); if (objectsTransferred != null) objectsTransferred(rayOrigin, destRayOrigin); diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs index 6298e8b7f..30fb93140 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs @@ -3,7 +3,6 @@ using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index efa73e02d..a03e780c2 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { sealed class AssetGridItem : DraggableListItem, IPlaceSceneObject, IUsesSpatialHash, - IUsesViewerBody, IRegisterRayVisibilitySettings + IUsesViewerBody, IRegisterRayVisibilitySettings { const float k_PreviewDuration = 0.1f; const float k_MinPreviewScale = 0.01f; @@ -65,8 +65,6 @@ sealed class AssetGridItem : DraggableListItem, IPlaceSceneOb Material m_SphereMaterial; - readonly DefaultRayVisibilitySettings m_HideConeSettings = new DefaultRayVisibilitySettings { rayVisible = false, coneVisible = true }; - public GameObject icon { private get @@ -301,7 +299,7 @@ protected override void OnDragStarted(BaseHandle handle, HandleEventData eventDa base.OnDragStarted(handle, eventData); var rayOrigin = eventData.rayOrigin; - this.RegisterRayVisibilitySettings(rayOrigin, this, m_HideConeSettings); + this.RegisterRayVisibilitySettings(rayOrigin, this, false, true); var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); From 57264796756b7ea5c46c1d9941c1b742ebc9dff7 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 18:03:27 -0700 Subject: [PATCH 645/870] Rename Un/RegisterRayVisibilitySettings to Add/RemoveVisibilitySettings --- Scripts/Core/EditorVR.MiniWorlds.cs | 6 +-- Scripts/Core/EditorVR.Rays.cs | 16 +++---- .../IRayVisibilitySettings.cs | 45 +++++++++++++++++++ ...cs.meta => IRayVisibilitySettings.cs.meta} | 0 .../IRegisterRayVisibilitySettings.cs | 45 ------------------- Scripts/Modules/KeyboardModule.cs | 6 +-- Scripts/Proxies/DefaultProxyRay.cs | 13 +----- .../CreatePrimitiveTool.cs | 8 ++-- Tools/LocomotionTool/LocomotionTool.cs | 18 ++++---- .../MoveWorkspacesTool/MoveWorkspacesTool.cs | 6 +-- Tools/TransformTool/TransformTool.cs | 12 ++--- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 6 +-- 12 files changed, 86 insertions(+), 95 deletions(-) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs rename Scripts/Interfaces/FunctionalityInjection/{IRegisterRayVisibilitySettings.cs.meta => IRayVisibilitySettings.cs.meta} (100%) delete mode 100644 Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index b17d7cb24..ab14ac019 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -474,10 +474,10 @@ internal void UpdateMiniWorlds() } if (isContained && !wasContained) - Rays.RegisterVisibilitySettings(rayOrigin, this, false, true); + Rays.AddVisibilitySettings(rayOrigin, this, false, true); if (!isContained && wasContained) - Rays.UnregisterVisibilitySettings(rayOrigin, this); + Rays.RemoveVisibilitySettings(rayOrigin, this); m_RayWasContained[rayOrigin] = isContained; }); @@ -585,7 +585,7 @@ void OnObjectsDropped(Transform rayOrigin, Transform[] grabbedObjects) miniWorldRay.dragStartedOutside = false; if (!miniWorldRay.isContained) - Rays.UnregisterVisibilitySettings(rayOrigin, this); + Rays.RemoveVisibilitySettings(rayOrigin, this); } } } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 3fafbf086..5144b4536 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -39,8 +39,8 @@ public Rays() ISetDefaultRayColorMethods.setDefaultRayColor = SetDefaultRayColor; IGetDefaultRayColorMethods.getDefaultRayColor = GetDefaultRayColor; - IRegisterRayVisibilitySettingsMethods.unregisterRayVisibilitySettings = UnregisterVisibilitySettings; - IRegisterRayVisibilitySettingsMethods.registerRayVisibilitySettings = RegisterVisibilitySettings; + IRayVisibilitySettingsMethods.removeRayVisibilitySettings = RemoveVisibilitySettings; + IRayVisibilitySettingsMethods.addRayVisibilitySettings = AddVisibilitySettings; IForEachRayOriginMethods.forEachRayOrigin = ForEachRayOrigin; IGetFieldGrabOriginMethods.getFieldGrabOriginForRayOrigin = GetFieldGrabOriginForRayOrigin; @@ -111,11 +111,11 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig var customMenu = deviceData.customMenu; if (mainMenu.visible || (customMenu != null && customMenu.visible)) { - RegisterVisibilitySettings(rayOrigin, mainMenu, false, false); + AddVisibilitySettings(rayOrigin, mainMenu, false, false); } else { - UnregisterVisibilitySettings(rayOrigin, mainMenu); + RemoveVisibilitySettings(rayOrigin, mainMenu); } } @@ -414,24 +414,24 @@ static bool IsConeActive(Transform rayOrigin) return dpr == null || dpr.coneVisible; } - internal static void RegisterVisibilitySettings(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) + internal static void AddVisibilitySettings(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) { if (rayOrigin) { var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - dpr.RegisterVisibilitySettings(caller, rayVisible, coneVisible, priority); + dpr.AddVisibilitySettings(caller, rayVisible, coneVisible, priority); } } - internal static void UnregisterVisibilitySettings(Transform rayOrigin, object obj) + internal static void RemoveVisibilitySettings(Transform rayOrigin, object obj) { if (!rayOrigin) // Prevent MissingReferenceException on closing EVR return; var dpr = rayOrigin.GetComponentInChildren(); if (dpr) - dpr.UnregisterVisibilitySettings(obj); + dpr.RemoveVisibilitySettings(obj); } internal void PreProcessRaycastSource(Transform rayOrigin) diff --git a/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs new file mode 100644 index 000000000..79f851392 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs @@ -0,0 +1,45 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Implementors can show & hide the default ray + /// + public interface IRayVisibilitySettings + { + } + + public static class IRayVisibilitySettingsMethods + { + public delegate void AddRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); + + internal static Action removeRayVisibilitySettings { get; set; } + public static AddRayVisibilitySettingsDelegate addRayVisibilitySettings; + + /// + /// Add visibility settings to try and show/hide the ray/cone + /// + /// The ray to hide or show + /// The object which is adding settings + /// Show or hide the ray + /// Show or hide the cone + /// The priority level of this request + public static void AddRayVisibilitySettings(this IRayVisibilitySettings customRay, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) + { + addRayVisibilitySettings(rayOrigin, caller, rayVisible, coneVisible, priority); + } + + /// + /// Remove visibility settings + /// + /// The ray to remove settings from + /// The object whose settings to remove + public static void RemoveRayVisibilitySettings(this IRayVisibilitySettings customRay, Transform rayOrigin, object caller) + { + removeRayVisibilitySettings(rayOrigin, caller); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs.meta similarity index 100% rename from Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs.meta diff --git a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs deleted file mode 100644 index 5ec71db5a..000000000 --- a/Scripts/Interfaces/FunctionalityInjection/IRegisterRayVisibilitySettings.cs +++ /dev/null @@ -1,45 +0,0 @@ -#if UNITY_EDITOR -using System; -using UnityEngine; - -namespace UnityEditor.Experimental.EditorVR -{ - /// - /// Implementors can show & hide the default ray - /// - public interface IRegisterRayVisibilitySettings - { - } - - public static class IRegisterRayVisibilitySettingsMethods - { - public delegate void RegisterRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); - - internal static Action unregisterRayVisibilitySettings { get; set; } - public static RegisterRayVisibilitySettingsDelegate registerRayVisibilitySettings; - - /// - /// Register visibility settings to try and show/hide the ray/cone - /// - /// The ray to hide or show - /// The object which is adding settings - /// Show or hide the ray - /// Show or hide the cone - /// The priority level of this request - public static void RegisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) - { - registerRayVisibilitySettings(rayOrigin, caller, rayVisible, coneVisible, priority); - } - - /// - /// Unregister visibility settings - /// - /// The ray to remove settings from - /// The object whose settings to remove - public static void UnregisterRayVisibilitySettings(this IRegisterRayVisibilitySettings customRay, Transform rayOrigin, object caller) - { - unregisterRayVisibilitySettings(rayOrigin, caller); - } - } -} -#endif diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index 275e4d26a..96afad8f4 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -9,7 +9,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - sealed class KeyboardModule : MonoBehaviour, IRegisterRayVisibilitySettings, IForEachRayOrigin, IConnectInterfaces + sealed class KeyboardModule : MonoBehaviour, IRayVisibilitySettings, IForEachRayOrigin, IConnectInterfaces { [SerializeField] KeyboardMallet m_KeyboardMalletPrefab; @@ -99,9 +99,9 @@ public void UpdateKeyboardMallets() { mallet.visible = malletVisible; if (malletVisible) - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); + this.AddRayVisibilitySettings(rayOrigin, this, false, false); else - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); } // TODO remove this after physics is in diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 11444323c..1fdd5f1af 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -62,27 +62,18 @@ public float pointerLength public bool rayVisible { get; private set; } public bool coneVisible { get; private set; } - [MenuItem("Tools/test")] - public static void Test() - { - var settings = new Dictionary(); - var obj = new object(); - for(int i =0; i<1000;i++) - settings[obj] = new DefaultRayVisibilitySettings { rayVisible = true, coneVisible = false, priority = 1 }; - } - void OnDisable() { this.StopCoroutine(ref m_RayVisibilityCoroutine); this.StopCoroutine(ref m_ConeVisibilityCoroutine); } - public void RegisterVisibilitySettings(object caller, bool rayVisible, bool coneVisible, int priority = 0) + public void AddVisibilitySettings(object caller, bool rayVisible, bool coneVisible, int priority = 0) { m_VisibilitySettings[caller] = new DefaultRayVisibilitySettings { rayVisible = rayVisible, coneVisible = coneVisible, priority = priority }; } - public void UnregisterVisibilitySettings(object caller) + public void RemoveVisibilitySettings(object caller) { m_VisibilitySettings.Remove(caller); } diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index 3601b1306..c28db7fe9 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools [MainMenuItem("Primitive", "Create", "Create primitives in the scene")] sealed class CreatePrimitiveTool : MonoBehaviour, ITool, IStandardActionMap, IConnectInterfaces, IInstantiateMenuUI, IUsesRayOrigin, IUsesSpatialHash, IUsesViewerScale, ISelectTool, IIsHoveringOverUI, IIsMainMenuVisible, - IRegisterRayVisibilitySettings + IRayVisibilitySettings { [SerializeField] CreatePrimitiveMenu m_MenuPrefab; @@ -76,9 +76,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } if (m_State == PrimitiveCreationStates.StartPoint && this.IsHoveringOverUI(rayOrigin)) - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); else - this.RegisterRayVisibilitySettings(rayOrigin, this, false, true); + this.AddRayVisibilitySettings(rayOrigin, this, false, true); } void SetSelectedPrimitive(PrimitiveType type, bool isFreeform) @@ -164,7 +164,7 @@ void OnDestroy() if (rayOrigin == null) return; - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); } } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index b1cd81277..580a01c46 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ICustomActionMap, ILinkedObject, - IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences, IRegisterRayVisibilitySettings + IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences, IRayVisibilitySettings { const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 1f; @@ -189,7 +189,7 @@ void OnDisable() void OnDestroy() { - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); if (m_ViewerScaleVisuals) ObjectUtils.Destroy(m_ViewerScaleVisuals.gameObject); @@ -328,7 +328,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + this.AddRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); } if (m_Crawling) @@ -337,7 +337,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) return true; } - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); m_StartCrawling = false; m_Crawling = false; @@ -349,7 +349,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + this.AddRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); m_BlinkVisuals.ShowVisuals(); @@ -359,7 +359,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_State == State.Aiming && m_LocomotionInput.blink.wasJustReleased) { - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); if (!m_BlinkVisuals.outOfMaxRange) { @@ -411,8 +411,8 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); - this.RegisterRayVisibilitySettings(otherRayOrigin, this, false, false, k_RayHidePriority); + this.AddRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + this.AddRayVisibilitySettings(otherRayOrigin, this, false, false, k_RayHidePriority); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; @@ -544,7 +544,7 @@ void CancelScale() if (!locomotionTool.m_StartCrawling && locomotionTool.m_Scaling) { var rayOrigin = locomotionTool.rayOrigin; - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); } locomotionTool.m_Scaling = false; diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index 71e669994..1df4eebfc 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -9,7 +9,7 @@ [ExecuteInEditMode] public class MoveWorkspacesTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesViewerBody, - IResetWorkspaces, IAllWorkspaces, IUsesViewerScale, IRegisterRayVisibilitySettings + IResetWorkspaces, IAllWorkspaces, IUsesViewerScale, IRayVisibilitySettings { enum State { @@ -159,7 +159,7 @@ void StartMove() m_State = State.MoveWorkspaces; - this.RegisterRayVisibilitySettings(rayOrigin, this, false, false); + this.AddRayVisibilitySettings(rayOrigin, this, false, false); foreach (var ws in allWorkspaces) { @@ -193,7 +193,7 @@ void EndMove() { m_State = State.WaitingForInput; - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); foreach (var ws in allWorkspaces) { diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index d14b288bc..9e8614d5a 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -14,7 +14,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, ILinkedObject, IRayToNode, IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, IIsRayActive, - IRegisterRayVisibilitySettings + IRayVisibilitySettings { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -333,7 +333,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; - this.RegisterRayVisibilitySettings(directRayOrigin, this, false, true, k_RayHidePriority); // This will also disable ray selection + this.AddRayVisibilitySettings(directRayOrigin, this, false, true, k_RayHidePriority); // This will also disable ray selection if (!this.IsConeActive(directRayOrigin)) continue; @@ -484,7 +484,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var rayOrigin = transformTool.rayOrigin; if (!(m_Scaling || directSelection.ContainsKey(rayOrigin) || m_GrabData.ContainsKey(transformTool.node.Value))) { - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); } } } @@ -562,8 +562,8 @@ public Transform[] GetHeldObjects(Node node) grabData.UpdatePositions(this); // Prevent lock from getting stuck - this.UnregisterRayVisibilitySettings(rayOrigin, this); - this.RegisterRayVisibilitySettings(destRayOrigin, this, false, true, k_RayHidePriority); + this.RemoveRayVisibilitySettings(rayOrigin, this); + this.AddRayVisibilitySettings(destRayOrigin, this, false, true, k_RayHidePriority); if (objectsTransferred != null) objectsTransferred(rayOrigin, destRayOrigin); @@ -587,7 +587,7 @@ public void DropHeldObjects(Node node) m_GrabData.Remove(node); - this.UnregisterRayVisibilitySettings(grabData.rayOrigin, this); + this.RemoveRayVisibilitySettings(grabData.rayOrigin, this); this.ClearSnappingState(rayOrigin); } diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index a03e780c2..afaf75aa7 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Workspaces { sealed class AssetGridItem : DraggableListItem, IPlaceSceneObject, IUsesSpatialHash, - IUsesViewerBody, IRegisterRayVisibilitySettings + IUsesViewerBody, IRayVisibilitySettings { const float k_PreviewDuration = 0.1f; const float k_MinPreviewScale = 0.01f; @@ -299,7 +299,7 @@ protected override void OnDragStarted(BaseHandle handle, HandleEventData eventDa base.OnDragStarted(handle, eventData); var rayOrigin = eventData.rayOrigin; - this.RegisterRayVisibilitySettings(rayOrigin, this, false, true); + this.AddRayVisibilitySettings(rayOrigin, this, false, true); var clone = Instantiate(gameObject, transform.position, transform.rotation, transform.parent); var cloneItem = clone.GetComponent(); @@ -349,7 +349,7 @@ protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData var gridItem = m_DragObject.GetComponent(); var rayOrigin = eventData.rayOrigin; - this.UnregisterRayVisibilitySettings(rayOrigin, this); + this.RemoveRayVisibilitySettings(rayOrigin, this); if (!this.IsOverShoulder(eventData.rayOrigin)) { From 9f4a004cc41c89839ba7d8e1de5715b669d2b1e0 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 18:07:07 -0700 Subject: [PATCH 646/870] Rename IIsRayActive to IGetRayVisibility --- Scripts/Core/EditorVR.Rays.cs | 4 +- .../IGetRayVisibility.cs | 38 +++++++++++++++++++ ...tive.cs.meta => IGetRayVisibility.cs.meta} | 0 .../FunctionalityInjection/IIsRayActive.cs | 38 ------------------- Tools/SelectionTool/SelectionTool.cs | 6 +-- Tools/TransformTool/TransformTool.cs | 4 +- 6 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs rename Scripts/Interfaces/FunctionalityInjection/{IIsRayActive.cs.meta => IGetRayVisibility.cs.meta} (100%) delete mode 100644 Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 5144b4536..6fe6de8a5 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -47,8 +47,8 @@ public Rays() IGetPreviewOriginMethods.getPreviewOriginForRayOrigin = GetPreviewOriginForRayOrigin; IUsesRaycastResultsMethods.getFirstGameObject = GetFirstGameObject; IRayToNodeMethods.requestNodeFromRayOrigin = RequestNodeFromRayOrigin; - IIsRayActiveMethods.isRayActive = IsRayActive; - IIsRayActiveMethods.isConeActive = IsConeActive; + IGetRayVisibilityMethods.isRayVisible = IsRayActive; + IGetRayVisibilityMethods.isConeVisible = IsConeActive; } internal override void OnDestroy() diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs b/Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs new file mode 100644 index 000000000..c108db402 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs @@ -0,0 +1,38 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provides access to checks that can test whether parts of the default ray is visible + /// + public interface IGetRayVisibility + { + } + + public static class IGetRayVisibilityMethods + { + internal static Func isRayVisible { get; set; } + internal static Func isConeVisible { get; set; } + + /// + /// Returns whether the specified ray is visible + /// + /// The rayOrigin that is being checked + public static bool IsRayVisible(this IGetRayVisibility obj, Transform rayOrigin) + { + return isRayVisible(rayOrigin); + } + + /// + /// Returns whether the specified cone is visible + /// + /// The rayOrigin that is being checked + public static bool IsConeVisible(this IGetRayVisibility obj, Transform rayOrigin) + { + return isConeVisible(rayOrigin); + } + } +} +#endif \ No newline at end of file diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs.meta similarity index 100% rename from Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs.meta diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs b/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs deleted file mode 100644 index b2c2fc8a2..000000000 --- a/Scripts/Interfaces/FunctionalityInjection/IIsRayActive.cs +++ /dev/null @@ -1,38 +0,0 @@ -#if UNITY_EDITOR -using System; -using UnityEngine; - -namespace UnityEditor.Experimental.EditorVR -{ - /// - /// Provides access to checks that can test whether a ray is active - /// - public interface IIsRayActive - { - } - - public static class IIsRayActiveMethods - { - internal static Func isRayActive { get; set; } - internal static Func isConeActive { get; set; } - - /// - /// Returns whether the specified ray is active - /// - /// The rayOrigin that is being checked - public static bool IsRayActive(this IIsRayActive obj, Transform rayOrigin) - { - return isRayActive(rayOrigin); - } - - /// - /// Returns whether the specified cone is active - /// - /// The rayOrigin that is being checked - public static bool IsConeActive(this IIsRayActive obj, Transform rayOrigin) - { - return isConeActive(rayOrigin); - } - } -} -#endif \ No newline at end of file diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 6c946ae2c..5f3a6a40a 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject, IGetManipulatorDragState, IUsesNode, IIsRayActive, IIsMainMenuVisible, IIsInMiniWorld, IRayToNode, + ICanGrabObject, IGetManipulatorDragState, IUsesNode, IGetRayVisibility, IIsMainMenuVisible, IIsInMiniWorld, IRayToNode, IGetDefaultRayColor, ISetDefaultRayColor, ITooltip, ITooltipPlacement, ISetTooltipVisibility { const float k_MultiselectHueShift = 0.5f; @@ -243,7 +243,7 @@ bool IsDirectActive() if (rayOrigin == null) return false; - if (!this.IsConeActive(rayOrigin)) + if (!this.IsConeVisible(rayOrigin)) return false; if (this.IsInMiniWorld(rayOrigin)) @@ -269,7 +269,7 @@ bool IsRayActive() if (this.IsInMiniWorld(rayOrigin)) return false; - if (!this.IsRayActive(rayOrigin)) + if (!this.IsRayVisible(rayOrigin)) return false; return true; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 9e8614d5a..331752185 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, ILinkedObject, IRayToNode, - IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, IIsRayActive, + IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, IGetRayVisibility, IRayVisibilitySettings { const float k_LazyFollowTranslate = 8f; @@ -335,7 +335,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.AddRayVisibilitySettings(directRayOrigin, this, false, true, k_RayHidePriority); // This will also disable ray selection - if (!this.IsConeActive(directRayOrigin)) + if (!this.IsConeVisible(directRayOrigin)) continue; var grabbingNode = this.RequestNodeFromRayOrigin(directRayOrigin); From 044c865d1dfabbe13a488232bc7e520cbddb198a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 20 Jul 2017 18:10:56 -0700 Subject: [PATCH 647/870] Allow for external setting of the GradientButton's local z offset during the highlight state --- Scripts/UI/GradientButton.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 95714c668..5d5c179e2 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -16,9 +16,6 @@ sealed class GradientButton : MonoBehaviour, IPointerEnterHandler, IPointerExitH const string k_MaterialColorTopProperty = "_ColorTop"; const string k_MaterialColorBottomProperty = "_ColorBottom"; - [SerializeField] - float m_IconHighlightedLocalZOffset = -0.0015f; - public event Action click; public event Action hoverEnter; public event Action hoverExit; @@ -185,6 +182,9 @@ public Sprite icon [SerializeField] Graphic[] m_HighlightItems; + [SerializeField] + float m_IconHighlightedLocalZOffset = -0.0015f; + [Header("Animated Reveal Settings")] [Tooltip("Default value is 0.25")] // If AnimatedReveal is enabled, wait this duration before performing the reveal @@ -214,9 +214,17 @@ public Sprite icon Coroutine m_IconHighlightCoroutine; public bool invertHighlightScale { private get; set; } - public float containerContentsAnimationSpeedMultiplier { set { m_ContainerContentsAnimationSpeedMultiplier = value; }} + public float iconHighlightedLocalZOffset + { + set + { + m_IconHighlightedLocalZOffset = value; + m_IconHighlightedLocalPosition = m_OriginalIconLocalPosition + Vector3.forward * m_IconHighlightedLocalZOffset; + } + } + void Awake() { m_OriginalIconSprite = m_Icon.sprite; From 6e784fa89515668e91e1e2c5f829d272b2878c42 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 20 Jul 2017 18:21:38 -0700 Subject: [PATCH 648/870] Add support for alternate Primary/Gradient button z-offset setting based on selection type in PinnedToolButtons. Greater z-offset during spatial selection vs ray selection, for additional visual emphasis of primary button icons/text during spatial selection --- .../PinnedToolButton/PinnedToolButton.cs | 1 + .../PinnedToolButton/PinnedToolButton.prefab | 4 ++-- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 +- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 13 +++++++++++-- Scripts/UI/Interfaces/IPinnedToolButton.cs | 1 + 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 9348774b3..e24794c08 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -523,6 +523,7 @@ public bool moveToAlternatePosition } public Vector3 primaryUIContentContainerLocalScale { get { return m_PrimaryUIContentContainer.localScale; } set { m_PrimaryUIContentContainer.localScale = value; } } + public float iconHighlightedLocalZOffset { set { m_GradientButton.iconHighlightedLocalZOffset = value; } } void Awake() { diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab index 8ee8b42e7..eb3c7deb8 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab @@ -1269,7 +1269,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} m_Name: m_EditorClassIdentifier: - m_IconHighlightedLocalZOffset: -0.0015 m_NormalGradientPair: a: {r: 1, g: 0.92156863, b: 0.93333334, a: 1} b: {r: 0.7176471, g: 0.10980392, b: 0.10980392, a: 1} @@ -1287,6 +1286,7 @@ MonoBehaviour: m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItems: - {fileID: 114000012344975988} + m_IconHighlightedLocalZOffset: -0.0015 m_DelayBeforeReveal: 0 m_highlightZScaleMultiplier: 25 --- !u!114 &114000010635728284 @@ -1738,7 +1738,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c14051f25ea615549aeb702ebe3005d8, type: 3} m_Name: m_EditorClassIdentifier: - m_IconHighlightedLocalZOffset: -0.0155 m_NormalGradientPair: a: {r: 0, g: 0, b: 0, a: 0} b: {r: 0, g: 0, b: 0, a: 0} @@ -1757,6 +1756,7 @@ MonoBehaviour: m_HighlightItems: - {fileID: 114000011650556854} - {fileID: 114000013859744370} + m_IconHighlightedLocalZOffset: -0.0155 m_DelayBeforeReveal: 0 m_highlightZScaleMultiplier: 10 --- !u!137 &137000010072420284 diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 9fa4e3d26..6f536692f 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -253,7 +253,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon allowSpatialScrollBeforeThisTime = Time.realtimeSinceStartup + kAutoHideDuration; allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; this.SetSpatialHintControlObject(rayOrigin); - m_PinnedToolsMenuUI.beginningSpatialScrolling = true; // Triggers the display of the directional hint arrows + m_PinnedToolsMenuUI.SpatiallyScrolling = true; // Triggers the display of the directional hint arrows //Dont show if the user hasnt passed the threshold in the given duration } diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index cfa54834f..4ea28bdb1 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -17,6 +17,8 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation const int k_InactiveButtonInitialOrderPosition = -1; + const float k_RaySelectIconHighlightedZOffset = -0.0075f; + const float k_SpatialSelectIconHighlightedZOffset = -0.02f; [SerializeField] Transform m_ButtonContainer; @@ -66,7 +68,7 @@ public bool allButtonsVisible //this.Pulse(rayOrigin, 0.5f, 0.065f, false, true); //spatialDragDistance = 0f; ShowOnlyMenuAndActiveToolButtons(); - + SpatiallyScrolling = false; this.SetSpatialHintRotationTarget(Vector3.zero); } } @@ -102,10 +104,16 @@ private bool aboveMinimumButtonCount } } - public bool beginningSpatialScrolling + public bool SpatiallyScrolling { set { + for (int i = 0; i < m_OrderedButtons.Count; ++i) + { + var button = m_OrderedButtons[i]; + button.iconHighlightedLocalZOffset = value ? k_SpatialSelectIconHighlightedZOffset : k_RaySelectIconHighlightedZOffset; + } + if (value) { Debug.LogWarning("SETTING Spatial Drag Distance : " + value); @@ -231,6 +239,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) button.selectTool = SelectExistingToolType; button.closeButton = DeleteHighlightedButton; button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount + button.iconHighlightedLocalZOffset = k_RaySelectIconHighlightedZOffset; button.hovered += OnButtonHover; bool allowSecondaryButton = false; // Secondary button is the close button diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 1979ecc70..2777b907e 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -13,6 +13,7 @@ public interface IPinnedToolButton Type toolType { get; set; } int order { get; set; } int maxButtonCount { get; set; } + float iconHighlightedLocalZOffset { set; } bool highlighted { get; set; } bool secondaryButtonHighlighted { get; } bool activeTool { get; set; } From 03008af39ca2b6d647a25562216c138e919e6152 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 18:43:30 -0700 Subject: [PATCH 649/870] Use local list to reduce GC when getting Workspace component in UpdateMenuVisibilities --- Scripts/Core/EditorVR.Menus.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index d286c1180..a587651f4 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -45,6 +45,7 @@ internal enum MenuHideFlags // Local method use only -- created here to reduce garbage collection readonly List m_ActiveDeviceData = new List(); + readonly List m_WorkspaceComponents = new List(); readonly Collider[] m_WorkspaceOverlaps = new Collider[k_PossibleOverlaps]; public Menus() @@ -147,8 +148,13 @@ internal void UpdateMenuVisibilities() { foreach (var overlap in m_WorkspaceOverlaps) { - if (overlap && overlap.GetComponent() != null) - hoveringWorkspace = true; + if (overlap) + { + m_WorkspaceComponents.Clear(); + overlap.GetComponents(m_WorkspaceComponents); + if (m_WorkspaceComponents.Count > 0) + hoveringWorkspace = true; + } } } From 951ca3cdd38761c93c1621b188e38f8dd9f420a1 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 20 Jul 2017 18:55:54 -0700 Subject: [PATCH 650/870] Force text serialization --- Prefabs/DefaultProxyRay.prefab | Bin 13528 -> 14151 bytes .../Base/ActionMaps/WorkspaceInput.asset | Bin 5772 -> 4492 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Prefabs/DefaultProxyRay.prefab b/Prefabs/DefaultProxyRay.prefab index fb863e84231993c3b6ed86cc61d7ff6cf14cc491..f86dad478578d0c51bbb9ded11f7db2ea78f28cd 100644 GIT binary patch literal 14151 zcmeHOTW{OQ6@K@x;67~70=6(W4oST^c9IofXAR47Q51zRB8L)NiZn>diFdL8y=P{4 zmuRJq3(>_oh$Ie&b2;C+&*9I1Kfk`R@C2Xye0ToI`f2-B-sInYxP+!qz+WiPYc8O(sLJoSsQ0^i|9ZpVKqxEgPNPmE1pOc;T_jIiOpoVmz>VF`1I%PA|jb0wZ+ z2B_-AeFpMRtqXunU*3t;yvU+tHMPDZz>F&y==Pbfn5WATo5g4GcrEjFXTW&@T;+cV zq9V;oRx~rs@^in49$~g!++dBaO$qhbVcZmBSC|-1I5uvWJ2vL7hlt_R4m}Kk--}${ ziYMzY_^(H$GbWx3T;_d;e2kCIgduJdMDQ>pUyCRKIv{q zuT(k+*_?Scwe4ZPzXS`ljfImG6O8MVK^D>YpS;T~`wB3g6p?^;Wh=Mv_D zJsd{*DoW(7Oaht7?3k*Kc!V%cUC!U4sw0fr+~M4a)P7J({IE^Hyet1~SSyxXK`7-M zVZyazwpr|P20#&hNP?R*N{VBmN3jRcIj-v-MsIx10Qdrq>tOF0XP{Jw$D}bh>n`OO zeA~B3W6BA$ZO3^=71c(E9?R%B7%@gDSRHU%*mr26QSmZ$sRIh1V}>DG(<*;R6H&^T z2mdI9eVjh4i5!Tg!1B0`i#a&^gJH>ily60xA3;Kx^{yZEp41tLXHpuk8ToA%tt3Gc z+?wP=lS(M5m--^UO;vQOL*Z{z>kOS*Pv+}4^Ys;i+gA6RG>@9@rZ;>-=PH6xgU;bU zM8&_uh-d=l198HM9=W=7uz6_W*xUw}+e~q>j^Y4PH72c4$L4G=OEtH(@6rvW&YH~| zP`b)>=XN*X-MLLVzUt2HzE=4tinU5e^p@C-L`<^i*9?4~Dv5Qai1%R|%j`T^#WMc| z>}g3xL%oX9W%{gUxn}v}V!0*@(&C{m%b|&bK;dz>y~9%r_^!UwdUhZGouLV`E6S)$ ziY8-=2Z7gssqsYd31lC2*XpXrcqRk5Sqvc9&1ZEGq*~<+Bj_1nQC}b}9*D~hh;^Vk zG7#(VzXe1O#2xT{NNJRS8K8Oy0hxE?uOH&{SD&-3Lv;3t@ zy=v=;ny76NNj31;KG!H#v{Td%?TsSuI?l6veZ-7hf$pDSpmkQC=(_K7ETXD#T zG2RO@Zgd6U{|HWV$~UY%iE|Ln#@`+noK1?T1xU}CDaEpqO8tF6D2)qxP$o5_v?Q~U zMO5nFIs`hPQ2S0x%Q-Oz;=|~D2XudH6x>UO#|+&KEs^(KANxz`YJAqr8Idw(%}n|VBJ?tN2({kr zWW}W{3`whX&!7q?D@0O!npI76smLw^Q@mohP;C!ZWAYW(Q4(#o8$IA0%BrT8aplgp zMf&CbT70{Vav0KAq@5VIpuVMZR8!0KjPs}V4cmYM7AU|0NMZGLpk2WN>w`)heSoCP zu=JDjR%^X*(^iMuWdz-lu;#3Cd=gfl7aMLItAs(>iIE*6V@$G;6R0+mT=O2*3MdrM5-wu~96|5L^~GS)k98Iz3d^)%j!jA6D6(Gt0m`7D%-dk*oI znE2QSpW6%nlrboZ{r|UP6gD$L$ym@exAKic>Lejt2_{1B?oU5ENmrpK3F z=!rmLoBKBS<;LHpHJ}_0BX`QPH4QG(I0grJ6inSe1FwRQU0-#U-(?Y0i-U`AobZl? z*;5*C(k@VU{wU$xyL8->Fa~eCi8wZk`M;y&Z&6UF5M+W(x7Wr33h&_kfwHc?scAjA zPLuS#T#Lsj-Hrl|{`(Le8gCXRY-zm$QU+*#7Cp4%GK}qxC(CU&2t!+7-wCAWGH=O+ z^h2`r1%=ugIBKrBSB1Q$pk2ozX2y$H!gwxb0w)mx{bFa$rE`pG* zr7mHGaJ*KP7nb=ED0^&}q2{1=ut?#rS0z)b&@RgL?BheZpSOD@lmpvEOP3447S0zi zBOdj=rHyQFNif07m!Vu`psI9)s$tPNCiqlmUkW%lfbKO{+1oTuGYE__#ht)6N}nn@ zcPJFrGKip->dK{9UGq~*fTA#*07^2=poa3leNJ;vIV0#3!$P`I57soLSsctCK&xMh z0;WZkA?|Qd^A67VxTvqXUx|x^O9N?p$oD~62%FiS=Yyg1><}`oGg6+2kkr%w7zUWH)35N9&ZPYZV;^Ru literal 13528 zcmeHN3v^V)8JmB#ET^7hPmi}9 z?#y>*{`u#h|NrKnjY^drrPSn?lu}<)s;nMwHD%&46DM`eY>sDAUQ@$__Hwnox3@R4 z8$P{TjDLE2PZ=}nuo4`V2svW%QTstNTo{r)tCkuz9zL(j9& zrk=xz>oO#y=Lie8_2d}Sf3P|cb9!h~pFN0Y`E5u@&ymEV#D|9T97SB0p=us&!n|hAU z;o<%IW)2VU*S9R3`$9WVpZ#+9;LyH|v2a_T{d0IkT>?3Gp-njlr&0}CGnV(iKmjP zZDC%s(Q}gNB`L41-tpXI1|4R_6K>56RO+2ftFG8X(vX^JcfCxvjjD{}wYVA8?tkM@ z)#)TUT$NgUrW?yNxJz8fkGYWB;I^eY-RA04TYD;rIn#PB&TbTDmsBb<+i7!8)`J1m zq|G;9OIic2aO&x!*FSLnHQ#<<>zfl_`PW`D=x=62MUEyMjYl*=jYpjh&pE10|4`tQ za13q;PzZ{IBREM>9G-+@@Ik5+jyD}`u9wB&CJbNLDy!`l(q9u!lz3QwO*j}r+$OGoaE$y$^r3tbPJi+>;Y9n&4+tkLKOmfl zdIa`a1hKRY35QR)O}Z+UiFdkMd02X{-&f3geL{KTpB`_!XwH!O3l4#f*Z8_-u-~D0)A-I0`2VGN zBN2D{acjj}DE@M^D^FST;^rG8QjRPM~m`xy!9iW@n*{r z`HVLk7x|1gk+%=0#P7C?rdK#}vYF*%5`%bToPXk$nU(hBv>NE#3K%EpqaYY>{Ih**l{Uk&{m$ zBFCnXT7^&m6;Z$7ju26+5h7E3y?4i(5A8#|TGxFF!9c-zL{g5SkN|J?ar?-o965S4 zg+xt%hUOLM&(Jg!LOdLrhC+ykL(@=*!Dm{bX()ua2~Dw&KC-oLgLJMd_F?GCe%*lj zT`1f`x|P9;)H3L~9&NajKC*56Ngof6Y!l*}fzy_x5b4iUP4o$lY(x2?4=F_SA?3X7 z%OQpEVJO>jYziUeh@5~z%w6CUjHNy$D17qejMbRIZ8?TQh(|Pq>iqi9j?MeF?`Qd$;ki!l2zV6GPXyGNW|3|>-Cr4_WvLcFj1R(KA#G^_v z9cplsAU052;k;Vyq%-qdo#xazyxlaoF&Al60Mw<(t4+8Vr95`1jkmPo_LExdE=W5q z=907|fzRj_g6o`&>&2Z!TFobC$EG`(SZhskNeV*pktJ~tN^~sd5>(o}t5Y5Nl4tcL zb7QogrYae0O))nN6lzK(I&cx|bUiQLOwIHuP?OX>+MISh)J?lyr@NquYpH2Trabo~ zTq&XEtdv*X>UfzMZpN&J9dPgSGEOoxyN2RiuG4Kc>8&v}wc}KE@npQMqfJYgA3v8+ zRYxYZpsCL3nh{S!hQ3hdFn!#ZT@v+hVZ=QWMoTkc?u$|bXoDCrFpNzmZ1g8hh#Y>4=n`HR zk9OkpUEFf8e+37h4pNTehHKxCLJ;=spph#UJ-p#pXFhS$bGMxIe7cH9%C#sAcRt*+ z6HOI0&cEY5`+rS6m|o05>2J^ENX*}}Bha6|D0@b`)xv@cfN>A))PuOBHcUMtRmRT5 z9lyW1y#)A~KCV-bsKM8ue;07ZMv!_$)J14tg|a(Jka~oV4yGQ|OJeB=)T#fzK2D#h zP9+kcyIu6U`qu7rJSH5i{m#&_%l`nCPr{@|1Wp zemm>y#2&Q6Q!(bwsXY^#D-I}Mdi#5Cy3033o9@Zpvi|P3dX{}}O6j^c$Dz+s6fSTm z4#-`}r!i!QM8sg}kBH>T!*9l@JI|*@PCgNdoI;66t4nvdjRGB2Il^f$yM^J=Ho-}?Rp7RhQkp(`z&nt4Wk-b|-9 z^20w-(WymG{=`-eJ(-tlr_N^aEu5EYr;ZX2=jB`nhH88sf(b#ErCgIw6OX9zXbXY= zH$Q>ZLC!)H+LQS-pL}};`E=Nx%%^3&YoMcxHuviQ6h74RY`iZ-p?vNGpM3cx8Z)?k z znfGM0Id3V7vgFIW=HeX4mwENY+3GLzmO)B?^Ku_#-Zfb7X=qcQLs9t94#ZnfCw>?~ zJjCh$q>l*7;RLJjN5F#rb|63ZrIq;|kbIO#dAN*u8L(1|TC5yRQUGTrn^DzFX1@Ck zA5VFS=K1YT%$?z69K&cus(w_>+7XvtJ@*F>O{$D;yKcq57w)m{?LoI}zbv-w+Lh`B zy`zo3_Fpktu%ln4E?*v_k%hvH#(nAg*91l!aXYoJQx`@i8G-#YqwP{;HaOk6ztiIn z@Qmov9Kgh3erxI+bV^J5v%2MfXUd8*B^K_u~TuUzStjoZcp(Y#I^$K z_ObSlCjFAwqT*nVig6FWP3+geMBa_v?>67I_YgH6OxNL${q&i4KKy*jNVOW+gTNqG zUGl;9Iop7pidDD!SjE{(7Z7_A*fl=3y!+ZtVvBJ7kbe7|F~5u0vliBM*5Vb!qC|fc>}m^Je%?XLhp)ihV7H*(y`#(SiLITd+JR9& zEL-i>vE>6|!-fags=sVlyC&PHR$Ex(m5;r@U|NToit7ybmj}W9FTFjw30S*@t*w3S z-DPc^>P`#0XzQkT)=Ya#Z3R|~adebt-Thx^DOwqsgp)ggHg9M5FI9ghwi?*wXk*#x z)7!J#bw6B-PDL9_)Oy1O)Yk5w;a{^KQs2H zYs=P+9kZ(DGlPmq`O$*yM0~O5c-=;LNi+VVnvO)KBsZy2TYfk4^Vns_)?T;vv%CH} z?};g4O(B8yDddqj+gX2!ZJ9*kf%0X4SeJcfo&Leg1@~Y1J82gjR5JdkL$zOgQS(U5avu6%ofA)Do`UD#IQx-x$bJh?u#dz6>vXUg zX0P$vcvttX%qcda9C>73`6e90?;-mgUAX;3w*8iQxaWL?k60IeVO{t_*Zo*$9pSF* z+ijsf!?E@wdWfG2&$5s37wf`5BwI|&+@|eb7%929dl<1<`I79oN`XE&h<6L(;fUnQ6VV28*3jnaAKv*fDO1OBvug>^od6Sia?wBz}hb18Lc!ShMJ zj6qyquE<=JMw@btET)Zoz|WO~xGBt!C6A}jpagP_e72<+ME1|Lf`13vKgsih5v&b7 zpR6xDZeU&z{}jFWrVmt(&zCe%oAx$2u<;=Uo7@Mk=>L)V?5}p*h~1?h-}IG|5heDJ z0_w(gYi|9inu?jUlA%d<1TB%kEZ7jTS7 pkhk&0haak_-28l_&lyVDZR#X?anwNih&`nr{XAbE`DW)G{{glF2jc($ diff --git a/Workspaces/Base/ActionMaps/WorkspaceInput.asset b/Workspaces/Base/ActionMaps/WorkspaceInput.asset index 78f6447b417e53f1ba6fcafc9580d01b6f160f1a..41bb8c587060941a8ab206c2549aa55b526701af 100644 GIT binary patch literal 4492 zcmeHKTW{Jh6n^JdxDVYEus9bkk@`Ss*P)dT6~?qq6LOpbcuj1SI9=Ja|2{hog^r+h z(<-%HK>~tLj?d-u_nqv2>hw<$uH(x7sB?n$vOOfp%+ENJODC*T5m#*sW4}_X)$}UH zE_$UtEd8qV1s8`fCs#~liC;k|p1cpf0+nxB2yY@XOMPVJe-9Fvl3+j*;L@1*=*N^r z&^uBlKR0Z8TtdQ0w7q^pV%T->F(*L;p^tFx>NsRlBwJAoX~GtA!!yQSo=FwWGN$gf zUGM^GwOX`I2?VYiP}gobA$4pVSdLRga=8E>IVR#W6_JlVisUj~5DGoM$mGWU-H4=V zFH|YBDTBmE`C5lcCU~mLRa@7fs42FaO~-Z}x82fPlo(*oYuOFQa!L#u*tI>o;aY8M z;ZlQEv)#a6qiJK$X%%(v3N8~74e1Q(iGw#TGqP5IY|~(G=?Nql{&EM z`MY}K8KG_#$t-~b4w+0yR7Ha$$A>g?s$HI%BuNljz5K@CyU@S-SAQ3Zs;yvMhi8UhI~ z1Xn1x>MO$_lTz@`HA{zuXY~0?;bfL5GLRY-njiFb2&KSNCfWA?T&H0&Luiq(m?XCiE#$N;xJ`rWw2xf$M?e1%X?oJca2$2cQ{Tj2Ip?A($8=0gVrm@Ia7gj8M=2-nrAcZ9|(#>>Z6U`eVf!^B-Z% zCy60`wGXbbcMF(*l+MKoVx8#tWb7>Q+vtcb1&^_Fq%n);SYHs~Dbl%@=2L=mQs<=@ z^G^mkg^~49ouUYj>J*1uW2;D~FVMjrHT;}v&(sKy>Xd|BV~5Djr%4C)l|qArWE`4^ z!!P(O?eC#|F9!QgBaWs~M56Xj=S=YEzB59uu}!q^VbVeTaepE7}o_B{_V+}NJrw)7Wp(B|; z${swAf~)=}z^Ne)(1AVBSpevR$CdkaU&srUcrGL^?pKj=zZQY>UZmWw#UYQg42^B- z*!O-qihWi6B_UV!aUak$R>XCr{SN~A;KkgY=V=;KI=yCX#uYac`y#I11zr##R36A^xh@|a1S{#X-u4aUX%yqG(3(C-14gxrA*11-P-rZv1N;%gOTAxT2O0R z8Pn>fQ^Ck(+|ax|yyw|gO~2{3 z^D9`_2;efy=+-^6&tN&*HTj_1(fdqqfVqe#5k9u`9LqUoukH*qy2G+$D|r)fxGwK{ zb}zhlb9&kkg&d{3_U`ZhEW32RogGKU~PEek}?0RljgAgnnGn zM6Wgz0{twL&h@F*R zJjGc7V}As!^2ASTrmsAp;Yod9?eOtqzx+C{?%-FS4_)<=`vm2uChr4&phf+`ug`6^vx~n` z_-*7%_ydEHj2*@@wiwI!VJzbYUBs)CN)8z}`m(XD7QN;gtZvgXQhbZe#_m*S8y||7 zelk(xx<+qTc3@dudynqql8H{kLB&zEBE|nD6Loa+^Nvwv8F|mqv&lqjzAI~{>7CqR z?=q|^E1%8MX4J6v|Glq_t$Zf&g#*Kl$MKDW2ZKU;u%5BOdbwV%fz9Ks`L8;iw1;}H zZ*JU4enL(94xi83e3o{bT6 zZ#a}bME%DvrKtbS#*WZ^>AMu24Bu~LpR{Yd<5+& Date: Thu, 20 Jul 2017 19:46:42 -0700 Subject: [PATCH 651/870] Prevent ToolTips from showing on PinnedToolButtons when performing the initial PrimaryButtonHighlight start/end --- Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index e24794c08..78e5ba799 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -1164,10 +1164,10 @@ void CorrectIconRotation() m_IconContainer.LookAt(iconLookDirection); m_IconContainer.localEulerAngles = new Vector3(0f, 0f, m_IconContainer.localEulerAngles.z); var angle = m_IconContainer.localEulerAngles.z; - m_TooltipTarget.localEulerAngles = new Vector3(90f, 0f, angle); + m_TooltipTarget.localEulerAngles = new Vector3(90f, 90f, angle); var yaw = transform.localRotation.eulerAngles.y; - //tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; + tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; } IEnumerator ShowSecondaryButton() @@ -1251,7 +1251,6 @@ IEnumerator PerformPrimaryButtonHighlightStart() const float kSecondaryButtonFrameVisibleBlendShapeWeight = 16f; const float kTargetDuration = 1f; var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - this.ShowTooltip(this); var currentDuration = 0f; while (currentDuration < kTargetDuration) { @@ -1266,7 +1265,7 @@ IEnumerator PerformPrimaryButtonHighlightEnd() const float kSecondaryButtonFrameHiddenBlendShapeWeight = 0f; const float kTargetDuration = 1f; var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - this.ShowTooltip(this); + this.hideTooltip(this); var currentDuration = 0f; while (currentDuration < kTargetDuration) { From ce36c3a4d6f185d3c4fdb394d5d712f780b10c0c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 20 Jul 2017 23:06:14 -0700 Subject: [PATCH 652/870] Add new visual layout for ToolTips on PinnedToolButtons; they're now centered, upward, and forward from the PinnedToolsMenu contents; allowing for a singular UX focal point, alleviating users' need to look at the buttons as they're scrolled/scrubbed through --- .../PinnedToolButton/PinnedToolButton.cs | 27 +++++++++------ .../PinnedToolButton/PinnedToolButton.prefab | 12 +++---- .../Prefabs/PinnedToolsMenu.prefab | 34 +++++++++++++++++-- .../Scripts/PinnedToolsMenuUI.cs | 4 +++ Scripts/UI/Interfaces/IPinnedToolButton.cs | 1 + 5 files changed, 59 insertions(+), 19 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 78e5ba799..b63f7dd64 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -296,7 +296,7 @@ public Transform alternateMenuOrigin bool m_Visible; public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } - public Transform tooltipTarget { get { return m_TooltipTarget; } } + public Transform tooltipTarget { get { return m_TooltipTarget; } set { m_TooltipTarget = value; } } public Transform tooltipSource { get { return m_TooltipSource; } } public TextAlignment tooltipAlignment { get; private set; } public Transform rayOrigin { get; set; } @@ -560,11 +560,16 @@ void Start() //transform.localPosition = activePosition; } - var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); - var tooltipXOffset = node == Node.LeftHand ? -0.15f : 0.15f; - tooltipSource.localPosition = tooltipSourcePosition; - tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; - m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); + //var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); + //var tooltipXOffset = node == Node.LeftHand ? -0.15f : 0.15f; + //tooltipSource.localPosition = tooltipSourcePosition; + //tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; + //m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); + + var tooltipSourcePosition = new Vector3(0f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); + //tooltipSource.localPosition = tooltipSourcePosition; + tooltipAlignment = TextAlignment.Center; + //m_TooltipTarget.localPosition = new Vector3(0, 0, -0.5f); m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions m_GradientButton.hoverExit += OnActionButtonHoverExit; @@ -1163,11 +1168,13 @@ void CorrectIconRotation() var iconLookDirection = m_IconContainer.transform.position + transform.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation m_IconContainer.LookAt(iconLookDirection); m_IconContainer.localEulerAngles = new Vector3(0f, 0f, m_IconContainer.localEulerAngles.z); - var angle = m_IconContainer.localEulerAngles.z; - m_TooltipTarget.localEulerAngles = new Vector3(90f, 90f, angle); - var yaw = transform.localRotation.eulerAngles.y; - tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; + //tooltipSource.localRotation = m_IconContainer.localRotation; + //var angle = m_IconContainer.localEulerAngles.z; + //m_TooltipTarget.localEulerAngles = new Vector3(0, 0, angle); + + //var yaw = transform.localRotation.eulerAngles.y; + //tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Center : TextAlignment.Center; } IEnumerator ShowSecondaryButton() diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab index eb3c7deb8..9daf79d9a 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab @@ -626,7 +626,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010797218832} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.24310015} + m_LocalPosition: {x: 0, y: 0, z: 0.0011} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4000012648346800} @@ -733,14 +733,14 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010204453368} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: 0.025} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4000012648346800} m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!4 &4000012609671830 Transform: m_ObjectHideFlags: 1 @@ -823,7 +823,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011695512812} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.18990004} + m_LocalPosition: {x: 0, y: 0, z: -0.1117} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4000012648346800} @@ -2103,7 +2103,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} + m_AnchoredPosition: {x: -0.00040786853, y: 0.0005000003} m_SizeDelta: {x: 268.38452, y: 268.38452} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010919883134 @@ -2310,7 +2310,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.00040786853, y: 0.00050000026} + m_AnchoredPosition: {x: -0.00040786853, y: 0.0005000003} m_SizeDelta: {x: 268.38452, y: 268.38452} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013933582366 diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 879c4a031..53440e1a3 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -43,6 +43,21 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1377745604396660 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4745237044191074} + m_Layer: 5 + m_Name: ButtonTooltipTarget + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4000011260103804 Transform: m_ObjectHideFlags: 1 @@ -66,10 +81,24 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_Children: + - {fileID: 4745237044191074} m_Father: {fileID: 4000011260103804} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4745237044191074 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1377745604396660} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0.15, z: 0.25} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012301197336} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!114 &114000010527895234 MonoBehaviour: m_ObjectHideFlags: 1 @@ -84,8 +113,7 @@ MonoBehaviour: m_ButtonContainer: {fileID: 4000012301197336} m_AlternatePosition: {x: 0, y: 0, z: -0.0136} m_AlternateLocalScale: {x: 0.54, y: 0.54, z: 0.54} - m_SpatialHintUI: {fileID: 114885606894613528, guid: cdc0eb858b1c7ed488024c8ad974bd47, - type: 2} + m_ButtonTooltipTarget: {fileID: 4745237044191074} --- !u!114 &114000011597863712 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 4ea28bdb1..9b524a46c 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -30,6 +30,9 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, I [SerializeField] Vector3 m_AlternateLocalScale; + [SerializeField] + Transform m_ButtonTooltipTarget; + bool m_AllButtonsVisible; List m_OrderedButtons; Coroutine m_ShowHideAllButtonsCoroutine; @@ -240,6 +243,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) button.closeButton = DeleteHighlightedButton; button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount button.iconHighlightedLocalZOffset = k_RaySelectIconHighlightedZOffset; + button.tooltipTarget = m_ButtonTooltipTarget; button.hovered += OnButtonHover; bool allowSecondaryButton = false; // Secondary button is the close button diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 2777b907e..8e289f0e7 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -20,6 +20,7 @@ public interface IPinnedToolButton bool toolTipVisible { set; } bool implementsSecondaryButton { get; set; } Vector3 primaryUIContentContainerLocalScale { get; set; } + Transform tooltipTarget { get; set; } Action destroy { get; } Action selectTool { get; set; } Func visibileButtonCount { get; set; } From 99e77a01a03432eb0648a5fd8f051394e6c22026 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Jul 2017 14:06:33 -0700 Subject: [PATCH 653/870] Remove "cannot be closed" text in PinnedToolButton assigned to main menu pinned tool buttons --- Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index b63f7dd64..4826ca2a9 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -23,7 +23,7 @@ public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, IToolt const string k_MaterialColorProperty = "_Color"; const string k_MaterialAlphaProperty = "_Alpha"; const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; - const string k_MainMenuTipText = "Main Menu (cannot be closed)"; + const string k_MainMenuTipText = "Main Menu"; readonly Vector3 k_ToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); readonly Vector3 k_SemiTransparentIconContainerScale = new Vector3(1.375f, 1.375f, 1f); From 20ebcfa9dd28342595020c026b95495e3f66ac28 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Jul 2017 14:07:01 -0700 Subject: [PATCH 654/870] Reduce height offset of the PinnedToolsMenu tooltip target location --- Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab index 53440e1a3..abc144e82 100644 --- a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab +++ b/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab @@ -93,7 +93,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1377745604396660} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0.15, z: 0.25} + m_LocalPosition: {x: 0, y: 0.14999996, z: 0.1} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4000012301197336} From 1c971fdb81cb16d3c095e52dbf092cd0fc76a73e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Jul 2017 18:45:26 -0700 Subject: [PATCH 655/870] Remove pinnedToolButtons collection reference from deviceData in EditorVR --- Scripts/Core/EditorVR.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index fe8ed20a3..c7d4a55a4 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -80,7 +80,6 @@ class DeviceData public IMenu customMenu; public IPinnedToolsMenu pinnedToolsMenu; public ActionMapInput pinnedToolsMenuInput; - //public Dictionary pinnedToolButtons; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); } From d305ce9d58ef98899abaadd39bf35b7adea0f98b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 21 Jul 2017 20:30:44 -0700 Subject: [PATCH 656/870] Add back in tool icon previews on the main menu button when hovering buttons on the main menu. --- Menus/MainMenu/Scripts/MainMenuButton.cs | 17 +++++++++------- .../PinnedToolButton/PinnedToolButton.cs | 8 ++++---- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 6 +++++- .../Scripts/PinnedToolsMenuUI.cs | 6 +++--- Scripts/Core/EditorVR.PinnedToolButtons.cs | 20 ++++--------------- Scripts/UI/Interfaces/IPinnedToolButton.cs | 2 +- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 2 +- 7 files changed, 28 insertions(+), 33 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 85d8efef0..49de8be55 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IPointerClickHandler + sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExitHandler, IPointerClickHandler { [SerializeField] Button m_Button; @@ -18,7 +18,6 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IPointe [SerializeField] Text m_ButtonTitle; - Transform m_HoveringRayOrigin; Color m_OriginalColor; IPinnedToolButton m_HighlightedPinnedToolbutton; Transform m_RayOrigin; @@ -84,8 +83,12 @@ public void OnRayEnter(RayEventData eventData) // Track which pointer is over us, so this information can supply context (e.g. selecting a tool for a different hand) m_InteractingRayOrigin = eventData.rayOrigin; - // Enable preview-mode on a pinned tool button; Display on the opposite proxy device via the HoveringRayOrigin - m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(m_HoveringRayOrigin, toolType); + if (toolType != null && m_InteractingRayOrigin != null) + { + // Enable preview-mode on a pinned tool button; Display on the opposite proxy device via the HoveringRayOrigin + m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(m_InteractingRayOrigin, toolType); + // TODO convert to a function that is returned, that is called if non-null, instead of a direct reference to the button. + } //m_RayOrigin = eventData.rayOrigin; // TODO: evaluate this need for m_RayOrigin if (hovered != null) @@ -94,12 +97,12 @@ public void OnRayEnter(RayEventData eventData) public void OnRayExit(RayEventData eventData) { - if (m_HoveringRayOrigin == eventData.rayOrigin) - m_HoveringRayOrigin = null; + //if (m_InteractingRayOrigin == eventData.rayOrigin) + //m_InteractingRayOrigin = null; // Disable preview-mode on pinned tool button if (m_HighlightedPinnedToolbutton != null) - m_HighlightedPinnedToolbutton.previewToolType = null; + m_HighlightedPinnedToolbutton.previewToolType = null; //m_RayOrigin = TODO: remove diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 4826ca2a9..e7388418a 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -58,7 +58,7 @@ public Type toolType //gradientPair = UnityBrandColorScheme.GetRandomCuratedLightGradient(); } - activeTool = activeTool; + isActiveTool = isActiveTool; m_GradientButton.visible = true; //m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); @@ -160,7 +160,7 @@ public Type previewToolType } // Show the grayscale highlight when previewing a tool on this button - m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; + m_GradientButton.highlightGradientPair = UnityBrandColorScheme.saturatedSessionGradient; // UnityBrandColorScheme.grayscaleSessionGradient; if (!previewIcon) m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); @@ -171,7 +171,7 @@ public Type previewToolType } else { - activeTool = activeTool; // Set active tool back to pre-preview state + isActiveTool = isActiveTool; // Set active tool back to pre-preview state icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button m_GradientButton.highlightGradientPair = gradientPair; //customToolTipHighlightColor = gradientPair; @@ -335,7 +335,7 @@ public Transform alternateMenuOrigin //public event Action hoverExit; public event Action selected; - public bool activeTool + public bool isActiveTool { get { return m_ActiveTool; } set diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 6f536692f..e39db20ec 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -48,6 +48,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac Transform m_RayOrigin; Transform m_AlternateMenuOrigin; + IPinnedToolButton m_MainMenuButton; public Transform menuOrigin { get; set; } List buttons { get { return m_PinnedToolsMenuUI.buttons; } } @@ -55,7 +56,6 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public int activeToolOrderPosition { get; private set; } public bool revealed { get; set; } public bool moveToAlternatePosition { set { m_PinnedToolsMenuUI.moveToAlternatePosition = value; } } - public Type previewToolType { get; set; } public Vector3 alternateMenuItem { get; private set; } public Action HighlightSingleButton { get; set; } @@ -69,6 +69,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Node? node { get; set; } public Action selectTool { get; set; } + public IPinnedToolButton previewToolButton { get { return m_MainMenuButton; } } public Transform rayOrigin { @@ -193,6 +194,9 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) //button.hoverExit += onButtonHoverExit; button.rayOrigin = rayOrigin; + if (toolType == typeof(IMainMenu)) + m_MainMenuButton = button; + m_PinnedToolsMenuUI.AddButton(button, buttonTransform); } diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 9b524a46c..5028d7ed3 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -263,7 +263,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) m_VisibleButtonCount = aboveMinimumButtonCount ? m_OrderedButtons.Count : 1; button.implementsSecondaryButton = allowSecondaryButton; - button.activeTool = true; + button.isActiveTool = true; button.order = insertPosition; buttonTransform.rotation = Quaternion.identity; @@ -358,7 +358,7 @@ void SetupButtonOrder() for (int i = 0; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i]; - button.activeTool = i == k_ActiveToolOrderPosition; + button.isActiveTool = i == k_ActiveToolOrderPosition; // Allow settings of regular button order if there are more buttons that just the MainMenu & SelectionTool button.order = aboveMinimumButtonCount || IsMainMenuButton(button) ? i : k_InactiveButtonInitialOrderPosition; } @@ -372,7 +372,7 @@ void ShowAllExceptMenuButton() for (int i = 0; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i]; - button.activeTool = i == k_ActiveToolOrderPosition; // Set the button gradients // TODO Consider handling insid button via k_ActiveToolOrder position comparison + button.isActiveTool = i == k_ActiveToolOrderPosition; // Set the button gradients // TODO Consider handling insid button via k_ActiveToolOrder position comparison button.order = i == k_MenuButtonOrderPosition ? k_InactiveButtonInitialOrderPosition : i - 1; // Hide the menu buttons when revealing all tools buttons } } diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 4e466d620..552297dc2 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -181,30 +181,18 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T if (!toolType.GetInterfaces().Contains(typeof(ITool))) return null; - IPinnedToolButton pinnedToolButton = null; + IPinnedToolButton previewPinnedToolButton = null; Rays.ForEachProxyDevice((deviceData) => { if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device { var pinnedToolsMenu = deviceData.pinnedToolsMenu; - pinnedToolsMenu.previewToolType = toolType; - /* - var pinnedToolButtons = deviceData.pinnedToolButtons; - foreach (var pair in pinnedToolButtons) - { - var button = pair.Value; - if (button.order == button.activeToolOrderPosition) - { - pinnedToolButton = button; - pinnedToolButton.previewToolType = toolType; - break; - } - } - */ + previewPinnedToolButton = pinnedToolsMenu.previewToolButton; + previewPinnedToolButton.previewToolType = toolType; } }); - return pinnedToolButton; + return previewPinnedToolButton; } internal void ToolButtonClicked(Transform rayOrigin, Type toolType) diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/UI/Interfaces/IPinnedToolButton.cs index 8e289f0e7..7664d8739 100644 --- a/Scripts/UI/Interfaces/IPinnedToolButton.cs +++ b/Scripts/UI/Interfaces/IPinnedToolButton.cs @@ -16,7 +16,7 @@ public interface IPinnedToolButton float iconHighlightedLocalZOffset { set; } bool highlighted { get; set; } bool secondaryButtonHighlighted { get; } - bool activeTool { get; set; } + bool isActiveTool { get; set; } bool toolTipVisible { set; } bool implementsSecondaryButton { get; set; } Vector3 primaryUIContentContainerLocalScale { get; set; } diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 0cfc818cb..db107b504 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -17,8 +17,8 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod bool revealed { set; } bool moveToAlternatePosition { set; } Transform rayOrigin { get; set; } - Type previewToolType { set; } Vector3 alternateMenuItem { get; } // Shared active button offset from the alternate menu + IPinnedToolButton previewToolButton { get; } event Action hoverEnter; event Action hoverExit; From ef0a92530967cc70f85364bc1a03aaf91538f5b6 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 24 Jul 2017 15:31:01 -0700 Subject: [PATCH 657/870] Cleanup code and refactor HighlightDevice into an extension method --- .../PinnedToolButton/PinnedToolButton.cs | 5 - Menus/PinnedToolMenu/PinnedToolsMenu.cs | 1 - Scripts/Core/EditorVR.PinnedToolButtons.cs | 5 + Scripts/Core/EditorVR.Tools.cs | 8 - Scripts/Proxies/TwoHandedProxyBase.cs | 16 - Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 13 +- Scripts/UI/PinnedToolActionButton.cs | 461 ------------------ Scripts/UI/PinnedToolActionButton.cs.meta | 12 - Tests/Editor/Unit.meta | 9 + libs/VRLineRenderer | 2 +- 10 files changed, 26 insertions(+), 506 deletions(-) delete mode 100644 Scripts/UI/PinnedToolActionButton.cs delete mode 100644 Scripts/UI/PinnedToolActionButton.cs.meta create mode 100644 Tests/Editor/Unit.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index e7388418a..434fcb197 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -656,11 +656,6 @@ string GetTypeAbbreviation(Type type) return abbreviation.ToString(); } - bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) - { - return buttonType == PinnedToolActionButton.ButtonType.SelectTool; - } - void OnBackgroundHoverEnter () { //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index e39db20ec..dc3004ff5 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -63,7 +63,6 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Action deleteHighlightedButton { get; set; } public Action onButtonHoverEnter { get; set; } public Action onButtonHoverExit { get; set; } - public Action highlightDevice { get; set; } public Action createPinnedToolButton { get; set; } public Action mainMenuActivatorSelected { get; set; } public Node? node { get; set; } diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 552297dc2..fbbdec32f 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -14,6 +14,11 @@ partial class EditorVR { class PinnedToolButtons : Nested, IInterfaceConnector { + public PinnedToolButtons() + { + IPinnedToolsMenuMethods.highlightDevice = HighlightDevice; + } + public void ConnectInterface(object obj, Transform rayOrigin = null) { var mainMenu = obj as IMainMenu; diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 4a0339d6a..ab3c16c46 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -124,18 +124,10 @@ internal static void SpawnDefaultTools(IProxy proxy) var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); deviceData.pinnedToolsMenu = pinnedToolsMenu; pinnedToolsMenu.selectTool = pinnedTools.ToolButtonClicked; - //pinnedToolsMenu.onButtonHoverEnter = pinnedTools.OnButtonHoverEnter; - //pinnedToolsMenu.onButtonHoverExit = pinnedTools.OnButtonHoverExit; - pinnedToolsMenu.highlightDevice = pinnedTools.HighlightDevice; pinnedToolsMenu.mainMenuActivatorSelected = pinnedTools.OnMainMenuActivatorSelected; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; - // Setup permanent menu & selection PinnedToolButtons - //deviceData.pinnedToolButtons = new Dictionary(); pinnedToolsMenu.createPinnedToolButton(typeof(IMainMenu), evr.m_UnityIcon, deviceData.node); - //pinnedTools.SetupPinnedToolButtonsForDevice(deviceData, deviceData.rayOrigin, typeof(IMainMenu)); pinnedToolsMenu.createPinnedToolButton(typeof(SelectionTool), selectionToolData.icon, deviceData.node); - // Initialize PinnedToolButtons & set SelectionTool as the active tool type - //pinnedTools.SetupPinnedToolButtonsForDevice(deviceData.rayOrigin, typeof(SelectionTool), deviceData.node); } evr.GetModule().UpdatePlayerHandleMaps(); diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs b/Scripts/Proxies/TwoHandedProxyBase.cs index 0e281ef98..b1499c5bc 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs +++ b/Scripts/Proxies/TwoHandedProxyBase.cs @@ -16,11 +16,9 @@ abstract class TwoHandedProxyBase : MonoBehaviour, IProxy { const int k_RendererQueue = 9000; const float k_TargetHighlightThicknessAmount = 0.02f; - const string k_MaterialAlphaProperty = "_Alpha"; const string k_MaterialColorTopProperty = "_ColorTop"; const string k_MaterialColorBottomProperty = "_ColorBottom"; const string k_MaterialThicknessProperty = "_Thickness"; - const string k_MaterialObjectScaleProperty = "_ObjectScale"; [SerializeField] protected GameObject m_LeftHandProxyPrefab; @@ -272,17 +270,6 @@ public void HighlightDevice (Node deviceNode, GradientPair gradientPair, bool pu IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair, bool pulseOnThenOff = false) { - // IF the highlight is already running, lerp the gradientPair color to the new target colors - // If the highlight is not already running, just set the gradientPair colors, then lerp in alpha - // perform a quick opacity fade in then out of the opacity on the material passed in - - Debug.LogWarning("ShowHighlight called!!!"); - - //deviceMaterial.SetFloat(k_MaterialAlphaProperty, 0); - //deviceMaterial.SetColor(k_MaterialColorTopProperty, m_OriginalInsetGradientPair.a); - //deviceMaterial.SetColor(k_MaterialColorBottomProperty, m_OriginalInsetGradientPair.b); - //m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); - //deviceMaterial.SetFloat(k_MaterialExpandProperty, 0); var currentThickness = deviceMaterial.GetFloat(k_MaterialThicknessProperty); var currentTopColor = deviceMaterial.GetColor(k_MaterialColorTopProperty); var currentBottomColor = deviceMaterial.GetColor(k_MaterialColorBottomProperty); @@ -295,14 +282,12 @@ IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair, bo var durationShaped = Mathf.Pow(duration, 3); var topColor = Color.Lerp(currentTopColor, targetTopColor, durationShaped); var bottomColor = Color.Lerp(currentBottomColor, targetBottomColor, durationShaped); - //deviceMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentAlpha, 1f, durationShaped)); deviceMaterial.SetFloat(k_MaterialThicknessProperty, Mathf.Lerp(currentThickness, k_TargetHighlightThicknessAmount, durationShaped)); deviceMaterial.SetColor(k_MaterialColorTopProperty, topColor); deviceMaterial.SetColor(k_MaterialColorBottomProperty, bottomColor); yield return null; } - //deviceMaterial.SetFloat(k_MaterialAlphaProperty, 1f); deviceMaterial.SetFloat(k_MaterialThicknessProperty, k_TargetHighlightThicknessAmount); deviceMaterial.SetColor(k_MaterialColorTopProperty, targetTopColor); deviceMaterial.SetColor(k_MaterialColorBottomProperty, targetBottomColor); @@ -322,7 +307,6 @@ IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair, bo yield return null; } - //deviceMaterial.SetFloat(k_MaterialAlphaProperty, 0f); deviceMaterial.SetFloat(k_MaterialThicknessProperty, pulseOnThenOff ? 0f : k_TargetHighlightThicknessAmount); m_HighlightCoroutine = null; diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index db107b504..6919743ab 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -32,7 +32,6 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod Action deleteHighlightedButton { set; } Action onButtonHoverEnter { get; set; } Action onButtonHoverExit { get; set; } - Action highlightDevice { get; set; } Action mainMenuActivatorSelected { set; } // CONVERT INTO METHODS @@ -41,7 +40,17 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod public static class IPinnedToolsMenuMethods { - //public static void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) + public static Action highlightDevice { get; set; } + + /// + /// + /// + /// + /// + public static void HighlightDevice(this IPinnedToolsMenu obj, Transform rayOrigin, GradientPair gradientPair) + { + highlightDevice(rayOrigin, gradientPair); + } } } #endif diff --git a/Scripts/UI/PinnedToolActionButton.cs b/Scripts/UI/PinnedToolActionButton.cs deleted file mode 100644 index dce503c16..000000000 --- a/Scripts/UI/PinnedToolActionButton.cs +++ /dev/null @@ -1,461 +0,0 @@ -#if UNITY_EDITOR -using System; -using System.Collections; -using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Utilities; -using UnityEngine; -using UnityEngine.EventSystems; -using UnityEngine.UI; - -namespace UnityEditor.Experimental.EditorVR.UI -{ - sealed class PinnedToolActionButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler - { - public enum ButtonType - { - SelectTool, - Close - } - - static Color s_CloseColor = UnityBrandColorScheme.red; - static Color s_SelectColor = UnityBrandColorScheme.green; - - const string k_MaterialAlphaProperty = "_Alpha"; - - //public event Action onClick; - //public event Action onHoverEnter; - //public event Action onHoverExit; - - public bool pressed - { - get { return m_Pressed; } - set - { - if (!highlighted) - { - value = false; - } - else if (value != m_Pressed && value) // proceed only if value is true after previously being false - { - m_Pressed = value; - - this.StopCoroutine(ref m_IconHighlightCoroutine); - - //m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight(true)); - } - } - } - bool m_Pressed; - - public bool highlighted - { - get { return m_Highlighted; } - set - { - if (m_Highlighted == value) - { - return; - } - else - { - // Stop any existing icon highlight coroutines - this.StopCoroutine(ref m_IconHighlightCoroutine); - - m_Highlighted = value; - - // Stop any existing begin/end highlight coroutine - this.StopCoroutine(ref m_HighlightCoroutine); - - if (!gameObject.activeInHierarchy) - return; - - //m_HighlightCoroutine = m_Highlighted ? StartCoroutine(BeginHighlight()) : StartCoroutine(EndHighlight()); - } - } - } - bool m_Highlighted; - - public bool visible - { - set - { - if (m_Visible == value) - return; - - Debug.LogWarning("Perform graceful showing/hiding of pinned tool action button visual here : start value : " + m_Visible + " - Setting to : " + value); - - m_Visible = value; - - highlighted = value ? highlighted : false; - - if (value && !gameObject.activeSelf) - gameObject.SetActive(value); - - this.RestartCoroutine(ref m_VisibilityCoroutine, value ? AnimateShow() : AnimateHide()); - } - } - bool m_Visible = true; // Initialize as true in order to allow for the first set to hide the visuals. - - public ButtonType buttonType - { - get - { - return m_ButtonType; - } - - set - { - m_ButtonType = value; - buttonColor = buttonType == ButtonType.SelectTool ? s_SelectColor : s_CloseColor; - m_Icon.sprite = buttonType == ButtonType.Close ? m_CloseIconSprite : m_Icon.sprite; - } - } - ButtonType m_ButtonType; - - [SerializeField] - Sprite m_IconSprite; - - // Transform-root of the contents in the icon container (icons, text, etc) - [SerializeField] - Transform m_IconContainer; - - // Transform-root of the contents that will be scaled when button is highlighted - [SerializeField] - Transform m_ContentContainer; - - // The canvas group managing the drawing of elements in the icon container - [SerializeField] - CanvasGroup m_CanvasGroup; - - [SerializeField] - Image m_Icon; - - [SerializeField] - Image m_Background; - - // Alternate icon sprite, shown when the main icon sprite isn't; If set, this button will swap icon sprites OnClick - [SerializeField] - Sprite m_CloseIconSprite; - - [SerializeField] - Color m_NormalContentColor; - - // The color that elements in the HighlighItems collection should inherit during the highlighted state - [SerializeField] - Color m_HighlightItemColor = UnityBrandColorScheme.light; - - // Collection of items that will change appearance during the highlighted state (color/position/etc) - [SerializeField] - Graphic[] m_HighlightItems; - - [Header("Animated Reveal Settings")] - [Tooltip("Default value is 0.25")] - // If AnimatedReveal is enabled, wait this duration before performing the reveal - [SerializeField] - [Range(0f, 2f)] - float m_DelayBeforeReveal = 0.25f; - - Material m_ButtonMaterial; - Vector3 m_OriginalIconLocalPosition; - Vector3 m_IconHighlightedLocalPosition; - Vector3 m_IconPressedLocalPosition; - Sprite m_OriginalIconSprite; - Vector3 m_OriginalLocalScale; - - /// - /// Set a custom button color for the selectTool - /// - public Color buttonColor - { - set { m_Background.color = value; } - } - - // The initial button reveal coroutines, before highlighting occurs - Coroutine m_VisibilityCoroutine; - - // The visibility & highlight coroutines - Coroutine m_HighlightCoroutine; - Coroutine m_IconHighlightCoroutine; - - bool alternateIconVisible - { - set - { - if (m_CloseIconSprite) // Only allow sprite swapping if an alternate sprite exists - m_Icon.sprite = value ? m_CloseIconSprite : m_OriginalIconSprite; // If true, set the icon sprite back to the original sprite - } - get - { - return m_Icon.sprite == m_CloseIconSprite; - } - } - - public bool rotateIcon - { - set - { - m_Icon.transform.localRotation = value ? Quaternion.Euler(0f, 0f, 180f) : Quaternion.identity; - } - } - - public Action clicked { get; set; } - public Action hoverEnter { get; set; } - public Action hoverExit { get; set; } - //public Collider mainButtonCollider { get; set; } - - void Awake() - { - m_OriginalIconSprite = m_Icon.sprite; - //m_ButtonMaterial = MaterialUtils.GetMaterialClone(m_ButtonMeshRenderer); - m_OriginalLocalScale = transform.localScale; - m_OriginalIconLocalPosition = m_IconContainer.localPosition; - - m_Icon.color = m_NormalContentColor; - } - - void OnEnable() - { - //m_ContentContainer.gameObject.SetActive(true); - } - - void OnDisable() - { - //if (gameObject.activeSelf) // TODO remove object shouldnt alredy be disabled - //{ - Debug.LogWarning("Disabling PinnedToolACtionButton"); - this.StopCoroutine(ref m_IconHighlightCoroutine); - this.StopCoroutine(ref m_HighlightCoroutine); - this.StopCoroutine(ref m_VisibilityCoroutine); - //m_ContentContainer.gameObject.SetActive(false); - //} - - //mainButtonCollider.enabled = true; - } - - /// - /// Animate the reveal of this button's visual elements - /// - IEnumerator AnimateShow() - { - //mainButtonCollider.enabled = false; - - const float kTargetTransitionAmount = 1f; - var transitionAmount = Time.unscaledDeltaTime; - var currentCanvasAlpha = m_CanvasGroup.alpha; - while (transitionAmount < kTargetTransitionAmount) - { - transitionAmount += Time.unscaledDeltaTime * 5f; - m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 1f, MathUtilsExt.SmoothInOutLerpFloat(transitionAmount)); - yield return null; - } - - m_CanvasGroup.alpha = 1f; - m_VisibilityCoroutine = null; - } - - /// - /// Animate the hiding of this button's visual elements - /// - IEnumerator AnimateHide() - { - const float kTargetTransitionAmount = 1f; - var transitionAmount = Time.unscaledDeltaTime; - var currentCanvasAlpha = m_CanvasGroup.alpha; - while (transitionAmount < kTargetTransitionAmount) - { - transitionAmount += Time.unscaledDeltaTime * 3f; - m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 0f, MathUtilsExt.SmoothInOutLerpFloat(transitionAmount)); - yield return null; - } - - m_CanvasGroup.alpha = 0f; - m_VisibilityCoroutine = null; - gameObject.SetActive(false); - } - - /// - /// Performs the animated beginning of a button's highlighted state - /// - IEnumerator BeginHighlight() - { - //this.StopCoroutine(ref m_IconHighlightCoroutine); - //m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); - - Debug.LogWarning("BeginHighlight : " + buttonType.ToString()); - const float kTargetTransitionAmount = 1f; - var transitionAmount = Time.unscaledDeltaTime; - var shapedTransitionAmount = 0f; - var currentCanvasAlpha = m_CanvasGroup.alpha; - while (transitionAmount < kTargetTransitionAmount) - { - transitionAmount += Time.unscaledDeltaTime * 4; - shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); - m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 1f, shapedTransitionAmount); - yield return null; - } - - m_HighlightCoroutine = null; - } - - /// - /// Performs the animated ending of a button's highlighted state - /// - IEnumerator EndHighlight() - { - //this.StopCoroutine(ref m_IconHighlightCoroutine); - //m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsEndHighlight()); - - Debug.LogWarning("EndHighlight : " + buttonType.ToString()); - const float kTargetTransitionAmount = 1f; - var transitionAmount = Time.unscaledDeltaTime; - var shapedTransitionAmount = 0f; - var currentCanvasAlpha = m_CanvasGroup.alpha; - while (transitionAmount < kTargetTransitionAmount) - { - transitionAmount += Time.unscaledDeltaTime * 6; - shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); - m_CanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, 0f, shapedTransitionAmount); - yield return null; - } - } -/* - /// - /// Animate the canvas group's alpha to full opacity - /// - IEnumerator ShowContent() - { - m_CanvasGroup.interactable = true; - - const float kTargetAlpha = 1f; - const float kRevealDuration = 0.4f; - const float kInitialDelayLengthenMultipler = 5f; // used to scale up the initial delay based on the m_InitialDelay value - var delay = 0f; - var targetDelay = Mathf.Clamp(m_DelayBeforeReveal * kInitialDelayLengthenMultipler, 0f, 2.5f); // scale the target delay, with a maximum clamp - var alpha = 0f; - var opacitySmoothVelocity = 1f; - var currentDuration = 0f; - var targetDuration = targetDelay + kRevealDuration; - while (currentDuration < targetDuration) - { - currentDuration += Time.unscaledDeltaTime; - m_CanvasGroup.alpha = alpha; - - while (delay < targetDelay) - { - delay += Time.unscaledDeltaTime; - yield return null; - } - - alpha = MathUtilsExt.SmoothDamp(alpha, kTargetAlpha, ref opacitySmoothVelocity, targetDuration, Mathf.Infinity, Time.unscaledDeltaTime); - yield return null; - } - - m_CanvasGroup.alpha = 1; - m_VisibilityCoroutine = null; - } - - m_HighlightCoroutine = null; - } - - /// - /// Performs the animated transition of the icon container's visual elements to their highlighted state - /// - /// If true, perform pressed-state specific visual changes, as opposed to hover-state specific visuals - IEnumerator IconContainerContentsBeginHighlight(bool pressed = false) - { - var currentPosition = m_IconContainer.localPosition; - var targetPosition = pressed == false ? m_IconHighlightedLocalPosition : m_IconPressedLocalPosition; // forward for highlight, backward for press - var transitionAmount = Time.unscaledDeltaTime; - var transitionAddMultiplier = !pressed ? 2 : 5; // Faster transition in for highlight; slower for pressed highlight - while (transitionAmount < 1) - { - transitionAmount += Time.unscaledDeltaTime * transitionAddMultiplier; - - foreach (var graphic in m_HighlightItems) - { - if (graphic) - graphic.color = Color.Lerp(m_NormalContentColor, m_HighlightItemColor, transitionAmount); - } - - //m_IconContainer.localPosition = Vector3.Lerp(currentPosition, targetPosition, transitionAmount); - yield return null; - } - - foreach (var graphic in m_HighlightItems) - { - if (graphic) - graphic.color = m_HighlightItemColor; - } - - //m_IconContainer.localPosition = targetPosition; - m_IconHighlightCoroutine = null; - } - - /// - /// Performs the animated transition of the icon container's visual elements to their non-highlighted state - /// - IEnumerator IconContainerContentsEndHighlight() - { - var currentPosition = m_IconContainer.localPosition; - var transitionAmount = 1f; - const float kTransitionSubtractMultiplier = 5f; - while (transitionAmount > 0) - { - transitionAmount -= Time.unscaledDeltaTime * kTransitionSubtractMultiplier; - - foreach (var graphic in m_HighlightItems) - { - if (graphic != null) - graphic.color = Color.Lerp(m_NormalContentColor, m_HighlightItemColor, transitionAmount); - } - - //m_IconContainer.localPosition = Vector3.Lerp(m_OriginalIconLocalPosition, currentPosition, transitionAmount); - yield return null; - } - - foreach (var graphic in m_HighlightItems) - { - if (graphic != null) - graphic.color = m_NormalContentColor; - } - - //m_IconContainer.localPosition = m_OriginalIconLocalPosition; - m_IconHighlightCoroutine = null; - } -*/ - /// - /// Enable button highlighting on ray enter if autoHighlight is true - /// - public void OnPointerEnter(PointerEventData eventData) - { - //Debug.LogError("OnPointerEnter"); - highlighted = true; - eventData.Use(); - hoverEnter(); - } - - /// - /// Disable button highlighting on ray exit if autoHighlight is true - /// - public void OnPointerExit(PointerEventData eventData) - { - //Debug.LogError("OnPointerExit"); - highlighted = false; - eventData.Use(); - hoverExit(); - } - - /// - /// Raise the OnClick event when this button is clicked - /// - public void OnPointerClick(PointerEventData eventData) - { - if (m_VisibilityCoroutine != null) - return; - - highlighted = false; - clicked(this); - } - } -} -#endif diff --git a/Scripts/UI/PinnedToolActionButton.cs.meta b/Scripts/UI/PinnedToolActionButton.cs.meta deleted file mode 100644 index f693dc5dd..000000000 --- a/Scripts/UI/PinnedToolActionButton.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 57d51bc05acd35a4fbe890fe1217cbd7 -timeCreated: 1490326191 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tests/Editor/Unit.meta b/Tests/Editor/Unit.meta new file mode 100644 index 000000000..42d118e53 --- /dev/null +++ b/Tests/Editor/Unit.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9bdb5ea018a1bc84eb34701cbffb0984 +folderAsset: yes +timeCreated: 1500927097 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/libs/VRLineRenderer b/libs/VRLineRenderer index 6ed5f3638..19473f5bc 160000 --- a/libs/VRLineRenderer +++ b/libs/VRLineRenderer @@ -1 +1 @@ -Subproject commit 6ed5f3638aca8d0ab1a7270b9772f0f7b2a83bb6 +Subproject commit 19473f5bc5fbe8211a08bf969d7c2fcfebdf5f74 From 0e569b53726c77152aa7585655a00623f2ebb176 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 24 Jul 2017 16:49:45 -0700 Subject: [PATCH 658/870] Perform first pass group session cleanups on various classes. --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 15 ---- Menus/PinnedToolMenu/Scripts/HintLine.cs | 85 ------------------ .../SpatialHintModule/SpatialHintModule.cs | 89 ++----------------- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 20 ----- 4 files changed, 9 insertions(+), 200 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index e39db20ec..4ccf1d628 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -215,15 +215,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon const float kAutoHideDuration = 10f; const float kAllowToggleDuration = 0.25f; var pinnedToolInput = (PinnedToolslMenuInput) input; - /* - if (continuedInputConsumptionStartTime != null) - { - // Continue consumption of the "show" input for period of time after releasing the button - consumeControl(pinnedToolInput.show); - if (Time.realtimeSinceStartup > continuedInputConsumptionStartTime.Value) - continuedInputConsumptionStartTime = null; - } - */ if (pinnedToolInput.show.wasJustPressed) Debug.LogError("SHOW pressed in PinnedToolButton"); @@ -342,14 +333,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // TODO refact into ISpatialScrolling interface; allow axis locking/selection/isolation float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) { - //Debug.LogError("Start position : " + startingPosition + " - Current Position : " + currentPosition); var normalizedLoopingPosition = 0f; var directionVector = currentPosition - startingPosition; const float kMaxFineTuneVelocity = 0.0005f; - //const float kMinFineTuneVelocity = 0.000001f; if (spatialDirection == null) { - Debug.LogWarning("spatial Direction is NULL - setting new one in processSpatialScrolling"); var newDirectionVectorThreshold = 0.0175f * this.GetViewerScale(); // Initial magnitude beyond which spatial scrolling will be evaluated var dragMagnitude = Vector3.Magnitude(directionVector); var dragPercentage = dragMagnitude / newDirectionVectorThreshold; @@ -359,7 +347,6 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, if (dragMagnitude > newDirectionVectorThreshold) { spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton - Debug.LogError("" + spatialDirection.Value.ToString("F4") + ""); m_PinnedToolsMenuUI.startingDragOrigin = spatialDirection; } } @@ -367,8 +354,6 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, { var rawVelocity = (previousWorldPosition - transform.position).sqrMagnitude; var velocity = rawVelocity * Time.unscaledDeltaTime; - //Debug.LogError("" + velocity + " : Raw Velocity : " + rawVelocity + " : unscaled time : " + Time.unscaledDeltaTime); - if (velocity < kMaxFineTuneVelocity) // && velocity > kMinFineTuneVelocity) { // OFfset the vector increasingly as velocity slows, in order to lessen the perceived scrolling magnitude diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/PinnedToolMenu/Scripts/HintLine.cs index 66d41a088..156da862f 100644 --- a/Menus/PinnedToolMenu/Scripts/HintLine.cs +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs @@ -12,9 +12,6 @@ public class HintLine : MonoBehaviour [SerializeField] bool m_HideOnInitialize = true; - //[SerializeField] - //Image m_Icon; - [SerializeField] VRLineRenderer m_ScrollLineRenderer; @@ -45,39 +42,8 @@ public class HintLine : MonoBehaviour public float LineWidth { set { m_ScrollLineRenderer.SetWidth(value, value); } } public Vector3[] Positions { set { m_ScrollLineRenderer.SetPositions(value) ; } } - /* - public bool visible - { - set - { - if (value) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); - else - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); - } - } - - public Color visibleColor - { - set - { - m_VisibleColor = value; - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); - } - } - */ - void Awake() { - /* - m_IconTransform = m_Icon.transform; - m_VisibleLocalScale = m_IconTransform.localScale * 1.25F; - m_Icon.color = m_VisibleColor; - - if (m_HideOnInitialize) - visible = false; - */ - m_ScrollLineRenderer.SetVertexCount(4); m_ScrollLineRenderer.useWorldSpace = true; m_ScrollLineRenderer.SetWidth(0f, 0f); @@ -89,56 +55,6 @@ void OnDestroy() ObjectUtils.Destroy(m_HintLineMaterial); } - /* - IEnumerator AnimateShow() - { - var currentDuration = 0f; - var targetDuration = 0f; - var currentLocalScale = m_IconTransform.localScale; - if (currentLocalScale == k_HiddenScale) - { - // Only perform delay if fully hidden; otherwise resume showing - targetDuration = Random.Range(0.25f, 0.35f); // Set an initial random wait duration - while (currentDuration < targetDuration) - { - currentDuration += Time.unscaledDeltaTime; - yield return null; - } - } - - currentDuration = 0f; - targetDuration = 0.125f; // Set animated reveal duration - var currentColor = m_Icon.color; - while (currentDuration < targetDuration) - { - var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / targetDuration); - m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, m_VisibleLocalScale, shapedDuration); - m_Icon.color = Color.Lerp(currentColor, m_VisibleColor, shapedDuration); - currentDuration += Time.unscaledDeltaTime; - yield return null; - } - - m_IconTransform.localScale = m_VisibleLocalScale; - } - - IEnumerator AnimateHide() - { - var currentDuration = 0f; - var targetDuration = Random.Range(0.125f, 0.25f); // Set an initial random wait duration - var currentLocalScale = m_IconTransform.localScale; - var currentColor = m_Icon.color; - while (currentDuration < targetDuration) - { - m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, k_HiddenScale, currentDuration / targetDuration); - m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); - currentDuration += Time.unscaledDeltaTime; - yield return null; - } - - m_IconTransform.localScale = k_HiddenScale; - } - */ - public void PulseColor() { if (Mathf.Approximately(m_PulseDuration, 0f) || m_PulseDuration > 0.85f) @@ -147,7 +63,6 @@ public void PulseColor() IEnumerator AnimatePulseColor() { - //Debug.LogError("Pulsing color of hint arrow : " + gameObject.name); const float kTargetDuration = 1f; m_PulseDuration = 0f; var maxShaderLineRadius = new Vector3 (0.03f, 0f, 100f); diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index 39106a762..54266091c 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -27,29 +27,21 @@ public SpatialHintStateFlags state get { return m_State; } set { - //if (m_State == value) - //return; - m_State = value; switch (m_State) { case SpatialHintStateFlags.Hidden: Debug.LogError("SpatialHintState : Hidden"); - //m_SpatialHintModuleUI.preScrollVisualsVisible = false; m_SpatialHintModuleUI.preScrollArrowsVisible = false; m_SpatialHintModuleUI.secondaryArrowsVisible = false; controllingRayOrigin = null; - //spatialHintPrimaryArrowsVisible = false; - //spatialHintSecondaryArrowsVisible = false; break; case SpatialHintStateFlags.PreDragReveal: Debug.LogError("SpatialHintState : Pre drag reveal state"); - //m_SpatialHintModuleUI.preScrollVisualsVisible = true; m_SpatialHintModuleUI.preScrollArrowsVisible = true; m_SpatialHintModuleUI.secondaryArrowsVisible = true; break; case SpatialHintStateFlags.Scrolling: - //m_SpatialHintModuleUI.preScrollVisualsVisible = false; m_SpatialHintModuleUI.preScrollArrowsVisible = false; m_SpatialHintModuleUI.scrollVisualsVisible = true; Debug.LogError("SpatialHintState : Scrolling"); @@ -79,74 +71,17 @@ private Transform controllingRayOrigin { state = SpatialHintModule.SpatialHintStateFlags.PreDragReveal; m_SpatialHintModuleUI.controllingNode = this.RequestNodeFromRayOrigin(m_ControllingRayOrigin); - //spatialHintScrollVisualsRotation = Vector3.zero; } } } - /* - /// - /// Description - /// - public bool spatialHintVisualsVisible - { - get { return m_SpatialHintModuleUI.visible; } - set { m_SpatialHintModuleUI.visible = value; } - } - - /// - /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action - /// This is only enabled before the enabling of the main select visuals - /// - bool spatialHintPreScrollVisualsVisible - { - get { return m_SpatialHintModuleUI.preScrollVisualsVisible; } - set { m_SpatialHintModuleUI.preScrollVisualsVisible = value; } - } - - /// - /// Description - /// - bool spatialHintPrimaryArrowsVisible - { - get { return m_SpatialHintModuleUI.primaryArrowsVisible; } - set { m_SpatialHintModuleUI.primaryArrowsVisible = value; } - } - - /// - /// Description - /// - bool spatialHintSecondaryArrowsVisible - { - get { return m_SpatialHintModuleUI.secondaryArrowsVisible; } - set { m_SpatialHintModuleUI.secondaryArrowsVisible = value; } - } - - /// - /// Description - /// - public Vector3 spatialHintScrollVisualsDragThresholdTriggerPosition - { - get { return m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition; } - set { m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = value; } - } - */ - /// /// Description /// Vector3 spatialHintScrollVisualsRotation { get { return m_SpatialHintModuleUI.scrollVisualsRotation; } - - set - { - //Debug.LogError("Spatial Rotation target being set to : " + value); - //if (value == Vector3.zero) - //state = SpatialHintStateFlags.Hidden; // Hide the non-spatial-scrolling visuals - - m_SpatialHintModuleUI.scrollVisualsRotation = value; - } + set { m_SpatialHintModuleUI.scrollVisualsRotation = value; } } /// @@ -156,7 +91,6 @@ Vector3 spatialHintScrollVisualsRotation void Awake() { - Debug.LogError("PinnedToolsMenuUI initialized"); m_SpatialHintModuleUI = this.InstantiateUI(m_SpatialHintModuleUI.gameObject).GetComponent(); this.ConnectInterfaces(m_SpatialHintModuleUI); } @@ -164,44 +98,39 @@ void Awake() /// /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatiatil scroll /// - public void PulseScrollArrows() + internal void PulseScrollArrows() { m_SpatialHintModuleUI.PulseScrollArrows(); } - public void SetState(SpatialHintStateFlags newState) + internal void SetState(SpatialHintStateFlags newState) { state = newState; } - public void SetPosition(Vector3 newPosition) + internal void SetPosition(Vector3 newPosition) { spatialHintContentContainer.position = newPosition; } - public void SetRotation(Quaternion newRotation) + internal void SetRotation(Quaternion newRotation) { m_SpatialHintModuleUI.transform.rotation = newRotation; } - public void SetRotationTarget(Vector3 target) + internal void SetRotationTarget(Vector3 target) { spatialHintScrollVisualsRotation = target; } - public void LookAt(Vector3 position) + internal void LookAt(Vector3 position) { var orig = spatialHintContentContainer.rotation; spatialHintContentContainer.LookAt(position); - //this.SetSpatialHintLookAT(value.Value); - //spatialHintContentContainer.LookAt(value.Value); - //Debug.LogError(value.Value.ToString("F4")); - //m_SpatialScrollOrientation = Quaternion.Euler(value.Value); // Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); - //m_SpatialHintModuleUI.rotation (orig); spatialHintContentContainer.rotation = orig; } - public void SetDragThresholdTriggerPosition (Vector3 position) + internal void SetDragThresholdTriggerPosition (Vector3 position) { if (state == SpatialHintStateFlags.Hidden || position == m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition) return; @@ -209,7 +138,7 @@ public void SetDragThresholdTriggerPosition (Vector3 position) m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = position; } - public void SetSpatialHintControlObject(Transform controlObject) + internal void SetSpatialHintControlObject(Transform controlObject) { controllingRayOrigin = controlObject; } diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index db107b504..fb3e52e5c 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -1,6 +1,5 @@ #if UNITY_EDITOR using System; -using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEngine; @@ -11,31 +10,12 @@ namespace UnityEditor.Experimental.EditorVR /// public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode { - Dictionary icons { set; } - int activeToolOrderPosition { get; } - //int activeButtonCount { set; } - bool revealed { set; } bool moveToAlternatePosition { set; } Transform rayOrigin { get; set; } - Vector3 alternateMenuItem { get; } // Shared active button offset from the alternate menu IPinnedToolButton previewToolButton { get; } - - event Action hoverEnter; - event Action hoverExit; - event Action selected; - Action selectTool { set; } - //Action deletePinnedToolButton { set; } - //Action revealAllToolButtons { set; } - Action HighlightSingleButton { set; } - Action SelectHighlightedButton { set; } - Action deleteHighlightedButton { set; } - Action onButtonHoverEnter { get; set; } - Action onButtonHoverExit { get; set; } Action highlightDevice { get; set; } Action mainMenuActivatorSelected { set; } - - // CONVERT INTO METHODS Action createPinnedToolButton { get; set; } } From d95d16450ab3ea0dd22812017a222a70bf5de034 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 24 Jul 2017 17:18:55 -0700 Subject: [PATCH 659/870] Move IPinnedToolButton to Core/Interfaces --- Scripts/{UI => Core}/Interfaces/IPinnedToolButton.cs | 0 Scripts/{UI => Core}/Interfaces/IPinnedToolButton.cs.meta | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Scripts/{UI => Core}/Interfaces/IPinnedToolButton.cs (100%) rename Scripts/{UI => Core}/Interfaces/IPinnedToolButton.cs.meta (100%) diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs b/Scripts/Core/Interfaces/IPinnedToolButton.cs similarity index 100% rename from Scripts/UI/Interfaces/IPinnedToolButton.cs rename to Scripts/Core/Interfaces/IPinnedToolButton.cs diff --git a/Scripts/UI/Interfaces/IPinnedToolButton.cs.meta b/Scripts/Core/Interfaces/IPinnedToolButton.cs.meta similarity index 100% rename from Scripts/UI/Interfaces/IPinnedToolButton.cs.meta rename to Scripts/Core/Interfaces/IPinnedToolButton.cs.meta From a6c05698776e9382587f3c466cbf92ac8f5b88cd Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 24 Jul 2017 17:26:41 -0700 Subject: [PATCH 660/870] Remove reference to the Unity Icon sprite in EditorVR, move it into PinnedToolsMenu; set it as default when no other sprite is assigned for a PinnedToolButton (main menu) --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 5 +- Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta | 3 +- .../PinnedToolMenu}/Textures/UnityIcon.png | 0 .../Textures/UnityIcon.png.meta | 46 +++++++++++++++---- Scripts/Core/EditorVR.Tools.cs | 5 +- 5 files changed, 43 insertions(+), 16 deletions(-) rename {Prefabs/UI => Menus/PinnedToolMenu}/Textures/UnityIcon.png (100%) rename {Prefabs/UI => Menus/PinnedToolMenu}/Textures/UnityIcon.png.meta (54%) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 7aa08e6d6..0e2433a3d 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -17,6 +17,9 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation const int k_MaxButtonCount = 16; // + [SerializeField] + Sprite m_UnityIcon; + [SerializeField] ActionMap m_MainMenuActionMap; @@ -185,7 +188,7 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) //button.node = deviceData.node; button.rayOrigin = rayOrigin; button.toolType = toolType; // Assign Tool Type before assigning order - button.icon = buttonIcon; + button.icon = buttonIcon ? buttonIcon : m_UnityIcon; button.highlightSingleButton = HighlightSingleButton; button.selectHighlightedButton = SelectHighlightedButton; //button.selected += OnMainMenuActivatorSelected; diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta index 4bb8da399..406b32463 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta @@ -1,10 +1,11 @@ fileFormatVersion: 2 guid: 800ff7c94496eac41ab0b6df27863704 -timeCreated: 1499972770 +timeCreated: 1500942141 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: + - m_UnityIcon: {fileID: 21300000, guid: 05f6f0555fbf99a429004b50ccd6ffa9, type: 3} - m_MainMenuActionMap: {fileID: 11400000, guid: 744d823602c92f94ebd746822bed646d, type: 2} - m_PinnedToolsMenuPrefab: {fileID: 114000010527895234, guid: 9df94b11e4f4ed848aa8c4055b378c6a, diff --git a/Prefabs/UI/Textures/UnityIcon.png b/Menus/PinnedToolMenu/Textures/UnityIcon.png similarity index 100% rename from Prefabs/UI/Textures/UnityIcon.png rename to Menus/PinnedToolMenu/Textures/UnityIcon.png diff --git a/Prefabs/UI/Textures/UnityIcon.png.meta b/Menus/PinnedToolMenu/Textures/UnityIcon.png.meta similarity index 54% rename from Prefabs/UI/Textures/UnityIcon.png.meta rename to Menus/PinnedToolMenu/Textures/UnityIcon.png.meta index 497a256fe..07c765404 100644 --- a/Prefabs/UI/Textures/UnityIcon.png.meta +++ b/Menus/PinnedToolMenu/Textures/UnityIcon.png.meta @@ -1,15 +1,15 @@ fileFormatVersion: 2 guid: 05f6f0555fbf99a429004b50ccd6ffa9 -timeCreated: 1491864084 +timeCreated: 1500941980 licenseType: Pro TextureImporter: fileIDToRecycleName: {} - serializedVersion: 2 + serializedVersion: 4 mipmaps: mipMapMode: 0 enableMipMap: 1 + sRGBTexture: 1 linearTexture: 0 - correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 @@ -21,21 +21,18 @@ TextureImporter: normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 - cubemapConvolutionSteps: 7 - cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 2048 textureSettings: filterMode: 2 - aniso: 3 + aniso: 16 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 - rGBM: 0 compressionQuality: 50 spriteMode: 1 spriteExtrude: 1 @@ -44,10 +41,39 @@ TextureImporter: spritePivot: {x: 0.5, y: 0.5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 + alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 5 - buildTargetSettings: [] + textureType: 8 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index ab3c16c46..b79a00db6 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -13,9 +13,6 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - [SerializeField] - Sprite m_UnityIcon; - class Tools : Nested, IInterfaceConnector { internal class ToolData @@ -126,7 +123,7 @@ internal static void SpawnDefaultTools(IProxy proxy) pinnedToolsMenu.selectTool = pinnedTools.ToolButtonClicked; pinnedToolsMenu.mainMenuActivatorSelected = pinnedTools.OnMainMenuActivatorSelected; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; - pinnedToolsMenu.createPinnedToolButton(typeof(IMainMenu), evr.m_UnityIcon, deviceData.node); + pinnedToolsMenu.createPinnedToolButton(typeof(IMainMenu), null, deviceData.node); pinnedToolsMenu.createPinnedToolButton(typeof(SelectionTool), selectionToolData.icon, deviceData.node); } From 04521b7ce0f6c7d56d0a1d504128e79beed27dfa Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 24 Jul 2017 17:34:08 -0700 Subject: [PATCH 661/870] Refactor naming of alternate menu visibility property throughout PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 +- Scripts/Core/EditorVR.Menus.cs | 2 +- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 0e2433a3d..090ec0252 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -58,7 +58,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Dictionary icons { get; set; } public int activeToolOrderPosition { get; private set; } public bool revealed { get; set; } - public bool moveToAlternatePosition { set { m_PinnedToolsMenuUI.moveToAlternatePosition = value; } } + public bool alternateMenuVisible { set { m_PinnedToolsMenuUI.moveToAlternatePosition = value; } } public Vector3 alternateMenuItem { get; private set; } public Action HighlightSingleButton { get; set; } diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index c29871183..54bcd4eba 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -182,7 +182,7 @@ static void UpdateAlternateMenuForDevice(DeviceData deviceData) // Move the pinned tool buttons to an alternate position if the alternate menu will be shown var pinnedToolsMenu = deviceData.pinnedToolsMenu; - pinnedToolsMenu.moveToAlternatePosition = alternateMenu.visible; + pinnedToolsMenu.alternateMenuVisible = alternateMenu.visible; } internal void UpdateMenuVisibilities() diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index b75f4a554..9d153aa3b 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR /// public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode { - bool moveToAlternatePosition { set; } + bool alternateMenuVisible { set; } Transform rayOrigin { get; set; } IPinnedToolButton previewToolButton { get; } Action selectTool { set; } From c659e972d8e65e4ec519c3b864034e66b6d488bf Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 24 Jul 2017 18:03:57 -0700 Subject: [PATCH 662/870] Clean up --- Menus/MainMenu/Scripts/MainMenuUI.cs | 16 +++++----------- Scripts/Core/EditorVR.DirectSelection.cs | 1 + .../IGetDefaultRayColor.cs | 2 +- .../IGetRayVisibility.cs | 4 ++-- .../FunctionalityInjection/IIsInMiniWorld.cs | 4 ++-- .../IIsMainMenuVisible.cs | 2 +- .../IRayVisibilitySettings.cs | 13 ++++++++----- .../ISetDefaultRayColor.cs | 2 +- Scripts/Modules/KeyboardModule.cs | 1 - Scripts/Proxies/DefaultProxyRay.cs | 14 +------------- Scripts/Utilities/MaterialUtils.cs | 18 +++++++++--------- Tests/Editor/Unit.meta | 9 +++++++++ .../CreatePrimitiveTool/CreatePrimitiveMenu.cs | 2 +- .../CreatePrimitiveTool/CreatePrimitiveTool.cs | 11 ++++------- Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs | 3 +-- Tools/SelectionTool/SelectionTool.cs | 13 ++++++------- Tools/TransformTool/TransformTool.cs | 7 +++---- Workspaces/Base/WorkspaceUI.cs | 1 - .../MiniWorldWorkspace/MiniWorldWorkspace.cs | 8 ++++---- .../MiniWorldWorkspace/Scripts/MiniWorld.cs | 1 - .../ProjectWorkspace/ProjectWorkspace.cs | 10 ++++++---- .../ProjectWorkspace/Scripts/AssetGridItem.cs | 8 +------- 22 files changed, 66 insertions(+), 84 deletions(-) create mode 100644 Tests/Editor/Unit.meta diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 5bfca3cb9..fadfe02e4 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -104,10 +104,6 @@ public int targetFaceIndex Vector3 m_MenuFaceContentOriginalLocalScale; Vector3 m_MenuFaceContentHiddenLocalScale; - Bounds m_LocalBounds; - - bool m_Hovering; - readonly Dictionary> m_FaceSubmenus = new Dictionary>(); public Transform menuOrigin @@ -183,10 +179,8 @@ int currentFaceIndex } float currentRotation { get { return m_MenuFaceRotationOrigin.localRotation.eulerAngles.y; } } - - public Bounds localBounds { get { return m_LocalBounds; } } - - public bool hovering { get { return m_Hovering; } } + public Bounds localBounds { get; private set; } + public bool hovering { get; private set; } public event Action buttonHovered; public event Action buttonClicked; @@ -195,7 +189,7 @@ void Awake() { m_MenuFacesMaterial = MaterialUtils.GetMaterialClone(m_MenuFaceRotationOrigin.GetComponent()); m_MenuFacesColor = m_MenuFacesMaterial.color; - m_LocalBounds = ObjectUtils.GetBounds(transform); + localBounds = ObjectUtils.GetBounds(transform); } public void Setup() @@ -630,12 +624,12 @@ void OnButtonClick(Transform rayOrigin) public void OnRayEnter(RayEventData eventData) { - m_Hovering = true; + hovering = true; } public void OnRayExit(RayEventData eventData) { - m_Hovering = false; + hovering = false; } } } diff --git a/Scripts/Core/EditorVR.DirectSelection.cs b/Scripts/Core/EditorVR.DirectSelection.cs index 8ebbfca8f..db87dc6df 100644 --- a/Scripts/Core/EditorVR.DirectSelection.cs +++ b/Scripts/Core/EditorVR.DirectSelection.cs @@ -137,6 +137,7 @@ GameObject GetDirectSelectionForRayOrigin(Transform rayOrigin) var renderer = m_IntersectionModule.GetIntersectedObjectForTester(tester); if (renderer) return renderer.gameObject; + return null; } diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs b/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs index 39cd7d4b2..2d131199a 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IGetDefaultRayColor.cs @@ -17,7 +17,7 @@ public static class IGetDefaultRayColorMethods /// /// Get the color of the default ray - /// The ray to set the color on + /// The ray on which to set the color /// public static Color GetDefaultRayColor(this IGetDefaultRayColor obj, Transform rayOrigin) { diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs b/Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs index c108db402..78dc966cb 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IGetRayVisibility.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Provides access to checks that can test whether parts of the default ray is visible + /// Provides access to checks that can test whether parts of the default ray are visible /// public interface IGetRayVisibility { @@ -35,4 +35,4 @@ public static bool IsConeVisible(this IGetRayVisibility obj, Transform rayOrigin } } } -#endif \ No newline at end of file +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs b/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs index 58bcbd990..a15ae7f1a 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IIsInMiniWorld.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Provides access to checks that can test whether a ray is active + /// Provides access to checks that can test whether a rayOrigin is contained in a miniworld /// public interface IIsInMiniWorld { @@ -25,4 +25,4 @@ public static bool IsInMiniWorld(this IIsInMiniWorld obj, Transform rayOrigin) } } } -#endif \ No newline at end of file +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs b/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs index 8f130ee15..5de34601a 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IIsMainMenuVisible.cs @@ -16,7 +16,7 @@ public static class IIsMainMenuVisibleMethods internal static Func isMainMenuVisible { get; set; } /// - /// Returns whether the main menu is visible on the specified ray origin + /// Returns whether the main menu is visible on the specified rayOrigin /// /// The rayOrigin that is being checked public static bool IsMainMenuVisible(this IIsMainMenuVisible obj, Transform rayOrigin) diff --git a/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs index 79f851392..2b334e274 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Implementors can show & hide the default ray + /// Implementors can request changes to visibility on parts of the default ray /// public interface IRayVisibilitySettings { @@ -13,7 +13,8 @@ public interface IRayVisibilitySettings public static class IRayVisibilitySettingsMethods { - public delegate void AddRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); + public delegate void AddRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, + bool coneVisible, int priority = 0); internal static Action removeRayVisibilitySettings { get; set; } public static AddRayVisibilitySettingsDelegate addRayVisibilitySettings; @@ -26,7 +27,8 @@ public static class IRayVisibilitySettingsMethods /// Show or hide the ray /// Show or hide the cone /// The priority level of this request - public static void AddRayVisibilitySettings(this IRayVisibilitySettings customRay, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) + public static void AddRayVisibilitySettings(this IRayVisibilitySettings obj, Transform rayOrigin, + object caller, bool rayVisible, bool coneVisible, int priority = 0) { addRayVisibilitySettings(rayOrigin, caller, rayVisible, coneVisible, priority); } @@ -34,9 +36,10 @@ public static void AddRayVisibilitySettings(this IRayVisibilitySettings customRa /// /// Remove visibility settings /// - /// The ray to remove settings from + /// The ray from which to remove settings /// The object whose settings to remove - public static void RemoveRayVisibilitySettings(this IRayVisibilitySettings customRay, Transform rayOrigin, object caller) + public static void RemoveRayVisibilitySettings(this IRayVisibilitySettings obj, Transform rayOrigin, + object caller) { removeRayVisibilitySettings(rayOrigin, caller); } diff --git a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs index f6a5cb61a..2e3f914fe 100644 --- a/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs +++ b/Scripts/Interfaces/FunctionalityInjection/ISetDefaultRayColor.cs @@ -18,7 +18,7 @@ public static class ISetDefaultRayColorMethods /// /// Set the color of the default ray /// - /// The ray to get the color of + /// The ray on which to set the color /// The color to set on the default ray public static void SetDefaultRayColor(this ISetDefaultRayColor obj, Transform rayOrigin, Color color) { diff --git a/Scripts/Modules/KeyboardModule.cs b/Scripts/Modules/KeyboardModule.cs index 96afad8f4..84c50a822 100644 --- a/Scripts/Modules/KeyboardModule.cs +++ b/Scripts/Modules/KeyboardModule.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Helpers; -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 1fdd5f1af..1761b10c1 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -37,11 +37,6 @@ struct DefaultRayVisibilitySettings Material m_RayMaterial; float m_LastPointerLength; - /// - /// The object that is set when LockRay is called while the ray is unlocked. - /// As long as this reference is set, and the ray is locked, only that object can unlock the ray. - /// If the object reference becomes null, the ray will be free to show/hide/lock/unlock until another locking entity takes ownership. - /// readonly Dictionary m_VisibilitySettings = new Dictionary(); /// @@ -134,16 +129,11 @@ void UpdateVisibility() var settings = kvp.Value; if (settings.priority == maxPriority) { - //Debug.Log(kvp.Key + ", " + settings.rayVisible + ", " + settings.coneVisible + ", " + settings.priority + ", " + Time.frameCount); rayVisible &= settings.rayVisible; coneVisible &= settings.coneVisible; } } } - else - { - //Debug.Log("no settings"); - } if (this.rayVisible != rayVisible) { @@ -186,7 +176,7 @@ IEnumerator ShowRay() { m_Tip.transform.localScale = m_TipStartScale; - float viewerScale = this.GetViewerScale(); + var viewerScale = this.GetViewerScale(); float scaledWidth; var currentWidth = m_LineRenderer.widthStart / viewerScale; var smoothVelocity = 0f; @@ -210,7 +200,6 @@ IEnumerator ShowRay() IEnumerator HideCone() { - //m_Tester.active = false; var currentScale = m_ConeTransform.localScale; var smoothVelocity = Vector3.one; const float kSmoothTime = 0.1875f; @@ -229,7 +218,6 @@ IEnumerator HideCone() IEnumerator ShowCone() { - //m_Tester.active = true; var currentScale = m_ConeTransform.localScale; var smoothVelocity = Vector3.zero; const float kSmoothTime = 0.3125f; diff --git a/Scripts/Utilities/MaterialUtils.cs b/Scripts/Utilities/MaterialUtils.cs index dd469cc21..24368da95 100644 --- a/Scripts/Utilities/MaterialUtils.cs +++ b/Scripts/Utilities/MaterialUtils.cs @@ -52,7 +52,7 @@ public static UnityMaterial[] CloneMaterials(Renderer renderer) } // from http://wiki.unity3d.com/index.php?title=HexConverter - // Note that Color32 and Color implictly convert to each other. You may pass a Color object to this method without first casting it. + // Note that Color32 and Color implicitly convert to each other. You may pass a Color object to this method without first casting it. public static string ColorToHex(Color32 color) { var hex = color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2"); @@ -62,10 +62,10 @@ public static string ColorToHex(Color32 color) public static Color HexToColor(string hex) { hex = hex.Replace("0x", "").Replace("#", ""); - var r = byte.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber); - var g = byte.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber); - var b = byte.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber); - var a = hex.Length == 8 ? byte.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber) : (byte)255; + var r = byte.Parse(hex.Substring(0, 2), NumberStyles.HexNumber); + var g = byte.Parse(hex.Substring(2, 2), NumberStyles.HexNumber); + var b = byte.Parse(hex.Substring(4, 2), NumberStyles.HexNumber); + var a = hex.Length == 8 ? byte.Parse(hex.Substring(4, 2), NumberStyles.HexNumber) : (byte)255; return new Color32(r, g, b, a); } @@ -84,10 +84,10 @@ public static Color PrefToColor(string pref) split[3] = split[3].Replace(',', '.'); split[4] = split[4].Replace(',', '.'); float r, g, b, a; - bool success = float.TryParse(split[1], NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat, out r); - success &= float.TryParse(split[2], NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat, out g); - success &= float.TryParse(split[3], NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat, out b); - success &= float.TryParse(split[4], NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture.NumberFormat, out a); + var success = float.TryParse(split[1], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out r); + success &= float.TryParse(split[2], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out g); + success &= float.TryParse(split[3], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out b); + success &= float.TryParse(split[4], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out a); if (success) return new Color(r, g, b, a); diff --git a/Tests/Editor/Unit.meta b/Tests/Editor/Unit.meta new file mode 100644 index 000000000..a80222d04 --- /dev/null +++ b/Tests/Editor/Unit.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9bdb5ea018a1bc84eb34701cbffb0984 +folderAsset: yes +timeCreated: 1500937019 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs index 90c090e4d..75c41e48e 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs @@ -41,7 +41,7 @@ public void SelectFreeformCuboid() { selectPrimitive(PrimitiveType.Cube, true); - foreach (GameObject go in m_HighlightObjects) + foreach (var go in m_HighlightObjects) go.SetActive(false); } diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index c28db7fe9..f38b6e8a8 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -33,7 +33,7 @@ enum PrimitiveCreationStates { StartPoint, EndPoint, - Freeform, + Freeform } void Start() @@ -113,7 +113,7 @@ void SetScalingForObjectType() { var corner = (m_EndPoint - m_StartPoint).magnitude; - // it feels better to scale these primitives vertically with the drawpoint + // it feels better to scale these primitives vertically with the draw point if (m_SelectedPrimitiveType == PrimitiveType.Capsule || m_SelectedPrimitiveType == PrimitiveType.Cylinder || m_SelectedPrimitiveType == PrimitiveType.Cube) m_CurrentGameObject.transform.localScale = Vector3.one * corner * 0.5f; else @@ -130,7 +130,7 @@ void UpdateFreeformScale() { var maxCorner = Vector3.Max(m_StartPoint, m_EndPoint); var minCorner = Vector3.Min(m_StartPoint, m_EndPoint); - m_CurrentGameObject.transform.localScale = (maxCorner - minCorner); + m_CurrentGameObject.transform.localScale = maxCorner - minCorner; } void CheckForTriggerRelease(Standard standardInput, ConsumeControlDelegate consumeControl) @@ -146,10 +146,7 @@ void CheckForTriggerRelease(Standard standardInput, ConsumeControlDelegate consu bool IsActive() { - if (this.IsMainMenuVisible(rayOrigin)) - return false; - - return true; + return !this.IsMainMenuVisible(rayOrigin); } void Close() diff --git a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs index 1df4eebfc..e98da093b 100644 --- a/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs +++ b/Tools/MoveWorkspacesTool/MoveWorkspacesTool.cs @@ -1,7 +1,6 @@ #if UNITY_EDITOR using System.Collections.Generic; using UnityEditor.Experimental.EditorVR; -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEditor.Experimental.EditorVR.Workspaces; using UnityEngine; @@ -180,7 +179,7 @@ void MoveWorkspaces() var workspaceTransform = allWorkspaces[i].transform; var deltaRotation = rayOrigin.rotation * Quaternion.Inverse(m_RayOriginStartRotation); var deltaPosition = rayOrigin.position - m_RayOriginStartPosition; - Quaternion yawRotation = MathUtilsExt.ConstrainYawRotation(deltaRotation); + var yawRotation = MathUtilsExt.ConstrainYawRotation(deltaRotation); var localOffset = m_WorkspacePositions[i] - m_RayOriginStartPosition; workspaceTransform.position = m_RayOriginStartPosition + deltaPosition * kMoveMultiplier + yawRotation * localOffset; } diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 5f3a6a40a..18e001f2a 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -11,8 +11,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, - ICanGrabObject, IGetManipulatorDragState, IUsesNode, IGetRayVisibility, IIsMainMenuVisible, IIsInMiniWorld, IRayToNode, - IGetDefaultRayColor, ISetDefaultRayColor, ITooltip, ITooltipPlacement, ISetTooltipVisibility + ICanGrabObject, IGetManipulatorDragState, IUsesNode, IGetRayVisibility, IIsMainMenuVisible, IIsInMiniWorld, + IRayToNode, IGetDefaultRayColor, ISetDefaultRayColor, ITooltip, ITooltipPlacement, ISetTooltipVisibility { const float k_MultiselectHueShift = 0.5f; static readonly Vector3 k_TooltipPosition = new Vector3(0, 0.05f, -0.03f); @@ -29,7 +29,6 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR Color m_NormalRayColor; Color m_MultiselectRayColor; bool m_MultiSelect; - Transform m_TooltipTarget; readonly Dictionary m_HoverGameObjects = new Dictionary(); @@ -45,7 +44,7 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR public List linkedObjects { get; set; } public string tooltipText { get { return m_MultiSelect ? "Multi-Select Enabled" : ""; } } - public Transform tooltipTarget { get { return m_TooltipTarget; } } + public Transform tooltipTarget { get; private set; } public Transform tooltipSource { get { return rayOrigin; } } public TextAlignment tooltipAlignment { get { return TextAlignment.Center; } } @@ -58,9 +57,9 @@ void Start() hsv.x = Mathf.Repeat(hsv.x + k_MultiselectHueShift, 1f); m_MultiselectRayColor = Color.HSVToRGB(hsv.x, hsv.y, hsv.z); - m_TooltipTarget = ObjectUtils.CreateEmptyGameObject("SelectionTool Tooltip Target", rayOrigin).transform; - m_TooltipTarget.localPosition = k_TooltipPosition; - m_TooltipTarget.localRotation = k_TooltipRotation; + tooltipTarget = ObjectUtils.CreateEmptyGameObject("SelectionTool Tooltip Target", rayOrigin).transform; + tooltipTarget.localPosition = k_TooltipPosition; + tooltipTarget.localRotation = k_TooltipRotation; } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 331752185..84e6a0f11 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -4,7 +4,6 @@ using System.Linq; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Manipulators; -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -13,8 +12,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChanged, IActions, IUsesDirectSelection, IGrabObjects, ISelectObject, IManipulatorController, IUsesSnapping, ISetHighlight, ILinkedObject, IRayToNode, - IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, IGetRayVisibility, - IRayVisibilitySettings + IControlHaptics, IUsesRayOrigin, IUsesNode, ICustomActionMap, ITwoHandedScaler, IIsMainMenuVisible, + IGetRayVisibility, IRayVisibilitySettings { const float k_LazyFollowTranslate = 8f; const float k_LazyFollowRotate = 12f; @@ -144,7 +143,7 @@ public List actions if (m_Actions == null) { - m_Actions = new List() + m_Actions = new List { m_PivotModeToggleAction, m_PivotRotationToggleAction, diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 1047d9ddd..c4bb2eb14 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -161,7 +161,6 @@ enum ResizeDirection class DragState { public Transform rayOrigin { get; private set; } - public Node? node { get; private set; } bool m_Resizing; Vector3 m_PositionOffset; Quaternion m_RotationOffset; diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs index 30fb93140..f4fcdf560 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs @@ -62,13 +62,13 @@ public string tooltipText class Preferences { [SerializeField] - public Vector3 m_MiniWorldRefeferenceScale; + Vector3 m_MiniWorldRefeferenceScale; [SerializeField] - public Vector3 m_MiniWorldReferencePosition; + Vector3 m_MiniWorldReferencePosition; [SerializeField] - public float m_ZoomSliderValue; + float m_ZoomSliderValue; public Vector3 miniWorldRefeferenceScale { get { return m_MiniWorldRefeferenceScale; } set { m_MiniWorldRefeferenceScale = value; } } public Vector3 miniWorldReferencePosition { get { return m_MiniWorldReferencePosition; } set { m_MiniWorldReferencePosition = value; } } @@ -418,4 +418,4 @@ protected override void OnDestroy() } } } -#endif \ No newline at end of file +#endif diff --git a/Workspaces/MiniWorldWorkspace/Scripts/MiniWorld.cs b/Workspaces/MiniWorldWorkspace/Scripts/MiniWorld.cs index 200048743..d93e64ae3 100644 --- a/Workspaces/MiniWorldWorkspace/Scripts/MiniWorld.cs +++ b/Workspaces/MiniWorldWorkspace/Scripts/MiniWorld.cs @@ -1,5 +1,4 @@ #if UNITY_EDITOR -using System; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; diff --git a/Workspaces/ProjectWorkspace/ProjectWorkspace.cs b/Workspaces/ProjectWorkspace/ProjectWorkspace.cs index 2a2c489c5..3b8eb21b4 100644 --- a/Workspaces/ProjectWorkspace/ProjectWorkspace.cs +++ b/Workspaces/ProjectWorkspace/ProjectWorkspace.cs @@ -162,10 +162,12 @@ public object OnSerializeWorkspace() { var folderListView = m_ProjectUI.folderListView; - var preferences = new Preferences(); - preferences.scaleFactor = m_ProjectUI.assetGridView.scaleFactor; - preferences.expandedFolders = folderListView.expandStates.Where(es => es.Value).Select(es => es.Key).ToList(); - preferences.selectedFolder = folderListView.selectedFolder; + var preferences = new Preferences + { + scaleFactor = m_ProjectUI.assetGridView.scaleFactor, + expandedFolders = folderListView.expandStates.Where(es => es.Value).Select(es => es.Key).ToList(), + selectedFolder = folderListView.selectedFolder + }; return preferences; } diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs index afaf75aa7..3748c3813 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridItem.cs @@ -5,7 +5,6 @@ using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Handles; using UnityEditor.Experimental.EditorVR.Helpers; -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.UI; @@ -67,12 +66,7 @@ sealed class AssetGridItem : DraggableListItem, IPlaceSceneOb public GameObject icon { - private get - { - if (m_Icon) - return m_Icon; - return m_Cube.gameObject; - } + private get { return m_Icon ? m_Icon : m_Cube.gameObject; } set { m_Cube.gameObject.SetActive(false); From 05cafc6a17761813ab3d4911d1d58b8057bc5483 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 24 Jul 2017 19:08:00 -0700 Subject: [PATCH 663/870] Convert constant local function values into consts in PinnedToolButton --- .../PinnedToolButton/PinnedToolButton.cs | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 434fcb197..446f3ad20 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -527,19 +527,18 @@ public bool moveToAlternatePosition void Awake() { + const float kSemiTransparentAlphaValue = 0.5f; m_OriginalLocalPosition = transform.localPosition; m_OriginalLocalScale = transform.localScale; - m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); var frameMaterialColor = m_FrameMaterial.color; m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); - s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); + s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, kSemiTransparentAlphaValue); m_IconMaterial = MaterialUtils.GetMaterialClone(m_ButtonIcon); m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); m_OriginalIconContainerLocalScale = m_IconContainer.localScale; - //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); } void Start() @@ -571,12 +570,13 @@ void Start() tooltipAlignment = TextAlignment.Center; //m_TooltipTarget.localPosition = new Vector3(0, 0, -0.5f); + const float kIncreasedContainerContentsSpeedMultiplier = 2.5f; m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions m_GradientButton.hoverExit += OnActionButtonHoverExit; m_GradientButton.click += OnBackgroundButtonClick; m_GradientButton.highlightStart += OnPrimaryButtonHighlightStart; m_GradientButton.highlightEnd += OnPrimaryButtonHighlightEnd; - m_GradientButton.containerContentsAnimationSpeedMultiplier = 2.5f; + m_GradientButton.containerContentsAnimationSpeedMultiplier = kIncreasedContainerContentsSpeedMultiplier; m_FrameRenderer.SetBlendShapeWeight(1, 0f); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, 100f); @@ -841,12 +841,15 @@ void OnSecondaryButtonClicked() IEnumerator AnimateInitialReveal(Vector3 targetPosition, Vector3 targetScale) { m_IconContainerCanvasGroup.alpha = 1f; + const int kDurationShapeAmount = 4; + const float kTimeScalar = 3f; + const float kAdditionalIconContainerScaleSpeed = 2f; var duration = 0f; while (duration < 2) { - duration += Time.unscaledDeltaTime * 3f; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); - m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, k_SemiTransparentIconContainerScale, durationShaped * 2f); + duration += Time.unscaledDeltaTime * kTimeScalar; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), kDurationShapeAmount); + m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, k_SemiTransparentIconContainerScale, durationShaped * kAdditionalIconContainerScaleSpeed); transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); transform.localScale = Vector3.Lerp(Vector3.zero, targetScale, durationShaped); yield return null; @@ -887,6 +890,7 @@ IEnumerator AnimateHide() { //primaryButtonCollidersEnabled = false; //secondaryButtonCollidersEnabled = false; + const float kTimeScalar = 8f; var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var targetPosition = Vector3.zero; var currentPosition = transform.localPosition; @@ -907,7 +911,7 @@ IEnumerator AnimateHide() var currentScale = transform.localScale; while (transitionAmount < 1) { - transitionAmount += Time.unscaledDeltaTime * 8; + transitionAmount += Time.unscaledDeltaTime * kTimeScalar; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); /* m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); @@ -941,6 +945,7 @@ IEnumerator AnimateShow() //primaryButtonCollidersEnabled = false; //secondaryButtonCollidersEnabled = false; + const float kTimeScalar = 8f; var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; @@ -961,7 +966,7 @@ IEnumerator AnimateShow() var currentPosition = transform.localPosition; while (transitionAmount < 1) { - transitionAmount += Time.unscaledDeltaTime * 8; + transitionAmount += Time.unscaledDeltaTime * kTimeScalar; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); /* m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); @@ -1011,8 +1016,12 @@ IEnumerator AnimatePosition(int orderPosition) else this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); - var rotationSpacing = 360f / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = orderPosition > -1 ? rotationSpacing * 0.5f - (visibileButtonCount() * 0.5f) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + const float kTimeScalar = 6f; + const float kCenterLocationAmount = 0.5f; + const float kCircularRange = 360f; + const int kDurationShapeAmount = 3; + var rotationSpacing = kCircularRange / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time + var phaseOffset = orderPosition > -1 ? rotationSpacing * kCenterLocationAmount - (visibileButtonCount() * kCenterLocationAmount) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; var duration = 0f; @@ -1024,8 +1033,8 @@ IEnumerator AnimatePosition(int orderPosition) var positionWait = 1f;// (order + 5) * 0.1f; while (duration < 1) { - duration += Time.unscaledDeltaTime * 6f * positionWait; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); + duration += Time.unscaledDeltaTime * kTimeScalar * positionWait; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), kDurationShapeAmount); transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); m_IconContainerCanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, targetCanvasAlpha, durationShaped); CorrectIconRotation(); @@ -1101,13 +1110,14 @@ IEnumerator AnimateSemiTransparentX(bool makeSemiTransparent) IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) { + const float kSpeedDecreaseScalar = 0.275f; var amount = 0f; var currentPosition = transform.localPosition; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; var currentLocalScale = transform.localScale; var targetLocalScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var speed = moveToAlternatePosition ? 5f : 4.5f; // perform faster is returning to original position - speed += (order + 1) * 0.275f; + speed += (order + 1) * kSpeedDecreaseScalar; while (amount < 1f) { amount += Time.unscaledDeltaTime * speed; @@ -1122,14 +1132,6 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) m_ActivatorMoveCoroutine = null; } -/* - IEnumerator DelayedCollderEnable() - { - yield return new WaitForSeconds(0.5f); - //m_RootCollider.enabled = true; - } -*/ - IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) { s_Hovered = false; @@ -1177,8 +1179,10 @@ IEnumerator ShowSecondaryButton() //Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; const float kSecondaryButtonVisibleBlendShapeWeight = 46f; + const float kMaxDelayDuration = 0.25f; + const int kDurationMultiplier = 10; var delayDuration = 0f; - while (delayDuration < 0.25f) + while (delayDuration < kMaxDelayDuration) { delayDuration += Time.unscaledDeltaTime; yield return null; @@ -1193,7 +1197,7 @@ IEnumerator ShowSecondaryButton() var currentDuration = 0f; while (currentDuration < 1f) { - currentDuration += Time.unscaledDeltaTime * 10f; + currentDuration += Time.unscaledDeltaTime * kDurationMultiplier; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kFrameSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); @@ -1208,7 +1212,7 @@ IEnumerator ShowSecondaryButton() IEnumerator HideSecondaryButton() { const float kSecondaryButtonHiddenBlendShapeWeight = 100f; - + const int kDurationMultiplier = 8; var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; @@ -1225,7 +1229,7 @@ IEnumerator HideSecondaryButton() this.StopCoroutine(ref m_HighlightCoroutine); - amount += Time.unscaledDeltaTime * 8f; + amount += Time.unscaledDeltaTime * kDurationMultiplier; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); @@ -1252,11 +1256,12 @@ IEnumerator PerformPrimaryButtonHighlightStart() { const float kSecondaryButtonFrameVisibleBlendShapeWeight = 16f; const float kTargetDuration = 1f; + const int kDurationMultiplier = 25; var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); var currentDuration = 0f; while (currentDuration < kTargetDuration) { - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * 25); + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * kDurationMultiplier); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kSecondaryButtonFrameVisibleBlendShapeWeight, shapedAmount)); yield return null; } @@ -1266,12 +1271,13 @@ IEnumerator PerformPrimaryButtonHighlightEnd() { const float kSecondaryButtonFrameHiddenBlendShapeWeight = 0f; const float kTargetDuration = 1f; + const int kDurationMultiplier = 5; var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); this.hideTooltip(this); var currentDuration = 0f; while (currentDuration < kTargetDuration) { - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * 5); + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * kDurationMultiplier); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kSecondaryButtonFrameHiddenBlendShapeWeight, shapedAmount)); yield return null; } From bb09ecfd04989313bdb4b9ab0adb61378b3c7964 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 24 Jul 2017 19:13:54 -0700 Subject: [PATCH 664/870] Convert function consts in PinnedToolsMenuUI --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 5028d7ed3..693650250 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -536,6 +536,8 @@ int VisibleButtonCount() IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) { const float kPrimaryButtonUIAlternatePositionScalar = 0.65f; + const int kDurationMultiplier = 6; + const int kShapeMultiplier = 4; var currentPosition = transform.localPosition; var currentScale = transform.localScale; var currentPrimaryButtonUIContainerLocalScale = m_OrderedButtons[0].primaryUIContentContainerLocalScale; @@ -543,8 +545,8 @@ IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) var duration = 0f; while (duration < 1) { - duration += Time.unscaledDeltaTime * 6f; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); + duration += Time.unscaledDeltaTime * kDurationMultiplier; + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), kShapeMultiplier); transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); From bef87600a63f31cef3c11f6b1900508185c60e77 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 24 Jul 2017 20:03:56 -0700 Subject: [PATCH 665/870] Display main menu button tooltip on opposite hand's PinnedToolsMenu --- Menus/MainMenu/MainMenu.cs | 2 +- Menus/MainMenu/Scripts/MainMenuButton.cs | 4 +-- .../PinnedToolButton/PinnedToolButton.cs | 34 +++++++++++++------ Scripts/Core/EditorVR.PinnedToolButtons.cs | 3 +- Scripts/Core/Interfaces/IPinnedToolButton.cs | 11 +++--- Scripts/Interfaces/Entity/IMainMenu.cs | 5 +-- 6 files changed, 37 insertions(+), 22 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index b5ee31063..0d598df4b 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -91,7 +91,7 @@ public bool visible public List menuActions { get; set; } public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } - public Func previewToolInPinnedToolButton { private get; set; } + public Func previewToolInPinnedToolButton { private get; set; } public Node? node { get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 49de8be55..d41ab0c47 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -26,7 +26,7 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExi /// /// Highlights a pinned tool button when this menu button is highlighted /// - public Func previewToolInPinnedToolButton { private get; set; } + public Func previewToolInPinnedToolButton { private get; set; } public Button button { get { return m_Button; } } @@ -86,7 +86,7 @@ public void OnRayEnter(RayEventData eventData) if (toolType != null && m_InteractingRayOrigin != null) { // Enable preview-mode on a pinned tool button; Display on the opposite proxy device via the HoveringRayOrigin - m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(m_InteractingRayOrigin, toolType); + m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(m_InteractingRayOrigin, toolType, m_ButtonDescription.text); // TODO convert to a function that is returned, that is called if non-null, instead of a direct reference to the button. } diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 446f3ad20..af8c0a83c 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -171,6 +171,7 @@ public Type previewToolType } else { + previewToolDescription = null; // Clear the preview tooltip isActiveTool = isActiveTool; // Set active tool back to pre-preview state icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button m_GradientButton.highlightGradientPair = gradientPair; @@ -184,22 +185,33 @@ public Type previewToolType } } - /* - public Transform alternateMenuOrigin + public string previewToolDescription { - get { return m_AlternateMenuOrigin; } + get { return m_previewToolDescription; } set { - if (m_AlternateMenuOrigin == value) - return; + if (value != null) + { + m_previewToolDescription = value; + this.ShowTooltip(this); + } + else + { + m_previewToolDescription = null; + toolTipVisible = false; + } + } + } - m_AlternateMenuOrigin = value; - transform.SetParent(m_AlternateMenuOrigin); - transform.localPosition = Vector3.zero; - transform.localRotation = Quaternion.identity; + public string tooltipText + { + get + { + return tooltip != null ? tooltip.tooltipText : (previewToolType == null ? m_TooltipText : previewToolDescription); } + + set { m_TooltipText = value; } } -*/ [SerializeField] GradientButton m_GradientButton; @@ -275,6 +287,7 @@ public Transform alternateMenuOrigin Coroutine m_SecondaryButtonVisibilityCoroutine; string m_TooltipText; + string m_previewToolDescription; bool m_Revealed; bool m_MoveToAlternatePosition; int m_Order = -1; @@ -295,7 +308,6 @@ public Transform alternateMenuOrigin bool m_ActiveTool; bool m_Visible; - public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } public Transform tooltipTarget { get { return m_TooltipTarget; } set { m_TooltipTarget = value; } } public Transform tooltipSource { get { return m_TooltipSource; } } public TextAlignment tooltipAlignment { get; private set; } diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index fbbdec32f..59b3128e5 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -180,7 +180,7 @@ void DeletePinnedToolButton(Transform rayOrigin, IPinnedToolButton buttonToDelet }); } - internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType) + internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, string toolDescription) { // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions if (!toolType.GetInterfaces().Contains(typeof(ITool))) @@ -194,6 +194,7 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T var pinnedToolsMenu = deviceData.pinnedToolsMenu; previewPinnedToolButton = pinnedToolsMenu.previewToolButton; previewPinnedToolButton.previewToolType = toolType; + previewPinnedToolButton.previewToolDescription = toolDescription; } }); diff --git a/Scripts/Core/Interfaces/IPinnedToolButton.cs b/Scripts/Core/Interfaces/IPinnedToolButton.cs index 7664d8739..00f5b76dc 100644 --- a/Scripts/Core/Interfaces/IPinnedToolButton.cs +++ b/Scripts/Core/Interfaces/IPinnedToolButton.cs @@ -21,12 +21,13 @@ public interface IPinnedToolButton bool implementsSecondaryButton { get; set; } Vector3 primaryUIContentContainerLocalScale { get; set; } Transform tooltipTarget { get; set; } + string previewToolDescription { set; } Action destroy { get; } - Action selectTool { get; set; } - Func visibileButtonCount { get; set; } - Func closeButton { get; set; } - Action showAllButtons { get; set; } - Action hoverExit { get; set; } + Action selectTool { set; } + Func visibileButtonCount { set; } + Func closeButton { set; } + Action showAllButtons { set; } + Action hoverExit { set; } event Action hovered; } diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 97c20be05..746c20b4f 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -40,10 +40,11 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Highlights a pinned tool button when a menu button is highlighted /// Transform: Ray origin to check /// Type: MenuButton's tool type to preview - /// Returns the unoccupied pinned tool button that will display the menu-button-tool preview while the button is highlighted + /// String: The tool description to display as a Tooltip + /// Returns the a pinned tool button that will display the menu-button-tool preview while the button is highlighted on the main menu /// The returned PinnedToolButton has its preview mode disabled upon a ray exit of the menu button /// - Func previewToolInPinnedToolButton { set; } + Func previewToolInPinnedToolButton { set; } } } #endif From 64b53bb0f3e10c5bb23512c599a614ab30920bb6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 01:40:56 -0700 Subject: [PATCH 666/870] Restore display of abbreviated tool names in PinnedToolButtons --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 090ec0252..1d22ab62e 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -188,7 +188,7 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) //button.node = deviceData.node; button.rayOrigin = rayOrigin; button.toolType = toolType; // Assign Tool Type before assigning order - button.icon = buttonIcon ? buttonIcon : m_UnityIcon; + button.icon = toolType != typeof(IMainMenu) ? buttonIcon : m_UnityIcon; button.highlightSingleButton = HighlightSingleButton; button.selectHighlightedButton = SelectHighlightedButton; //button.selected += OnMainMenuActivatorSelected; From ff84deba901d692a067688e35127a68191ea1456 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 01:53:12 -0700 Subject: [PATCH 667/870] Add IRayClickHandler; Implement in MainMenuButton --- Menus/MainMenu/Scripts/MainMenuButton.cs | 27 +++++-------------- .../ExecuteRayEvents.cs | 8 ++++++ .../Interfaces/IRayClickHandler.cs | 14 ++++++++++ .../Interfaces/IRayClickHandler.cs.meta | 12 +++++++++ 4 files changed, 40 insertions(+), 21 deletions(-) create mode 100644 Scripts/Modules/MultipleRayInputModule/Interfaces/IRayClickHandler.cs create mode 100644 Scripts/Modules/MultipleRayInputModule/Interfaces/IRayClickHandler.cs.meta diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index d41ab0c47..967eb5f2d 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -2,12 +2,11 @@ using System; using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; -using UnityEngine.EventSystems; using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExitHandler, IPointerClickHandler + sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExitHandler, IRayClickHandler { [SerializeField] Button m_Button; @@ -21,7 +20,6 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExi Color m_OriginalColor; IPinnedToolButton m_HighlightedPinnedToolbutton; Transform m_RayOrigin; - Transform m_InteractingRayOrigin; /// /// Highlights a pinned tool button when this menu button is highlighted @@ -36,10 +34,10 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExi public Type toolType { get; set; } - public void OnPointerClick(PointerEventData eventData) + public void OnRayClick(RayEventData eventData) { if (clicked != null) - clicked(m_InteractingRayOrigin); + clicked(eventData.rayOrigin); } public bool selected @@ -67,11 +65,6 @@ void Awake() m_OriginalColor = m_Button.targetGraphic.color; } - void OnDisable() - { - m_InteractingRayOrigin = null; - } - public void SetData(string name, string description) { m_ButtonTitle.text = name; @@ -81,12 +74,11 @@ public void SetData(string name, string description) public void OnRayEnter(RayEventData eventData) { // Track which pointer is over us, so this information can supply context (e.g. selecting a tool for a different hand) - m_InteractingRayOrigin = eventData.rayOrigin; - - if (toolType != null && m_InteractingRayOrigin != null) + var interactingRayOrigin = eventData.rayOrigin; + if (toolType != null && interactingRayOrigin != null) { // Enable preview-mode on a pinned tool button; Display on the opposite proxy device via the HoveringRayOrigin - m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(m_InteractingRayOrigin, toolType, m_ButtonDescription.text); + m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(interactingRayOrigin, toolType, m_ButtonDescription.text); // TODO convert to a function that is returned, that is called if non-null, instead of a direct reference to the button. } @@ -97,17 +89,10 @@ public void OnRayEnter(RayEventData eventData) public void OnRayExit(RayEventData eventData) { - //if (m_InteractingRayOrigin == eventData.rayOrigin) - //m_InteractingRayOrigin = null; - // Disable preview-mode on pinned tool button if (m_HighlightedPinnedToolbutton != null) m_HighlightedPinnedToolbutton.previewToolType = null; - //m_RayOrigin = TODO: remove - - m_InteractingRayOrigin = eventData.rayOrigin; - if (hovered != null) hovered(eventData.rayOrigin); } diff --git a/Scripts/Modules/MultipleRayInputModule/ExecuteRayEvents.cs b/Scripts/Modules/MultipleRayInputModule/ExecuteRayEvents.cs index c4d385833..6590fbb40 100644 --- a/Scripts/Modules/MultipleRayInputModule/ExecuteRayEvents.cs +++ b/Scripts/Modules/MultipleRayInputModule/ExecuteRayEvents.cs @@ -23,6 +23,9 @@ static class ExecuteRayEvents public static ExecuteEvents.EventFunction rayHoverHandler { get { return s_RayHoverHandler; } } private static readonly ExecuteEvents.EventFunction s_RayHoverHandler = Execute; + public static ExecuteEvents.EventFunction rayClickHandler { get { return s_RayClickHandler; } } + private static readonly ExecuteEvents.EventFunction s_RayClickHandler = Execute; + private static void Execute(IRayBeginDragHandler handler, BaseEventData eventData) { handler.OnBeginDrag(ExecuteEvents.ValidateEventData(eventData)); @@ -52,6 +55,11 @@ private static void Execute(IRayHoverHandler handler, BaseEventData eventData) { handler.OnRayHover(ExecuteEvents.ValidateEventData(eventData)); } + + private static void Execute(IRayClickHandler handler, BaseEventData eventData) + { + handler.OnRayClick(ExecuteEvents.ValidateEventData(eventData)); + } } } #endif diff --git a/Scripts/Modules/MultipleRayInputModule/Interfaces/IRayClickHandler.cs b/Scripts/Modules/MultipleRayInputModule/Interfaces/IRayClickHandler.cs new file mode 100644 index 000000000..b059f3c3c --- /dev/null +++ b/Scripts/Modules/MultipleRayInputModule/Interfaces/IRayClickHandler.cs @@ -0,0 +1,14 @@ +#if UNITY_EDITOR +using UnityEngine.EventSystems; + +namespace UnityEditor.Experimental.EditorVR.Modules +{ + /// + /// Decorates objects with functionality to detect RayClick events + /// + interface IRayClickHandler : IEventSystemHandler + { + void OnRayClick(RayEventData eventData); + } +} +#endif diff --git a/Scripts/Modules/MultipleRayInputModule/Interfaces/IRayClickHandler.cs.meta b/Scripts/Modules/MultipleRayInputModule/Interfaces/IRayClickHandler.cs.meta new file mode 100644 index 000000000..efd4f55b4 --- /dev/null +++ b/Scripts/Modules/MultipleRayInputModule/Interfaces/IRayClickHandler.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b8d8fcdf701509d4f99ef9cf7f3bd549 +timeCreated: 1471288027 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 68c4a489b83cba9ae06c118b2caa3347e01eb021 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 12:13:50 -0700 Subject: [PATCH 668/870] Remove time-limited activation of Spatial Scrolling from PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 15 ++++----------- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 4 ++-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 1d22ab62e..716340efe 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -206,7 +206,6 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) Vector3 m_SpatialScrollStartPosition; Vector3? spatialDirection = null; Vector3 previousWorldPosition; - float? allowSpatialScrollBeforeThisTime = null; // use to hide menu if input is consumed externally and no spatialDirection is define within a given duration float allowToolToggleBeforeThisTime; public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { @@ -227,17 +226,17 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (pinnedToolInput.cancel.wasJustPressed) Debug.LogError("CANCELLING SPATIAL SELECTION!!!!"); - if (allowSpatialScrollBeforeThisTime != null && spatialDirection == null && Time.realtimeSinceStartup > allowSpatialScrollBeforeThisTime.Value) + /* + if (spatialDirection == null) { // Hide if no direction as been defined after a given duration Debug.LogWarning("Perform an increasing visual presence of visuals as time progresses, and the drag threshold hasn't been met."); m_PinnedToolsMenuUI.allButtonsVisible = false; - allowSpatialScrollBeforeThisTime = null; - this.SetSpatialHintControlObject(null); // Hide Spatial Hint Visuals return; } + */ if (pinnedToolInput.show.wasJustPressed) { @@ -247,10 +246,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //m_PinnedToolsMenuUI.allButtonsVisible = true; m_SpatialScrollStartPosition = m_AlternateMenuOrigin.position; Debug.LogError("Start position : " + m_SpatialScrollStartPosition + ""); - allowSpatialScrollBeforeThisTime = Time.realtimeSinceStartup + kAutoHideDuration; allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; this.SetSpatialHintControlObject(rayOrigin); - m_PinnedToolsMenuUI.SpatiallyScrolling = true; // Triggers the display of the directional hint arrows + m_PinnedToolsMenuUI.spatiallyScrolling = true; // Triggers the display of the directional hint arrows //Dont show if the user hasnt passed the threshold in the given duration } @@ -276,7 +274,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (buttonCount <= k_ActiveToolOrderPosition + 1) { - allowSpatialScrollBeforeThisTime = null; spatialDirection = null; return; } @@ -300,12 +297,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else if (pinnedToolInput.show.wasJustReleased) { - if (allowSpatialScrollBeforeThisTime == null) - return; - const float kAdditionalConsumptionDuration = 0.25f; continuedInputConsumptionStartTime = Time.realtimeSinceStartup + kAdditionalConsumptionDuration; - allowSpatialScrollBeforeThisTime = null; if (spatialDirection != null) { Debug.LogWarning("PinnedToolButton was just released"); diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 693650250..4165d9317 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -71,7 +71,7 @@ public bool allButtonsVisible //this.Pulse(rayOrigin, 0.5f, 0.065f, false, true); //spatialDragDistance = 0f; ShowOnlyMenuAndActiveToolButtons(); - SpatiallyScrolling = false; + spatiallyScrolling = false; this.SetSpatialHintRotationTarget(Vector3.zero); } } @@ -107,7 +107,7 @@ private bool aboveMinimumButtonCount } } - public bool SpatiallyScrolling + public bool spatiallyScrolling { set { From 643158dcfe61d168fd1e397ad1d60aed2b7aef03 Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Tue, 25 Jul 2017 16:54:18 -0500 Subject: [PATCH 669/870] make test setup possible by eliminating static EVR contructor --- Scripts/Core/EditorVR.cs | 60 ++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 59370e38c..5da9dd3b0 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -35,6 +35,8 @@ sealed partial class EditorVR : MonoBehaviour bool m_HasDeserialized; + static bool s_IsInitialized; + static EditorVR s_Instance; static HideFlags defaultHideFlags @@ -97,14 +99,44 @@ static void ResetPreferences() EditorPrefs.DeleteKey(k_SerializedPreferences); } + // code from the previous static contructor moved here to allow for testability + void HandleInitialization() + { + if (!s_IsInitialized) + { + s_IsInitialized = true; + + if (!PlayerSettings.virtualRealitySupported) + Debug.Log("EditorVR requires VR support. Please check Virtual Reality Supported in Edit->Project Settings->Player->Other Settings"); + +#if !ENABLE_OVR_INPUT && !ENABLE_STEAMVR_INPUT && !ENABLE_SIXENSE_INPUT + Debug.Log("EditorVR requires at least one partner (e.g. Oculus, Vive) SDK to be installed for input. You can download these from the Asset Store or from the partner's website"); +#endif + + // Add EVR tags and layers if they don't exist + var tags = TagManager.GetRequiredTags(); + var layers = TagManager.GetRequiredLayers(); + + foreach (var tag in tags) + { + TagManager.AddTag(tag); + } + + foreach (var layer in layers) + { + TagManager.AddLayer(layer); + } + } + } + void Awake() { s_Instance = this; // Used only by PreferencesGUI Nested.evr = this; // Set this once for the convenience of all nested classes m_DefaultTools = defaultTools; SetHideFlags(defaultHideFlags); - ClearDeveloperConsoleIfNecessary(); + HandleInitialization(); m_Interfaces = (Interfaces)AddNestedModule(typeof(Interfaces)); AddModule(); // Added here in case any nested modules have preference serialization @@ -465,32 +497,6 @@ void SetHideFlags(HideFlags hideFlags) EditorApplication.DirtyHierarchyWindowSorting(); // Otherwise objects aren't shown/hidden in hierarchy window } - static EditorVR() - { - ObjectUtils.hideFlags = defaultHideFlags; - - if (!PlayerSettings.virtualRealitySupported) - Debug.Log("EditorVR requires VR support. Please check Virtual Reality Supported in Edit->Project Settings->Player->Other Settings"); - -#if !ENABLE_OVR_INPUT && !ENABLE_STEAMVR_INPUT && !ENABLE_SIXENSE_INPUT - Debug.Log("EditorVR requires at least one partner (e.g. Oculus, Vive) SDK to be installed for input. You can download these from the Asset Store or from the partner's website"); -#endif - - // Add EVR tags and layers if they don't exist - var tags = TagManager.GetRequiredTags(); - var layers = TagManager.GetRequiredLayers(); - - foreach (var tag in tags) - { - TagManager.AddTag(tag); - } - - foreach (var layer in layers) - { - TagManager.AddLayer(layer); - } - } - [PreferenceItem("EditorVR")] static void PreferencesGUI() { From 093c9390447fc1f0dcd0fc369e3a985d93d0b1d3 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 25 Jul 2017 16:10:53 -0700 Subject: [PATCH 670/870] Start working on a new version of blink visuals --- Scripts/Core/EditorVR.cs | 5 +- .../FunctionalityInjection/IRaycast.cs | 21 ++++ .../FunctionalityInjection/IRaycast.cs.meta | 12 ++ .../IntersectionModule/IntersectionModule.cs | 2 + .../Modules/SnappingModule/SnappingModule.cs | 8 +- Tests/Editor/Unit.meta | 9 ++ Tools/LocomotionTool/LocomotionTool.cs | 10 +- Tools/LocomotionTool/LocomotionTool.cs.meta | 4 +- .../Prefabs/BlinkVisuals1.prefab | 115 ++++++++++++++++++ .../Prefabs/BlinkVisuals1.prefab.meta | 9 ++ Tools/LocomotionTool/Scripts/BlinkVisuals1.cs | 56 +++++++++ .../Scripts/BlinkVisuals1.cs.meta | 12 ++ 12 files changed, 249 insertions(+), 14 deletions(-) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IRaycast.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IRaycast.cs.meta create mode 100644 Tests/Editor/Unit.meta create mode 100644 Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab create mode 100644 Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab.meta create mode 100644 Tools/LocomotionTool/Scripts/BlinkVisuals1.cs create mode 100644 Tools/LocomotionTool/Scripts/BlinkVisuals1.cs.meta diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 59370e38c..cee46899e 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -161,8 +161,7 @@ void Awake() m_Interfaces.ConnectInterfaces(intersectionModule); intersectionModule.Setup(spatialHashModule.spatialHash); - var snappingModule = AddModule(); - snappingModule.raycast = intersectionModule.Raycast; + AddModule(); var vacuumables = GetNestedModule(); @@ -204,6 +203,8 @@ void Awake() AddModule(); + AddModule(); + viewer.AddPlayerModel(); GetNestedModule().CreateAllProxies(); diff --git a/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs new file mode 100644 index 000000000..219e53f32 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + public interface IRaycast + { + } + + public static class IRaycastMethods + { + public delegate bool RaycastDelegate(Ray ray, out RaycastHit hit, out GameObject go, float maxDistance = Mathf.Infinity, List ignoreList = null); + + public static RaycastDelegate raycast { get; set; } + + public static bool Raycast(this IRaycast obj, Ray ray, out RaycastHit hit, out GameObject go, float maxDistance = Mathf.Infinity, List ignoreList = null) + { + return raycast(ray, out hit, out go, maxDistance, ignoreList); + } + } +} diff --git a/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs.meta new file mode 100644 index 000000000..83f25ad6a --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ccda391232ab2f04e9da196586a96144 +timeCreated: 1501022830 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/IntersectionModule/IntersectionModule.cs b/Scripts/Modules/IntersectionModule/IntersectionModule.cs index ca403d176..d2425bb02 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionModule.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionModule.cs @@ -41,6 +41,8 @@ struct SortableRenderer void Awake() { IntersectionUtils.BakedMesh = new Mesh(); // Create a new Mesh in each Awake because it is destroyed on scene load + + IRaycastMethods.raycast = Raycast; } internal void Setup(SpatialHash hash) diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index 06ae4ef34..a6f135130 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -12,10 +12,9 @@ namespace UnityEditor.Experimental.EditorVR.Modules { [MainMenuItem("Snapping", "Settings", "Select snapping modes")] - sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProvider, ISerializePreferences + sealed class SnappingModule : MonoBehaviour, IUsesViewerScale, ISettingsMenuProvider, ISerializePreferences, + IRaycast { - public delegate bool RaycastDelegate(Ray ray, out RaycastHit hit, out GameObject go, float maxDistance = Mathf.Infinity, List ignoreList = null); - const float k_GroundPlaneScale = 1000f; const float k_GroundSnappingMaxRayLength = 25f; @@ -236,7 +235,6 @@ public bool directSnappingEnabled public bool widgetEnabled { get; set; } - public RaycastDelegate raycast { private get; set; } public Renderer[] ignoreList { private get; set; } public GameObject settingsMenuPrefab { get { return m_SettingsMenuPrefab; } } @@ -756,7 +754,7 @@ bool SnapToSurface(Ray ray, ref Vector3 position, ref Quaternion rotation, Snapp { RaycastHit hit; GameObject go; - if (raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) + if (this.Raycast(ray, out hit, out go, raycastDistance, m_CombinedIgnoreList)) { if (Vector3.Dot(ray.direction, hit.normal) > maxRayDot) return false; diff --git a/Tests/Editor/Unit.meta b/Tests/Editor/Unit.meta new file mode 100644 index 000000000..c656adf59 --- /dev/null +++ b/Tests/Editor/Unit.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9bdb5ea018a1bc84eb34701cbffb0984 +folderAsset: yes +timeCreated: 1501019103 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index de9fcc7c7..5502987c2 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -60,7 +60,7 @@ class Preferences ViewerScaleVisuals m_ViewerScaleVisuals; GameObject m_BlinkVisualsGO; - BlinkVisuals m_BlinkVisuals; + BlinkVisuals1 m_BlinkVisuals; State m_State = State.Inactive; @@ -158,7 +158,7 @@ void Start() } m_BlinkVisualsGO = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin); - m_BlinkVisuals = m_BlinkVisualsGO.GetComponentInChildren(); + m_BlinkVisuals = m_BlinkVisualsGO.GetComponentInChildren(); m_BlinkVisuals.enabled = false; m_BlinkVisualsGO.transform.parent = rayOrigin; m_BlinkVisualsGO.transform.localPosition = Vector3.zero; @@ -334,7 +334,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); - m_BlinkVisuals.ShowVisuals(); + m_BlinkVisuals.visible = true; consumeControl(m_LocomotionInput.blink); return true; @@ -347,8 +347,8 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (!m_BlinkVisuals.outOfMaxRange) { - m_BlinkVisuals.HideVisuals(); - StartCoroutine(MoveTowardTarget(m_BlinkVisuals.locatorPosition)); + m_BlinkVisuals.visible = false; + StartCoroutine(MoveTowardTarget(m_BlinkVisuals.targetPosition)); } else { diff --git a/Tools/LocomotionTool/LocomotionTool.cs.meta b/Tools/LocomotionTool/LocomotionTool.cs.meta index 986831910..62a7fd4e7 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs.meta +++ b/Tools/LocomotionTool/LocomotionTool.cs.meta @@ -1,11 +1,11 @@ fileFormatVersion: 2 guid: 403957a6dcd8bfe4a905881513f309b0 -timeCreated: 1498018808 +timeCreated: 1501023394 licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: - - m_BlinkVisualsPrefab: {fileID: 1000010640839482, guid: 1a8cb71dcb1ec2e4c8dc0b3158762bcb, + - m_BlinkVisualsPrefab: {fileID: 1359949259200608, guid: da60c6627f686ff46977b7ad8b694b91, type: 2} - m_ViewerScaleVisualsPrefab: {fileID: 1000012817627458, guid: 60a4bda9bfa0dcc4e9ccab99d39c295f, type: 2} diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab new file mode 100644 index 000000000..a6f1ca8f3 --- /dev/null +++ b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab @@ -0,0 +1,115 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1359949259200608} + m_IsPrefabParent: 1 +--- !u!1 &1359949259200608 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4941602581352918} + - component: {fileID: 33051271591036750} + - component: {fileID: 23320344508890766} + - component: {fileID: 114924831655948450} + - component: {fileID: 114017680955354874} + m_Layer: 0 + m_Name: BlinkVisuals1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4941602581352918 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1359949259200608} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23320344508890766 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1359949259200608} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33051271591036750 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1359949259200608} + m_Mesh: {fileID: 0} +--- !u!114 &114017680955354874 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1359949259200608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d580b86a6ae18014293c9b5059b2121b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Positions: [] + m_ColorStart: {r: 1, g: 1, b: 1, a: 1} + m_ColorEnd: {r: 1, g: 1, b: 1, a: 1} + m_WidthStart: 1 + m_WidthEnd: 1 + m_WorldSpaceData: 0 +--- !u!114 &114924831655948450 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1359949259200608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cf39114d78dfefc4dadd8131c757bd9b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ProjectileSpeed: 100 + m_TimeStep: 0.001 + m_MaxProjectileSteps: 20 diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab.meta b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab.meta new file mode 100644 index 000000000..fd2d3eada --- /dev/null +++ b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: da60c6627f686ff46977b7ad8b694b91 +timeCreated: 1501023385 +licenseType: Free +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs new file mode 100644 index 000000000..5c212ddf0 --- /dev/null +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs @@ -0,0 +1,56 @@ +using UnityEditor.Experimental.EditorVR; +using UnityEngine; + +public class BlinkVisuals1 : MonoBehaviour, IUsesViewerScale, IRaycast +{ + [SerializeField] + float m_ProjectileSpeed = 1f; + + [SerializeField] + float m_TimeStep = 0.01f; + + [SerializeField] + int m_MaxProjectileSteps = 100; + + VRLineRenderer m_LineRenderer; + + public Vector3 targetPosition { get; set; } + + public bool visible + { + set { enabled = value; } + } + + public bool outOfMaxRange { get; set; } + + void Start() + { + m_LineRenderer = GetComponent(); + } + + void Update() + { + GizmoModule.instance.DrawSphere(transform.position, 0.1f, Color.black); + var lastPosition = transform.position; + var timeStep = m_TimeStep * this.GetViewerScale(); + var startVelocity = transform.forward * m_ProjectileSpeed * timeStep; + var gravity = Physics.gravity * timeStep; + for (var i = 0; i < m_MaxProjectileSteps; i++) + { + var nextPosition = lastPosition + startVelocity; + startVelocity += gravity; + + var segment = nextPosition - lastPosition; + var ray = new Ray(lastPosition, segment); + RaycastHit hit; + GameObject go; + GizmoModule.instance.DrawRay(ray.origin, ray.direction, Color.white, segment.magnitude); + //if (this.Raycast(ray, out hit, out go, segment.magnitude)) + //{ + // break; + //} + + lastPosition = nextPosition; + } + } +} diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs.meta b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs.meta new file mode 100644 index 000000000..7ada0e6ca --- /dev/null +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: cf39114d78dfefc4dadd8131c757bd9b +timeCreated: 1501020498 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 6dc7c07a372764b0131131f49de8a94d4f12f5ff Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Tue, 25 Jul 2017 18:28:26 -0500 Subject: [PATCH 671/870] PR feedback fixes for HandleInitialization --- Scripts/Core/EditorVR.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 5da9dd3b0..558746cf3 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -99,8 +99,8 @@ static void ResetPreferences() EditorPrefs.DeleteKey(k_SerializedPreferences); } - // code from the previous static contructor moved here to allow for testability - void HandleInitialization() + // Code from the previous static constructor moved here to allow for testability + static void HandleInitialization() { if (!s_IsInitialized) { From fd446e0ba64e01931add8bf77c0aa32ff617ec38 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 16:51:14 -0700 Subject: [PATCH 672/870] Refactor haptic pulses & their folder structure for Spatial Selection module refactor --- .../PinnedToolMenuScrollingPulse.asset | 17 ----------------- .../PinnedToolMenuScrollingPulse.asset.meta | 9 --------- Scripts/Modules/SpatialScrollModule.meta | 9 +++++++++ .../SpatialScrollModule/HapticPulses.meta | 9 +++++++++ .../SpatialScrollActivationPulse.asset | 2 +- .../SpatialScrollActivationPulse.asset.meta | 0 6 files changed, 19 insertions(+), 27 deletions(-) delete mode 100644 Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset delete mode 100644 Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset.meta create mode 100644 Scripts/Modules/SpatialScrollModule.meta create mode 100644 Scripts/Modules/SpatialScrollModule/HapticPulses.meta rename Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset => Scripts/Modules/SpatialScrollModule/HapticPulses/SpatialScrollActivationPulse.asset (91%) rename Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset.meta => Scripts/Modules/SpatialScrollModule/HapticPulses/SpatialScrollActivationPulse.asset.meta (100%) diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset deleted file mode 100644 index 928e785f0..000000000 --- a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset +++ /dev/null @@ -1,17 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: PinnedToolMenuScrollingPulse - m_EditorClassIdentifier: - m_Duration: 0.25 - m_Intensity: 0.35 - m_FadeIn: 1 - m_FadeOut: 1 diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset.meta b/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset.meta deleted file mode 100644 index 21d80c15c..000000000 --- a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuScrollingPulse.asset.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e3b61c818f641ce4fb27eb9d16770364 -timeCreated: 1497398079 -licenseType: Pro -NativeFormatImporter: - mainObjectFileID: 11400000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Scripts/Modules/SpatialScrollModule.meta b/Scripts/Modules/SpatialScrollModule.meta new file mode 100644 index 000000000..fa999bb28 --- /dev/null +++ b/Scripts/Modules/SpatialScrollModule.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 56454fea8be71084f8909b4980a2589e +folderAsset: yes +timeCreated: 1501010577 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SpatialScrollModule/HapticPulses.meta b/Scripts/Modules/SpatialScrollModule/HapticPulses.meta new file mode 100644 index 000000000..39f904288 --- /dev/null +++ b/Scripts/Modules/SpatialScrollModule/HapticPulses.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ce9f7ad428f0d7e4592060ea59b1fc29 +folderAsset: yes +timeCreated: 1501010841 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset b/Scripts/Modules/SpatialScrollModule/HapticPulses/SpatialScrollActivationPulse.asset similarity index 91% rename from Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset rename to Scripts/Modules/SpatialScrollModule/HapticPulses/SpatialScrollActivationPulse.asset index 2e4a4a23c..57091917c 100644 --- a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset +++ b/Scripts/Modules/SpatialScrollModule/HapticPulses/SpatialScrollActivationPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: PinnedToolMenuActivationPulse + m_Name: SpatialScrollActivationPulse m_EditorClassIdentifier: m_Duration: 0.25 m_Intensity: 0.3 diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset.meta b/Scripts/Modules/SpatialScrollModule/HapticPulses/SpatialScrollActivationPulse.asset.meta similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuActivationPulse.asset.meta rename to Scripts/Modules/SpatialScrollModule/HapticPulses/SpatialScrollActivationPulse.asset.meta From d3d3fb49fe746d40184f13fc35dedbf71d59c67e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 17:09:14 -0700 Subject: [PATCH 673/870] Refactor SpatialScrolling functionality into module form --- .../SpatialScrollModuleConnector.cs | 18 ++++ .../SpatialScrollModuleConnector.cs.meta | 12 +++ .../IControlSpatialScrolling.cs | 39 ++++++++ .../IControlSpatialScrolling.cs.meta | 12 +++ .../SpatialScrollModule.cs | 95 +++++++++++++++++++ .../SpatialScrollModule.cs.meta | 14 +++ 6 files changed, 190 insertions(+) create mode 100644 Scripts/Core/InterfaceConnectors/SpatialScrollModuleConnector.cs create mode 100644 Scripts/Core/InterfaceConnectors/SpatialScrollModuleConnector.cs.meta create mode 100644 Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs.meta create mode 100644 Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs create mode 100644 Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs.meta diff --git a/Scripts/Core/InterfaceConnectors/SpatialScrollModuleConnector.cs b/Scripts/Core/InterfaceConnectors/SpatialScrollModuleConnector.cs new file mode 100644 index 000000000..a4b58ac9f --- /dev/null +++ b/Scripts/Core/InterfaceConnectors/SpatialScrollModuleConnector.cs @@ -0,0 +1,18 @@ +#if UNITY_EDITOR && UNITY_EDITORVR +using UnityEditor.Experimental.EditorVR.Modules; + +namespace UnityEditor.Experimental.EditorVR.Core +{ + partial class EditorVR + { + class SpatialScrollModuleConnector : Nested, ILateBindInterfaceMethods + { + public void LateBindInterfaceMethods(SpatialScrollModule provider) + { + IControlSpatialScrollingMethods.performSpatialScroll = provider.PerformScroll; + IControlSpatialScrollingMethods.endSpatialScroll = provider.EndScroll; + } + } + } +} +#endif diff --git a/Scripts/Core/InterfaceConnectors/SpatialScrollModuleConnector.cs.meta b/Scripts/Core/InterfaceConnectors/SpatialScrollModuleConnector.cs.meta new file mode 100644 index 000000000..e158f9b30 --- /dev/null +++ b/Scripts/Core/InterfaceConnectors/SpatialScrollModuleConnector.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b2adf9dd694035a45b24f0ecb7d37ebe +timeCreated: 1489520545 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs new file mode 100644 index 000000000..fefcf9355 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs @@ -0,0 +1,39 @@ +#if UNITY_EDITOR +using UnityEditor.Experimental.EditorVR.Modules; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Gives decorated class ability to control/perform spatial-scrolling + /// + public interface IControlSpatialScrolling + { + } + + public static class IControlSpatialScrollingMethods + { + internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDelegate (object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1); + internal static PerformSpatialScrollDelegate performSpatialScroll { private get; set; } + + /// + /// + /// + public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IControlSpatialHinting obj, object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) + { + return performSpatialScroll(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount); + } + + internal delegate void EndSpatialScrollDelegate (object caller); + internal static EndSpatialScrollDelegate endSpatialScroll { private get; set; } + + /// + /// + /// + public static void EndSpatialScroll(this IControlSpatialHinting obj, object caller) + { + endSpatialScroll(caller); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs.meta new file mode 100644 index 000000000..9649f1aed --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6f048058e1a88984ab40e7ce4b19fbf7 +timeCreated: 1468885156 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs new file mode 100644 index 000000000..02abc488d --- /dev/null +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -0,0 +1,95 @@ +#if UNITY_EDITOR +using UnityEditor.Experimental.EditorVR.Core; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Modules +{ + public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, IControlHaptics + { + [SerializeField] + HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection + + SpatialScrollData m_spatialScrollData; // Class housing the data representing a spatial scroll for a given caller + + public class SpatialScrollData + { + public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) + { + this.caller = caller; + this.node = node; + this.startingPosition = startingPosition; + this.currentPosition = currentPosition; + this.repeatingScrollLengthRange = repeatingScrollLengthRange; + this.scrollableItemCount = scrollableItemCount; + this.maxItemCount = maxItemCount; + spatialDirection = null; + } + + // Data assigned by calling object requesting spatial scroll processing + public object caller { get; set; } + public Node? node { get; set; } + public Vector3 startingPosition { get; set; } + public Vector3 currentPosition { get; set; } + public float repeatingScrollLengthRange { get; set; } + public int scrollableItemCount { get; set; } + public int maxItemCount { get; set; } + + // Values populated by scoll processing + public Vector3? spatialDirection { get; set; } + public Vector3 startingDragOrigin { get; set; } + public Vector3 previousWorldPosition { get; set; } + public float normalizedLoopingPosition { get; set; } + public float dragDistance { get; set; } + public bool passedMinDragActivationThreshold { get { return spatialDirection != null; } } + + public void UpdateExistingScrollData(Vector3 newPosition) + { + currentPosition = newPosition; + } + } + + internal SpatialScrollData PerformScroll(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) + { + // Continue processing of spatial scrolling for a given caller, + // Or create new instance of scroll data for new callers. (Initial structure for support of simultaneous callers) + if (m_spatialScrollData == null || m_spatialScrollData.caller != caller) + m_spatialScrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount); + else + m_spatialScrollData.UpdateExistingScrollData(currentPosition); + + return processSpatialScrolling(m_spatialScrollData); + } + + SpatialScrollData processSpatialScrolling(SpatialScrollData scrollData) + { + var directionVector = scrollData.currentPosition - scrollData.startingPosition; + const float kMaxFineTuneVelocity = 0.0005f; + if (scrollData.spatialDirection == null) + { + var newDirectionVectorThreshold = 0.0175f; // Initial magnitude beyond which spatial scrolling will be evaluated + newDirectionVectorThreshold *= this.GetViewerScale(); + var dragMagnitude = Vector3.Magnitude(directionVector); + var dragPercentage = dragMagnitude / newDirectionVectorThreshold; + var repeatingPulseAmount = Mathf.Sin(Time.realtimeSinceStartup * 20) > 0.5f ? 1f : 0f; // Perform an on/off repeating pulse while waiting for the drag threshold to be crossed + scrollData.dragDistance = dragMagnitude > 0 ? dragPercentage : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred + this.Pulse(scrollData.node, m_ActivationPulse, repeatingPulseAmount, repeatingPulseAmount); + if (dragMagnitude > newDirectionVectorThreshold) + scrollData.spatialDirection = directionVector; // Initialize vector defining the spatial scroll direciton + } + else + { + var projectedAmount = Vector3.Project(directionVector, scrollData.spatialDirection.Value).magnitude / this.GetViewerScale(); + scrollData.normalizedLoopingPosition = (Mathf.Abs(projectedAmount * (scrollData.maxItemCount / scrollData.scrollableItemCount)) % scrollData.repeatingScrollLengthRange) * (1 / scrollData.repeatingScrollLengthRange); + } + + return scrollData; + } + + internal void EndScroll(object caller) + { + if (m_spatialScrollData != null && m_spatialScrollData.caller == caller) + m_spatialScrollData = null; + } + } +} +#endif diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs.meta b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs.meta new file mode 100644 index 000000000..93ac8aeda --- /dev/null +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 2bcdcdfd736dbea43bb4b256792cc7be +timeCreated: 1501022878 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: + - m_ActivationPulse: {fileID: 11400000, guid: c3a3fe0d1f5495c4db58b5282c37a962, + type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 17f08fbd87472abd808562f07d9e707dc9f8cc61 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 25 Jul 2017 17:27:09 -0700 Subject: [PATCH 674/870] Use VRLineRenderer for visuals; Implement target position --- Tools/LocomotionTool/LocomotionTool.cs | 77 +++++++---------- .../Prefabs/BlinkVisuals1.prefab | 11 ++- Tools/LocomotionTool/Scripts/BlinkVisuals1.cs | 86 +++++++++++++------ 3 files changed, 99 insertions(+), 75 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 5502987c2..ab8c9e612 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -27,13 +27,6 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const int k_RotationSegments = 32; - enum State - { - Inactive = 0, - Aiming = 1, - Moving = 3 - } - [SerializeField] GameObject m_BlinkVisualsPrefab; @@ -62,8 +55,6 @@ class Preferences GameObject m_BlinkVisualsGO; BlinkVisuals1 m_BlinkVisuals; - State m_State = State.Inactive; - bool m_AllowScaling = true; bool m_Scaling; float m_StartScale; @@ -83,6 +74,8 @@ class Preferences Vector3 m_CameraStartPosition; Quaternion m_LastRotationDiff; + bool m_BlinkMoving; + // Allow shared updater to check input values and consume controls LocomotionInput m_LocomotionInput; @@ -159,7 +152,7 @@ void Start() m_BlinkVisualsGO = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin); m_BlinkVisuals = m_BlinkVisualsGO.GetComponentInChildren(); - m_BlinkVisuals.enabled = false; + m_BlinkVisualsGO.SetActive(false); m_BlinkVisualsGO.transform.parent = rayOrigin; m_BlinkVisualsGO.transform.localPosition = Vector3.zero; m_BlinkVisualsGO.transform.localRotation = Quaternion.identity; @@ -175,11 +168,6 @@ void Start() viewerScaleObject.SetActive(false); } - void OnDisable() - { - m_State = State.Inactive; - } - void OnDestroy() { this.SetDefaultRayVisibility(rayOrigin, true); @@ -192,19 +180,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { m_LocomotionInput = (LocomotionInput)input; - if (m_State == State.Moving) - return; - - foreach (var linkedObject in linkedObjects) - { - var locomotionTool = (LocomotionTool)linkedObject; - if (locomotionTool == this) - continue; - - if (locomotionTool.m_State != State.Inactive) - return; - } - if (DoTwoHandedScaling(consumeControl)) return; @@ -328,36 +303,40 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) bool DoBlink(ConsumeControlDelegate consumeControl) { - if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) + var visuals = m_BlinkVisuals.gameObject; + if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.tooSteep) { - m_State = State.Aiming; this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); - m_BlinkVisuals.visible = true; + visuals.SetActive(true); consumeControl(m_LocomotionInput.blink); return true; } - if (m_State == State.Aiming && m_LocomotionInput.blink.wasJustReleased) + if (m_LocomotionInput.blink.wasJustReleased) + { + visuals.SetActive(false); + + if (m_BlinkVisuals.targetPosition.HasValue) + StartCoroutine(MoveTowardTarget(m_BlinkVisuals.targetPosition.Value)); + + return true; + } + + if (visuals.activeInHierarchy) + { + m_BlinkVisuals.extraSpeed = m_LocomotionInput.speed.value; + return true; + } + else { this.UnlockRay(rayOrigin, this); this.SetDefaultRayVisibility(rayOrigin, true); - - if (!m_BlinkVisuals.outOfMaxRange) - { - m_BlinkVisuals.visible = false; - StartCoroutine(MoveTowardTarget(m_BlinkVisuals.targetPosition)); - } - else - { - m_BlinkVisuals.enabled = false; - m_State = State.Inactive; - } } - return false; + return m_BlinkMoving; } bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) @@ -544,8 +523,12 @@ void CancelScale() IEnumerator MoveTowardTarget(Vector3 targetPosition) { - m_State = State.Moving; - targetPosition = new Vector3(targetPosition.x + (cameraRig.position.x - CameraUtils.GetMainCamera().transform.position.x), cameraRig.position.y, targetPosition.z + (cameraRig.position.z - CameraUtils.GetMainCamera().transform.position.z)); + m_BlinkMoving = true; + + var offset = cameraRig.position - CameraUtils.GetMainCamera().transform.position; + offset.y = 0; + offset += VRView.HeadHeight * Vector3.up * this.GetViewerScale(); + targetPosition += offset; const float kTargetDuration = 0.05f; var currentPosition = cameraRig.position; var currentDuration = 0f; @@ -558,7 +541,7 @@ IEnumerator MoveTowardTarget(Vector3 targetPosition) } cameraRig.position = targetPosition; - m_State = State.Inactive; + m_BlinkMoving = false; } public object OnSerializePreferences() diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab index a6f1ca8f3..80ddf6ec2 100644 --- a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab +++ b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab @@ -56,7 +56,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 0} + - {fileID: 2100000, guid: f2fba8b64c9117743a10be92c68c38a0, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -110,6 +110,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cf39114d78dfefc4dadd8131c757bd9b, type: 3} m_Name: m_EditorClassIdentifier: - m_ProjectileSpeed: 100 - m_TimeStep: 0.001 - m_MaxProjectileSteps: 20 + m_LineWidth: 1 + m_ProjectileSpeed: 250 + m_MaxProjectileSpeed: 750 + m_TimeStep: 0.00075 + m_MaxProjectileSteps: 200 + m_InvalidThreshold: -0.95 diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs index 5c212ddf0..f60c315a9 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs @@ -4,53 +4,91 @@ public class BlinkVisuals1 : MonoBehaviour, IUsesViewerScale, IRaycast { [SerializeField] - float m_ProjectileSpeed = 1f; + float m_LineWidth = 1f; [SerializeField] - float m_TimeStep = 0.01f; + Color m_ValidColor; [SerializeField] - int m_MaxProjectileSteps = 100; + Color m_InvalidColor; + + [SerializeField] + float m_ProjectileSpeed = 250f; + + [SerializeField] + float m_MaxProjectileSpeed = 500f; + + [SerializeField] + float m_TimeStep = 0.0075f; + + [SerializeField] + int m_MaxProjectileSteps = 200; + + [SerializeField] + float m_InvalidThreshold = -0.8f; VRLineRenderer m_LineRenderer; + Vector3[] m_Positions; - public Vector3 targetPosition { get; set; } + public Vector3? targetPosition { get; private set; } - public bool visible + public bool tooSteep { - set { enabled = value; } + get { return Vector3.Dot(transform.forward, Physics.gravity.normalized) < m_InvalidThreshold; } } - public bool outOfMaxRange { get; set; } + public float extraSpeed { private get; set; } void Start() { + m_Positions = new Vector3[m_MaxProjectileSteps]; + m_LineRenderer = GetComponent(); + m_LineRenderer.SetPositions(m_Positions); } void Update() { - GizmoModule.instance.DrawSphere(transform.position, 0.1f, Color.black); + targetPosition = null; + + if (tooSteep) + gameObject.SetActive(false); + + var viewerScale = this.GetViewerScale(); var lastPosition = transform.position; - var timeStep = m_TimeStep * this.GetViewerScale(); - var startVelocity = transform.forward * m_ProjectileSpeed * timeStep; + var timeStep = m_TimeStep * viewerScale; + var projectileSpeed = m_ProjectileSpeed + extraSpeed * (m_MaxProjectileSpeed - m_ProjectileSpeed); + var startVelocity = transform.forward * projectileSpeed * timeStep; var gravity = Physics.gravity * timeStep; for (var i = 0; i < m_MaxProjectileSteps; i++) { - var nextPosition = lastPosition + startVelocity; - startVelocity += gravity; - - var segment = nextPosition - lastPosition; - var ray = new Ray(lastPosition, segment); - RaycastHit hit; - GameObject go; - GizmoModule.instance.DrawRay(ray.origin, ray.direction, Color.white, segment.magnitude); - //if (this.Raycast(ray, out hit, out go, segment.magnitude)) - //{ - // break; - //} - - lastPosition = nextPosition; + if (targetPosition.HasValue) + { + m_Positions[i] = targetPosition.Value; + } + else + { + var nextPosition = lastPosition + startVelocity; + startVelocity += gravity; + + var segment = nextPosition - lastPosition; + var ray = new Ray(lastPosition, segment); + RaycastHit hit; + GameObject go; + m_Positions[i] = lastPosition; + if (this.Raycast(ray, out hit, out go, segment.magnitude)) + targetPosition = hit.point; + + lastPosition = nextPosition; + } } + + var lineWidth = m_LineWidth * viewerScale; + m_LineRenderer.SetWidth(lineWidth, lineWidth); + + var color = targetPosition.HasValue ? m_ValidColor : m_InvalidColor; + m_LineRenderer.SetColors(color, color); + + m_LineRenderer.SetPositions(m_Positions); } } From 262f84236f00a917a7be87a541c2b89a3c9e2977 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 25 Jul 2017 18:11:51 -0700 Subject: [PATCH 675/870] Add room scale visuals, arc motion indicators --- Tools/LocomotionTool/LocomotionInput.cs | 1 + Tools/LocomotionTool/LocomotionTool.cs | 11 +- .../Prefabs/BlinkVisuals1.prefab | 325 +++++++++++++++++- Tools/LocomotionTool/Scripts/BlinkVisuals1.cs | 74 +++- 4 files changed, 401 insertions(+), 10 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionInput.cs b/Tools/LocomotionTool/LocomotionInput.cs index df1a4ed93..ac7916223 100644 --- a/Tools/LocomotionTool/LocomotionInput.cs +++ b/Tools/LocomotionTool/LocomotionInput.cs @@ -17,5 +17,6 @@ public LocomotionInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @rotate { get { return (ButtonInputControl)this[7]; } } public AxisInputControl @horizontal { get { return (AxisInputControl)this[8]; } } public AxisInputControl @vertical { get { return (AxisInputControl)this[9]; } } + public AxisInputControl @altSpeed { get { return (AxisInputControl)this[10]; } } } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index ab8c9e612..c32f0e0d2 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -11,8 +12,9 @@ namespace UnityEditor.Experimental.EditorVR.Tools { - sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ISetDefaultRayVisibility, ICustomActionMap, - ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences + sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ISetDefaultRayVisibility, + ICustomActionMap, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences, + IUsesProxyType { const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 1f; @@ -137,6 +139,8 @@ public GameObject settingsMenuItemInstance } } + public Type proxyType { get; set; } + void Start() { if (this.IsSharedUpdater(this) && m_Preferences == null) @@ -327,7 +331,8 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (visuals.activeInHierarchy) { - m_BlinkVisuals.extraSpeed = m_LocomotionInput.speed.value; + m_BlinkVisuals.extraSpeed = proxyType == typeof(ViveProxy) ? + m_LocomotionInput.speed.value : m_LocomotionInput.altSpeed.value; return true; } else diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab index 80ddf6ec2..8fe75aa35 100644 --- a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab +++ b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab @@ -30,6 +30,157 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1491713701017202 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4940556684366548} + - component: {fileID: 33135772953623368} + - component: {fileID: 23214690956901648} + m_Layer: 0 + m_Name: BlinkRoomScale + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1667304039778116 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4400543621614174} + - component: {fileID: 33264623978311132} + - component: {fileID: 23824010235433554} + m_Layer: 0 + m_Name: Tube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1782646734945570 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4547096988000856} + - component: {fileID: 33653270552104436} + - component: {fileID: 23865348689344118} + m_Layer: 0 + m_Name: Ring + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1858194495447818 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4582830611293654} + m_Layer: 0 + m_Name: ArcLocator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!1 &1896404931618214 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4512748166471956} + - component: {fileID: 33277758808345278} + - component: {fileID: 23055203929627856} + m_Layer: 0 + m_Name: BlinkArcFollower + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &4400543621614174 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1667304039778116} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.4726565, y: 1.4726562, z: 1.4726562} + m_Children: [] + m_Father: {fileID: 4582830611293654} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4512748166471956 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1896404931618214} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -5.77} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4941602581352918} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4547096988000856 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1782646734945570} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.01, z: 0} + m_LocalScale: {x: 1.5466889, y: 0.9587882, z: 1.5466901} + m_Children: [] + m_Father: {fileID: 4582830611293654} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4582830611293654 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1858194495447818} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -5.77} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4547096988000856} + - {fileID: 4400543621614174} + - {fileID: 4940556684366548} + m_Father: {fileID: 4941602581352918} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4940556684366548 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491713701017202} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 2, y: 1, z: 2} + m_Children: [] + m_Father: {fileID: 4582830611293654} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4941602581352918 Transform: m_ObjectHideFlags: 1 @@ -39,10 +190,76 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_Children: + - {fileID: 4512748166471956} + - {fileID: 4582830611293654} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23055203929627856 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1896404931618214} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23214690956901648 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491713701017202} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 --- !u!23 &23320344508890766 MeshRenderer: m_ObjectHideFlags: 1 @@ -75,6 +292,70 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 +--- !u!23 &23824010235433554 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1667304039778116} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &23865348689344118 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1782646734945570} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_Materials: + - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 --- !u!33 &33051271591036750 MeshFilter: m_ObjectHideFlags: 1 @@ -82,6 +363,34 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1359949259200608} m_Mesh: {fileID: 0} +--- !u!33 &33135772953623368 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1491713701017202} + m_Mesh: {fileID: 4300002, guid: 9c7f75547e1d1834fa589397d40910eb, type: 3} +--- !u!33 &33264623978311132 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1667304039778116} + m_Mesh: {fileID: 4300000, guid: b7e4cfe9480488744a6b02777149c16e, type: 3} +--- !u!33 &33277758808345278 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1896404931618214} + m_Mesh: {fileID: 4300000, guid: 7d2f4d442df85a34d8d148946b187371, type: 3} +--- !u!33 &33653270552104436 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1782646734945570} + m_Mesh: {fileID: 4300000, guid: b20a7ed3b57b8d943aaf6d03ede191dc, type: 3} --- !u!114 &114017680955354874 MonoBehaviour: m_ObjectHideFlags: 1 @@ -98,7 +407,7 @@ MonoBehaviour: m_ColorEnd: {r: 1, g: 1, b: 1, a: 1} m_WidthStart: 1 m_WidthEnd: 1 - m_WorldSpaceData: 0 + m_WorldSpaceData: 1 --- !u!114 &114924831655948450 MonoBehaviour: m_ObjectHideFlags: 1 @@ -111,8 +420,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_LineWidth: 1 + m_ValidColor: {r: 0.12635165, g: 0.9044118, b: 0.26049998, a: 1} + m_InvalidColor: {r: 0.85294116, g: 0.21950692, b: 0.21950692, a: 1} m_ProjectileSpeed: 250 - m_MaxProjectileSpeed: 750 - m_TimeStep: 0.00075 - m_MaxProjectileSteps: 200 + m_MaxProjectileSpeed: 1000 + m_TimeStep: 0.002 + m_MaxProjectileSteps: 100 + m_SphereCount: 25 + m_Spherespeed: 2 m_InvalidThreshold: -0.95 + m_MotionIndicatorSphere: {fileID: 1896404931618214} + m_ArcLocator: {fileID: 1858194495447818} diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs index f60c315a9..696d07f14 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs @@ -1,4 +1,5 @@ using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; public class BlinkVisuals1 : MonoBehaviour, IUsesViewerScale, IRaycast @@ -24,11 +25,27 @@ public class BlinkVisuals1 : MonoBehaviour, IUsesViewerScale, IRaycast [SerializeField] int m_MaxProjectileSteps = 200; + [SerializeField] + int m_SphereCount = 25; + + [SerializeField] + float m_Spherespeed = 1f; + [SerializeField] float m_InvalidThreshold = -0.8f; + [SerializeField] + GameObject m_MotionIndicatorSphere; + + [SerializeField] + GameObject m_ArcLocator; + + float m_SpherePosition; VRLineRenderer m_LineRenderer; Vector3[] m_Positions; + Transform[] m_Spheres; + Material m_VisualsMaterial; + Vector3 m_SphereScale; public Vector3? targetPosition { get; private set; } @@ -39,12 +56,26 @@ public bool tooSteep public float extraSpeed { private get; set; } - void Start() + void Awake() { + m_SphereScale = m_MotionIndicatorSphere.transform.localScale; + m_VisualsMaterial = MaterialUtils.GetMaterialClone(m_MotionIndicatorSphere.GetComponent()); + m_Positions = new Vector3[m_MaxProjectileSteps]; m_LineRenderer = GetComponent(); - m_LineRenderer.SetPositions(m_Positions); + m_LineRenderer.SetPositions(m_Positions, true); + + m_Spheres = new Transform[m_SphereCount]; + for (var i = 0; i < m_SphereCount; i++) + { + m_Spheres[i] = Instantiate(m_MotionIndicatorSphere, transform, false).transform; + } + + foreach (var renderer in m_ArcLocator.GetComponentsInChildren(true)) + { + renderer.sharedMaterial = m_VisualsMaterial; + } } void Update() @@ -60,11 +91,14 @@ void Update() var projectileSpeed = m_ProjectileSpeed + extraSpeed * (m_MaxProjectileSpeed - m_ProjectileSpeed); var startVelocity = transform.forward * projectileSpeed * timeStep; var gravity = Physics.gravity * timeStep; + m_SpherePosition = (m_SpherePosition + Time.deltaTime * m_Spherespeed) % 1; for (var i = 0; i < m_MaxProjectileSteps; i++) { if (targetPosition.HasValue) { m_Positions[i] = targetPosition.Value; + if (i < m_SphereCount) + m_Spheres[i].gameObject.SetActive(false); } else { @@ -72,6 +106,20 @@ void Update() startVelocity += gravity; var segment = nextPosition - lastPosition; + + if (i < m_SphereCount) + { + var sphere = m_Spheres[i]; + if (i == 0) + sphere.localScale = m_SphereScale * m_SpherePosition; + + if (i == m_SphereCount - 1) + sphere.localScale = m_SphereScale * (1 - m_SpherePosition); + + m_Spheres[i].position = lastPosition + segment * m_SpherePosition; + m_Spheres[i].gameObject.SetActive(true); + } + var ray = new Ray(lastPosition, segment); RaycastHit hit; GameObject go; @@ -83,12 +131,34 @@ void Update() } } + if (targetPosition.HasValue) + { + m_ArcLocator.SetActive(true); + m_ArcLocator.transform.rotation = Quaternion.identity; + m_ArcLocator.transform.position = targetPosition.Value; + } + else + { + m_ArcLocator.SetActive(false); + } + var lineWidth = m_LineWidth * viewerScale; m_LineRenderer.SetWidth(lineWidth, lineWidth); var color = targetPosition.HasValue ? m_ValidColor : m_InvalidColor; + m_VisualsMaterial.SetColor("_TintColor", color); m_LineRenderer.SetColors(color, color); m_LineRenderer.SetPositions(m_Positions); } + + void OnDestroy() + { + ObjectUtils.Destroy(m_VisualsMaterial); + + foreach (var sphere in m_Spheres) + { + ObjectUtils.Destroy(sphere.gameObject); + } + } } From 08f03c24d7e809e5d7d4ad7e34724f75d96c4f22 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 25 Jul 2017 18:12:55 -0700 Subject: [PATCH 676/870] Rename BlinkVisuals1 to BlinkVisuals --- Tools/LocomotionTool/LocomotionTool.cs | 4 +- .../Prefabs/BlinkVisuals.prefab | 296 +++++------ .../Prefabs/BlinkVisuals.prefab.meta | 7 +- .../Prefabs/BlinkVisuals1.prefab | 433 ---------------- .../Prefabs/BlinkVisuals1.prefab.meta | 9 - Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 467 +++++------------- .../Scripts/BlinkVisuals.cs.meta | 6 +- Tools/LocomotionTool/Scripts/BlinkVisuals1.cs | 164 ------ .../Scripts/BlinkVisuals1.cs.meta | 12 - 9 files changed, 241 insertions(+), 1157 deletions(-) delete mode 100644 Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab delete mode 100644 Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab.meta delete mode 100644 Tools/LocomotionTool/Scripts/BlinkVisuals1.cs delete mode 100644 Tools/LocomotionTool/Scripts/BlinkVisuals1.cs.meta diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index c32f0e0d2..56d267b77 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -55,7 +55,7 @@ class Preferences ViewerScaleVisuals m_ViewerScaleVisuals; GameObject m_BlinkVisualsGO; - BlinkVisuals1 m_BlinkVisuals; + BlinkVisuals m_BlinkVisuals; bool m_AllowScaling = true; bool m_Scaling; @@ -155,7 +155,7 @@ void Start() } m_BlinkVisualsGO = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin); - m_BlinkVisuals = m_BlinkVisualsGO.GetComponentInChildren(); + m_BlinkVisuals = m_BlinkVisualsGO.GetComponentInChildren(); m_BlinkVisualsGO.SetActive(false); m_BlinkVisualsGO.transform.parent = rayOrigin; m_BlinkVisualsGO.transform.localPosition = Vector3.zero; diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab index f0d52fcbc..8fe75aa35 100644 --- a/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab +++ b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab @@ -9,103 +9,103 @@ Prefab: m_Modifications: [] m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1000010640839482} + m_RootGameObject: {fileID: 1359949259200608} m_IsPrefabParent: 1 ---- !u!1 &1000010640839482 +--- !u!1 &1359949259200608 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4000010985936092} - - component: {fileID: 33000012023554606} - - component: {fileID: 23000011686859876} - - component: {fileID: 114000013148279206} - - component: {fileID: 114000013178740676} + - component: {fileID: 4941602581352918} + - component: {fileID: 33051271591036750} + - component: {fileID: 23320344508890766} + - component: {fileID: 114924831655948450} + - component: {fileID: 114017680955354874} m_Layer: 0 - m_Name: BlinkVisuals + m_Name: BlinkVisuals1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000011965053254 +--- !u!1 &1491713701017202 GameObject: - m_ObjectHideFlags: 0 + m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4000012679276312} + - component: {fileID: 4940556684366548} + - component: {fileID: 33135772953623368} + - component: {fileID: 23214690956901648} m_Layer: 0 - m_Name: ArcLocator + m_Name: BlinkRoomScale m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000012269511344 +--- !u!1 &1667304039778116 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4000012691536342} - - component: {fileID: 33000012127541476} - - component: {fileID: 23000012792587668} + - component: {fileID: 4400543621614174} + - component: {fileID: 33264623978311132} + - component: {fileID: 23824010235433554} m_Layer: 0 - m_Name: BlinkRoomScale + m_Name: Tube m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013442150416 +--- !u!1 &1782646734945570 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4000010958140338} - - component: {fileID: 33000012633782850} - - component: {fileID: 23000011375832772} + - component: {fileID: 4547096988000856} + - component: {fileID: 33653270552104436} + - component: {fileID: 23865348689344118} m_Layer: 0 - m_Name: Tube + m_Name: Ring m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013523524200 +--- !u!1 &1858194495447818 GameObject: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4000010593314914} - - component: {fileID: 33000011726525582} - - component: {fileID: 23000012921752718} + - component: {fileID: 4582830611293654} m_Layer: 0 - m_Name: Ring + m_Name: ArcLocator m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000013707663658 + m_IsActive: 0 +--- !u!1 &1896404931618214 GameObject: - m_ObjectHideFlags: 1 + m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4000011536291192} - - component: {fileID: 33000013869760680} - - component: {fileID: 23000012923540092} + - component: {fileID: 4512748166471956} + - component: {fileID: 33277758808345278} + - component: {fileID: 23055203929627856} m_Layer: 0 m_Name: BlinkArcFollower m_TagString: Untagged @@ -113,95 +113,95 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!4 &4000010593314914 +--- !u!4 &4400543621614174 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013523524200} - m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0.01, z: 0} - m_LocalScale: {x: 1.5466889, y: 0.9587882, z: 1.5466901} - m_Children: [] - m_Father: {fileID: 4000012679276312} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000010958140338 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013442150416} + m_GameObject: {fileID: 1667304039778116} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.4726565, y: 1.4726562, z: 1.4726562} m_Children: [] - m_Father: {fileID: 4000012679276312} + m_Father: {fileID: 4582830611293654} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000010985936092 +--- !u!4 &4512748166471956 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010640839482} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_GameObject: {fileID: 1896404931618214} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -5.77} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4000012679276312} - m_Father: {fileID: 0} + m_Children: [] + m_Father: {fileID: 4941602581352918} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000011536291192 +--- !u!4 &4547096988000856 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013707663658} + m_GameObject: {fileID: 1782646734945570} m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalPosition: {x: 0, y: 0.01, z: 0} + m_LocalScale: {x: 1.5466889, y: 0.9587882, z: 1.5466901} m_Children: [] - m_Father: {fileID: 4000012679276312} - m_RootOrder: 3 + m_Father: {fileID: 4582830611293654} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012679276312 +--- !u!4 &4582830611293654 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011965053254} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_GameObject: {fileID: 1858194495447818} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -5.77} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 4000010593314914} - - {fileID: 4000010958140338} - - {fileID: 4000012691536342} - - {fileID: 4000011536291192} - m_Father: {fileID: 4000010985936092} - m_RootOrder: 0 + - {fileID: 4547096988000856} + - {fileID: 4400543621614174} + - {fileID: 4940556684366548} + m_Father: {fileID: 4941602581352918} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012691536342 +--- !u!4 &4940556684366548 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012269511344} + m_GameObject: {fileID: 1491713701017202} m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0, y: 0, z: 0} m_LocalScale: {x: 2, y: 1, z: 2} m_Children: [] - m_Father: {fileID: 4000012679276312} + m_Father: {fileID: 4582830611293654} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23000011375832772 +--- !u!4 &4941602581352918 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1359949259200608} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4512748166471956} + - {fileID: 4582830611293654} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23055203929627856 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013442150416} + m_GameObject: {fileID: 1896404931618214} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -228,12 +228,12 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000011686859876 +--- !u!23 &23214690956901648 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010640839482} + m_GameObject: {fileID: 1491713701017202} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -241,7 +241,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: f2fba8b64c9117743a10be92c68c38a0, type: 2} + - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -260,12 +260,12 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000012792587668 +--- !u!23 &23320344508890766 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012269511344} + m_GameObject: {fileID: 1359949259200608} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -273,7 +273,7 @@ MeshRenderer: m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} + - {fileID: 2100000, guid: f2fba8b64c9117743a10be92c68c38a0, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -292,12 +292,12 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000012921752718 +--- !u!23 &23824010235433554 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013523524200} + m_GameObject: {fileID: 1667304039778116} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -324,12 +324,12 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000012923540092 +--- !u!23 &23865348689344118 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013707663658} + m_GameObject: {fileID: 1782646734945570} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -356,130 +356,78 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!33 &33000011726525582 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013523524200} - m_Mesh: {fileID: 4300000, guid: b20a7ed3b57b8d943aaf6d03ede191dc, type: 3} ---- !u!33 &33000012023554606 +--- !u!33 &33051271591036750 MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010640839482} + m_GameObject: {fileID: 1359949259200608} m_Mesh: {fileID: 0} ---- !u!33 &33000012127541476 +--- !u!33 &33135772953623368 MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012269511344} + m_GameObject: {fileID: 1491713701017202} m_Mesh: {fileID: 4300002, guid: 9c7f75547e1d1834fa589397d40910eb, type: 3} ---- !u!33 &33000012633782850 +--- !u!33 &33264623978311132 MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013442150416} + m_GameObject: {fileID: 1667304039778116} m_Mesh: {fileID: 4300000, guid: b7e4cfe9480488744a6b02777149c16e, type: 3} ---- !u!33 &33000013869760680 +--- !u!33 &33277758808345278 MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013707663658} + m_GameObject: {fileID: 1896404931618214} m_Mesh: {fileID: 4300000, guid: 7d2f4d442df85a34d8d148946b187371, type: 3} ---- !u!114 &114000013148279206 +--- !u!33 &33653270552104436 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1782646734945570} + m_Mesh: {fileID: 4300000, guid: b20a7ed3b57b8d943aaf6d03ede191dc, type: 3} +--- !u!114 &114017680955354874 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010640839482} + m_GameObject: {fileID: 1359949259200608} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d580b86a6ae18014293c9b5059b2121b, type: 3} m_Name: m_EditorClassIdentifier: - m_Positions: - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - - {x: 0, y: 0, z: 0} - m_ColorStart: {r: 1, g: 0, b: 0, a: 1} - m_ColorEnd: {r: 1, g: 0, b: 0, a: 1} + m_Positions: [] + m_ColorStart: {r: 1, g: 1, b: 1, a: 1} + m_ColorEnd: {r: 1, g: 1, b: 1, a: 1} m_WidthStart: 1 m_WidthEnd: 1 m_WorldSpaceData: 1 ---- !u!114 &114000013178740676 +--- !u!114 &114924831655948450 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010640839482} + m_GameObject: {fileID: 1359949259200608} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cf1060efd014427c9d7b70e0492b81f, type: 3} + m_Script: {fileID: 11500000, guid: cf39114d78dfefc4dadd8131c757bd9b, type: 3} m_Name: m_EditorClassIdentifier: - m_InvalidLocationColor: {r: 1, g: 0.3882353, b: 0.3882353, a: 1} - m_LayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_LineSegmentCount: 48 - m_MaxArc: 0.85 - m_Radius: 0.1 - m_Range: 18 - m_ValidLocationColor: {r: 0.50855184, g: 1, b: 0.491, a: 1} - m_LineRenderer: {fileID: 114000013148279206} - m_LocatorRoot: {fileID: 4000012679276312} - m_MotionIndicatorSphere: {fileID: 1000013707663658} - m_MotionSphereCount: 10 - m_RingRenderer: {fileID: 23000012921752718} - m_RoomScaleRenderer: {fileID: 23000012792587668} - m_TubeRenderer: {fileID: 23000011375832772} + m_LineWidth: 1 + m_ValidColor: {r: 0.12635165, g: 0.9044118, b: 0.26049998, a: 1} + m_InvalidColor: {r: 0.85294116, g: 0.21950692, b: 0.21950692, a: 1} + m_ProjectileSpeed: 250 + m_MaxProjectileSpeed: 1000 + m_TimeStep: 0.002 + m_MaxProjectileSteps: 100 + m_SphereCount: 25 + m_Spherespeed: 2 + m_InvalidThreshold: -0.95 + m_MotionIndicatorSphere: {fileID: 1896404931618214} + m_ArcLocator: {fileID: 1858194495447818} diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab.meta b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab.meta index 62bd02029..fd2d3eada 100644 --- a/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab.meta +++ b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 1a8cb71dcb1ec2e4c8dc0b3158762bcb -timeCreated: 1465592402 -licenseType: Pro +guid: da60c6627f686ff46977b7ad8b694b91 +timeCreated: 1501023385 +licenseType: Free NativeFormatImporter: + mainObjectFileID: 100100000 userData: assetBundleName: assetBundleVariant: diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab deleted file mode 100644 index 8fe75aa35..000000000 --- a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab +++ /dev/null @@ -1,433 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1359949259200608} - m_IsPrefabParent: 1 ---- !u!1 &1359949259200608 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4941602581352918} - - component: {fileID: 33051271591036750} - - component: {fileID: 23320344508890766} - - component: {fileID: 114924831655948450} - - component: {fileID: 114017680955354874} - m_Layer: 0 - m_Name: BlinkVisuals1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1491713701017202 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4940556684366548} - - component: {fileID: 33135772953623368} - - component: {fileID: 23214690956901648} - m_Layer: 0 - m_Name: BlinkRoomScale - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1667304039778116 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4400543621614174} - - component: {fileID: 33264623978311132} - - component: {fileID: 23824010235433554} - m_Layer: 0 - m_Name: Tube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1782646734945570 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4547096988000856} - - component: {fileID: 33653270552104436} - - component: {fileID: 23865348689344118} - m_Layer: 0 - m_Name: Ring - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1858194495447818 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4582830611293654} - m_Layer: 0 - m_Name: ArcLocator - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1896404931618214 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4512748166471956} - - component: {fileID: 33277758808345278} - - component: {fileID: 23055203929627856} - m_Layer: 0 - m_Name: BlinkArcFollower - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &4400543621614174 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1667304039778116} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.4726565, y: 1.4726562, z: 1.4726562} - m_Children: [] - m_Father: {fileID: 4582830611293654} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4512748166471956 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1896404931618214} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -5.77} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4941602581352918} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4547096988000856 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1782646734945570} - m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0.01, z: 0} - m_LocalScale: {x: 1.5466889, y: 0.9587882, z: 1.5466901} - m_Children: [] - m_Father: {fileID: 4582830611293654} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4582830611293654 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1858194495447818} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -5.77} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4547096988000856} - - {fileID: 4400543621614174} - - {fileID: 4940556684366548} - m_Father: {fileID: 4941602581352918} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4940556684366548 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1491713701017202} - m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -0, y: 0, z: 0} - m_LocalScale: {x: 2, y: 1, z: 2} - m_Children: [] - m_Father: {fileID: 4582830611293654} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4941602581352918 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1359949259200608} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4512748166471956} - - {fileID: 4582830611293654} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23055203929627856 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1896404931618214} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23214690956901648 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1491713701017202} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23320344508890766 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1359949259200608} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: f2fba8b64c9117743a10be92c68c38a0, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23824010235433554 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1667304039778116} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23865348689344118 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1782646734945570} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 547c08b0f83c5f04c97bf50315d16065, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &33051271591036750 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1359949259200608} - m_Mesh: {fileID: 0} ---- !u!33 &33135772953623368 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1491713701017202} - m_Mesh: {fileID: 4300002, guid: 9c7f75547e1d1834fa589397d40910eb, type: 3} ---- !u!33 &33264623978311132 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1667304039778116} - m_Mesh: {fileID: 4300000, guid: b7e4cfe9480488744a6b02777149c16e, type: 3} ---- !u!33 &33277758808345278 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1896404931618214} - m_Mesh: {fileID: 4300000, guid: 7d2f4d442df85a34d8d148946b187371, type: 3} ---- !u!33 &33653270552104436 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1782646734945570} - m_Mesh: {fileID: 4300000, guid: b20a7ed3b57b8d943aaf6d03ede191dc, type: 3} ---- !u!114 &114017680955354874 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1359949259200608} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d580b86a6ae18014293c9b5059b2121b, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Positions: [] - m_ColorStart: {r: 1, g: 1, b: 1, a: 1} - m_ColorEnd: {r: 1, g: 1, b: 1, a: 1} - m_WidthStart: 1 - m_WidthEnd: 1 - m_WorldSpaceData: 1 ---- !u!114 &114924831655948450 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1359949259200608} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: cf39114d78dfefc4dadd8131c757bd9b, type: 3} - m_Name: - m_EditorClassIdentifier: - m_LineWidth: 1 - m_ValidColor: {r: 0.12635165, g: 0.9044118, b: 0.26049998, a: 1} - m_InvalidColor: {r: 0.85294116, g: 0.21950692, b: 0.21950692, a: 1} - m_ProjectileSpeed: 250 - m_MaxProjectileSpeed: 1000 - m_TimeStep: 0.002 - m_MaxProjectileSteps: 100 - m_SphereCount: 25 - m_Spherespeed: 2 - m_InvalidThreshold: -0.95 - m_MotionIndicatorSphere: {fileID: 1896404931618214} - m_ArcLocator: {fileID: 1858194495447818} diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab.meta b/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab.meta deleted file mode 100644 index fd2d3eada..000000000 --- a/Tools/LocomotionTool/Prefabs/BlinkVisuals1.prefab.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: da60c6627f686ff46977b7ad8b694b91 -timeCreated: 1501023385 -licenseType: Free -NativeFormatImporter: - mainObjectFileID: 100100000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index ae25c035b..5777bf3e4 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -1,411 +1,164 @@ -#if UNITY_EDITOR -using System.Collections; -using UnityEngine; +using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; -namespace UnityEditor.Experimental.EditorVR.Tools +public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast { - sealed class BlinkVisuals : MonoBehaviour, IUsesViewerScale - { - private enum State - { - Inactive = 0, - Active = 1, - TransitioningIn = 2, - TransitioningOut = 3 - } + [SerializeField] + float m_LineWidth = 1f; - [SerializeField] - private Color m_InvalidLocationColor; - [SerializeField] - private LayerMask m_LayerMask = -1; - [SerializeField] - private int m_LineSegmentCount = 10; - [SerializeField] - private float m_MaxArc = 0.85f; - [SerializeField] - private float m_Radius = 0.5f; - [SerializeField] - private float m_Range = 5f; - [SerializeField] - private Color m_ValidLocationColor; - - [SerializeField] - private VRLineRenderer m_LineRenderer; - [SerializeField] - private Transform m_LocatorRoot; - [SerializeField] - private GameObject m_MotionIndicatorSphere; - [SerializeField] - private int m_MotionSphereCount = 10; - [SerializeField] - private MeshRenderer m_RingRenderer; - [SerializeField] - [Tooltip("Room-Scale mesh that will be instantiated to visually represent the surrounding room-scale bounds.")] - private MeshRenderer m_RoomScaleRenderer; - [SerializeField] - private MeshRenderer m_TubeRenderer; - - private readonly Vector3 k_GroundOffset = Vector3.one * 0.01f; // Used to offset the room scale visuals to avoid z-fighting - private readonly string k_TintColor = "_TintColor"; - - private float m_CurveLengthEstimate; - private Vector3? m_DetachedWorldArcPosition; - private Vector3 m_FinalPosition; - private Vector3 m_LastPosition; - private Quaternion m_LastRotation; - private MeshRenderer m_LineRendererMeshRenderer; - private float m_MotionSphereOffset; - private Transform[] m_MotionSpheres; - private Vector3 m_MotionSphereOriginalScale; - private float m_MovementMagnitudeDelta; - private Vector3 m_MovementVelocityDelta; - private readonly Vector3[] m_BezierControlPoints = new Vector3[4]; // Cubic - private Transform m_RingTransform; - private Vector3 m_RingTransformOriginalScale; - private Vector3 m_RoomScaleLazyPosition; - private Transform m_RoomScaleTransform; - private Vector3[] m_SegmentPositions; - private State m_State = State.Inactive; - private Transform m_ToolPoint; - private Transform m_Transform; - private Transform m_TubeTransform; - private Vector3 m_TubeTransformHiddenScale; - private Vector3 m_TubeTransformOriginalScale; - private Material m_BlinkMaterial; - private Material m_MotionSpheresMaterial; - - public bool outOfMaxRange - { - get { return Mathf.Abs(pointerStrength) > m_MaxArc; } - } + [SerializeField] + Color m_ValidColor; - public Vector3 locatorPosition - { - get { return locatorRoot.position; } - } + [SerializeField] + Color m_InvalidColor; - public Transform locatorRoot - { - get { return m_LocatorRoot; } - } + [SerializeField] + float m_ProjectileSpeed = 250f; - public bool validTarget { get; private set; } - public bool showValidTargetIndicator { private get; set; } + [SerializeField] + float m_MaxProjectileSpeed = 500f; - private float pointerStrength - { - get { return (m_ToolPoint.forward.y + 1.0f) * 0.5f; } - } + [SerializeField] + float m_TimeStep = 0.0075f; - private bool visible - { - get { return m_State == State.TransitioningIn || m_State == State.Active; } - } + [SerializeField] + int m_MaxProjectileSteps = 200; - private void OnDestroy() - { - ObjectUtils.Destroy(m_BlinkMaterial); - ObjectUtils.Destroy(m_MotionSpheresMaterial); - } + [SerializeField] + int m_SphereCount = 25; - private void Awake() - { - m_LineRenderer = GetComponent(); - m_LineRendererMeshRenderer = m_LineRenderer.GetComponent(); - m_BlinkMaterial = MaterialUtils.GetMaterialClone(m_RoomScaleRenderer); + [SerializeField] + float m_Spherespeed = 1f; - foreach (var renderer in m_LocatorRoot.GetComponentsInChildren()) - renderer.sharedMaterial = m_BlinkMaterial; + [SerializeField] + float m_InvalidThreshold = -0.8f; - if (!m_ToolPoint) - m_ToolPoint = transform; + [SerializeField] + GameObject m_MotionIndicatorSphere; - m_RoomScaleTransform = m_RoomScaleRenderer.transform; - m_RoomScaleTransform.parent = m_LocatorRoot; - m_RoomScaleTransform.localPosition = Vector3.zero; - m_RoomScaleTransform.localRotation = Quaternion.identity; + [SerializeField] + GameObject m_ArcLocator; - m_Transform = transform; + float m_SpherePosition; + VRLineRenderer m_LineRenderer; + Vector3[] m_Positions; + Transform[] m_Spheres; + Material m_VisualsMaterial; + Vector3 m_SphereScale; - m_LineRenderer.SetVertexCount(m_LineSegmentCount); - m_LineRenderer.useWorldSpace = true; - - m_MotionSpheres = new Transform[m_MotionSphereCount]; - for (int i = 0; i < m_MotionSphereCount; i++) - { - var sphere = ((GameObject)Instantiate(m_MotionIndicatorSphere, m_ToolPoint.position, m_ToolPoint.rotation)).transform; - m_MotionSpheres[i] = sphere; - sphere.SetParent(m_Transform, false); - sphere.name = "motion-sphere-" + i; - sphere.gameObject.SetActive(false); - - var sphereRenderer = sphere.GetComponent(); - if (m_MotionSpheresMaterial == null) // Only one material clone is needed - m_MotionSpheresMaterial = MaterialUtils.GetMaterialClone(sphereRenderer); - - sphereRenderer.sharedMaterial = m_MotionSpheresMaterial; - } - m_MotionSphereOriginalScale = m_MotionSpheres[0].localScale; - m_CurveLengthEstimate = 1.0f; - m_MotionSphereOffset = 0.0f; + public Vector3? targetPosition { get; private set; } - m_RingTransform = m_RingRenderer.transform; - m_RingTransformOriginalScale = m_RingTransform.localScale; - m_TubeTransform = m_TubeRenderer.transform; - m_TubeTransformOriginalScale = m_TubeTransform.localScale; - m_TubeTransformHiddenScale = new Vector3(m_TubeTransform.localScale.x, 0.0001f, m_TubeTransform.localScale.z); - - ShowLine(false); - } - - void Update() - { - if (visible) - { - const float kMotionSphereSpeed = 0.125f; - m_MotionSphereOffset = (m_MotionSphereOffset + (Time.deltaTime * kMotionSphereSpeed)) % (1.0f / (float)m_MotionSphereCount); + public bool tooSteep + { + get { return Vector3.Dot(transform.forward, Physics.gravity.normalized) < m_InvalidThreshold; } + } - if (m_LastPosition != m_Transform.position || m_LastRotation != m_Transform.rotation) - { - DrawArc(); - m_LastPosition = m_Transform.position; - m_LastRotation = m_Transform.rotation; - } - DrawMotionSpheres(); + public float extraSpeed { private get; set; } - m_RoomScaleTransform.position = MathUtilsExt.SmoothDamp(m_RoomScaleLazyPosition, m_LocatorRoot.position, - ref m_MovementVelocityDelta, 0.2625f, 100f * this.GetViewerScale(), Time.deltaTime); + void Awake() + { + m_SphereScale = m_MotionIndicatorSphere.transform.localScale; + m_VisualsMaterial = MaterialUtils.GetMaterialClone(m_MotionIndicatorSphere.GetComponent()); - // Since the room scale visuals are parented under the locater root it is necessary to cache the position each frame before the locater root gets updated - m_RoomScaleLazyPosition = m_RoomScaleTransform.position; - m_MovementMagnitudeDelta = (m_RoomScaleTransform.position - m_LocatorRoot.position).magnitude; + m_Positions = new Vector3[m_MaxProjectileSteps]; - const float kTubeHiddenDistanceThreshold = 6f; - m_TubeTransform.localScale = Vector3.Lerp(m_TubeTransformOriginalScale, m_TubeTransformHiddenScale, m_MovementMagnitudeDelta / kTubeHiddenDistanceThreshold); - } - else if (!outOfMaxRange && m_State == State.Inactive) - { - ShowVisuals(); - } - } + m_LineRenderer = GetComponent(); + m_LineRenderer.SetPositions(m_Positions, true); - public void ShowVisuals() + m_Spheres = new Transform[m_SphereCount]; + for (var i = 0; i < m_SphereCount; i++) { - enabled = true; - if (m_State == State.Inactive || m_State == State.TransitioningOut) - { - m_RoomScaleLazyPosition = m_RoomScaleTransform.position; - - for (int i = 0; i < m_MotionSphereCount; ++i) - m_MotionSpheres[i].gameObject.SetActive(true); - - StartCoroutine(AnimateShowVisuals()); - } + m_Spheres[i] = Instantiate(m_MotionIndicatorSphere, transform, false).transform; } - public void HideVisuals() + foreach (var renderer in m_ArcLocator.GetComponentsInChildren(true)) { - if (m_State != State.Inactive) - { - StopAllCoroutines(); - StartCoroutine(AnimateHideVisuals()); - } - enabled = false; + renderer.sharedMaterial = m_VisualsMaterial; } + } - private IEnumerator AnimateShowVisuals() - { - m_State = State.TransitioningIn; - m_RoomScaleTransform.position = m_FinalPosition + k_GroundOffset; - ShowLine(); - - for (int i = 0; i < m_MotionSphereCount; ++i) - { - m_MotionSpheres[i].localScale = m_MotionSphereOriginalScale; - } - - const float kTargetScale = 1f; - - float scale = 0f; - float tubeScale = m_TubeTransform.localScale.x; - float smoothVelocity = 0f; - - const float kSmoothTime = 0.75f; - var currentDuration = 0f; - var viewerScale = this.GetViewerScale(); - while (m_State == State.TransitioningIn && currentDuration < kSmoothTime) - { - scale = MathUtilsExt.SmoothDamp(scale, kTargetScale, ref smoothVelocity, kSmoothTime, Mathf.Infinity, Time.deltaTime); - var adjustedScale = scale * viewerScale; - currentDuration += Time.deltaTime; - m_TubeTransform.localScale = new Vector3(tubeScale, scale, tubeScale); - m_LocatorRoot.localScale = Vector3.one * scale; - m_LineRenderer.SetWidth(adjustedScale, adjustedScale); - yield return null; - } + void Update() + { + targetPosition = null; - m_State = State.Active; - } + if (tooSteep) + gameObject.SetActive(false); - private IEnumerator AnimateHideVisuals() + var viewerScale = this.GetViewerScale(); + var lastPosition = transform.position; + var timeStep = m_TimeStep * viewerScale; + var projectileSpeed = m_ProjectileSpeed + extraSpeed * (m_MaxProjectileSpeed - m_ProjectileSpeed); + var startVelocity = transform.forward * projectileSpeed * timeStep; + var gravity = Physics.gravity * timeStep; + m_SpherePosition = (m_SpherePosition + Time.deltaTime * m_Spherespeed) % 1; + for (var i = 0; i < m_MaxProjectileSteps; i++) { - m_State = State.TransitioningOut; - m_DetachedWorldArcPosition = m_LocatorRoot.position; - - const float kTargetScale = 0f; - - float smoothVelocity = 0f; - float scale = 1f; - float tubeScale = m_TubeTransform.localScale.x; - const float kSmoothTime = 0.75f; - var currentDuration = 0f; - var viewerScale = this.GetViewerScale(); - while (m_State == State.TransitioningOut && currentDuration < kSmoothTime) + if (targetPosition.HasValue) { - scale = MathUtilsExt.SmoothDamp(scale, kTargetScale, ref smoothVelocity, kSmoothTime, Mathf.Infinity, Time.deltaTime); - var adjustedScale = scale * viewerScale; - currentDuration += Time.deltaTime; - SetColors(Color.Lerp(!showValidTargetIndicator || validTarget ? m_ValidLocationColor : m_InvalidLocationColor, Color.clear, 1f - scale)); - m_TubeTransform.localScale = new Vector3(tubeScale, scale, tubeScale); - m_LineRenderer.SetWidth(scale * adjustedScale, scale * adjustedScale); - m_RingTransform.localScale = Vector3.Lerp(m_RingTransform.localScale, m_RingTransformOriginalScale, scale); - yield return null; + m_Positions[i] = targetPosition.Value; + if (i < m_SphereCount) + m_Spheres[i].gameObject.SetActive(false); } - - m_DetachedWorldArcPosition = null; - - // set value if no additional transition has begun - if (m_State == State.TransitioningOut) + else { - // Must set the line renderer to zero to turn it completely off - m_LineRenderer.SetWidth(kTargetScale, kTargetScale); - m_State = State.Inactive; + var nextPosition = lastPosition + startVelocity; + startVelocity += gravity; - ShowLine(false); + var segment = nextPosition - lastPosition; - for (int i = 0; i < m_MotionSphereCount; ++i) - m_MotionSpheres[i].gameObject.SetActive(false); - } - } - - public void DrawArc() - { - m_LocatorRoot.rotation = Quaternion.identity; - - // prevent rendering line when pointing to high or low - if (outOfMaxRange) - { - validTarget = false; - if (m_State != State.Inactive) + if (i < m_SphereCount) { - StopAllCoroutines(); - StartCoroutine(AnimateHideVisuals()); - } - - return; - } - - // start point - m_BezierControlPoints[0] = m_ToolPoint.position; - - // first handle -- determines how steep the first part will be - m_BezierControlPoints[1] = m_ToolPoint.position + m_ToolPoint.forward * pointerStrength * m_Range * this.GetViewerScale(); + var sphere = m_Spheres[i]; + if (i == 0) + sphere.localScale = m_SphereScale * m_SpherePosition; - const float kArcEndHeight = 0f; - m_FinalPosition = new Vector3(m_BezierControlPoints[1].x, kArcEndHeight, m_BezierControlPoints[1].z); + if (i == m_SphereCount - 1) + sphere.localScale = m_SphereScale * (1 - m_SpherePosition); - // end point - m_BezierControlPoints[3] = m_FinalPosition; - - // second handle -- determines how steep the intersection with the ground will be - m_BezierControlPoints[2] = m_FinalPosition; - - // set the position of the locater - m_LocatorRoot.position = m_DetachedWorldArcPosition == null ? m_FinalPosition + k_GroundOffset : (Vector3)m_DetachedWorldArcPosition; - - validTarget = false; - - var colliders = Physics.OverlapSphere(m_FinalPosition, m_Radius, m_LayerMask.value); - validTarget = colliders != null && colliders.Length > 0; - - SetColors(!showValidTargetIndicator || validTarget ? m_ValidLocationColor : m_InvalidLocationColor); + m_Spheres[i].position = lastPosition + segment * m_SpherePosition; + m_Spheres[i].gameObject.SetActive(true); + } - // calculate and send points to the line renderer - m_SegmentPositions = new Vector3[m_LineSegmentCount]; + var ray = new Ray(lastPosition, segment); + RaycastHit hit; + GameObject go; + m_Positions[i] = lastPosition; + if (this.Raycast(ray, out hit, out go, segment.magnitude)) + targetPosition = hit.point; - for (int i = 0; i < m_LineSegmentCount; i++) - { - var t = i / (float)Mathf.Max((m_LineSegmentCount - 1), 1); - var q = MathUtilsExt.CalculateCubicBezierPoint(t, m_BezierControlPoints); - m_SegmentPositions[i] = q; + lastPosition = nextPosition; } - m_LineRenderer.SetPositions(m_SegmentPositions); - - // The curve length will be somewhere between a straight line between the points - // and a path that directly follows the control points. So we estimate this by just averaging the two. - m_CurveLengthEstimate = ((m_BezierControlPoints[3] - m_BezierControlPoints[0]).magnitude + ((m_BezierControlPoints[1] - m_BezierControlPoints[0]).magnitude + (m_BezierControlPoints[1] - m_BezierControlPoints[2]).magnitude)) * 0.5f; } - public void DrawMotionSpheres() + if (targetPosition.HasValue) { - var viewerScale = this.GetViewerScale(); - // We estimate how much we should correct our curve time by with a guess step - for (int i = 0; i < m_MotionSphereCount; ++i) - { - var t = i / (float)m_MotionSphereCount + m_MotionSphereOffset; - var motionSphere = m_MotionSpheres[i]; - motionSphere.position = MathUtilsExt.CalculateCubicBezierPoint(t, m_BezierControlPoints); - var motionSphereScale = visible ? (validTarget ? m_MotionSphereOriginalScale.x : 0.05f) : 0f; - var smoothVelocity = 0f; - const float scaleCoefficient = 4f; - - motionSphereScale = MathUtilsExt.SmoothDamp(motionSphere.localScale.x, motionSphereScale, - ref smoothVelocity, 3f, Mathf.Infinity, Time.deltaTime) - * Mathf.Min((m_Transform.position - motionSphere.position).magnitude - * scaleCoefficient / viewerScale, 1f); - - motionSphere.localScale = Vector3.one * motionSphereScale; - motionSphere.localRotation = Quaternion.identity; - - // If we're not at the starting point, we apply a correction factor - if (t > 0.0f) - { - // We have how long we *think* the curve should be - var lengthEstimate = m_CurveLengthEstimate * t; - - // We compare that to how long our distance actually is - var correctionFactor = lengthEstimate / (motionSphere.position - m_BezierControlPoints[0]).magnitude; - - // We then scale our time value by this correction factor - var correctedTime = Mathf.Clamp01(t * correctionFactor); - motionSphere.position = MathUtilsExt.CalculateCubicBezierPoint(correctedTime, m_BezierControlPoints); - } - } + m_ArcLocator.SetActive(true); + m_ArcLocator.transform.rotation = Quaternion.identity; + m_ArcLocator.transform.position = targetPosition.Value; } - - public void ShowLine(bool show = true) + else { - m_LocatorRoot.gameObject.SetActive(show); - m_LineRendererMeshRenderer.enabled = show; + m_ArcLocator.SetActive(false); + } - if (!show) - { - m_RoomScaleRenderer.sharedMaterial.SetColor(k_TintColor, Color.clear); + var lineWidth = m_LineWidth * viewerScale; + m_LineRenderer.SetWidth(lineWidth, lineWidth); - for (int i = 0; i < m_MotionSphereCount; ++i) - m_MotionSpheres[i].localScale = Vector3.zero; - } - } + var color = targetPosition.HasValue ? m_ValidColor : m_InvalidColor; + m_VisualsMaterial.SetColor("_TintColor", color); + m_LineRenderer.SetColors(color, color); - void SetColors(Color color) - { - m_LineRenderer.SetColors(color, color); + m_LineRenderer.SetPositions(m_Positions); + } - // Set the color for all object sharing the blink material - m_BlinkMaterial.SetColor(k_TintColor, color); - m_MotionSpheresMaterial.SetColor(k_TintColor, color); + void OnDestroy() + { + ObjectUtils.Destroy(m_VisualsMaterial); + + foreach (var sphere in m_Spheres) + { + ObjectUtils.Destroy(sphere.gameObject); } } } -#endif \ No newline at end of file diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs.meta b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs.meta index 80ea971af..7ada0e6ca 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs.meta +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0cf1060efd014427c9d7b70e0492b81f -timeCreated: 1466808256 -licenseType: Pro +guid: cf39114d78dfefc4dadd8131c757bd9b +timeCreated: 1501020498 +licenseType: Free MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs deleted file mode 100644 index 696d07f14..000000000 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs +++ /dev/null @@ -1,164 +0,0 @@ -using UnityEditor.Experimental.EditorVR; -using UnityEditor.Experimental.EditorVR.Utilities; -using UnityEngine; - -public class BlinkVisuals1 : MonoBehaviour, IUsesViewerScale, IRaycast -{ - [SerializeField] - float m_LineWidth = 1f; - - [SerializeField] - Color m_ValidColor; - - [SerializeField] - Color m_InvalidColor; - - [SerializeField] - float m_ProjectileSpeed = 250f; - - [SerializeField] - float m_MaxProjectileSpeed = 500f; - - [SerializeField] - float m_TimeStep = 0.0075f; - - [SerializeField] - int m_MaxProjectileSteps = 200; - - [SerializeField] - int m_SphereCount = 25; - - [SerializeField] - float m_Spherespeed = 1f; - - [SerializeField] - float m_InvalidThreshold = -0.8f; - - [SerializeField] - GameObject m_MotionIndicatorSphere; - - [SerializeField] - GameObject m_ArcLocator; - - float m_SpherePosition; - VRLineRenderer m_LineRenderer; - Vector3[] m_Positions; - Transform[] m_Spheres; - Material m_VisualsMaterial; - Vector3 m_SphereScale; - - public Vector3? targetPosition { get; private set; } - - public bool tooSteep - { - get { return Vector3.Dot(transform.forward, Physics.gravity.normalized) < m_InvalidThreshold; } - } - - public float extraSpeed { private get; set; } - - void Awake() - { - m_SphereScale = m_MotionIndicatorSphere.transform.localScale; - m_VisualsMaterial = MaterialUtils.GetMaterialClone(m_MotionIndicatorSphere.GetComponent()); - - m_Positions = new Vector3[m_MaxProjectileSteps]; - - m_LineRenderer = GetComponent(); - m_LineRenderer.SetPositions(m_Positions, true); - - m_Spheres = new Transform[m_SphereCount]; - for (var i = 0; i < m_SphereCount; i++) - { - m_Spheres[i] = Instantiate(m_MotionIndicatorSphere, transform, false).transform; - } - - foreach (var renderer in m_ArcLocator.GetComponentsInChildren(true)) - { - renderer.sharedMaterial = m_VisualsMaterial; - } - } - - void Update() - { - targetPosition = null; - - if (tooSteep) - gameObject.SetActive(false); - - var viewerScale = this.GetViewerScale(); - var lastPosition = transform.position; - var timeStep = m_TimeStep * viewerScale; - var projectileSpeed = m_ProjectileSpeed + extraSpeed * (m_MaxProjectileSpeed - m_ProjectileSpeed); - var startVelocity = transform.forward * projectileSpeed * timeStep; - var gravity = Physics.gravity * timeStep; - m_SpherePosition = (m_SpherePosition + Time.deltaTime * m_Spherespeed) % 1; - for (var i = 0; i < m_MaxProjectileSteps; i++) - { - if (targetPosition.HasValue) - { - m_Positions[i] = targetPosition.Value; - if (i < m_SphereCount) - m_Spheres[i].gameObject.SetActive(false); - } - else - { - var nextPosition = lastPosition + startVelocity; - startVelocity += gravity; - - var segment = nextPosition - lastPosition; - - if (i < m_SphereCount) - { - var sphere = m_Spheres[i]; - if (i == 0) - sphere.localScale = m_SphereScale * m_SpherePosition; - - if (i == m_SphereCount - 1) - sphere.localScale = m_SphereScale * (1 - m_SpherePosition); - - m_Spheres[i].position = lastPosition + segment * m_SpherePosition; - m_Spheres[i].gameObject.SetActive(true); - } - - var ray = new Ray(lastPosition, segment); - RaycastHit hit; - GameObject go; - m_Positions[i] = lastPosition; - if (this.Raycast(ray, out hit, out go, segment.magnitude)) - targetPosition = hit.point; - - lastPosition = nextPosition; - } - } - - if (targetPosition.HasValue) - { - m_ArcLocator.SetActive(true); - m_ArcLocator.transform.rotation = Quaternion.identity; - m_ArcLocator.transform.position = targetPosition.Value; - } - else - { - m_ArcLocator.SetActive(false); - } - - var lineWidth = m_LineWidth * viewerScale; - m_LineRenderer.SetWidth(lineWidth, lineWidth); - - var color = targetPosition.HasValue ? m_ValidColor : m_InvalidColor; - m_VisualsMaterial.SetColor("_TintColor", color); - m_LineRenderer.SetColors(color, color); - - m_LineRenderer.SetPositions(m_Positions); - } - - void OnDestroy() - { - ObjectUtils.Destroy(m_VisualsMaterial); - - foreach (var sphere in m_Spheres) - { - ObjectUtils.Destroy(sphere.gameObject); - } - } -} diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs.meta b/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs.meta deleted file mode 100644 index 7ada0e6ca..000000000 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals1.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: cf39114d78dfefc4dadd8131c757bd9b -timeCreated: 1501020498 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 9b50b958d3917242d95fcbde90b8e84545e64ee5 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 25 Jul 2017 18:19:45 -0700 Subject: [PATCH 677/870] Leave visuals active when arc is too steep --- Tools/LocomotionTool/LocomotionTool.cs | 2 +- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 56d267b77..d7523c9d7 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -308,7 +308,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) bool DoBlink(ConsumeControlDelegate consumeControl) { var visuals = m_BlinkVisuals.gameObject; - if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.tooSteep) + if (m_LocomotionInput.blink.wasJustPressed) { this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index 5777bf3e4..b585af7b5 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -49,11 +49,6 @@ public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast public Vector3? targetPosition { get; private set; } - public bool tooSteep - { - get { return Vector3.Dot(transform.forward, Physics.gravity.normalized) < m_InvalidThreshold; } - } - public float extraSpeed { private get; set; } void Awake() @@ -82,9 +77,6 @@ void Update() { targetPosition = null; - if (tooSteep) - gameObject.SetActive(false); - var viewerScale = this.GetViewerScale(); var lastPosition = transform.position; var timeStep = m_TimeStep * viewerScale; @@ -142,6 +134,9 @@ void Update() m_ArcLocator.SetActive(false); } + if (Vector3.Dot(transform.forward, Physics.gravity.normalized) < m_InvalidThreshold) + targetPosition = null; + var lineWidth = m_LineWidth * viewerScale; m_LineRenderer.SetWidth(lineWidth, lineWidth); From 8fe97e752cf60878344bc977a45b35d8ed5afa1a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 18:27:54 -0700 Subject: [PATCH 678/870] Refactor PinnedToolsMenu internal spatial scrolling functionality to support new module implemenation; simplify some surrounding logic; add new module to EVR --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 35 ++++++++++++++----------- Scripts/Core/EditorVR.cs | 1 + 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 716340efe..2154e6fe9 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Core; -using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -38,9 +37,6 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac [SerializeField] HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection, but not passing the trigger threshold - [SerializeField] - HapticPulse m_ScrollingPulse; // The pulse performed when spatially scrolling - [SerializeField] HapticPulse m_HidingPulse; // The pulse performed when ending a spatial selection @@ -52,6 +48,11 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac Transform m_RayOrigin; Transform m_AlternateMenuOrigin; IPinnedToolButton m_MainMenuButton; + float? continuedInputConsumptionStartTime; + Vector3 m_SpatialScrollStartPosition; + Vector3 previousWorldPosition; + float allowToolToggleBeforeThisTime; + SpatialScrollModule.SpatialScrollData m_SpatialScrollData; public Transform menuOrigin { get; set; } List buttons { get { return m_PinnedToolsMenuUI.buttons; } } @@ -202,11 +203,6 @@ public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) m_PinnedToolsMenuUI.AddButton(button, buttonTransform); } - float? continuedInputConsumptionStartTime; - Vector3 m_SpatialScrollStartPosition; - Vector3? spatialDirection = null; - Vector3 previousWorldPosition; - float allowToolToggleBeforeThisTime; public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount @@ -274,23 +270,30 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (buttonCount <= k_ActiveToolOrderPosition + 1) { - spatialDirection = null; + this.EndSpatialScroll(this); return; } } // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.25f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); + m_SpatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.25f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); + var normalizedRepeatingPosition = m_SpatialScrollData.normalizedLoopingPosition; + //var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.25f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { if (!m_PinnedToolsMenuUI.allButtonsVisible) { + m_PinnedToolsMenuUI.spatialDragDistance = m_SpatialScrollData.dragDistance; this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Scrolling); m_PinnedToolsMenuUI.allButtonsVisible = true; } + else if (m_SpatialScrollData.spatialDirection != null)// && m_PinnedToolsMenuUI.startingDragOrigin != m_SpatialScrollData.spatialDirection) + { + m_PinnedToolsMenuUI.startingDragOrigin = m_SpatialScrollData.spatialDirection; + } - m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int) (buttonCount * normalizedRepeatingPosition) + 1); + m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); consumeControl(pinnedToolInput.show); consumeControl(pinnedToolInput.select); } @@ -299,12 +302,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { const float kAdditionalConsumptionDuration = 0.25f; continuedInputConsumptionStartTime = Time.realtimeSinceStartup + kAdditionalConsumptionDuration; - if (spatialDirection != null) + if (m_SpatialScrollData.passedMinDragActivationThreshold) { Debug.LogWarning("PinnedToolButton was just released"); m_PinnedToolsMenuUI.SelectHighlightedButton(); //m_PinnedToolsMenuUI.spatialDragDistance = 0f; // Triggers the display of the directional hint arrows - spatialDirection = null; consumeControl(pinnedToolInput.select); this.Pulse(node, m_HidingPulse); } @@ -318,14 +320,14 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.SetDefaultRayVisibility(rayOrigin, true); this.UnlockRay(rayOrigin, this); this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); + this.EndSpatialScroll(this); // Free the spatial scroll data owned by this object } // cache current position for delta comparison on next frame for fine tuned scrolling with low velocity previousWorldPosition = transform.position; } - // TODO ADD SUPPORT FOR VIEWERSCALE SIZE CHANGES - // TODO refact into ISpatialScrolling interface; allow axis locking/selection/isolation + /* float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) { var normalizedLoopingPosition = 0f; @@ -374,6 +376,7 @@ float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, return normalizedLoopingPosition; } + */ void OnButtonClick() { diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index c7d4a55a4..ee72755da 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -206,6 +206,7 @@ void Awake() AddModule(); AddModule(); + AddModule(); viewer.AddPlayerModel(); From 2e91cb231d904fb6531854a44739c496a5652621 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 18:29:58 -0700 Subject: [PATCH 679/870] Add support for multiple spatial scroll callers, each with their own paired scroll data in SpatialScrollModule --- .../SpatialScrollModule.cs | 44 +++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index 02abc488d..3eeafaa84 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; using UnityEngine; @@ -9,7 +10,8 @@ public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, ICont [SerializeField] HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection - SpatialScrollData m_spatialScrollData; // Class housing the data representing a spatial scroll for a given caller + // Collection housing caller object & ScrollData pairs + Dictionary m_ScrollData; public class SpatialScrollData { @@ -48,16 +50,33 @@ public void UpdateExistingScrollData(Vector3 newPosition) } } + void Awake() + { + m_ScrollData = new Dictionary(); + } + internal SpatialScrollData PerformScroll(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) { // Continue processing of spatial scrolling for a given caller, // Or create new instance of scroll data for new callers. (Initial structure for support of simultaneous callers) - if (m_spatialScrollData == null || m_spatialScrollData.caller != caller) - m_spatialScrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount); - else - m_spatialScrollData.UpdateExistingScrollData(currentPosition); + SpatialScrollData spatialScrollData = null; + foreach (var kvp in m_ScrollData) + { + if (kvp.Key == caller) + { + spatialScrollData = kvp.Value; + spatialScrollData.UpdateExistingScrollData(currentPosition); + break; + } + } - return processSpatialScrolling(m_spatialScrollData); + if (spatialScrollData == null) + { + spatialScrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount); + m_ScrollData.Add(caller, spatialScrollData); + } + + return processSpatialScrolling(spatialScrollData); } SpatialScrollData processSpatialScrolling(SpatialScrollData scrollData) @@ -87,8 +106,17 @@ SpatialScrollData processSpatialScrolling(SpatialScrollData scrollData) internal void EndScroll(object caller) { - if (m_spatialScrollData != null && m_spatialScrollData.caller == caller) - m_spatialScrollData = null; + if (m_ScrollData.Count == 0) + return; + + foreach (var kvp in m_ScrollData) + { + if (kvp.Key == caller) + { + m_ScrollData.Remove(caller); + return; + } + } } } } From 09f1de88e0ba8c10f0a0e4a846eb5bef1d42f5de Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 18:40:34 -0700 Subject: [PATCH 680/870] Remove unused function from ISelectTool --- .../Interfaces/FunctionalityInjection/ISelectTool.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs b/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs index f8ddccbfb..984ae2169 100644 --- a/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs +++ b/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs @@ -36,16 +36,6 @@ public static bool IsToolActive(this ISelectTool obj, Transform rayOrigin, Type { return isToolActive(rayOrigin, type); } - - /* - /// - /// Returns true if the active tool on the given ray origin is of the given type - /// Transform: Ray origin to check - /// Type: Type with which to compare - /// Returns whether the active tool is of the same type - /// - Func isToolActive { set; } - */ } } #endif From 0187473d55e6d6781383bba158f263d3fca2e4e1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 18:46:12 -0700 Subject: [PATCH 681/870] Rename PinnedToolButton material used for UI content --- .../PinnedToolActionButtonUIContent.mat | 157 ------------------ .../Materials/PinnedToolButtonUIContent.mat | 85 ++++++++++ ...eta => PinnedToolButtonUIContent.mat.meta} | 0 3 files changed, 85 insertions(+), 157 deletions(-) delete mode 100644 Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat create mode 100644 Prefabs/UI/Materials/PinnedToolButtonUIContent.mat rename Prefabs/UI/Materials/{PinnedToolActionButtonUIContent.mat.meta => PinnedToolButtonUIContent.mat.meta} (100%) diff --git a/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat b/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat deleted file mode 100644 index b0a7f4598..000000000 --- a/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat +++ /dev/null @@ -1,157 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: PinnedToolActionButtonUIContent - m_Shader: {fileID: 10760, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _ALPHABLEND_ON _EMISSION - m_LightmapFlags: 1 - m_CustomRenderQueue: 9504 - stringTagMap: {} - m_SavedProperties: - serializedVersion: 2 - m_TexEnvs: - - first: - name: _BumpMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailAlbedoMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailMask - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailNormalMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _EmissionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _MainTex - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _MetallicGlossMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _OcclusionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _ParallaxMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - first: - name: PixelSnap - second: 0 - - first: - name: _BumpScale - second: 1 - - first: - name: _ColorMask - second: 15 - - first: - name: _Cutoff - second: 0.5 - - first: - name: _DetailNormalMapScale - second: 1 - - first: - name: _DstBlend - second: 10 - - first: - name: _GlossMapScale - second: 1 - - first: - name: _Glossiness - second: 0.5 - - first: - name: _GlossyReflections - second: 1 - - first: - name: _InvFade - second: 1 - - first: - name: _Metallic - second: 0 - - first: - name: _Mode - second: 2 - - first: - name: _OcclusionStrength - second: 1 - - first: - name: _Parallax - second: 0.02 - - first: - name: _SmoothnessTextureChannel - second: 0 - - first: - name: _SpecularHighlights - second: 1 - - first: - name: _SrcBlend - second: 5 - - first: - name: _Stencil - second: 0 - - first: - name: _StencilComp - second: 8 - - first: - name: _StencilOp - second: 0 - - first: - name: _StencilReadMask - second: 255 - - first: - name: _StencilWriteMask - second: 255 - - first: - name: _UVSec - second: 0 - - first: - name: _UseUIAlphaClip - second: 0 - - first: - name: _ZWrite - second: 0 - m_Colors: - - first: - name: _Color - second: {r: 1, g: 1, b: 1, a: 1} - - first: - name: _EmissionColor - second: {r: 0, g: 0, b: 0, a: 1} - - first: - name: _TintColor - second: {r: 1, g: 1, b: 1, a: 1} diff --git a/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat b/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat new file mode 100644 index 000000000..36ac44b10 --- /dev/null +++ b/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat @@ -0,0 +1,85 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: PinnedToolButtonUIContent + m_Shader: {fileID: 10760, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHABLEND_ON _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: 9504 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _BumpScale: 1 + - _ColorMask: 15 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _InvFade: 1 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _Stencil: 0 + - _StencilComp: 8 + - _StencilOp: 0 + - _StencilReadMask: 255 + - _StencilWriteMask: 255 + - _UVSec: 0 + - _UseUIAlphaClip: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _TintColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat.meta b/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat.meta similarity index 100% rename from Prefabs/UI/Materials/PinnedToolActionButtonUIContent.mat.meta rename to Prefabs/UI/Materials/PinnedToolButtonUIContent.mat.meta From 7adcd5907fca01c0eeb8b3056a2a21bf2a4929be Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 25 Jul 2017 18:46:43 -0700 Subject: [PATCH 682/870] Allow rotation in blink mode --- Tools/LocomotionTool/LocomotionInput.asset | 30 ++++++++++ Tools/LocomotionTool/LocomotionTool.cs | 59 ++++++++++++------- .../LocomotionTool/Materials/BlinkVisuals.mat | 2 +- .../Prefabs/BlinkVisuals.prefab | 2 +- 4 files changed, 70 insertions(+), 23 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionInput.asset b/Tools/LocomotionTool/LocomotionInput.asset index 710e81d24..4c828a70d 100644 --- a/Tools/LocomotionTool/LocomotionInput.asset +++ b/Tools/LocomotionTool/LocomotionInput.asset @@ -22,6 +22,7 @@ MonoBehaviour: - {fileID: 114894458248566326} - {fileID: 114795339600363638} - {fileID: 114866277550077874} + - {fileID: 114074002882361640} m_ControlSchemes: - m_Name: LocomotionInput m_DeviceSlots: @@ -122,6 +123,15 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 + - sources: + - controlIndex: 3 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 m_MapTypeName: LocomotionInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: @@ -265,6 +275,26 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: WorldReset defaultValue: 0 +--- !u!114 &114074002882361640 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: AltSpeed + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 10 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: AltSpeed + defaultValue: 0 --- !u!114 &114795339600363638 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index d7523c9d7..7b6ea441c 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -187,6 +187,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (DoTwoHandedScaling(consumeControl)) return; + if (DoRotating(consumeControl)) + return; + if (m_Preferences.blinkMode) { if (DoBlink(consumeControl)) @@ -206,6 +209,38 @@ bool DoFlying(ConsumeControlDelegate consumeControl) var reverse = m_LocomotionInput.reverse.isHeld; var moving = m_LocomotionInput.forward.isHeld || reverse; if (moving) + { + var speed = k_SlowMoveSpeed; + var speedControl = m_LocomotionInput.speed; + var speedControlValue = speedControl.value; + if (!Mathf.Approximately(speedControlValue, 0)) // Consume control to block selection + { + speed = k_SlowMoveSpeed + speedControlValue * (k_FastMoveSpeed - k_SlowMoveSpeed); + consumeControl(speedControl); + } + + speed *= this.GetViewerScale(); + if (reverse) + speed *= -1; + + m_Rotating = false; + cameraRig.Translate(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.forward * speed * Time.unscaledDeltaTime); + + consumeControl(m_LocomotionInput.forward); + return true; + } + + return false; + } + + bool DoRotating(ConsumeControlDelegate consumeControl) + { + if (m_BlinkVisuals.gameObject.activeInHierarchy) + return false; + + var reverse = m_LocomotionInput.reverse.isHeld; + var move = m_LocomotionInput.forward.isHeld || reverse; + if (move) { if (m_LocomotionInput.rotate.isHeld) { @@ -246,28 +281,8 @@ bool DoFlying(ConsumeControlDelegate consumeControl) cameraRig.position = m_CameraStartPosition + segmentedRotation * startOffset; m_LastRotationDiff = filteredRotation; + return true; } - else - { - var speed = k_SlowMoveSpeed; - var speedControl = m_LocomotionInput.speed; - var speedControlValue = speedControl.value; - if (!Mathf.Approximately(speedControlValue, 0)) // Consume control to block selection - { - speed = k_SlowMoveSpeed + speedControlValue * (k_FastMoveSpeed - k_SlowMoveSpeed); - consumeControl(speedControl); - } - - speed *= this.GetViewerScale(); - if (reverse) - speed *= -1; - - m_Rotating = false; - cameraRig.Translate(Quaternion.Inverse(cameraRig.rotation) * rayOrigin.forward * speed * Time.unscaledDeltaTime); - } - - consumeControl(m_LocomotionInput.forward); - return true; } m_Rotating = false; @@ -333,6 +348,8 @@ bool DoBlink(ConsumeControlDelegate consumeControl) { m_BlinkVisuals.extraSpeed = proxyType == typeof(ViveProxy) ? m_LocomotionInput.speed.value : m_LocomotionInput.altSpeed.value; + + consumeControl(m_LocomotionInput.blink); return true; } else diff --git a/Tools/LocomotionTool/Materials/BlinkVisuals.mat b/Tools/LocomotionTool/Materials/BlinkVisuals.mat index dc7784a6c..2e4bc5f0d 100644 --- a/Tools/LocomotionTool/Materials/BlinkVisuals.mat +++ b/Tools/LocomotionTool/Materials/BlinkVisuals.mat @@ -74,4 +74,4 @@ Material: m_Colors: - _Color: {r: 0.00012356043, g: 0.00004797052, b: 0.00004797052, a: 0.00012356043} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _TintColor: {r: 0, g: 0, b: 0, a: 0} + - _TintColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab index 8fe75aa35..2534f3341 100644 --- a/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab +++ b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab @@ -24,7 +24,7 @@ GameObject: - component: {fileID: 114924831655948450} - component: {fileID: 114017680955354874} m_Layer: 0 - m_Name: BlinkVisuals1 + m_Name: BlinkVisuals m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 From 096fe931f692182e43995dc05c091dc72e54bcb3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 18:48:03 -0700 Subject: [PATCH 683/870] Cleanup PinnedToolButton prefab hierarchy --- .../PinnedToolButton/PinnedToolButton.prefab | 998 +----------------- 1 file changed, 31 insertions(+), 967 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab index 9daf79d9a..280ad7bc2 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab @@ -59,23 +59,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000010561241686 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000010555036514} - - component: {fileID: 222000012771696822} - - component: {fileID: 114000013054965370} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000010664688126 GameObject: m_ObjectHideFlags: 1 @@ -117,40 +100,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000010714816488 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000013614942004} - - component: {fileID: 33000012298580722} - - component: {fileID: 23000013623333764} - m_Layer: 0 - m_Name: PinnedToolButtonInset - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000010746370754 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000011771676402} - - component: {fileID: 33000012558278368} - - component: {fileID: 23000012760767544} - m_Layer: 0 - m_Name: PinnedToolButtonFaceMask - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000010797218832 GameObject: m_ObjectHideFlags: 1 @@ -182,23 +131,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000011241481320 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000010919883134} - - component: {fileID: 222000013364307902} - - component: {fileID: 114000013366903114} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000011303308952 GameObject: m_ObjectHideFlags: 1 @@ -277,38 +209,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000011915299818 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000013373873342} - m_Layer: 0 - m_Name: PinnedToolButtonMeshOld - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1000011923834384 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000011657560110} - - component: {fileID: 222000011737525400} - - component: {fileID: 114000011928962840} - m_Layer: 5 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000012048525766 GameObject: m_ObjectHideFlags: 1 @@ -390,24 +290,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013126942410 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000012388631740} - - component: {fileID: 114000011926581952} - - component: {fileID: 225000011672881634} - - component: {fileID: 65000010916098064} - m_Layer: 5 - m_Name: LeftActionButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000013163218754 GameObject: m_ObjectHideFlags: 1 @@ -424,40 +306,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000013207144374 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000013975901740} - - component: {fileID: 222000012834606604} - - component: {fileID: 114000013055861932} - m_Layer: 5 - m_Name: Background - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000013544577132 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000013910327088} - - component: {fileID: 222000011018194712} - - component: {fileID: 114000012662170858} - m_Layer: 5 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1000013816124996 GameObject: m_ObjectHideFlags: 1 @@ -475,60 +323,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!1 &1000013929112766 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000012760332454} - - component: {fileID: 222000011673250278} - - component: {fileID: 114000011796366970} - - component: {fileID: 114000013866165818} - - component: {fileID: 114000013570860828} - m_Layer: 5 - m_Name: ActionButtonsMask - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!1 &1000013979951132 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000014065128128} - - component: {fileID: 114000013773965116} - - component: {fileID: 225000013730456080} - - component: {fileID: 65000012740030200} - m_Layer: 5 - m_Name: RightActionButton - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000014013795426 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000013218953584} - - component: {fileID: 222000014289754014} - - component: {fileID: 114000013828986210} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000014082726766 GameObject: m_ObjectHideFlags: 1 @@ -569,23 +363,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000014169611568 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4000012896115128} - - component: {fileID: 33000012464504980} - - component: {fileID: 23000013529982034} - m_Layer: 0 - m_Name: PinnedToolButtonFrame - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1431581445204510 GameObject: m_ObjectHideFlags: 1 @@ -658,19 +435,6 @@ Transform: m_Father: {fileID: 4000010261126032} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000011771676402 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010746370754} - m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} - m_LocalPosition: {x: -0, y: 0, z: 0} - m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_Children: [] - m_Father: {fileID: 4000013373873342} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000011872301252 Transform: m_ObjectHideFlags: 1 @@ -699,7 +463,7 @@ Transform: - {fileID: 224000012246060254} - {fileID: 224000013933582366} m_Father: {fileID: 224000013167097666} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012190781878 Transform: @@ -712,7 +476,7 @@ Transform: m_LocalScale: {x: 2.7019417, y: 2.7019417, z: 2.7019417} m_Children: [] m_Father: {fileID: 224000013167097666} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000012297013730 Transform: @@ -769,24 +533,10 @@ Transform: - {fileID: 224000011571037388} - {fileID: 224000011060550722} - {fileID: 4000010261126032} - - {fileID: 4000013373873342} - {fileID: 4000013747407424} m_Father: {fileID: 4000012504767854} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000012896115128 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014169611568} - m_LocalRotation: {x: 0, y: 0.09801716, z: -0, w: 0.9951847} - m_LocalPosition: {x: -0, y: 0, z: 0} - m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_Children: [] - m_Father: {fileID: 4000013373873342} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013243584372 Transform: m_ObjectHideFlags: 1 @@ -800,22 +550,6 @@ Transform: m_Father: {fileID: 4000010261126032} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000013373873342 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011915299818} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.05} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 4000011771676402} - - {fileID: 4000012896115128} - - {fileID: 4000013614942004} - m_Father: {fileID: 4000012648346800} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013378434912 Transform: m_ObjectHideFlags: 1 @@ -829,19 +563,6 @@ Transform: m_Father: {fileID: 4000012648346800} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} ---- !u!4 &4000013614942004 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010714816488} - m_LocalRotation: {x: -0, y: 0.09801716, z: -0, w: 0.9951847} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.9999999, y: 1, z: 0.9999999} - m_Children: [] - m_Father: {fileID: 4000013373873342} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4000013747407424 Transform: m_ObjectHideFlags: 1 @@ -854,7 +575,7 @@ Transform: m_Children: - {fileID: 224000013167097666} m_Father: {fileID: 4000012648346800} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4181584002966386 Transform: @@ -868,22 +589,22 @@ Transform: m_Children: - {fileID: 4000011872301252} m_Father: {fileID: 224000013167097666} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23000012760767544 +--- !u!23 &23000013593520400 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010746370754} - m_Enabled: 1 + m_GameObject: {fileID: 1000010692782980} + m_Enabled: 0 m_CastShadows: 0 m_ReceiveShadows: 0 m_MotionVectors: 0 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} + - {fileID: 2100000, guid: 6adae681ad457e140ac31a9ac83c3a11, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -902,20 +623,21 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000013529982034 +--- !u!23 &23000013664958186 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014169611568} - m_Enabled: 1 + m_GameObject: {fileID: 1000014082726766} + m_Enabled: 0 m_CastShadows: 0 m_ReceiveShadows: 0 m_MotionVectors: 0 m_LightProbeUsage: 0 m_ReflectionProbeUsage: 0 m_Materials: - - {fileID: 2100000, guid: 5c092e872a72dd144a84ae7da8095049, type: 2} + - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} + - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -934,146 +656,28 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!23 &23000013593520400 -MeshRenderer: +--- !u!33 &33000011006197312 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014082726766} + m_Mesh: {fileID: 4300000, guid: 7f7c3987753e1bf41bee70661b3eff03, type: 3} +--- !u!33 &33000012601387000 +MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010692782980} - m_Enabled: 0 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 6adae681ad457e140ac31a9ac83c3a11, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23000013623333764 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010714816488} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23000013664958186 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014082726766} - m_Enabled: 0 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_MotionVectors: 0 - m_LightProbeUsage: 0 - m_ReflectionProbeUsage: 0 - m_Materials: - - {fileID: 2100000, guid: 38860ca708e7b5641ace5d1ed4e7c0fc, type: 2} - - {fileID: 2100000, guid: 7c873c9977af7044aa1412eb381756f8, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &33000011006197312 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014082726766} - m_Mesh: {fileID: 4300000, guid: 7f7c3987753e1bf41bee70661b3eff03, type: 3} ---- !u!33 &33000012298580722 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010714816488} - m_Mesh: {fileID: 4300014, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} ---- !u!33 &33000012464504980 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014169611568} - m_Mesh: {fileID: 4300012, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} ---- !u!33 &33000012558278368 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010746370754} - m_Mesh: {fileID: 4300016, guid: 303f9d32292c8d444aa4375f4f57be3a, type: 3} ---- !u!33 &33000012601387000 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010692782980} - m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} ---- !u!65 &65000010009342954 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014093660532} - m_Material: {fileID: 0} - m_IsTrigger: 0 + m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} +--- !u!65 &65000010009342954 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014093660532} + m_Material: {fileID: 0} + m_IsTrigger: 0 m_Enabled: 0 serializedVersion: 2 m_Size: {x: 0.205, y: 0.005, z: 0.06} @@ -1102,18 +706,6 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.205, y: 0.005, z: 0.06} m_Center: {x: 0, y: 0, z: -0} ---- !u!65 &65000010916098064 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013126942410} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 0.0345, y: 0.069, z: 0.01} - m_Center: {x: 0, y: 0, z: 0} --- !u!65 &65000011573248474 BoxCollider: m_ObjectHideFlags: 1 @@ -1222,18 +814,6 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.225, y: 0.005, z: 0.06} m_Center: {x: 0, y: 0, z: -0.06} ---- !u!65 &65000012740030200 -BoxCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013979951132} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Size: {x: 0.0345, y: 0.069, z: 0.01} - m_Center: {x: 0, y: 0, z: 0} --- !u!65 &65000013092476136 BoxCollider: m_ObjectHideFlags: 1 @@ -1386,83 +966,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114000011796366970 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013929112766} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114000011926581952 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013126942410} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IconSprite: {fileID: 21300000, guid: fc47de3bcfede8d49b869829e6ff0c0a, type: 3} - m_IconContainer: {fileID: 224000012388631740} - m_ContentContainer: {fileID: 224000012388631740} - m_CanvasGroup: {fileID: 225000011672881634} - m_Icon: {fileID: 114000013828986210} - m_Background: {fileID: 114000013055861932} - m_CloseIconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, type: 3} - m_NormalContentColor: {r: 0.19607843, g: 0.2, b: 0.2, a: 1} - m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_HighlightItems: - - {fileID: 114000013828986210} - m_DelayBeforeReveal: 0 ---- !u!114 &114000011928962840 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011923834384} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} - m_Color: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 --- !u!114 &114000012344975988 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1490,198 +993,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!114 &114000012662170858 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013544577132} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 12800000, guid: 007346dc664d64847a830c562c9659f9, type: 3} - m_FontSize: 250 - m_FontStyle: 0 - m_BestFit: 1 - m_MinSize: 0 - m_MaxSize: 250 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: L ---- !u!114 &114000013054965370 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010561241686} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 12800000, guid: 007346dc664d64847a830c562c9659f9, type: 3} - m_FontSize: 250 - m_FontStyle: 0 - m_BestFit: 1 - m_MinSize: 0 - m_MaxSize: 250 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: R ---- !u!114 &114000013055861932 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013207144374} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} - m_Color: {r: 0.5411765, g: 0.7607843, b: 0.28627452, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114000013366903114 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011241481320} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} - m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: ea362006918ddee41a65752e3722d093, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 ---- !u!114 &114000013570860828 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013929112766} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Padding: - m_Left: 0 - m_Right: 0 - m_Top: 0 - m_Bottom: 0 - m_ChildAlignment: 4 - m_Spacing: 0 - m_ChildForceExpandWidth: 1 - m_ChildForceExpandHeight: 1 - m_ChildControlWidth: 1 - m_ChildControlHeight: 1 ---- !u!114 &114000013773965116 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013979951132} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 57d51bc05acd35a4fbe890fe1217cbd7, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, type: 3} - m_IconContainer: {fileID: 224000014065128128} - m_ContentContainer: {fileID: 224000014065128128} - m_CanvasGroup: {fileID: 225000013730456080} - m_Icon: {fileID: 114000013366903114} - m_Background: {fileID: 114000011928962840} - m_CloseIconSprite: {fileID: 21300000, guid: 8f21106ed0539b64ca132508f61ed30b, type: 3} - m_NormalContentColor: {r: 0.19607843, g: 0.2, b: 0.2, a: 1} - m_HighlightItemColor: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_HighlightItems: - - {fileID: 114000013366903114} - m_DelayBeforeReveal: 0 ---- !u!114 &114000013828986210 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014013795426} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: 4acc1ec5dda65fc4895d9a4d22a63a14, type: 2} - m_Color: {r: 0.9607843, g: 0.972549, b: 0.9764706, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: ea362006918ddee41a65752e3722d093, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 --- !u!114 &114000013859744370 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1715,18 +1026,6 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: A ---- !u!114 &114000013866165818 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013929112766} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 --- !u!114 &114000014181189902 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1990,66 +1289,24 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010001831882} ---- !u!222 &222000011018194712 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013544577132} ---- !u!222 &222000011673250278 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013929112766} --- !u!222 &222000011708094976 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013816124996} ---- !u!222 &222000011737525400 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011923834384} ---- !u!222 &222000012771696822 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010561241686} ---- !u!222 &222000012834606604 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013207144374} --- !u!222 &222000013219081446 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013077063568} ---- !u!222 &222000013364307902 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011241481320} --- !u!222 &222000013531508252 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011851968468} ---- !u!222 &222000014289754014 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014013795426} --- !u!223 &223000013382208598 Canvas: m_ObjectHideFlags: 1 @@ -2088,42 +1345,6 @@ RectTransform: m_AnchoredPosition: {x: -7.8898665e-11, y: 0.00000038940925} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000010555036514 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010561241686} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000010134187} - m_LocalScale: {x: 0.00008000002, y: 0.00008000015, z: 1} - m_Children: [] - m_Father: {fileID: 224000014065128128} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.00040786853, y: 0.0005000003} - m_SizeDelta: {x: 268.38452, y: 268.38452} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000010919883134 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011241481320} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.0017} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000014065128128} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: -0.0002999992} - m_SizeDelta: {x: 0.0413, y: 0.0413} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011060550722 RectTransform: m_ObjectHideFlags: 1 @@ -2160,24 +1381,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000011657560110 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011923834384} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.0008} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000014065128128} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0.0000032186508, y: -0.000000029802322} - m_SizeDelta: {x: -0.00001, y: -0.00007} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012246060254 RectTransform: m_ObjectHideFlags: 1 @@ -2196,47 +1399,6 @@ RectTransform: m_AnchoredPosition: {x: -7.8898665e-11, y: 0.00000038940925} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000012388631740 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013126942410} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.001} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000013975901740} - - {fileID: 224000013218953584} - - {fileID: 224000013910327088} - m_Father: {fileID: 224000012760332454} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0.017025, y: -0.03575} - m_SizeDelta: {x: 0.03405, y: 0.0715} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000012760332454 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013929112766} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.0030222163} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000012388631740} - - {fileID: 224000014065128128} - m_Father: {fileID: 224000013167097666} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.3283064e-10, y: -0.0012286394} - m_SizeDelta: {x: 0.0681, y: 0.0715} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013167097666 RectTransform: m_ObjectHideFlags: 1 @@ -2247,7 +1409,6 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: -0.1471} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000012760332454} - {fileID: 4181584002966386} - {fileID: 4000012190781878} - {fileID: 4000012079080268} @@ -2259,24 +1420,6 @@ RectTransform: m_AnchoredPosition: {x: -0.00039896322, y: -9.1830804e-10} m_SizeDelta: {x: 0.09, y: 0.09} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000013218953584 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014013795426} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.0017} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000012388631740} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: -0.0002999992} - m_SizeDelta: {x: 0.0413, y: 0.0413} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013307387580 RectTransform: m_ObjectHideFlags: 1 @@ -2295,24 +1438,6 @@ RectTransform: m_AnchoredPosition: {x: 0.00020984784, y: 0.0013569929} m_SizeDelta: {x: 224.9724, y: 224.9724} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000013910327088 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013544577132} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000010134187} - m_LocalScale: {x: 0.00008000002, y: 0.00008000015, z: 1} - m_Children: [] - m_Father: {fileID: 224000012388631740} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -0.00040786853, y: 0.0005000003} - m_SizeDelta: {x: 268.38452, y: 268.38452} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013933582366 RectTransform: m_ObjectHideFlags: 1 @@ -2331,45 +1456,6 @@ RectTransform: m_AnchoredPosition: {x: 0.00020984784, y: 0.0013569929} m_SizeDelta: {x: 224.9724, y: 224.9724} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000013975901740 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013207144374} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.0008} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000012388631740} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0.0000032186508, y: -0.000000029802322} - m_SizeDelta: {x: -0.00001, y: -0.00007} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000014065128128 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013979951132} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.001} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000011657560110} - - {fileID: 224000010919883134} - - {fileID: 224000010555036514} - m_Father: {fileID: 224000012760332454} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0.051074997, y: -0.03575} - m_SizeDelta: {x: 0.03405, y: 0.0715} - m_Pivot: {x: 0.5, y: 0.5} --- !u!225 &225000010727404378 CanvasGroup: m_ObjectHideFlags: 1 @@ -2381,17 +1467,6 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 ---- !u!225 &225000011672881634 -CanvasGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013126942410} - m_Enabled: 1 - m_Alpha: 1 - m_Interactable: 1 - m_BlocksRaycasts: 1 - m_IgnoreParentGroups: 0 --- !u!225 &225000012815828682 CanvasGroup: m_ObjectHideFlags: 1 @@ -2403,14 +1478,3 @@ CanvasGroup: m_Interactable: 1 m_BlocksRaycasts: 0 m_IgnoreParentGroups: 0 ---- !u!225 &225000013730456080 -CanvasGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013979951132} - m_Enabled: 1 - m_Alpha: 1 - m_Interactable: 1 - m_BlocksRaycasts: 1 - m_IgnoreParentGroups: 0 From aaea75d78b28f7a4774a5839e09e5175868ec3b7 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 25 Jul 2017 18:50:20 -0700 Subject: [PATCH 684/870] Add documentation to IRaycast --- .../Interfaces/FunctionalityInjection/IRaycast.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs index 219e53f32..92b091c5d 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs @@ -3,6 +3,9 @@ namespace UnityEditor.Experimental.EditorVR { + /// + /// Gives decorated class access to IntersectionModule.Raycast + /// public interface IRaycast { } @@ -13,6 +16,15 @@ public static class IRaycastMethods public static RaycastDelegate raycast { get; set; } + /// + /// Do a raycast against all Renderers + /// + /// The ray to use for the raycast + /// Hit information + /// The gameobject which was hit, if any + /// The maximum distance of the raycast + /// (optional) A list of GameObjects to ignore + /// public static bool Raycast(this IRaycast obj, Ray ray, out RaycastHit hit, out GameObject go, float maxDistance = Mathf.Infinity, List ignoreList = null) { return raycast(ray, out hit, out go, maxDistance, ignoreList); From ea79c4dee6b642de5c8c7b8c9a62ee6fe00cab55 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 19:05:37 -0700 Subject: [PATCH 685/870] Cleanup SpatialHintUI prefab contents --- .../SpatialHintModule/SpatialHintUI.prefab | 260 +++--------------- 1 file changed, 32 insertions(+), 228 deletions(-) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index 35952b926..06e1cb050 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -28,23 +28,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1046794607109420 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224008207930297392} - - component: {fileID: 222044567740138078} - - component: {fileID: 114534977170210908} - m_Layer: 5 - m_Name: Icon - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1075893997324224 GameObject: m_ObjectHideFlags: 1 @@ -55,7 +38,7 @@ GameObject: - component: {fileID: 4800155596865708} - component: {fileID: 114602193729648712} m_Layer: 5 - m_Name: DiagonalArrowsTopArrow (1) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -71,7 +54,7 @@ GameObject: - component: {fileID: 4234521712409882} - component: {fileID: 114549952638618038} m_Layer: 5 - m_Name: DiagonalArrowsTopArrow (4) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -106,7 +89,7 @@ GameObject: - component: {fileID: 4352658633633276} - component: {fileID: 114508101107919186} m_Layer: 5 - m_Name: DiagonalArrowsTopArrow (3) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -208,7 +191,7 @@ GameObject: - component: {fileID: 4841372590907710} - component: {fileID: 114472214291358280} m_Layer: 5 - m_Name: DiagonalArrowsLeftArrow (4) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -273,7 +256,7 @@ GameObject: - component: {fileID: 4920529215995508} - component: {fileID: 114721502774444018} m_Layer: 5 - m_Name: DiagonalArrowsRightArrow (3) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -305,7 +288,7 @@ GameObject: - component: {fileID: 4405923127552798} - component: {fileID: 114000567662040162} m_Layer: 5 - m_Name: DiagonalArrowsBottomArrow (3) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -321,7 +304,7 @@ GameObject: - component: {fileID: 4930137114917576} - component: {fileID: 114478667145759116} m_Layer: 5 - m_Name: DiagonalArrowsLeftArrow (2) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -411,21 +394,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1415035000229474 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4486931087156832} - m_Layer: 5 - m_Name: DiagonalArrowsBackArrow (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1435546683708450 GameObject: m_ObjectHideFlags: 0 @@ -453,7 +421,7 @@ GameObject: - component: {fileID: 4873933386520716} - component: {fileID: 114201708188467934} m_Layer: 5 - m_Name: DiagonalArrowsRightArrow (2) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -492,21 +460,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1498453846321146 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4998463843861972} - m_Layer: 5 - m_Name: DiagonalArrowsFrontArrow (1) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 --- !u!1 &1515404789711088 GameObject: m_ObjectHideFlags: 1 @@ -517,7 +470,7 @@ GameObject: - component: {fileID: 4024087671455752} - component: {fileID: 114933653232386136} m_Layer: 5 - m_Name: DiagonalArrowsLeftArrow (3) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -549,7 +502,7 @@ GameObject: - component: {fileID: 4673130869543022} - component: {fileID: 114347973994711784} m_Layer: 5 - m_Name: DiagonalArrowsLeftArrow (1) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -632,7 +585,7 @@ GameObject: - component: {fileID: 4436731719689366} - component: {fileID: 114647227679990130} m_Layer: 5 - m_Name: DiagonalArrowsBottomArrow (2) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -681,24 +634,7 @@ GameObject: - component: {fileID: 4680161644130496} - component: {fileID: 114041376699156020} m_Layer: 5 - m_Name: DiagonalArrowsTopArrow (2) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1710819549023888 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224562911775927908} - - component: {fileID: 222380044330408610} - - component: {fileID: 114699673652902324} - m_Layer: 5 - m_Name: Icon + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -832,7 +768,7 @@ GameObject: - component: {fileID: 4715255144694938} - component: {fileID: 114820192887403444} m_Layer: 5 - m_Name: DiagonalArrowsRightArrow (1) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -865,7 +801,7 @@ GameObject: - component: {fileID: 4724266729072562} - component: {fileID: 114873812632177310} m_Layer: 5 - m_Name: DiagonalArrowsBottomArrow (1) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -898,7 +834,7 @@ GameObject: - component: {fileID: 4675647250350146} - component: {fileID: 114310382182576548} m_Layer: 5 - m_Name: DiagonalArrowsBottomArrow (4) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -914,7 +850,7 @@ GameObject: - component: {fileID: 4392107344112590} - component: {fileID: 114004058444794040} m_Layer: 5 - m_Name: DiagonalArrowsRightArrow (4) + m_Name: DiagonalArrow m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -966,7 +902,7 @@ Transform: m_Children: - {fileID: 224057756797921652} m_Father: {fileID: 4656611640740372} - m_RootOrder: 11 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} --- !u!4 &4055687054597960 Transform: @@ -1036,7 +972,7 @@ Transform: m_Children: - {fileID: 224153830142605794} m_Father: {fileID: 4656611640740372} - m_RootOrder: 14 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} --- !u!4 &4352658633633276 Transform: @@ -1050,7 +986,7 @@ Transform: m_Children: - {fileID: 224988536893287282} m_Father: {fileID: 4656611640740372} - m_RootOrder: 13 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} --- !u!4 &4392107344112590 Transform: @@ -1064,7 +1000,7 @@ Transform: m_Children: - {fileID: 224196823680673236} m_Father: {fileID: 4656611640740372} - m_RootOrder: 17 + m_RootOrder: 15 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} --- !u!4 &4405923127552798 Transform: @@ -1078,7 +1014,7 @@ Transform: m_Children: - {fileID: 224935697657075864} m_Father: {fileID: 4656611640740372} - m_RootOrder: 12 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 9.736} --- !u!4 &4436731719689366 Transform: @@ -1092,22 +1028,8 @@ Transform: m_Children: - {fileID: 224081872875984476} m_Father: {fileID: 4656611640740372} - m_RootOrder: 7 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} ---- !u!4 &4486931087156832 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1415035000229474} - m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: -0.35757425} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224008207930297392} - m_Father: {fileID: 4656611640740372} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} --- !u!4 &4536356174147362 Transform: m_ObjectHideFlags: 1 @@ -1173,8 +1095,6 @@ Transform: m_LocalPosition: {x: 0.00011226709, y: 0.000016883754, z: -0.000107623935} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 4486931087156832} - - {fileID: 4998463843861972} - {fileID: 4715255144694938} - {fileID: 4673130869543022} - {fileID: 4724266729072562} @@ -1206,7 +1126,7 @@ Transform: m_Children: - {fileID: 224930925262972702} m_Father: {fileID: 4656611640740372} - m_RootOrder: 3 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} --- !u!4 &4675647250350146 Transform: @@ -1220,7 +1140,7 @@ Transform: m_Children: - {fileID: 224156246626200480} m_Father: {fileID: 4656611640740372} - m_RootOrder: 15 + m_RootOrder: 13 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 45.000004} --- !u!4 &4680161644130496 Transform: @@ -1234,7 +1154,7 @@ Transform: m_Children: - {fileID: 224312738310551638} m_Father: {fileID: 4656611640740372} - m_RootOrder: 6 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 9.735001} --- !u!4 &4715255144694938 Transform: @@ -1248,7 +1168,7 @@ Transform: m_Children: - {fileID: 224513997123549140} m_Father: {fileID: 4656611640740372} - m_RootOrder: 2 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} --- !u!4 &4724266729072562 Transform: @@ -1262,7 +1182,7 @@ Transform: m_Children: - {fileID: 224489897271799108} m_Father: {fileID: 4656611640740372} - m_RootOrder: 4 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4800155596865708 Transform: @@ -1276,7 +1196,7 @@ Transform: m_Children: - {fileID: 224424293093470762} m_Father: {fileID: 4656611640740372} - m_RootOrder: 5 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &4841372590907710 Transform: @@ -1290,7 +1210,7 @@ Transform: m_Children: - {fileID: 224129579457830516} m_Father: {fileID: 4656611640740372} - m_RootOrder: 16 + m_RootOrder: 14 m_LocalEulerAnglesHint: {x: 45.000004, y: 90.00001, z: 135} --- !u!4 &4851979343048988 Transform: @@ -1318,7 +1238,7 @@ Transform: m_Children: - {fileID: 224856635122786234} m_Father: {fileID: 4656611640740372} - m_RootOrder: 9 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} --- !u!4 &4919626380897530 Transform: @@ -1346,7 +1266,7 @@ Transform: m_Children: - {fileID: 224403490052312444} m_Father: {fileID: 4656611640740372} - m_RootOrder: 10 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: -30.001001, y: -35.266003, z: 99.73601} --- !u!4 &4930137114917576 Transform: @@ -1360,22 +1280,8 @@ Transform: m_Children: - {fileID: 224244514581948698} m_Father: {fileID: 4656611640740372} - m_RootOrder: 8 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 29.999, y: 35.263, z: 99.73501} ---- !u!4 &4998463843861972 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1498453846321146} - m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 0.35741758} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224562911775927908} - m_Father: {fileID: 4656611640740372} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: -90, y: 180, z: 0} --- !u!23 &23475728828767504 MeshRenderer: m_ObjectHideFlags: 1 @@ -1970,33 +1876,6 @@ MonoBehaviour: m_ShowDuration: 0.125 m_HideDuration: 0.25 m_SlightlyRandomizeHideDuration: 1 ---- !u!114 &114534977170210908 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1046794607109420} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 --- !u!114 &114546261427105744 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2157,33 +2036,6 @@ MonoBehaviour: m_ShowDuration: 0.5 m_HideDuration: 0.25 m_SlightlyRandomizeHideDuration: 1 ---- !u!114 &114699673652902324 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1710819549023888} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 2100000, guid: dd79a285dde86924793e5a909ca783e0, type: 2} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: da944d70255b19e4ebca037de23078f3, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 2 --- !u!114 &114719726697718162 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2801,12 +2653,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!222 &222044567740138078 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1046794607109420} --- !u!222 &222056117849062356 CanvasRenderer: m_ObjectHideFlags: 1 @@ -2861,12 +2707,6 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1166111979364004} ---- !u!222 &222380044330408610 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1710819549023888} --- !u!222 &222409781002321340 CanvasRenderer: m_ObjectHideFlags: 1 @@ -2995,24 +2835,6 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224008207930297392 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1046794607109420} - m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4486931087156832} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224057756797921652 RectTransform: m_ObjectHideFlags: 1 @@ -3340,24 +3162,6 @@ RectTransform: m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} m_SizeDelta: {x: 0.02244997, y: 0.02263999} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224562911775927908 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1710819549023888} - m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.00007824046} - m_LocalScale: {x: 6.561867, y: 6.5618753, z: 7.719844} - m_Children: [] - m_Father: {fileID: 4998463843861972} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -2.9461944e-10, y: -0.000000029802322} - m_SizeDelta: {x: 0.02244997, y: 0.02263999} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224644784610691812 RectTransform: m_ObjectHideFlags: 1 From 952a1e9508447d880b6ab9ed2913e90bb79f312d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 25 Jul 2017 19:16:26 -0700 Subject: [PATCH 686/870] Remove now unused functions in EditorVR.PinnedToolButtons; cleanup formatting --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 261 +-------------------- Scripts/Core/EditorVR.Tools.cs | 2 +- 2 files changed, 3 insertions(+), 260 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 59b3128e5..b905f1d02 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -1,12 +1,8 @@ #if UNITY_EDITOR && UNITY_EDITORVR using System; -using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Helpers; -using UnityEditor.Experimental.EditorVR.Tools; -using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -using UnityEngine.InputNew; namespace UnityEditor.Experimental.EditorVR.Core { @@ -30,107 +26,6 @@ public void DisconnectInterface(object obj, Transform rayOrigin = null) { } -/* TODO remove after removal of main menu activator codebase - internal MainMenuActivator SpawnMainMenuActivator(InputDevice device) - { - var mainMenuActivator = ObjectUtils.Instantiate(evr.m_MainMenuActivatorPrefab.gameObject).GetComponent(); - evr.m_Interfaces.ConnectInterfaces(mainMenuActivator, device); - - return mainMenuActivator; - } - internal IPinnedToolButton SpawnPinnedToolButton(InputDevice device) - { - var button = ObjectUtils.Instantiate(evr.m_PinnedToolButtonPrefab.gameObject).GetComponent(); - evr.m_Interfaces.ConnectInterfaces(button, device); - - return button; - } -*/ - - /* - internal IPinnedToolButton AddPinnedToolButton(DeviceData deviceData, Type toolType, Sprite buttonIcon) - { - Debug.LogWarning("SPAWNING pinned tool button for type of : " + toolType); - var pinnedToolButtons = deviceData.pinnedToolButtons; - if (pinnedToolButtons.ContainsKey(toolType)) // Return if tooltype already occupies a pinned tool button - return null; - - // Before adding new button, offset each button to a position greater than the zeroth/active tool position - foreach (var pair in pinnedToolButtons) - { - if (pair.Value.order != pair.Value.menuButtonOrderPosition) // don't move the main menu button - pair.Value.order++; - } - - var button = SpawnPinnedToolButton(deviceData.inputDevice); - pinnedToolButtons.Add(toolType, button); - - // Initialize button in alternate position if the alternate menu is hidden - IPinnedToolButton mainMenu = null; - if (toolType == typeof(IMainMenu)) - mainMenu = button; - else - pinnedToolButtons.TryGetValue(typeof(IMainMenu), out mainMenu); - - button.moveToAlternatePosition = mainMenu != null && mainMenu.moveToAlternatePosition; - button.node = deviceData.node; - button.toolType = toolType; // Assign Tool Type before assigning order - button.icon = buttonIcon; - //button.order = button.activeToolOrderPosition; // first position is the active tool position - button.deletePinnedToolButton = DeletePinnedToolButton; - button.revealAllToolButtons = RevealAllToolButtons; - button.selectTool = ToolButtonClicked; - //button.highli = HighlightSingleButtonWithoutMenu; - button.selectHighlightedButton = SelectHighlightedButton; - button.deleteHighlightedButton = DeleteHighlightedButton; - //button.selected += OnMainMenuActivatorSelected; - button.hoverEnter += onButtonHoverEnter; - button.hoverExit += onButtonHoverExit; - - return button; - } -*/ -/* - internal void SetupPinnedToolButtonsForDevice(DeviceData deviceData, Transform rayOrigin, Type activeToolType) - { - Debug.LogError("Setting up pinned tool button for type of : " + activeToolType); - activeToolType = activeToolType == typeof(IMainMenu) ? typeof(SelectionTool) : activeToolType; // Assign SelectionTool if setting up for IMainMenu - const int kMaxButtonCount = 16; - var buttons = deviceData.pinnedToolButtons; - var inactiveButtonInitialOrderPosition = -1; - var buttonCount = buttons.Count; // Position buttons relative to count - - if (buttonCount >= kMaxButtonCount) - { - Debug.LogError("Attempting to add buttons beyond max count! Handle for removing highest ordered button and adding this new button!"); - return; - } - - foreach (var pair in buttons) - { - var button = pair.Value; - inactiveButtonInitialOrderPosition = inactiveButtonInitialOrderPosition == -1 ? button.activeToolOrderPosition : inactiveButtonInitialOrderPosition; - button.rayOrigin = rayOrigin; - button.activeButtonCount = buttonCount; - - if (button.toolType == typeof(IMainMenu)) - { - Debug.LogWarning("Setting up main menu button"); - button.order = button.menuButtonOrderPosition; - button.revealed = true; - } - else - { - button.order = button.toolType == activeToolType ? button.activeToolOrderPosition : ++inactiveButtonInitialOrderPosition; - Debug.LogWarning("Setting up button : " + button.toolType + " - ORDER : " + button.order); - } - - if (button.order == button.activeToolOrderPosition) - deviceData.proxy.HighlightDevice(deviceData.node, button.gradientPair); // Perform the higlight on the node with the button's gradient pair - } - } -*/ - internal void HighlightDevice(Transform rayOrigin, GradientPair gradientPair) { Rays.ForEachProxyDevice(deviceData => @@ -142,44 +37,6 @@ internal void HighlightDevice(Transform rayOrigin, GradientPair gradientPair) }); } - void DeletePinnedToolButton(Transform rayOrigin, IPinnedToolButton buttonToDelete) - { - // Remove the pinned tool from the device data collection - // re-order the current buttons - // Highlight the device if the top/selected tool was the one that was closed - - Debug.LogError("deletePinnedToolButton called"); - - //var result = false; - //var deviceInputModule = evr.m_DeviceInputModule; - Type selectedButtontype = null; - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - { - /* - var buttons = deviceData.pinnedToolButtons; - var selectedButtonOrder = buttons.Count; - foreach (var pair in deviceData.pinnedToolButtons) - { - var button = pair.Value; - if (button != buttonToDelete) - { - // Identify the new selected button - selectedButtonOrder = button.order < selectedButtonOrder ? button.order : selectedButtonOrder; - selectedButtontype = selectedButtonOrder == button.order ? button.toolType : selectedButtontype; - } - } - - Debug.LogError("Removing button : " + buttonToDelete.toolType + " - Setting new active button of type : " + selectedButtontype); - buttons.Remove(buttonToDelete.toolType); - Tools.SelectTool(rayOrigin, selectedButtontype); - // TODO remove after refacter : SetupPinnedToolButtonsForDevice(deviceData, rayOrigin, selectedButtontype); - */ - } - }); - } - internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, string toolDescription) { // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions @@ -189,7 +46,7 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T IPinnedToolButton previewPinnedToolButton = null; Rays.ForEachProxyDevice((deviceData) => { - if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device + if (deviceData.rayOrigin == rayOrigin) // Enable pinned tool preview on the opposite (handed) device { var pinnedToolsMenu = deviceData.pinnedToolsMenu; previewPinnedToolButton = pinnedToolsMenu.previewToolButton; @@ -201,130 +58,16 @@ internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, T return previewPinnedToolButton; } - internal void ToolButtonClicked(Transform rayOrigin, Type toolType) + internal void OnToolButtonClicked(Transform rayOrigin, Type toolType) { - Debug.LogError("TOOL BUTTON CLICKED : " + toolType.ToString()); - if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); else Tools.SelectTool(rayOrigin, toolType); } - /* - internal void RevealAllToolButtons (Transform rayOrigin, bool reveal) - { - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - { - var buttons = deviceData.pinnedToolButtons; - foreach (var pair in buttons) - { - pair.Value.revealed = reveal; - } - } - }); - } - */ - - /* - // TODO: move into pinned tool button controller? - internal void HighlightSingleButtonWithoutMenu (Transform rayOrigin, int buttonOrderPosition, bool highlight = true) - { - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - { - var buttons = deviceData.pinnedToolButtons; - foreach (var pair in buttons) - { - var toolButton = pair.Value; - toolButton.highlighted = toolButton.order == buttonOrderPosition ? highlight : false; - } - } - }); - } - */ - - // TODO: move into pinned tool button controller - internal void DeleteHighlightedButton (Transform rayOrigin) - { - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - { - Debug.LogError("RE IMPLEMENT DELETING OF TOOL BUTTONS!!! after refactor"); - /* - var buttons = deviceData.pinnedToolButtons; - foreach (var pair in buttons) - { - var toolButton = pair.Value; - if (toolButton.highlighted == true) - { - DeletePinnedToolButton(rayOrigin, toolButton); - return; - } - } - */ - } - }); - } - - internal void SelectHighlightedButton (Transform rayOrigin) - { - Debug.LogError("SELECT HIGHLIGHTED BUTTON CALLED - ADD FUNCTIOALITY BACK IN!!!"); - /* - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - { - var buttons = deviceData.pinnedToolButtons; - foreach (var pair in buttons) - { - var toolButton = pair.Value; - if (toolButton.highlighted) - { - ToolButtonClicked(toolButton.rayOrigin, toolButton.toolType); - break; - } - } - } - }); - */ - } - - /* - internal void OnButtonHoverEnter(Transform rayOrigin) - { - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); - if (deviceData != null) - { - var menus = new List(deviceData.menuHideFlags.Keys); - foreach (var menu in menus) - { - deviceData.menuHideFlags[menu] |= Menus.MenuHideFlags.OverActivator; - } - } - } - - internal void OnButtonHoverExit(Transform rayOrigin) - { - var deviceData = evr.m_DeviceData.FirstOrDefault(dd => dd.rayOrigin == rayOrigin); - if (deviceData != null) - { - var menus = new List(deviceData.menuHideFlags.Keys); - foreach (var menu in menus) - { - deviceData.menuHideFlags[menu] &= ~Menus.MenuHideFlags.OverActivator; - } - } - } - */ - internal void OnMainMenuActivatorSelected(Transform rayOrigin) { - Debug.LogError("OnMainMenuActivatorSelected called!"); var targetToolRayOrigin = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin != rayOrigin).rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin == rayOrigin); diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index b79a00db6..3d8916e2b 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -120,7 +120,7 @@ internal static void SpawnDefaultTools(IProxy proxy) // Setup PinnedToolsMenu var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); deviceData.pinnedToolsMenu = pinnedToolsMenu; - pinnedToolsMenu.selectTool = pinnedTools.ToolButtonClicked; + pinnedToolsMenu.selectTool = pinnedTools.OnToolButtonClicked; pinnedToolsMenu.mainMenuActivatorSelected = pinnedTools.OnMainMenuActivatorSelected; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; pinnedToolsMenu.createPinnedToolButton(typeof(IMainMenu), null, deviceData.node); From 434df5ff82974b7ecbe040d032fd5c0ad5c0c0a2 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 26 Jul 2017 02:28:53 -0700 Subject: [PATCH 687/870] Remove lighter gradient pairs from the curated (mid-tone) gradient collection in UnityBrandColorScheme --- Scripts/Utilities/UnityBrandColorScheme.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index fd7658136..32748f7ad 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -296,18 +296,6 @@ private static void SetupUnityBrandColors() s_CuratedGradientPairs.Add(new GradientPair(blue, magenta)); s_CuratedGradientPairs.Add(new GradientPair(blue, purple)); s_CuratedGradientPairs.Add(new GradientPair(magenta, darker)); - // Slightly lighter pairs added to main curated set - s_CuratedGradientPairs.Add(new GradientPair(yellowLight, tealDark)); - s_CuratedGradientPairs.Add(new GradientPair(orangeDark, orangeLight)); - s_CuratedGradientPairs.Add(new GradientPair(lime, greenLight)); - s_CuratedGradientPairs.Add(new GradientPair(red, redLight)); - s_CuratedGradientPairs.Add(new GradientPair(red, orangeLight)); - s_CuratedGradientPairs.Add(new GradientPair(lime, orange)); - s_CuratedGradientPairs.Add(new GradientPair(lime, teal)); - s_CuratedGradientPairs.Add(new GradientPair(magenta, blueLight)); - s_CuratedGradientPairs.Add(new GradientPair(blue, blueLight)); - s_CuratedGradientPairs.Add(new GradientPair(blue, lime)); - s_CuratedGradientPairs.Add(new GradientPair(blue, yellowLight)); // Setup dark-luma curated gradient pairs s_CuratedDarkGradientPairs.Add(new GradientPair(tealDark, darkBlue)); From 47e19a903b172603e6c70e50da51c1a9a51f69f9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 26 Jul 2017 02:42:38 -0700 Subject: [PATCH 688/870] Remove remaining spatial scrolling implementation in PinnedToolsMenu; use IUsesRayOrigin to assign rayOrigin to PinnedToolsMenuUI, as opposed to assigning through PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 89 +++---------------- .../Scripts/PinnedToolsMenuUI.cs | 3 +- 2 files changed, 12 insertions(+), 80 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 2154e6fe9..8646b05d9 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -10,7 +10,8 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics, IUsesViewerScale, IControlSpatialHinting, ISetDefaultRayVisibility + sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, + IControlHaptics, IUsesViewerScale, IControlSpatialHinting, ISetDefaultRayVisibility, IUsesRayOrigin { const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation @@ -40,18 +41,13 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac [SerializeField] HapticPulse m_HidingPulse; // The pulse performed when ending a spatial selection - PinnedToolsMenuUI m_PinnedToolsMenuUI; - - //public int menuButtonOrderPosition { get { return k_MenuButtonOrderPosition; } } - //public int activeToolOrderPosition { get { return k_ActiveToolOrderPosition; } } - Transform m_RayOrigin; Transform m_AlternateMenuOrigin; - IPinnedToolButton m_MainMenuButton; + float allowToolToggleBeforeThisTime; float? continuedInputConsumptionStartTime; Vector3 m_SpatialScrollStartPosition; - Vector3 previousWorldPosition; - float allowToolToggleBeforeThisTime; + IPinnedToolButton m_MainMenuButton; + PinnedToolsMenuUI m_PinnedToolsMenuUI; SpatialScrollModule.SpatialScrollData m_SpatialScrollData; public Transform menuOrigin { get; set; } @@ -80,7 +76,7 @@ public Transform rayOrigin set { m_RayOrigin = value; - CreatePinnedToolsUI(); + //Setup(); } } @@ -104,20 +100,11 @@ public Transform alternateMenuOrigin public event Action hoverEnter; public event Action hoverExit; public event Action selected; - /* - public bool visible { get; set; } - public GameObject menuContent { get; private set; } - public List menuActions { get; set; } - public Transform rayOrigin { get; set; } - public event Action itemWasSelected; - */ - - // Spatial Hint Module implementation - - - void Awake() + + void Start() { createPinnedToolButton = CreatePinnedToolButton; + CreatePinnedToolsUI(); } void OnDestroy() @@ -131,10 +118,9 @@ void CreatePinnedToolsUI() if (m_PinnedToolsMenuUI == null) m_PinnedToolsMenuUI = this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); - this.ConnectInterfaces(m_PinnedToolsMenuUI); + //this.ConnectInterfaces(m_PinnedToolsMenuUI); REMOVE IConnectInterfaces. already done in InstantiateUI m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; m_PinnedToolsMenuUI.mainMenuActivatorSelected = mainMenuActivatorSelected; - m_PinnedToolsMenuUI.rayOrigin = rayOrigin; m_PinnedToolsMenuUI.buttonHovered += OnButtonHover; m_PinnedToolsMenuUI.buttonClicked += OnButtonClick; @@ -279,7 +265,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon buttonCount -= 1; // Decrement to disallow cycling through the main menu button m_SpatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.25f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); var normalizedRepeatingPosition = m_SpatialScrollData.normalizedLoopingPosition; - //var normalizedRepeatingPosition = processSpatialScrolling(m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.25f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { if (!m_PinnedToolsMenuUI.allButtonsVisible) @@ -322,61 +307,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); this.EndSpatialScroll(this); // Free the spatial scroll data owned by this object } - - // cache current position for delta comparison on next frame for fine tuned scrolling with low velocity - previousWorldPosition = transform.position; - } - - /* - float processSpatialScrolling(Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) - { - var normalizedLoopingPosition = 0f; - var directionVector = currentPosition - startingPosition; - const float kMaxFineTuneVelocity = 0.0005f; - if (spatialDirection == null) - { - var newDirectionVectorThreshold = 0.0175f * this.GetViewerScale(); // Initial magnitude beyond which spatial scrolling will be evaluated - var dragMagnitude = Vector3.Magnitude(directionVector); - var dragPercentage = dragMagnitude / newDirectionVectorThreshold; - var repeatingPulseAmount = Mathf.Sin(Time.realtimeSinceStartup * 20) > 0.5f ? 1f : 0f; - m_PinnedToolsMenuUI.spatialDragDistance = dragMagnitude > 0 ? dragPercentage : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred - this.Pulse(node, m_ActivationPulse, repeatingPulseAmount, repeatingPulseAmount); - if (dragMagnitude > newDirectionVectorThreshold) - { - spatialDirection = directionVector; // initialize vector defining the spatial scroll direciton - m_PinnedToolsMenuUI.startingDragOrigin = spatialDirection; - } - } - else - { - var rawVelocity = (previousWorldPosition - transform.position).sqrMagnitude; - var velocity = rawVelocity * Time.unscaledDeltaTime; - if (velocity < kMaxFineTuneVelocity) // && velocity > kMinFineTuneVelocity) - { - // OFfset the vector increasingly as velocity slows, in order to lessen the perceived scrolling magnitude - //spatialDirection -= spatialDirection.Value * ( 100f * (kMaxFineTuneVelocity - velocity)); // TODO: support this offset in either direction/inverse - //spatialScrollStartPosition -= spatialScrollStartPosition * ( 0.1f * (kMaxFineTuneVelocity - velocity)); - //repeatingScrollLengthRange += repeatingScrollLengthRange * (10000f * (kMaxFineTuneVelocity - velocity)); - //Debug.LogError("" + repeatingScrollLengthRange + ""); - } - - //Debug.LogError(directionVector.magnitude); - var projectedAmount = Vector3.Project(directionVector, spatialDirection.Value).magnitude / this.GetViewerScale(); - normalizedLoopingPosition = (Mathf.Abs(projectedAmount * (maxItemCount / scrollableItemCount)) % repeatingScrollLengthRange) * (1 / repeatingScrollLengthRange); - - //Debug.LogError("" + velocity + ""); - //if (velocity < kMaxFineTuneVelocity && velocity > kMinFineTuneVelocity) - //{ - //Debug.LogError("" + projectedAmount + " : Spatial Direction : " + spatialDirection.Value); - // OFfset the vector increasingly as velocity slows, in order to lessen the perceived scrolling magnitude - //spatialDirection -= spatialDirection.Value * ( 100f * (kMaxFineTuneVelocity - velocity)); // TODO: support this offset in either direction/inverse - //spatialScrollStartPosition -= spatialScrollStartPosition * ( 0.1f * (kMaxFineTuneVelocity - velocity)); - //} - } - - return normalizedLoopingPosition; } - */ void OnButtonClick() { diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 4165d9317..2c2ace12e 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -12,7 +12,8 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI, IConnectInterfaces, IControlSpatialHinting, IControlHaptics + sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI, + IConnectInterfaces, IControlSpatialHinting, IControlHaptics, IUsesRayOrigin { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation From bda6293d00c3dd60a4df6d7bec99219d45d1845f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 26 Jul 2017 11:21:47 -0700 Subject: [PATCH 689/870] Fix issue where left hand ray wouldn't hide for blink --- Scripts/Proxies/DefaultProxyRay.cs | 1 - Tools/LocomotionTool/LocomotionTool.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 656ea5338..ac04c6bb9 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -38,7 +38,6 @@ sealed class DefaultProxyRay : MonoBehaviour, IUsesViewerScale private object m_LockRayObject; public bool LockRay(object lockCaller) - { // Allow the caller to lock the ray // If the reference to the lockCaller is destroyed, and the ray was not properly diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 7b6ea441c..c988f704b 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -531,7 +531,7 @@ void CancelScale() var locomotionTool = (LocomotionTool)linkedObject; locomotionTool.m_Scaling = false; - if (!locomotionTool.m_Crawling) + if (!locomotionTool.m_Crawling && !locomotionTool.m_BlinkVisuals.gameObject.activeInHierarchy) { var rayOrigin = locomotionTool.rayOrigin; this.UnlockRay(rayOrigin, this); From 91abbc0e9166bac1247628565efe9044a6b9c888 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 26 Jul 2017 17:13:49 -0700 Subject: [PATCH 690/870] Add show/hide transitions; Fix shader alpha issue --- Shaders/EVRMeshChain.shader | 27 ++++---- Tools/LocomotionTool/Materials/BlinkLine.mat | 2 +- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 70 +++++++++++++++++++- 3 files changed, 84 insertions(+), 15 deletions(-) diff --git a/Shaders/EVRMeshChain.shader b/Shaders/EVRMeshChain.shader index c54a99e31..15a764b13 100644 --- a/Shaders/EVRMeshChain.shader +++ b/Shaders/EVRMeshChain.shader @@ -26,14 +26,14 @@ // In the first pass we write only to the alpha channel. // This lets us punch a hole in the background that our // line color then shows through - blend srcalpha oneminussrcalpha - blendop sub - cull off - lighting off - zwrite on - ztest lequal - colormask a - offset 0, -.1 + Blend One One + BlendOp Min + Cull Off + Lighting Off + ZWrite Off + ColorMask A + Offset 0, -.1 + CGPROGRAM #pragma vertex vert @@ -52,11 +52,12 @@ // as the alpha value we wrote before allows through. To // prevent overlapping lines from adding too much color, // we set the alpha value to one after visiting a pixel. - blend oneminusdstalpha dstalpha - cull off - lighting off - zwrite on - offset 0, -.1 + Blend OneMinusDstAlpha DstAlpha, One One + BlendOp Add, Max + Cull Off + Lighting Off + ZWrite Off + Offset 0, -.1 CGPROGRAM diff --git a/Tools/LocomotionTool/Materials/BlinkLine.mat b/Tools/LocomotionTool/Materials/BlinkLine.mat index 0cf116c1f..42e2c7d4d 100644 --- a/Tools/LocomotionTool/Materials/BlinkLine.mat +++ b/Tools/LocomotionTool/Materials/BlinkLine.mat @@ -11,7 +11,7 @@ Material: m_ShaderKeywords: LINE_PERSPECTIVE_WIDTH LINE_WORLD_SPACE m_LightmapFlags: 5 m_EnableInstancingVariants: 0 - m_CustomRenderQueue: 3000 + m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index b585af7b5..b4e4dccf7 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -1,4 +1,5 @@ -using UnityEditor.Experimental.EditorVR; +using System.Collections; +using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -34,6 +35,9 @@ public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast [SerializeField] float m_InvalidThreshold = -0.8f; + [SerializeField] + float m_TransitionTime = 0.3f; + [SerializeField] GameObject m_MotionIndicatorSphere; @@ -46,11 +50,33 @@ public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast Transform[] m_Spheres; Material m_VisualsMaterial; Vector3 m_SphereScale; + bool m_Visible; + float m_TransitionAmount; public Vector3? targetPosition { get; private set; } public float extraSpeed { private get; set; } + public bool visible + { + set + { + if (value == m_Visible) + return; + + m_Visible = value; + + if (m_Visible) + { + gameObject.SetActive(true); + } + else + { + StartCoroutine(VisibilityTransition(false)); + } + } + } + void Awake() { m_SphereScale = m_MotionIndicatorSphere.transform.localScale; @@ -73,14 +99,55 @@ void Awake() } } + void OnEnable() + { + for (var i = 0; i < m_MaxProjectileSteps; i++) + { + m_Positions[i] = transform.position; + } + + m_LineRenderer.SetPositions(m_Positions); + + StartCoroutine(VisibilityTransition(true)); + } + + IEnumerator VisibilityTransition(bool visible) + { + var startValue = m_TransitionAmount; + var targetValue = visible ? 1f : 0f; + var startTime = Time.time; + var timeDiff = Time.time - startTime; + while (timeDiff < m_TransitionTime) + { + m_TransitionAmount = Mathf.Lerp(startValue, targetValue, timeDiff / m_TransitionTime); + timeDiff = Time.time - startTime; + yield return null; + } + + m_TransitionAmount = targetValue; + + if (!visible) + gameObject.SetActive(false); + } + + void OnDisable() + { + StopAllCoroutines(); + m_TransitionAmount = 0; + } + void Update() { targetPosition = null; + if (Mathf.Approximately(m_TransitionAmount, 0)) + return; + var viewerScale = this.GetViewerScale(); var lastPosition = transform.position; var timeStep = m_TimeStep * viewerScale; var projectileSpeed = m_ProjectileSpeed + extraSpeed * (m_MaxProjectileSpeed - m_ProjectileSpeed); + projectileSpeed *= m_TransitionAmount; var startVelocity = transform.forward * projectileSpeed * timeStep; var gravity = Physics.gravity * timeStep; m_SpherePosition = (m_SpherePosition + Time.deltaTime * m_Spherespeed) % 1; @@ -141,6 +208,7 @@ void Update() m_LineRenderer.SetWidth(lineWidth, lineWidth); var color = targetPosition.HasValue ? m_ValidColor : m_InvalidColor; + color.a *= m_TransitionAmount * m_TransitionAmount; m_VisualsMaterial.SetColor("_TintColor", color); m_LineRenderer.SetColors(color, color); From 79b7327cc9d5a7e410cb27434fd36a0298bb8daa Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 7 Aug 2017 14:13:58 -0700 Subject: [PATCH 691/870] Fix an issue where the radial menu can be transparent when you are hovering it --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index e2d99219a..3187a2dcb 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -504,20 +504,6 @@ public void OnRayEnter(RayEventData eventData) public void OnRayExit(RayEventData eventData) { - this.RestartCoroutine(ref m_RayExitDelayCoroutine, RayExitDelay()); - } - - IEnumerator RayExitDelay() - { - // Wait before setting highlighted to false if the user is moving the ray between slots - // This delay prevents highlight flickering when navigating the menu via ray vs analog input - var duration = Time.deltaTime; - while (duration < 0.2f) - { - duration += Time.deltaTime; - yield return null; - } - highlighted = false; } } From fb4c42e944117a0730564e866554ed92610283b8 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 7 Aug 2017 16:26:47 -0700 Subject: [PATCH 692/870] Add transition out; Add IGetVRPlayerObjects to let blink ignore player head; Extend arc segments by an Epsilon value to prevent false negatives --- Scripts/Core/EditorVR.Viewer.cs | 10 ++++- .../IGetVRPlayerObjects.cs | 28 +++++++++++++ .../IGetVRPlayerObjects.cs.meta | 12 ++++++ Tools/LocomotionTool/LocomotionTool.cs | 10 ++--- Tools/LocomotionTool/Materials/BlinkLine.mat | 2 +- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 42 ++++++++++--------- 6 files changed, 77 insertions(+), 27 deletions(-) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs.meta diff --git a/Scripts/Core/EditorVR.Viewer.cs b/Scripts/Core/EditorVR.Viewer.cs index 743ae36e6..20d1baf26 100644 --- a/Scripts/Core/EditorVR.Viewer.cs +++ b/Scripts/Core/EditorVR.Viewer.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR && UNITY_EDITORVR using System; using System.Collections; +using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; @@ -39,6 +40,7 @@ class Preferences PlayerBody m_PlayerBody; float m_OriginalNearClipPlane; float m_OriginalFarClipPlane; + readonly List m_VRPlayerObjects = new List(); readonly Preferences m_Preferences = new Preferences(); @@ -55,6 +57,7 @@ public Viewer() IUsesViewerBodyMethods.isAboveHead = IsAboveHead; IUsesViewerScaleMethods.getViewerScale = GetViewerScale; IUsesViewerScaleMethods.setViewerScale = SetViewerScale; + IGetVRPlayerObjectsMethods.getVRPlayerObjects = () => m_VRPlayerObjects; VRView.hmdStatusChange += OnHMDStatusChange; @@ -178,7 +181,12 @@ internal void AddPlayerModel() m_PlayerBody = ObjectUtils.Instantiate(evr.m_PlayerModelPrefab, CameraUtils.GetMainCamera().transform, false).GetComponent(); var renderer = m_PlayerBody.GetComponent(); evr.GetModule().spatialHash.AddObject(renderer, renderer.bounds); - evr.GetModule().ignoreList = renderer.GetComponentsInChildren(true); + var renderers = renderer.GetComponentsInChildren(true); + evr.GetModule().ignoreList = renderers; + foreach (var r in renderers) + { + m_VRPlayerObjects.Add(r.gameObject); + } } internal bool IsOverShoulder(Transform rayOrigin) diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs b/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs new file mode 100644 index 000000000..d3d87497f --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs @@ -0,0 +1,28 @@ +#if UNITY_EDITOR +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provides access to the gameobjects that represent the VR player + /// + public interface IGetVRPlayerObjects + { + } + + public static class IGetVRPlayerObjectsMethods + { + internal static Func> getVRPlayerObjects { get; set; } + + /// + /// Returns objects that are used to represent the VR player + /// + public static List GetVRPlayerObjects(this IGetVRPlayerObjects obj) + { + return getVRPlayerObjects(); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs.meta new file mode 100644 index 000000000..16f509f5a --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4c168dced3c202741b7a04c7cce3c103 +timeCreated: 1502144884 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index c988f704b..20530017e 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -14,7 +14,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, ISetDefaultRayVisibility, ICustomActionMap, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences, - IUsesProxyType + IUsesProxyType, IGetVRPlayerObjects { const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 1f; @@ -156,6 +156,7 @@ void Start() m_BlinkVisualsGO = ObjectUtils.Instantiate(m_BlinkVisualsPrefab, rayOrigin); m_BlinkVisuals = m_BlinkVisualsGO.GetComponentInChildren(); + m_BlinkVisuals.ignoreList = this.GetVRPlayerObjects(); m_BlinkVisualsGO.SetActive(false); m_BlinkVisualsGO.transform.parent = rayOrigin; m_BlinkVisualsGO.transform.localPosition = Vector3.zero; @@ -322,13 +323,12 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) bool DoBlink(ConsumeControlDelegate consumeControl) { - var visuals = m_BlinkVisuals.gameObject; if (m_LocomotionInput.blink.wasJustPressed) { this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); - visuals.SetActive(true); + m_BlinkVisuals.visible = true; consumeControl(m_LocomotionInput.blink); return true; @@ -336,7 +336,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustReleased) { - visuals.SetActive(false); + m_BlinkVisuals.visible = false; if (m_BlinkVisuals.targetPosition.HasValue) StartCoroutine(MoveTowardTarget(m_BlinkVisuals.targetPosition.Value)); @@ -344,7 +344,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) return true; } - if (visuals.activeInHierarchy) + if (m_BlinkVisuals.gameObject.activeInHierarchy) { m_BlinkVisuals.extraSpeed = proxyType == typeof(ViveProxy) ? m_LocomotionInput.speed.value : m_LocomotionInput.altSpeed.value; diff --git a/Tools/LocomotionTool/Materials/BlinkLine.mat b/Tools/LocomotionTool/Materials/BlinkLine.mat index 42e2c7d4d..2159ad72d 100644 --- a/Tools/LocomotionTool/Materials/BlinkLine.mat +++ b/Tools/LocomotionTool/Materials/BlinkLine.mat @@ -7,7 +7,7 @@ Material: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: BlinkLine - m_Shader: {fileID: 4800000, guid: d2d82e816970e9849bc93f1842c33050, type: 3} + m_Shader: {fileID: 4800000, guid: 9cf337af42e23a3459efede97d9f4ba0, type: 3} m_ShaderKeywords: LINE_PERSPECTIVE_WIDTH LINE_WORLD_SPACE m_LightmapFlags: 5 m_EnableInstancingVariants: 0 diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index b4e4dccf7..26701afea 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -1,10 +1,14 @@ using System.Collections; +using System.Collections.Generic; using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast { + const float k_Epsilon = 0.001f; + [SerializeField] float m_LineWidth = 1f; @@ -36,7 +40,7 @@ public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast float m_InvalidThreshold = -0.8f; [SerializeField] - float m_TransitionTime = 0.3f; + float m_TransitionTime = 0.15f; [SerializeField] GameObject m_MotionIndicatorSphere; @@ -52,11 +56,14 @@ public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast Vector3 m_SphereScale; bool m_Visible; float m_TransitionAmount; + Coroutine m_VisibilityCoroutine; public Vector3? targetPosition { get; private set; } public float extraSpeed { private get; set; } + public List ignoreList { private get; set; } + public bool visible { set @@ -69,10 +76,11 @@ public bool visible if (m_Visible) { gameObject.SetActive(true); + this.RestartCoroutine(ref m_VisibilityCoroutine, VisibilityTransition(true)); } - else + else if (gameObject.activeInHierarchy) { - StartCoroutine(VisibilityTransition(false)); + this.RestartCoroutine(ref m_VisibilityCoroutine, VisibilityTransition(false)); } } } @@ -107,8 +115,6 @@ void OnEnable() } m_LineRenderer.SetPositions(m_Positions); - - StartCoroutine(VisibilityTransition(true)); } IEnumerator VisibilityTransition(bool visible) @@ -130,25 +136,17 @@ IEnumerator VisibilityTransition(bool visible) gameObject.SetActive(false); } - void OnDisable() - { - StopAllCoroutines(); - m_TransitionAmount = 0; - } - void Update() { targetPosition = null; - if (Mathf.Approximately(m_TransitionAmount, 0)) - return; - var viewerScale = this.GetViewerScale(); - var lastPosition = transform.position; var timeStep = m_TimeStep * viewerScale; var projectileSpeed = m_ProjectileSpeed + extraSpeed * (m_MaxProjectileSpeed - m_ProjectileSpeed); projectileSpeed *= m_TransitionAmount; - var startVelocity = transform.forward * projectileSpeed * timeStep; + var velocity = transform.forward * projectileSpeed * timeStep; + + var lastPosition = transform.position; var gravity = Physics.gravity * timeStep; m_SpherePosition = (m_SpherePosition + Time.deltaTime * m_Spherespeed) % 1; for (var i = 0; i < m_MaxProjectileSteps; i++) @@ -161,11 +159,14 @@ void Update() } else { - var nextPosition = lastPosition + startVelocity; - startVelocity += gravity; + var nextPosition = lastPosition + velocity; + velocity += gravity; var segment = nextPosition - lastPosition; + if (segment == Vector3.zero) + continue; + if (i < m_SphereCount) { var sphere = m_Spheres[i]; @@ -179,11 +180,12 @@ void Update() m_Spheres[i].gameObject.SetActive(true); } - var ray = new Ray(lastPosition, segment); + var scaledEpsilon = k_Epsilon * viewerScale; + var ray = new Ray(lastPosition - segment.normalized * scaledEpsilon, segment); RaycastHit hit; GameObject go; m_Positions[i] = lastPosition; - if (this.Raycast(ray, out hit, out go, segment.magnitude)) + if (this.Raycast(ray, out hit, out go, segment.magnitude + scaledEpsilon, ignoreList)) targetPosition = hit.point; lastPosition = nextPosition; From c4c0760e902963eb1cb480b4380e6d620d75ce54 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 7 Aug 2017 17:24:26 -0700 Subject: [PATCH 693/870] Fix PinnedToolsMenuUI initialization --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 8646b05d9..3237d970a 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -76,7 +76,9 @@ public Transform rayOrigin set { m_RayOrigin = value; - //Setup(); + // UI is created after RayOrigin is set here + // Ray origin is then set in CreatePinnedToolsUI() + CreatePinnedToolsUI(); } } @@ -101,10 +103,9 @@ public Transform alternateMenuOrigin public event Action hoverExit; public event Action selected; - void Start() + void Awake() { createPinnedToolButton = CreatePinnedToolButton; - CreatePinnedToolsUI(); } void OnDestroy() @@ -115,12 +116,10 @@ void OnDestroy() void CreatePinnedToolsUI() { Debug.LogWarning("Spawing pinned tools menu UI"); - if (m_PinnedToolsMenuUI == null) - m_PinnedToolsMenuUI = this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); - - //this.ConnectInterfaces(m_PinnedToolsMenuUI); REMOVE IConnectInterfaces. already done in InstantiateUI + m_PinnedToolsMenuUI = m_PinnedToolsMenuUI ?? this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; m_PinnedToolsMenuUI.mainMenuActivatorSelected = mainMenuActivatorSelected; + m_PinnedToolsMenuUI.rayOrigin = rayOrigin; m_PinnedToolsMenuUI.buttonHovered += OnButtonHover; m_PinnedToolsMenuUI.buttonClicked += OnButtonClick; From 858dde1d428148dc4244058d6e108b6c7983411c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 7 Aug 2017 18:53:03 -0700 Subject: [PATCH 694/870] Convert relevant IPinnedToolsMenu actions to extension methods --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 7 ++--- .../Scripts/PinnedToolsMenuUI.cs | 2 +- Scripts/Core/EditorVR.PinnedToolButtons.cs | 2 ++ Scripts/Core/EditorVR.Tools.cs | 2 -- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 28 +++++++++++++++++-- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 3237d970a..02ff5e70a 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -64,10 +64,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Action onButtonHoverEnter { get; set; } public Action onButtonHoverExit { get; set; } public Action createPinnedToolButton { get; set; } - public Action mainMenuActivatorSelected { get; set; } public Node? node { get; set; } - - public Action selectTool { get; set; } public IPinnedToolButton previewToolButton { get { return m_MainMenuButton; } } public Transform rayOrigin @@ -118,7 +115,7 @@ void CreatePinnedToolsUI() Debug.LogWarning("Spawing pinned tools menu UI"); m_PinnedToolsMenuUI = m_PinnedToolsMenuUI ?? this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; - m_PinnedToolsMenuUI.mainMenuActivatorSelected = mainMenuActivatorSelected; + m_PinnedToolsMenuUI.mainMenuActivatorSelected = this.MainMenuActivatorSelected; m_PinnedToolsMenuUI.rayOrigin = rayOrigin; m_PinnedToolsMenuUI.buttonHovered += OnButtonHover; m_PinnedToolsMenuUI.buttonClicked += OnButtonClick; @@ -130,7 +127,7 @@ void CreatePinnedToolsUI() pinnedToolsUITransform.localRotation = Quaternion.identity; } - public void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) + void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) { Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); //var buttons = deviceData.buttons; diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 2c2ace12e..0a63e32f3 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -424,7 +424,7 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) } /// - /// Utilized by PinnedToolsMenu to select an existing button by type, without created a new button + /// Utilized by PinnedToolsMenu to select an existing button by type, without creating a new button /// /// Button ToolType to compare against existing button types public void SelectExistingToolType(Type type) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index b905f1d02..ccf511806 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -13,6 +13,8 @@ class PinnedToolButtons : Nested, IInterfaceConnector public PinnedToolButtons() { IPinnedToolsMenuMethods.highlightDevice = HighlightDevice; + IPinnedToolsMenuMethods.mainMenuActivatorSelected = OnMainMenuActivatorSelected; + IPinnedToolsMenuMethods.selectTool = OnToolButtonClicked; } public void ConnectInterface(object obj, Transform rayOrigin = null) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 3d8916e2b..814f42cfd 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -120,8 +120,6 @@ internal static void SpawnDefaultTools(IProxy proxy) // Setup PinnedToolsMenu var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); deviceData.pinnedToolsMenu = pinnedToolsMenu; - pinnedToolsMenu.selectTool = pinnedTools.OnToolButtonClicked; - pinnedToolsMenu.mainMenuActivatorSelected = pinnedTools.OnMainMenuActivatorSelected; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; pinnedToolsMenu.createPinnedToolButton(typeof(IMainMenu), null, deviceData.node); pinnedToolsMenu.createPinnedToolButton(typeof(SelectionTool), selectionToolData.icon, deviceData.node); diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 9d153aa3b..4b5533e90 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -13,9 +13,8 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod bool alternateMenuVisible { set; } Transform rayOrigin { get; set; } IPinnedToolButton previewToolButton { get; } - Action selectTool { set; } - Action mainMenuActivatorSelected { set; } - Action createPinnedToolButton { get; set; } + // This method isn't hooked up in EVR, it should reside in the implementing class + Action createPinnedToolButton { get; } } public static class IPinnedToolsMenuMethods @@ -31,6 +30,29 @@ public static void HighlightDevice(this IPinnedToolsMenu obj, Transform rayOrigi { highlightDevice(rayOrigin, gradientPair); } + + public static Action mainMenuActivatorSelected { get; set; } + + /// + /// + /// + /// + public static void MainMenuActivatorSelected(this IPinnedToolsMenu obj, Transform rayOrigin) + { + mainMenuActivatorSelected(rayOrigin); + } + + public static Action selectTool { get; set; } + + /// + /// + /// + /// + /// + public static void SelectTool(this IPinnedToolsMenu obj, Transform rayOrigin, Type type) + { + selectTool(rayOrigin, type); + } } } #endif From e92139fb54776d48caa27f34e26812a021a7679e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 8 Aug 2017 16:04:22 -0700 Subject: [PATCH 695/870] Fix PinnedToolButton frame mesh being initially transparent. --- Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index af8c0a83c..88a96eb78 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -442,6 +442,7 @@ bool secondaryButtonCollidersEnabled } } + /* public bool revealed { get { return m_Revealed; } @@ -492,6 +493,7 @@ public bool revealed //get { return m_Revealed; } } + */ public Sprite icon { @@ -544,8 +546,8 @@ void Awake() m_OriginalLocalScale = transform.localScale; m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); var frameMaterialColor = m_FrameMaterial.color; - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); + m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, kSemiTransparentAlphaValue); m_IconMaterial = MaterialUtils.GetMaterialClone(m_ButtonIcon); From b077ccc9e27c5900feca3767a9703df1849d058a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 8 Aug 2017 16:56:32 -0700 Subject: [PATCH 696/870] Move MainMenu preview tool button logic into MainMenu, and out of the MainMenuUI & the MainMenuButtons --- Menus/MainMenu/MainMenu.cs | 20 ++++++++++++++---- Menus/MainMenu/Scripts/MainMenuButton.cs | 26 +++--------------------- Menus/MainMenu/Scripts/MainMenuUI.cs | 16 --------------- 3 files changed, 19 insertions(+), 43 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 0d598df4b..872cda7a3 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -83,6 +83,7 @@ public bool visible MainMenuUI m_MainMenuUI; float m_LastRotationInput; readonly Dictionary m_ToolButtons = new Dictionary(); + IPinnedToolButton m_HighlightedPinnedToolbutton; public List menuTools { private get; set; } public List menuWorkspaces { private get; set; } @@ -106,8 +107,6 @@ void Start() m_MainMenuUI.menuOrigin = menuOrigin; m_MainMenuUI.Setup(); m_MainMenuUI.visible = m_Visible; - m_MainMenuUI.buttonHovered += OnButtonHovered; - m_MainMenuUI.buttonClicked += OnButtonClicked; m_MainMenuUI.opening += OnOpening; m_MainMenuUI.closing += OnClosing; @@ -260,7 +259,8 @@ void CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action { // Assign pinned tool button preview properties mainMenuButton.toolType = selectedType; - mainMenuButton.previewToolInPinnedToolButton = previewToolInPinnedToolButton; + mainMenuButton.hovered += OnButtonHovered; + mainMenuButton.clicked += OnButtonClicked; } } @@ -277,9 +277,21 @@ void OnButtonClicked(Transform rayOrigin) this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonClickPulse); } - void OnButtonHovered(Transform rayOrigin) + void OnButtonHovered(Transform rayOrigin, Type buttonType, string buttonDescription) { this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); + + // Track which pointer is over us, so this information can supply context (e.g. selecting a tool for a different hand) + // Enable preview-mode on a pinned tool button; Display on the opposite proxy device by evaluating the entering RayOrigin + if (m_HighlightedPinnedToolbutton != null) + { + // Disable preview-mode on pinned tool button + m_HighlightedPinnedToolbutton.previewToolType = null; // Clear any preview tool type + m_HighlightedPinnedToolbutton = null; + } + + if (buttonType != null && rayOrigin != null) + m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(rayOrigin, buttonType, buttonDescription); } void OnOpening() diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 967eb5f2d..82a8f6ca4 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -18,14 +18,8 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExi Text m_ButtonTitle; Color m_OriginalColor; - IPinnedToolButton m_HighlightedPinnedToolbutton; Transform m_RayOrigin; - /// - /// Highlights a pinned tool button when this menu button is highlighted - /// - public Func previewToolInPinnedToolButton { private get; set; } - public Button button { get { return m_Button; } } public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : null; } } @@ -57,7 +51,7 @@ public bool selected } } - public event Action hovered; + public event Action hovered; public event Action clicked; void Awake() @@ -73,28 +67,14 @@ public void SetData(string name, string description) public void OnRayEnter(RayEventData eventData) { - // Track which pointer is over us, so this information can supply context (e.g. selecting a tool for a different hand) - var interactingRayOrigin = eventData.rayOrigin; - if (toolType != null && interactingRayOrigin != null) - { - // Enable preview-mode on a pinned tool button; Display on the opposite proxy device via the HoveringRayOrigin - m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(interactingRayOrigin, toolType, m_ButtonDescription.text); - // TODO convert to a function that is returned, that is called if non-null, instead of a direct reference to the button. - } - - //m_RayOrigin = eventData.rayOrigin; // TODO: evaluate this need for m_RayOrigin if (hovered != null) - hovered(eventData.rayOrigin); + hovered(eventData.rayOrigin, toolType, m_ButtonDescription.text); } public void OnRayExit(RayEventData eventData) { - // Disable preview-mode on pinned tool button - if (m_HighlightedPinnedToolbutton != null) - m_HighlightedPinnedToolbutton.previewToolType = null; - if (hovered != null) - hovered(eventData.rayOrigin); + hovered(eventData.rayOrigin, null, null); } } } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 4e1bb7d07..150060f93 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -179,8 +179,6 @@ float currentRotation get { return m_MenuFaceRotationOrigin.localRotation.eulerAngles.y; } } - public event Action buttonHovered; - public event Action buttonClicked; public event Action opening; public event Action closing; @@ -251,8 +249,6 @@ public MainMenuButton CreateFaceButton(ButtonData buttonData) var button = ObjectUtils.Instantiate(m_ButtonTemplatePrefab.gameObject); button.name = buttonData.name; var mainMenuButton = button.GetComponent(); - mainMenuButton.clicked += OnButtonClick; - mainMenuButton.hovered += OnButtonHover; if (string.IsNullOrEmpty(buttonData.sectionName)) buttonData.sectionName = k_UncategorizedFaceName; @@ -613,18 +609,6 @@ IEnumerator AnimateFaceReveal(int faceIndex) faceTransform.localScale = targetScale; faceTransform.localPosition = targetPosition; } - - void OnButtonHover(Transform rayOrigin) - { - if (buttonHovered != null) - buttonHovered(rayOrigin); - } - - void OnButtonClick(Transform rayOrigin) - { - if (buttonClicked != null) - buttonClicked(rayOrigin); - } } } #endif From 5dd9c2ce7b4881bc950162cdfb73dd3c7ee17e64 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 8 Aug 2017 15:35:47 -0700 Subject: [PATCH 697/870] Remove InitializeOnLoad; Add untracked meta --- Scripts/Core/EditorVR.cs | 1 - Tests/Editor/Unit.meta | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 Tests/Editor/Unit.meta diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 558746cf3..eb214345f 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -13,7 +13,6 @@ namespace UnityEditor.Experimental.EditorVR.Core { - [InitializeOnLoad] #if UNITY_EDITORVR [RequiresTag(k_VRPlayerTag)] sealed partial class EditorVR : MonoBehaviour diff --git a/Tests/Editor/Unit.meta b/Tests/Editor/Unit.meta new file mode 100644 index 000000000..c656adf59 --- /dev/null +++ b/Tests/Editor/Unit.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9bdb5ea018a1bc84eb34701cbffb0984 +folderAsset: yes +timeCreated: 1501019103 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: From ff653185a8f30978b56bab19d434eff49a227877 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 8 Aug 2017 17:12:45 -0700 Subject: [PATCH 698/870] Remove delay before displaying toolTips in spatialSelection mode; show toolTip for selection tool PinnedToolButton --- Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 88a96eb78..57e56122f 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -396,7 +396,7 @@ public bool highlighted else { //this.Pulse(rayOrigin, 0.005f, 0.2f); // Used for spatial selection highlighting only - Debug.LogWarning("Perform Pulse up in PinnedToolsMenu level"); + this.ShowTooltip(this); } if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) @@ -579,7 +579,7 @@ void Start() //tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; //m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); - var tooltipSourcePosition = new Vector3(0f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); + //var tooltipSourcePosition = new Vector3(0f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); //tooltipSource.localPosition = tooltipSourcePosition; tooltipAlignment = TextAlignment.Center; //m_TooltipTarget.localPosition = new Vector3(0, 0, -0.5f); @@ -1202,7 +1202,6 @@ IEnumerator ShowSecondaryButton() yield return null; } - this.ShowTooltip(this); this.StopCoroutine(ref m_HighlightCoroutine); var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); From 224a4ae0bb51f2b87da6fc692bfd1d33a52d94c7 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 8 Aug 2017 17:42:39 -0700 Subject: [PATCH 699/870] Remove recenter, which was no longer necessary messing with deserialization --- Scripts/Core/VRView.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scripts/Core/VRView.cs b/Scripts/Core/VRView.cs index c44d617d1..94ed2552b 100644 --- a/Scripts/Core/VRView.cs +++ b/Scripts/Core/VRView.cs @@ -148,7 +148,6 @@ public void OnEnable() var currentCamera = Camera.current; Camera.SetupCurrent(m_Camera); VRSettings.enabled = true; - InputTracking.Recenter(); Camera.SetupCurrent(currentCamera); if (viewEnabled != null) From 64ae86fbf7fcd5aa6850e08eed8d753242a66f87 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 8 Aug 2017 18:12:18 -0700 Subject: [PATCH 700/870] Fix localScale vs viewerScale inconsistency in SpatialHint visuals. --- Scripts/Modules/SpatialHintModule/SpatialHintModule.cs | 3 --- Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index 54266091c..0d44c84e4 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -84,9 +84,6 @@ Vector3 spatialHintScrollVisualsRotation set { m_SpatialHintModuleUI.scrollVisualsRotation = value; } } - /// - /// Description - /// Transform spatialHintContentContainer { get { return m_SpatialHintModuleUI.contentContainer; } } void Awake() diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 20e703d17..634b4da34 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -131,6 +131,7 @@ public bool preScrollArrowsVisible m_PreScrollArrowsVisible = value; if (m_PreScrollArrowsVisible) { + transform.localScale = Vector3.one * this.GetViewerScale(); foreach (var arrow in m_PrimaryDirectionalHintArrows) { arrow.visibleColor = k_PrimaryArrowColor; @@ -280,7 +281,7 @@ IEnumerator ShowScrollVisuals() scrollArrowsVisible = true; preScrollArrowsVisible = false; secondaryArrowsVisible = false; - m_ScrollVisualsTransform.localScale = Vector3.one * this.GetViewerScale(); + transform.localScale = Vector3.one * this.GetViewerScale(); m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, Vector3.up);// CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. m_ScrollVisualsCanvasGroup.alpha = 1f; // remove m_ScrollVisualsDragTargetArrowTransform.localPosition = Vector3.zero; @@ -288,6 +289,7 @@ IEnumerator ShowScrollVisuals() const float kTargetDuration = 1f; var currentDuration = 0f; var currentLocalScale = m_ScrollVisualsTransform.localScale; + var targetLocalScale = Vector3.one; var currentAlpha = m_ScrollVisualsCanvasGroup.alpha; var secondArrowCurrentPosition = m_ScrollVisualsDragTargetArrowTransform.position; var normalizedScrollVisualsForward = Vector3.Normalize(m_ScrollVisualsTransform.forward); @@ -306,6 +308,7 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsDragTargetArrowTransform.position - m_ScrollVisualsTransform.position); m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsTransform.position - m_ScrollVisualsDragTargetArrowTransform.position); + m_ScrollVisualsTransform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedDuration); var lineRendererPositions = new Vector3[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrowTransform.position }; m_ScrollHintLine.Positions = lineRendererPositions; m_ScrollHintLine.LineWidth = shapedDuration * this.GetViewerScale(); From 65cb0e0a2694e5dced9af5d7935fd2a98395d62f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 8 Aug 2017 19:33:34 -0700 Subject: [PATCH 701/870] Move setting and clearing of PinnedToolButton preview logic out of the MainMenu structure --- Menus/MainMenu/MainMenu.cs | 16 ++++++---------- Scripts/Core/EditorVR.PinnedToolButtons.cs | 20 ++++++++++++++------ Scripts/Interfaces/Entity/IMainMenu.cs | 9 ++++++--- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 872cda7a3..c89c0fa8e 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -83,7 +83,6 @@ public bool visible MainMenuUI m_MainMenuUI; float m_LastRotationInput; readonly Dictionary m_ToolButtons = new Dictionary(); - IPinnedToolButton m_HighlightedPinnedToolbutton; public List menuTools { private get; set; } public List menuWorkspaces { private get; set; } @@ -92,7 +91,8 @@ public bool visible public List menuActions { get; set; } public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } - public Func previewToolInPinnedToolButton { private get; set; } + public Action previewToolInPinnedToolButton { private get; set; } + public Action clearPinnedToolButtonPreview { private get; set; } public Node? node { get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } @@ -281,17 +281,13 @@ void OnButtonHovered(Transform rayOrigin, Type buttonType, string buttonDescript { this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); - // Track which pointer is over us, so this information can supply context (e.g. selecting a tool for a different hand) + // Pass the pointer which is over us, so this information can supply context (e.g. selecting a tool for a different hand) // Enable preview-mode on a pinned tool button; Display on the opposite proxy device by evaluating the entering RayOrigin - if (m_HighlightedPinnedToolbutton != null) - { - // Disable preview-mode on pinned tool button - m_HighlightedPinnedToolbutton.previewToolType = null; // Clear any preview tool type - m_HighlightedPinnedToolbutton = null; - } + // Disable any existing previews being displayed in PinnedToolsMenus + clearPinnedToolButtonPreview(); if (buttonType != null && rayOrigin != null) - m_HighlightedPinnedToolbutton = previewToolInPinnedToolButton(rayOrigin, buttonType, buttonDescription); + previewToolInPinnedToolButton(rayOrigin, buttonType, buttonDescription); } void OnOpening() diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index ccf511806..e0fafb08d 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -21,7 +21,10 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) { var mainMenu = obj as IMainMenu; if (mainMenu != null) + { mainMenu.previewToolInPinnedToolButton = PreviewToolInPinnedToolButton; + mainMenu.clearPinnedToolButtonPreview = ClearPinnedToolButtonPreview; + } } public void DisconnectInterface(object obj, Transform rayOrigin = null) @@ -39,25 +42,30 @@ internal void HighlightDevice(Transform rayOrigin, GradientPair gradientPair) }); } - internal IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, string toolDescription) + internal void PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, string toolDescription) { // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions if (!toolType.GetInterfaces().Contains(typeof(ITool))) - return null; + return; - IPinnedToolButton previewPinnedToolButton = null; Rays.ForEachProxyDevice((deviceData) => { if (deviceData.rayOrigin == rayOrigin) // Enable pinned tool preview on the opposite (handed) device { - var pinnedToolsMenu = deviceData.pinnedToolsMenu; - previewPinnedToolButton = pinnedToolsMenu.previewToolButton; + var previewPinnedToolButton = deviceData.pinnedToolsMenu.previewToolButton; previewPinnedToolButton.previewToolType = toolType; previewPinnedToolButton.previewToolDescription = toolDescription; + return; } }); + } - return previewPinnedToolButton; + internal void ClearPinnedToolButtonPreview() + { + Rays.ForEachProxyDevice((deviceData) => + { + deviceData.pinnedToolsMenu.previewToolButton.previewToolType = null; + }); } internal void OnToolButtonClicked(Transform rayOrigin, Type toolType) diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 746c20b4f..536760af2 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -41,10 +41,13 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Transform: Ray origin to check /// Type: MenuButton's tool type to preview /// String: The tool description to display as a Tooltip - /// Returns the a pinned tool button that will display the menu-button-tool preview while the button is highlighted on the main menu - /// The returned PinnedToolButton has its preview mode disabled upon a ray exit of the menu button /// - Func previewToolInPinnedToolButton { set; } + Action previewToolInPinnedToolButton { set; } + + /// + /// Clears any PinnedToolButton previews that are set + /// + Action clearPinnedToolButtonPreview { set; } } } #endif From c9d6d825915c7bd3d85c9f1026022a34378f9580 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 8 Aug 2017 19:48:11 -0700 Subject: [PATCH 702/870] Refactor PinnedToolButton preview logic into IMainMenu static methods; IMainMenuMethods; Remove remaining relevant logic from MainMenu; Remove IInterfaceConnector from EditorVR.PinnedToolButtons --- Menus/MainMenu/MainMenu.cs | 6 ++---- Scripts/Core/EditorVR.PinnedToolButtons.cs | 17 +++-------------- Scripts/Interfaces/Entity/IMainMenu.cs | 18 +++++++++++++++--- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index c89c0fa8e..de21124c9 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -91,8 +91,6 @@ public bool visible public List menuActions { get; set; } public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } - public Action previewToolInPinnedToolButton { private get; set; } - public Action clearPinnedToolButtonPreview { private get; set; } public Node? node { get; set; } public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } @@ -284,10 +282,10 @@ void OnButtonHovered(Transform rayOrigin, Type buttonType, string buttonDescript // Pass the pointer which is over us, so this information can supply context (e.g. selecting a tool for a different hand) // Enable preview-mode on a pinned tool button; Display on the opposite proxy device by evaluating the entering RayOrigin // Disable any existing previews being displayed in PinnedToolsMenus - clearPinnedToolButtonPreview(); + this.ClearPinnedToolButtonPreview(); if (buttonType != null && rayOrigin != null) - previewToolInPinnedToolButton(rayOrigin, buttonType, buttonDescription); + this.PreviewInPinnedToolButton(rayOrigin, buttonType, buttonDescription); } void OnOpening() diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index e0fafb08d..567c57980 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -8,27 +8,16 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - class PinnedToolButtons : Nested, IInterfaceConnector + class PinnedToolButtons : Nested { public PinnedToolButtons() { IPinnedToolsMenuMethods.highlightDevice = HighlightDevice; IPinnedToolsMenuMethods.mainMenuActivatorSelected = OnMainMenuActivatorSelected; IPinnedToolsMenuMethods.selectTool = OnToolButtonClicked; - } - public void ConnectInterface(object obj, Transform rayOrigin = null) - { - var mainMenu = obj as IMainMenu; - if (mainMenu != null) - { - mainMenu.previewToolInPinnedToolButton = PreviewToolInPinnedToolButton; - mainMenu.clearPinnedToolButtonPreview = ClearPinnedToolButtonPreview; - } - } - - public void DisconnectInterface(object obj, Transform rayOrigin = null) - { + IMainMenuMethods.previewInPinnedToolButton = PreviewToolInPinnedToolButton; + IMainMenuMethods.clearPinnedToolButtonPreview = ClearPinnedToolButtonPreview; } internal void HighlightDevice(Transform rayOrigin, GradientPair gradientPair) diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 536760af2..417e4cffe 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -1,7 +1,6 @@ #if UNITY_EDITOR using System; using System.Collections.Generic; -using UnityEditor.Experimental.EditorVR.Menus; using UnityEngine; namespace UnityEditor.Experimental.EditorVR @@ -35,6 +34,11 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// The ray origin that spawned the menu and will be used for node-specific operations (e.g. selecting a tool) /// Transform targetRayOrigin { set; } + } + + public static class IMainMenuMethods + { + public static Action previewInPinnedToolButton { get; set; } /// /// Highlights a pinned tool button when a menu button is highlighted @@ -42,12 +46,20 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Type: MenuButton's tool type to preview /// String: The tool description to display as a Tooltip /// - Action previewToolInPinnedToolButton { set; } + public static void PreviewInPinnedToolButton (this IMainMenu obj, Transform rayOrigin, Type toolType, string toolDescription) + { + previewInPinnedToolButton(rayOrigin, toolType, toolDescription); + } + + public static Action clearPinnedToolButtonPreview { get; set; } /// /// Clears any PinnedToolButton previews that are set /// - Action clearPinnedToolButtonPreview { set; } + public static void ClearPinnedToolButtonPreview (this IMainMenu obj) + { + clearPinnedToolButtonPreview(); + } } } #endif From 02e664c18c5e7266e2a907bf7079b4dd60786c0c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 9 Aug 2017 00:48:25 -0700 Subject: [PATCH 703/870] Move PinnedToolButton selection logic up to PinnedToolsMenu --- .../PinnedToolButton/PinnedToolButton.cs | 6 ----- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 7 ++++++ .../Scripts/PinnedToolsMenuUI.cs | 24 +++++++++++++------ Scripts/Core/EditorVR.PinnedToolButtons.cs | 2 ++ Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 2 +- 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 57e56122f..a756fb766 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -340,12 +340,6 @@ public string tooltipText public Action hoverExit { get; set; } public event Action hovered; - //public event Action hovered; - //public event Action clicked; - - //public event Action hoverEnter; - //public event Action hoverExit; - public event Action selected; public bool isActiveTool { diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 02ff5e70a..8207c5211 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -119,6 +119,7 @@ void CreatePinnedToolsUI() m_PinnedToolsMenuUI.rayOrigin = rayOrigin; m_PinnedToolsMenuUI.buttonHovered += OnButtonHover; m_PinnedToolsMenuUI.buttonClicked += OnButtonClick; + m_PinnedToolsMenuUI.buttonSelected += OnButtonSelected; // Alternate menu origin isnt set when awake or start run var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; @@ -315,6 +316,12 @@ void OnButtonHover() { this.Pulse(node, m_ButtonHoverPulse); } + + void OnButtonSelected(Transform rayOrigin, Type buttonType) + { + Debug.LogError("Selecting Tool in PinnedToolsMenu"); + this.SelectTool(rayOrigin, buttonType); + } } } #endif \ No newline at end of file diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 0a63e32f3..cb89a1189 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, ISelectTool, IUsesViewerScale, IUsesNode, IInstantiateUI, + sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IUsesNode, IInstantiateUI, IConnectInterfaces, IControlSpatialHinting, IControlHaptics, IUsesRayOrigin { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation @@ -160,6 +160,7 @@ public Vector3? startingDragOrigin public event Action buttonHovered; public event Action buttonClicked; + public event Action buttonSelected; private Vector3 m_StartingDragOrigin; private Vector3 m_DragTarget; @@ -415,9 +416,12 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1f, showMenuButton)); - bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); - if (!existingButton) - this.SelectTool(rayOrigin, pinnedToolButton.toolType); + if (buttonSelected != null) + { + bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); + if (!existingButton) + buttonSelected(rayOrigin, pinnedToolButton.toolType); + } Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); //this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); @@ -444,7 +448,9 @@ public void SelectNextExistingToolButton() { var button = m_OrderedButtons[aboveMinimumButtonCount ? k_ActiveToolOrderPosition + 1 : k_ActiveToolOrderPosition]; SetupButtonOrderThenSelectTool(button); - this.SelectTool(rayOrigin, button.toolType); + + if (buttonSelected != null) + buttonSelected(rayOrigin, button.toolType); } public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) @@ -481,7 +487,9 @@ public void SelectHighlightedButton() { Debug.LogError("Selecting highlighted button : "+ button.toolType); // Force the selection of the button regardless of it previously existing via a call to EVR that triggers a call to SelectExistingType() - this.SelectTool(rayOrigin, button.toolType); + if (buttonSelected != null) + buttonSelected(rayOrigin, button.toolType); + if (buttonClicked != null) buttonClicked(); @@ -513,7 +521,9 @@ public bool DeleteHighlightedButton() m_OrderedButtons.Remove(button); button.destroy(); button = m_OrderedButtons[k_ActiveToolOrderPosition]; - this.SelectTool(rayOrigin, button.toolType); + + if (buttonSelected != null) + buttonSelected(rayOrigin, button.toolType); } return button != null; diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 567c57980..58a4c2fb7 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -59,6 +59,8 @@ internal void ClearPinnedToolButtonPreview() internal void OnToolButtonClicked(Transform rayOrigin, Type toolType) { + Debug.LogError("Selecting Tool in EditorVR.PinnedToolButtons"); + if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); else diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 4b5533e90..2ea200d89 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR /// /// Gives decorated class Pinned Tools Menu functionality /// - public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode + public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode, ISelectTool { bool alternateMenuVisible { set; } Transform rayOrigin { get; set; } From 76a69a9772e180d7eadf0371de3429faa9f2f6bb Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 14 Aug 2017 10:48:52 -0700 Subject: [PATCH 704/870] Add tooltip to MainMenuActivator when menus are hidden; Update TooltipModule to handle tooltips which change state while hovered --- Prefabs/UI/MainMenuActivator.prefab | 60 +++++++++++++++++++ Scripts/Core/EditorVR.cs | 1 + .../Modules/TooltipModule/TooltipModule.cs | 29 ++++++++- Scripts/UI/MainMenuActivator.cs | 18 +++++- 4 files changed, 106 insertions(+), 2 deletions(-) diff --git a/Prefabs/UI/MainMenuActivator.prefab b/Prefabs/UI/MainMenuActivator.prefab index aeecc7b9f..4030f46f4 100644 --- a/Prefabs/UI/MainMenuActivator.prefab +++ b/Prefabs/UI/MainMenuActivator.prefab @@ -78,6 +78,36 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1044445693346948 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4266906433321582} + m_Layer: 5 + m_Name: TooltipTarget + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1712832307945816 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4177477894796008} + m_Layer: 5 + m_Name: TooltipSource + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4000010187138780 Transform: m_ObjectHideFlags: 1 @@ -130,9 +160,37 @@ Transform: - {fileID: 4000010187138780} - {fileID: 4000011430756646} - {fileID: 4000010854155806} + - {fileID: 4177477894796008} + - {fileID: 4266906433321582} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4177477894796008 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1712832307945816} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.01475} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012631310542} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!4 &4266906433321582 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1044445693346948} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.045} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000012631310542} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!23 &23000010303846554 MeshRenderer: m_ObjectHideFlags: 1 @@ -250,3 +308,5 @@ MonoBehaviour: m_HighlightedPRS: {fileID: 4000011430756646} m_HoverPulse: {fileID: 11400000, guid: d4ac399f781bc824c8c1392fb126398e, type: 2} m_DisabledColor: {r: 0.5019608, g: 0.5019608, b: 0.5019608, a: 0} + m_TooltipSource: {fileID: 4177477894796008} + m_TooltipTarget: {fileID: 4266906433321582} diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 6aeb1b8de..9c9dc4460 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -175,6 +175,7 @@ void Awake() var tooltipModule = AddModule(); m_Interfaces.ConnectInterfaces(tooltipModule); multipleRayInputModule.rayEntered += tooltipModule.OnRayEntered; + multipleRayInputModule.rayHovering += tooltipModule.OnRayHovering; multipleRayInputModule.rayExited += tooltipModule.OnRayExited; AddModule(); diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index 1e326e465..e42cceac1 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -37,6 +37,9 @@ class TooltipData Transform m_TooltipCanvas; Vector3 m_TooltipScale; + // Local method use only -- created here to reduce garbage collection + readonly List m_TooltipsToHide = new List(); + void Start() { m_TooltipCanvas = Instantiate(m_TooltipCanvasPrefab).transform; @@ -50,6 +53,7 @@ void Start() void Update() { + m_TooltipsToHide.Clear(); foreach (var kvp in m_Tooltips) { var tooltip = kvp.Key; @@ -84,6 +88,14 @@ void Update() var lerp = Mathf.Clamp01((hoverTime - k_Delay) / k_TransitionDuration); UpdateVisuals(tooltip, tooltipUI, target, lerp); } + + if (!IsValidTooltip(tooltip)) + m_TooltipsToHide.Add(tooltip); + } + + foreach (var tooltip in m_TooltipsToHide) + { + HideTooltip(tooltip); } } @@ -184,6 +196,16 @@ public void OnRayEntered(GameObject gameObject, RayEventData eventData) ShowTooltip(tooltip); } + public void OnRayHovering(GameObject gameObject, RayEventData eventData) + { + if (gameObject == this.gameObject) + return; + + var tooltip = gameObject.GetComponent(); + if (tooltip != null) + ShowTooltip(tooltip); + } + public void OnRayExited(GameObject gameObject, RayEventData eventData) { if (gameObject && gameObject != this.gameObject) @@ -196,7 +218,7 @@ public void OnRayExited(GameObject gameObject, RayEventData eventData) public void ShowTooltip(ITooltip tooltip) { - if (string.IsNullOrEmpty(tooltip.tooltipText)) + if (!IsValidTooltip(tooltip)) return; if (m_Tooltips.ContainsKey(tooltip)) @@ -208,6 +230,11 @@ public void ShowTooltip(ITooltip tooltip) }; } + static bool IsValidTooltip(ITooltip tooltip) + { + return !string.IsNullOrEmpty(tooltip.tooltipText); + } + public void HideTooltip(ITooltip tooltip) { TooltipData tooltipData; diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index 25ae1102d..b4565ffaf 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -10,7 +10,8 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IUsesMenuOrigins, IControlHaptics, IUsesHandedRayOrigin + sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, + IUsesMenuOrigins, IControlHaptics, IUsesHandedRayOrigin, ITooltip, ITooltipPlacement { readonly Vector3 m_OriginalActivatorLocalPosition = new Vector3(0f, 0f, -0.075f); static readonly float k_AlternateLocationOffset = 0.06f; @@ -65,6 +66,12 @@ public bool activatorButtonMoveAway [SerializeField] Color m_DisabledColor; + [SerializeField] + Transform m_TooltipSource; + + [SerializeField] + Transform m_TooltipTarget; + Vector3 m_OriginalActivatorIconLocalScale; Vector3 m_OriginalActivatorIconLocalPosition; Vector3 m_HighlightedActivatorIconLocalScale; @@ -100,6 +107,15 @@ public bool disabled } } + public string tooltipText + { + get { return m_Disabled ? "Main Menu Hidden" : null; } + } + + public Transform tooltipTarget { get { return m_TooltipTarget; } } + public Transform tooltipSource { get { return m_TooltipSource; } } + public TextAlignment tooltipAlignment { get { return TextAlignment.Center; } } + void Awake() { m_IconMaterial = MaterialUtils.GetMaterialClone(m_Icon); From cf88cb8448ba49bdf08dfcbe6852b43d4cda4a67 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 14 Aug 2017 11:13:09 -0700 Subject: [PATCH 705/870] Move radial menu to opposite hand when direct selecting --- Scripts/Core/EditorVR.Menus.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index a587651f4..5cc22726a 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -178,12 +178,18 @@ internal void UpdateMenuVisibilities() menuHideFlags[menu] |= MenuHideFlags.HasDirectSelection; } + if (alternateMenuVisible) + SetAlternateMenuVisibility(rayOrigin, false); + foreach (var otherDeviceData in m_ActiveDeviceData) { if (otherDeviceData == deviceData) continue; var otherRayOrigin = otherDeviceData.rayOrigin; + if (alternateMenuVisible && otherDeviceData.alternateMenu != null) + SetAlternateMenuVisibility(otherRayOrigin, true); + if (directSelection.IsHovering(otherRayOrigin) || directSelection.IsScaling(otherRayOrigin) || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * viewerScale) { From 5279e02f1f36a518cf1ac5ce6edff819ca72823c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 14 Aug 2017 14:04:37 -0700 Subject: [PATCH 706/870] Rename UnityIcon to MainMenuIcon in PinnedToolsMenu; re-set inspector reference to icon sprite --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 6 +++--- Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 8207c5211..211827ce9 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -18,7 +18,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac const int k_MaxButtonCount = 16; // [SerializeField] - Sprite m_UnityIcon; + Sprite m_MainMenuIcon; [SerializeField] ActionMap m_MainMenuActionMap; @@ -172,7 +172,7 @@ void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) //button.node = deviceData.node; button.rayOrigin = rayOrigin; button.toolType = toolType; // Assign Tool Type before assigning order - button.icon = toolType != typeof(IMainMenu) ? buttonIcon : m_UnityIcon; + button.icon = toolType != typeof(IMainMenu) ? buttonIcon : m_MainMenuIcon; button.highlightSingleButton = HighlightSingleButton; button.selectHighlightedButton = SelectHighlightedButton; //button.selected += OnMainMenuActivatorSelected; @@ -319,7 +319,7 @@ void OnButtonHover() void OnButtonSelected(Transform rayOrigin, Type buttonType) { - Debug.LogError("Selecting Tool in PinnedToolsMenu"); + Debug.LogError("Selecting Tool in PinnedToolsMenu : " + buttonType.ToString()); this.SelectTool(rayOrigin, buttonType); } } diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta index 406b32463..bd86ef116 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta @@ -1,11 +1,11 @@ fileFormatVersion: 2 guid: 800ff7c94496eac41ab0b6df27863704 -timeCreated: 1500942141 +timeCreated: 1502308659 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - - m_UnityIcon: {fileID: 21300000, guid: 05f6f0555fbf99a429004b50ccd6ffa9, type: 3} + - m_MainMenuIcon: {fileID: 21300000, guid: 05f6f0555fbf99a429004b50ccd6ffa9, type: 3} - m_MainMenuActionMap: {fileID: 11400000, guid: 744d823602c92f94ebd746822bed646d, type: 2} - m_PinnedToolsMenuPrefab: {fileID: 114000010527895234, guid: 9df94b11e4f4ed848aa8c4055b378c6a, @@ -18,7 +18,6 @@ MonoImporter: type: 2} - m_ActivationPulse: {fileID: 11400000, guid: c3a3fe0d1f5495c4db58b5282c37a962, type: 2} - - m_ScrollingPulse: {fileID: 11400000, guid: e3b61c818f641ce4fb27eb9d16770364, type: 2} - m_HidingPulse: {fileID: 11400000, guid: 2e01cf9fae741534eaf75d6f0910be3a, type: 2} executionOrder: 0 icon: {instanceID: 0} From ed38ffe64e283e589c339ea4c24a7f50425d137d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 14 Aug 2017 14:05:51 -0700 Subject: [PATCH 707/870] Remove redundant else check in PinnedToolsMenuUI SetupButtonOrderThenSelectTool() --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index cb89a1189..ef7f1edbe 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -407,10 +407,9 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) mainMenuActivatorSelected(rayOrigin); return; } - else if (!aboveMinimumButtonCount) - { + + if (!aboveMinimumButtonCount) showMenuButton = true; - } Reinsert(pinnedToolButton, k_ActiveToolOrderPosition); From 16821ab2eead65db13d2aefffea61db49dbdf594 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 14 Aug 2017 14:39:29 -0700 Subject: [PATCH 708/870] Fix documentation; Demote public delegate in IRayVisibilitySettings; Fix failed NoEditorVR test --- Scripts/Interfaces/Capability/ITwoHandedScaler.cs | 2 +- Scripts/Interfaces/Entity/IMenu.cs | 3 +++ .../FunctionalityInjection/IRayVisibilitySettings.cs | 6 +++--- Scripts/Modules/HierarchyModule.cs | 2 ++ Tools/LocomotionTool/LocomotionTool.cs | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Scripts/Interfaces/Capability/ITwoHandedScaler.cs b/Scripts/Interfaces/Capability/ITwoHandedScaler.cs index 6f8a7d014..ae949963d 100644 --- a/Scripts/Interfaces/Capability/ITwoHandedScaler.cs +++ b/Scripts/Interfaces/Capability/ITwoHandedScaler.cs @@ -4,7 +4,7 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Provides methods and delegates used to directly select and grab scene objects + /// Provides a method used to check the status of two-handed scaling /// public interface ITwoHandedScaler { diff --git a/Scripts/Interfaces/Entity/IMenu.cs b/Scripts/Interfaces/Entity/IMenu.cs index 07b9e2c44..91a185bdb 100644 --- a/Scripts/Interfaces/Entity/IMenu.cs +++ b/Scripts/Interfaces/Entity/IMenu.cs @@ -23,6 +23,9 @@ public interface IMenu /// GameObject menuContent { get; } + /// + /// If the rayOrigin this menu is attached to is hovering UI, hide it if the raycast distance is less than this + /// float hideDistance { get; } } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs b/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs index 2b334e274..f75620bd0 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRayVisibilitySettings.cs @@ -13,11 +13,11 @@ public interface IRayVisibilitySettings public static class IRayVisibilitySettingsMethods { - public delegate void AddRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, + internal delegate void AddRayVisibilitySettingsDelegate(Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0); internal static Action removeRayVisibilitySettings { get; set; } - public static AddRayVisibilitySettingsDelegate addRayVisibilitySettings; + internal static AddRayVisibilitySettingsDelegate addRayVisibilitySettings; /// /// Add visibility settings to try and show/hide the ray/cone @@ -26,7 +26,7 @@ public delegate void AddRayVisibilitySettingsDelegate(Transform rayOrigin, objec /// The object which is adding settings /// Show or hide the ray /// Show or hide the cone - /// The priority level of this request + /// (Optional) The priority level of this request public static void AddRayVisibilitySettings(this IRayVisibilitySettings obj, Transform rayOrigin, object caller, bool rayVisible, bool coneVisible, int priority = 0) { diff --git a/Scripts/Modules/HierarchyModule.cs b/Scripts/Modules/HierarchyModule.cs index 50d5c0f09..74fc61fdd 100644 --- a/Scripts/Modules/HierarchyModule.cs +++ b/Scripts/Modules/HierarchyModule.cs @@ -28,10 +28,12 @@ void Awake() m_IgnoreList.Add(manager.gameObject); } +#if UNITY_EDITORVR foreach (var manager in Resources.FindObjectsOfTypeAll()) { m_IgnoreList.Add(manager.gameObject); } +#endif } void OnEnable() diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 580a01c46..3074009aa 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -484,8 +484,9 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) if (worldResetHeld && otherWorldResetHeld) { m_AllowScaling = false; - +#if UNITY_EDITORVR cameraRig.position = Vector3.up * VRView.HeadHeight; +#endif cameraRig.rotation = Quaternion.identity; ResetViewerScale(); From 0d229f53febb396b73d5415d2ebb4860e81452b4 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 14 Aug 2017 15:09:16 -0700 Subject: [PATCH 709/870] Use thumbpad for multi-select on Vive --- Tools/SelectionTool/SelectionInput.asset | 30 ++++++++++++++++++++++++ Tools/SelectionTool/SelectionInput.cs | 1 + Tools/SelectionTool/SelectionTool.cs | 8 ++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/Tools/SelectionTool/SelectionInput.asset b/Tools/SelectionTool/SelectionInput.asset index 4e9283803..b07927f3f 100644 --- a/Tools/SelectionTool/SelectionInput.asset +++ b/Tools/SelectionTool/SelectionInput.asset @@ -14,6 +14,7 @@ MonoBehaviour: m_Actions: - {fileID: 114000010095369560} - {fileID: 114000010106806814} + - {fileID: 114957470106761538} m_ControlSchemes: - m_Name: SelectionInput m_DeviceSlots: @@ -42,6 +43,15 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 + - sources: + - controlIndex: 22 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 m_MapTypeName: SelectionInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: @@ -85,3 +95,23 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Select defaultValue: 0 +--- !u!114 &114957470106761538 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: Multi Select Alt + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 2 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: Multi Select Alt + defaultValue: 0 diff --git a/Tools/SelectionTool/SelectionInput.cs b/Tools/SelectionTool/SelectionInput.cs index 8f0860b84..fa3e918b4 100644 --- a/Tools/SelectionTool/SelectionInput.cs +++ b/Tools/SelectionTool/SelectionInput.cs @@ -9,5 +9,6 @@ public SelectionInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @multiSelect { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @select { get { return (ButtonInputControl)this[1]; } } + public ButtonInputControl @multiSelectAlt { get { return (ButtonInputControl)this[2]; } } } } diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index 18e001f2a..f151be24d 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Core; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -12,7 +13,8 @@ namespace UnityEditor.Experimental.EditorVR.Tools sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastResults, ICustomActionMap, ISetHighlight, ISelectObject, ISetManipulatorsVisible, IIsHoveringOverUI, IUsesDirectSelection, ILinkedObject, ICanGrabObject, IGetManipulatorDragState, IUsesNode, IGetRayVisibility, IIsMainMenuVisible, IIsInMiniWorld, - IRayToNode, IGetDefaultRayColor, ISetDefaultRayColor, ITooltip, ITooltipPlacement, ISetTooltipVisibility + IRayToNode, IGetDefaultRayColor, ISetDefaultRayColor, ITooltip, ITooltipPlacement, ISetTooltipVisibility, + IUsesProxyType { const float k_MultiselectHueShift = 0.5f; static readonly Vector3 k_TooltipPosition = new Vector3(0, 0.05f, -0.03f); @@ -42,6 +44,7 @@ sealed class SelectionTool : MonoBehaviour, ITool, IUsesRayOrigin, IUsesRaycastR public event Action hovered; public List linkedObjects { get; set; } + public Type proxyType { get; set; } public string tooltipText { get { return m_MultiSelect ? "Multi-Select Enabled" : ""; } } public Transform tooltipTarget { get; private set; } @@ -70,6 +73,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_SelectionInput = (SelectionInput)input; var multiSelectControl = m_SelectionInput.multiSelect; + if (proxyType == typeof(ViveProxy)) + multiSelectControl = m_SelectionInput.multiSelectAlt; + if (multiSelectControl.wasJustPressed) { var realTime = Time.realtimeSinceStartup; From 822db97c055417d9070bb578283143a3ac11b7c3 Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Mon, 14 Aug 2017 15:12:41 -0700 Subject: [PATCH 710/870] object utils test cleanup --- .../Editor/Unit/Utilities/ObjectUtilsTests.cs | 321 ++++++++++-------- 1 file changed, 172 insertions(+), 149 deletions(-) diff --git a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs index 9530de710..141eb1bec 100644 --- a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs +++ b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs @@ -10,154 +10,177 @@ namespace UnityEditor.Experimental.EditorVR.Tests.Utilities [TestFixture] public class ObjectUtilsTests { - GameObject go, parent, other; - float delta = 0.00000001f; - - [SetUp] - public void BeforeEach() - { - go = new GameObject("object utils test"); - parent = new GameObject("parent"); - parent.transform.position += new Vector3(2, 4, 8); - other = new GameObject("other"); - other.transform.position += new Vector3(-5, 1, 2); - } - - [Test] - public void Instantiate_OneArg_ClonesActiveAtOrigin() - { - var clone = ObjectUtils.Instantiate(go); - Assert.IsTrue(clone.activeSelf); - Assert.AreEqual(new Vector3(0, 0, 0), clone.transform.position); - } - - [Test] - public void Instantiate_InactiveClone() - { - var clone = ObjectUtils.Instantiate(go, null, true, true, false); - Assert.IsFalse(clone.activeSelf); - } - - [Test] - public void Instantiate_WithParent_WorldPositionStays() - { - var clone = ObjectUtils.Instantiate(go, parent.transform); - Assert.AreEqual(parent.transform, clone.transform.parent); - Assert.AreNotEqual(parent.transform.position, clone.transform.position); - } - - [Test] - public void Instantiate_WithParent_WorldPositionMoves() - { - var clone = ObjectUtils.Instantiate(go, parent.transform, false); - Assert.AreEqual(parent.transform, clone.transform.parent); - Assert.AreEqual(parent.transform.position, clone.transform.position); - Assert.AreEqual(parent.transform.rotation, clone.transform.rotation); - } - - [TestCase(true)] - [TestCase(false)] - public void Instantiate_SetRunInEditMode(bool expected) - { - Assert.IsFalse(Application.isPlaying); - var clone = ObjectUtils.Instantiate(go, null, true, expected); - AssertRunInEditModeSet(clone, expected); - } - - [UnityTest] - public IEnumerator Destroy_OneArg_DestroysImmediately_InEditMode() - { - Assert.IsFalse(Application.isPlaying); - ObjectUtils.Destroy(other); - yield return null; // skip frame to allow destruction to run - Assert.IsTrue(other == null); - } - - // here, we could test the other types of calls to Destroy / Instantiate, but that - // would require refactor / making some things "internal" instead of private, - // as well as figuring out how we want to do mocking / stubs - hard to test coroutines - - [Test] - public void CreateGameObjectWithComponent_OneArg_TypeAsGeneric() - { - var renderer = ObjectUtils.CreateGameObjectWithComponent(); - // the object name assigned is based on the component's type name - var foundObject = GameObject.Find(typeof(MeshRenderer).Name); - Assert.IsInstanceOf(renderer); - Assert.IsInstanceOf(foundObject.GetComponent()); - } - - [Test] - public void CreateGameObjectWithComponent_SetsParent_WorldPositionStays() - { - var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform); - Assert.AreEqual(parent.transform, comp.transform.parent); - Assert.AreNotEqual(parent.transform.position, comp.transform.position); - } - - [Test] - public void CreateGameObjectWithComponent_SetsParent_WorldPositionMoves() - { - var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform, false); - Assert.AreEqual(parent.transform, comp.transform.parent); - Assert.AreEqual(parent.transform.position, comp.transform.position); - } - - [Test] - public void AddComponent_AddsToObject_TypeAsGeneric() - { - var instance = ObjectUtils.AddComponent(other); - var onObject = other.GetComponent(); - Assert.IsInstanceOf(instance); - Assert.AreEqual(instance, onObject); - AssertRunInEditModeSet(other, true); - } - - [Test] - public void AddComponent_AddsToObject_TypeAsArg() - { - var instance = ObjectUtils.AddComponent(typeof(MeshRenderer), other); - var onObject = other.GetComponent(); - Assert.IsInstanceOf(instance); - Assert.AreEqual((MeshRenderer)instance, onObject); - AssertRunInEditModeSet(other, true); - } - - [Test] - public void GetBounds_WithoutExtents() - { - var localBounds = new Bounds(other.transform.position, new Vector3(0, 0, 0)); - var bounds = ObjectUtils.GetBounds(other.transform); - - Assert.AreEqual(localBounds, bounds); - } - - [Test] - public void GetBounds_Array() - { - var gameObjectA = new GameObject(); - gameObjectA.transform.position += new Vector3(-5, -2, 8); - var gameObjectB = new GameObject(); - gameObjectB.transform.position += new Vector3(2, 6, 4); - var transforms = new Transform[] { gameObjectA.transform, gameObjectB.transform }; - - var bounds = ObjectUtils.GetBounds(transforms); - Bounds expected = new Bounds(new Vector3(-1.5f, 2f, 6f), new Vector3(7f, 8f, 4f)); - - Assert.That(bounds, Is.EqualTo(expected).Within(delta)); - } - - [TearDown] - public void Cleanup() { } - - // this doesn't actually do it recursively yet - private void AssertRunInEditModeSet(GameObject go, bool expected) - { - var MBs = go.GetComponents(); - foreach (var mb in MBs) - { - Assert.AreEqual(expected, mb.runInEditMode); - } - } + GameObject go, parent, other; + GameObject currentObject; + GameObject boundsA, boundsB; + + float delta = 0.00000001f; + + [SetUp] + public void BeforeEach() + { + go = new GameObject("object utils test"); + parent = new GameObject("parent"); + parent.transform.position += new Vector3(2, 4, 8); + other = new GameObject("other"); + other.transform.position += new Vector3(-5, 1, 2); + } + + [Test] + public void Instantiate_OneArg_ClonesActiveAtOrigin() + { + currentObject = ObjectUtils.Instantiate(go); + Assert.IsTrue(currentObject.activeSelf); + Assert.AreEqual(new Vector3(0, 0, 0), currentObject.transform.position); + } + + [Test] + public void Instantiate_InactiveClone() + { + currentObject = ObjectUtils.Instantiate(go, null, true, true, false); + Assert.IsFalse(currentObject.activeSelf); + } + + [Test] + public void Instantiate_WithParent_WorldPositionStays() + { + currentObject = ObjectUtils.Instantiate(go, parent.transform); + Assert.AreEqual(parent.transform, currentObject.transform.parent); + Assert.AreNotEqual(parent.transform.position, currentObject.transform.position); + } + + [Test] + public void Instantiate_WithParent_WorldPositionMoves() + { + currentObject = ObjectUtils.Instantiate(go, parent.transform, false); + Assert.AreEqual(parent.transform, currentObject.transform.parent); + Assert.AreEqual(parent.transform.position, currentObject.transform.position); + Assert.AreEqual(parent.transform.rotation, currentObject.transform.rotation); + } + + [TestCase(true)] + [TestCase(false)] + public void Instantiate_SetRunInEditMode(bool expected) + { + Assert.IsFalse(Application.isPlaying); + currentObject = ObjectUtils.Instantiate(go, null, true, expected); + AssertRunInEditModeSet(currentObject, expected); + } + + [UnityTest] + public IEnumerator Destroy_OneArg_DestroysImmediately_InEditMode() + { + Assert.IsFalse(Application.isPlaying); + ObjectUtils.Destroy(other); + yield return null; // skip frame to allow destruction to run + Assert.IsTrue(other == null); + } + + // here, we could test the other types of calls to Destroy / Instantiate, but that + // would require refactor / making some things "internal" instead of private, + // as well as figuring out how we want to do mocking / stubs - hard to test coroutines + + [Test] + public void CreateGameObjectWithComponent_OneArg_TypeAsGeneric() + { + var renderer = ObjectUtils.CreateGameObjectWithComponent(); + currentObject = renderer.gameObject; + // the object name assigned is based on the component's type name + var foundObject = GameObject.Find(typeof(MeshRenderer).Name); + Assert.IsInstanceOf(renderer); + Assert.IsInstanceOf(foundObject.GetComponent()); + } + + [Test] + public void CreateGameObjectWithComponent_SetsParent_WorldPositionStays() + { + var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform); + currentObject = comp.gameObject; + Assert.AreEqual(parent.transform, comp.transform.parent); + Assert.AreNotEqual(parent.transform.position, comp.transform.position); + } + + [Test] + public void CreateGameObjectWithComponent_SetsParent_WorldPositionMoves() + { + var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform, false); + currentObject = comp.gameObject; + Assert.AreEqual(parent.transform, comp.transform.parent); + Assert.AreEqual(parent.transform.position, comp.transform.position); + } + + [Test] + public void AddComponent_AddsToObject_TypeAsGeneric() + { + var instance = ObjectUtils.AddComponent(other); + var onObject = other.GetComponent(); + Assert.IsInstanceOf(instance); + Assert.AreEqual(instance, onObject); + AssertRunInEditModeSet(other, true); + } + + [Test] + public void AddComponent_AddsToObject_TypeAsArg() + { + var instance = ObjectUtils.AddComponent(typeof(MeshRenderer), other); + var onObject = other.GetComponent(); + Assert.IsInstanceOf(instance); + Assert.AreEqual((MeshRenderer)instance, onObject); + AssertRunInEditModeSet(other, true); + } + + [Test] + public void GetBounds_WithoutExtents() + { + var localBounds = new Bounds(other.transform.position, new Vector3(0, 0, 0)); + var bounds = ObjectUtils.GetBounds(other.transform); + + Assert.AreEqual(localBounds, bounds); + } + + [Test] + public void GetBounds_Array() + { + boundsA = new GameObject(); + boundsA.transform.position += new Vector3(-5, -2, 8); + boundsB = new GameObject(); + boundsB.transform.position += new Vector3(2, 6, 4); + var transforms = new Transform[] { boundsA.transform, boundsB.transform }; + + var bounds = ObjectUtils.GetBounds(transforms); + Bounds expected = new Bounds(new Vector3(-1.5f, 2f, 6f), new Vector3(7f, 8f, 4f)); + + Assert.That(bounds, Is.EqualTo(expected).Within(delta)); + } + + [TearDown] + public void CleanupAfterEach() + { + ObjectUtils.Destroy(go); + ObjectUtils.Destroy(parent); + ObjectUtils.Destroy(other); + + if (currentObject != null) + { + ObjectUtils.Destroy(currentObject); + } + } + + [OneTimeTearDown] + public void CleanupAfterAll() + { + ObjectUtils.Destroy(boundsA); + ObjectUtils.Destroy(boundsB); + } + + // this doesn't actually do it recursively yet + private void AssertRunInEditModeSet(GameObject go, bool expected) + { + var MBs = go.GetComponents(); + foreach (var mb in MBs) + { + Assert.AreEqual(expected, mb.runInEditMode); + } + } } } From 819ff3ff17210eba20e4dbe3b51ced79ebc147f6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 14 Aug 2017 16:33:17 -0700 Subject: [PATCH 711/870] Allow GradientButton begin and end highlight animated duration to be set in the inspector. --- Scripts/UI/GradientButton.cs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 5d5c179e2..aaa488c92 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -185,6 +185,12 @@ public Sprite icon [SerializeField] float m_IconHighlightedLocalZOffset = -0.0015f; + [SerializeField] + float m_BeginHighlightDuration = 0.25f; + + [SerializeField] + float m_EndHighlightDuration = 0.167f; + [Header("Animated Reveal Settings")] [Tooltip("Default value is 0.25")] // If AnimatedReveal is enabled, wait this duration before performing the reveal @@ -377,19 +383,16 @@ IEnumerator BeginHighlight() this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsBeginHighlight()); - const float kTargetTransitionAmount = 1f; var transitionAmount = Time.deltaTime; - var shapedTransitionAmount = 0f; var currentGradientPair = GetMaterialColors(); var targetGradientPair = highlightGradientPair; var currentLocalScale = m_ContentContainer.localScale; var highlightedLocalScale = highlightScale; - while (transitionAmount < kTargetTransitionAmount) + var highlightDuration = m_BeginHighlightDuration > 0f ? m_BeginHighlightDuration : 0.01f; // Add sane default if highlight duration is zero + while (transitionAmount < highlightDuration) { - transitionAmount += Time.unscaledDeltaTime * 4; - shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + var shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount += Time.unscaledDeltaTime / highlightDuration); m_ContentContainer.localScale = Vector3.Lerp(currentLocalScale, highlightedLocalScale, shapedTransitionAmount); - currentGradientPair = GradientPair.Lerp(currentGradientPair, targetGradientPair, shapedTransitionAmount); SetMaterialColors(currentGradientPair); yield return null; @@ -408,21 +411,17 @@ IEnumerator EndHighlight() this.StopCoroutine(ref m_IconHighlightCoroutine); m_IconHighlightCoroutine = StartCoroutine(IconContainerContentsEndHighlight()); - const float kTargetTransitionAmount = 1f; var transitionAmount = Time.deltaTime; - var shapedTransitionAmount = 0f; var originalGradientPair = GetMaterialColors(); var targetGradientPair = normalGradientPair; var currentLocalScale = m_ContentContainer.localScale; var targetScale = originalScale; - while (transitionAmount < kTargetTransitionAmount) + var highlightDuration = m_EndHighlightDuration > 0f ? m_EndHighlightDuration : 0.01f; // Add sane default if highlight duration is zero + while (transitionAmount < highlightDuration) { - transitionAmount += Time.unscaledDeltaTime * 6; - shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); + var shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount += Time.unscaledDeltaTime / highlightDuration); var transitioningGradientPair = GradientPair.Lerp(originalGradientPair, targetGradientPair, shapedTransitionAmount); - SetMaterialColors(transitioningGradientPair); - m_ContentContainer.localScale = Vector3.Lerp(currentLocalScale, targetScale, shapedTransitionAmount); yield return null; } From 641fc2ea6721b97f9333f6406b8e516bfcd7742f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 14 Aug 2017 16:36:23 -0700 Subject: [PATCH 712/870] Set custom begin & end animated highlight durations for secondary (close) button, in PinnedToolButton prefab --- .../PinnedToolButton/PinnedToolButton.prefab | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab index 280ad7bc2..97f6b3c36 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab @@ -850,7 +850,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_NormalGradientPair: - a: {r: 1, g: 0.92156863, b: 0.93333334, a: 1} + a: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} b: {r: 0.7176471, g: 0.10980392, b: 0.10980392, a: 1} m_HighlightGradientPair: a: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} @@ -862,11 +862,13 @@ MonoBehaviour: m_Text: {fileID: 114000010635728284} m_Icon: {fileID: 114000012344975988} m_AlternateIconSprite: {fileID: 0} - m_NormalContentColor: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + m_NormalContentColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItems: - {fileID: 114000012344975988} m_IconHighlightedLocalZOffset: -0.0015 + m_BeginHighlightDuration: 0.25 + m_EndHighlightDuration: 0.3 m_DelayBeforeReveal: 0 m_highlightZScaleMultiplier: 25 --- !u!114 &114000010635728284 @@ -1056,6 +1058,8 @@ MonoBehaviour: - {fileID: 114000011650556854} - {fileID: 114000013859744370} m_IconHighlightedLocalZOffset: -0.0155 + m_BeginHighlightDuration: 0.25 + m_EndHighlightDuration: 0.167 m_DelayBeforeReveal: 0 m_highlightZScaleMultiplier: 10 --- !u!137 &137000010072420284 @@ -1352,7 +1356,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014093660532} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.15000011} + m_LocalPosition: {x: 0, y: 0, z: -0.15106471} m_LocalScale: {x: 0.42501074, y: 0.49999997, z: 0.42501074} m_Children: [] m_Father: {fileID: 4000012648346800} From 790eaf210a562a761fd7e6f4242d6ba1756963bc Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 14 Aug 2017 16:58:54 -0700 Subject: [PATCH 713/870] Fix secondary button highlight handling; reduce logic complexity in handling highlighted states --- .../PinnedToolButton/PinnedToolButton.cs | 100 +++++++----------- .../PinnedToolButton/PinnedToolButton.prefab | 4 +- 2 files changed, 42 insertions(+), 62 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index a756fb766..cb94aa190 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -388,13 +388,11 @@ public bool highlighted if (!m_Highlighted) this.HideTooltip(this); else - { - //this.Pulse(rayOrigin, 0.005f, 0.2f); // Used for spatial selection highlighting only this.ShowTooltip(this); - } if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) { + // This show/hide functionality utilized by spatial scrolling if (m_Highlighted) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); else @@ -582,8 +580,6 @@ void Start() m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions m_GradientButton.hoverExit += OnActionButtonHoverExit; m_GradientButton.click += OnBackgroundButtonClick; - m_GradientButton.highlightStart += OnPrimaryButtonHighlightStart; - m_GradientButton.highlightEnd += OnPrimaryButtonHighlightEnd; m_GradientButton.containerContentsAnimationSpeedMultiplier = kIncreasedContainerContentsSpeedMultiplier; m_FrameRenderer.SetBlendShapeWeight(1, 0f); @@ -1185,23 +1181,44 @@ void CorrectIconRotation() IEnumerator ShowSecondaryButton() { //Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); - const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; - const float kSecondaryButtonVisibleBlendShapeWeight = 46f; - const float kMaxDelayDuration = 0.25f; - const int kDurationMultiplier = 10; - var delayDuration = 0f; - while (delayDuration < kMaxDelayDuration) + + // Don't perform additional animated visuals if already in a fully revealed state + if (Mathf.Approximately(m_SecondaryButtonContainerCanvasGroup.alpha, 1f)) { - delayDuration += Time.unscaledDeltaTime; + m_SecondaryButtonVisibilityCoroutine = null; + yield break; + } + + const float kSecondaryButtonFrameVisibleBlendShapeWeight = 16f; // The extra amount of the frame to show on hover-before the full reveal of the secondary button + const float kTargetDuration = 1f; + const int kIntroDurationMultiplier = 10; + var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + var currentDuration = 0f; + while (currentDuration < kTargetDuration) + { + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * kIntroDurationMultiplier); + m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kSecondaryButtonFrameVisibleBlendShapeWeight, shapedAmount)); + yield return null; + } + + const float kDelayBeforeSecondaryButtonReveal = 0.25f; + currentDuration = 0f; + while (currentDuration < kDelayBeforeSecondaryButtonReveal) + { + currentDuration += Time.unscaledDeltaTime; yield return null; } + const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; + const float kSecondaryButtonVisibleBlendShapeWeight = 46f; + const int kDurationMultiplier = 25; + this.StopCoroutine(ref m_HighlightCoroutine); var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; - var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - var currentDuration = 0f; + currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); + currentDuration = 0f; while (currentDuration < 1f) { currentDuration += Time.unscaledDeltaTime * kDurationMultiplier; @@ -1218,8 +1235,16 @@ IEnumerator ShowSecondaryButton() IEnumerator HideSecondaryButton() { + const float kMaxDelayDuration = 0.125f; + var delayDuration = 0f; + while (delayDuration < kMaxDelayDuration) + { + delayDuration += Time.unscaledDeltaTime; + yield return null; + } + const float kSecondaryButtonHiddenBlendShapeWeight = 100f; - const int kDurationMultiplier = 8; + const int kDurationMultiplier = 12; var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; @@ -1246,51 +1271,6 @@ IEnumerator HideSecondaryButton() m_SecondaryButtonVisibilityCoroutine = null; } - - void OnPrimaryButtonHighlightStart () - { - if (!isMainMenu) - this.RestartCoroutine(ref m_HighlightCoroutine, PerformPrimaryButtonHighlightStart()); - } - - void OnPrimaryButtonHighlightEnd () - { - if (m_HighlightCoroutine != null) - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, PerformPrimaryButtonHighlightEnd()); - } - - IEnumerator PerformPrimaryButtonHighlightStart() - { - const float kSecondaryButtonFrameVisibleBlendShapeWeight = 16f; - const float kTargetDuration = 1f; - const int kDurationMultiplier = 25; - var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - var currentDuration = 0f; - while (currentDuration < kTargetDuration) - { - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * kDurationMultiplier); - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kSecondaryButtonFrameVisibleBlendShapeWeight, shapedAmount)); - yield return null; - } - } - - IEnumerator PerformPrimaryButtonHighlightEnd() - { - const float kSecondaryButtonFrameHiddenBlendShapeWeight = 0f; - const float kTargetDuration = 1f; - const int kDurationMultiplier = 5; - var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - this.hideTooltip(this); - var currentDuration = 0f; - while (currentDuration < kTargetDuration) - { - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * kDurationMultiplier); - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kSecondaryButtonFrameHiddenBlendShapeWeight, shapedAmount)); - yield return null; - } - - m_HighlightCoroutine = null; - } } } #endif diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab index 97f6b3c36..938da5b1b 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab @@ -866,7 +866,7 @@ MonoBehaviour: m_HighlightItemColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightItems: - {fileID: 114000012344975988} - m_IconHighlightedLocalZOffset: -0.0015 + m_IconHighlightedLocalZOffset: -0.005 m_BeginHighlightDuration: 0.25 m_EndHighlightDuration: 0.3 m_DelayBeforeReveal: 0 @@ -1356,7 +1356,7 @@ RectTransform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014093660532} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.15106471} + m_LocalPosition: {x: 0, y: 0, z: -0.1517516} m_LocalScale: {x: 0.42501074, y: 0.49999997, z: 0.42501074} m_Children: [] m_Father: {fileID: 4000012648346800} From f4acb15b2b43ca4eef600d074182dfdda6640280 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 14 Aug 2017 17:00:35 -0700 Subject: [PATCH 714/870] Remove k_RayHidePriority because it is no longer needed --- Tools/LocomotionTool/LocomotionTool.cs | 10 ++++------ Tools/TransformTool/TransformTool.cs | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 3074009aa..28b867bfc 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -20,8 +20,6 @@ sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, const float k_RotationThreshold = 0.75f; const float k_DistanceThreshold = 0.02f; - const int k_RayHidePriority = 2; - //TODO: Fix triangle intersection test at tiny scales, so this can go back to 0.01 const float k_MinScale = 0.1f; const float k_MaxScale = 1000f; @@ -328,7 +326,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_Crawling = true; m_RigStartPosition = cameraRig.position; m_RayOriginStartPosition = m_RigStartPosition - rayOrigin.position; - this.AddRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + this.AddRayVisibilitySettings(rayOrigin, this, false, false); } if (m_Crawling) @@ -349,7 +347,7 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_LocomotionInput.blink.wasJustPressed && !m_BlinkVisuals.outOfMaxRange) { m_State = State.Aiming; - this.AddRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); + this.AddRayVisibilitySettings(rayOrigin, this, false, false); m_BlinkVisuals.ShowVisuals(); @@ -411,8 +409,8 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) var otherPosition = cameraRig.InverseTransformPoint(otherRayOrigin.position); var distance = Vector3.Distance(thisPosition, otherPosition); - this.AddRayVisibilitySettings(rayOrigin, this, false, false, k_RayHidePriority); - this.AddRayVisibilitySettings(otherRayOrigin, this, false, false, k_RayHidePriority); + this.AddRayVisibilitySettings(rayOrigin, this, false, false); + this.AddRayVisibilitySettings(otherRayOrigin, this, false, false); var rayToRay = otherPosition - thisPosition; var midPoint = thisPosition + rayToRay * 0.5f; diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 84e6a0f11..7e5775bf3 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -20,8 +20,6 @@ sealed class TransformTool : MonoBehaviour, ITool, ITransformer, ISelectionChang const float k_DirectLazyFollowTranslate = 20f; const float k_DirectLazyFollowRotate = 30f; - const int k_RayHidePriority = 1; - class GrabData { Vector3[] m_PositionOffsets; @@ -332,7 +330,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!this.CanGrabObject(directHoveredObject, directRayOrigin)) continue; - this.AddRayVisibilitySettings(directRayOrigin, this, false, true, k_RayHidePriority); // This will also disable ray selection + this.AddRayVisibilitySettings(directRayOrigin, this, false, true); // This will also disable ray selection if (!this.IsConeVisible(directRayOrigin)) continue; @@ -562,7 +560,7 @@ public Transform[] GetHeldObjects(Node node) // Prevent lock from getting stuck this.RemoveRayVisibilitySettings(rayOrigin, this); - this.AddRayVisibilitySettings(destRayOrigin, this, false, true, k_RayHidePriority); + this.AddRayVisibilitySettings(destRayOrigin, this, false, true); if (objectsTransferred != null) objectsTransferred(rayOrigin, destRayOrigin); From 81c3f81fd64b7948ce15377ad61ce61c7997eb84 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 14 Aug 2017 19:24:44 -0700 Subject: [PATCH 715/870] Fix some cases in which tools are no longer selectable after recent refactors --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 1 - .../Scripts/PinnedToolsMenuUI.cs | 58 +++++++++++-------- Scripts/Core/EditorVR.PinnedToolButtons.cs | 2 +- .../SpatialHintModule/SpatialHintModuleUI.cs | 4 -- 4 files changed, 35 insertions(+), 30 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 211827ce9..17a3b2cd7 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -240,7 +240,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon //selectHighlightedButton(rayOrigin); //OnActionButtonHoverExit(false); - //KEEP deleteHighlightedButton(rayOrigin); // convert to method in IPinnedToolsMenu interface if (m_PinnedToolsMenuUI.DeleteHighlightedButton()) { buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index ef7f1edbe..a3ab84619 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -241,7 +241,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) button.showAllButtons = ShowAllButtons; button.hoverExit = ButtonHoverExitPerformed; button.maxButtonCount = maxButtonCount; - button.selectTool = SelectExistingToolType; + button.selectTool = SelectExistingToolTypeFromButton; button.closeButton = DeleteHighlightedButton; button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount button.iconHighlightedLocalZOffset = k_RaySelectIconHighlightedZOffset; @@ -278,14 +278,6 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1.25f, false)); else SetupButtonOrder(); // Setup the MainMenu and active tool buttons only - /* - - foreach (var pair in pinnedToolButtons) - { - if (pair.Value.order != pair.Value.menuButtonOrderPosition) // don't move the main menu button - pair.Value.order++; - } - */ } IEnumerator ShowThenHideAllButtons(float delayBeforeHiding = 1.25f, bool showMenuButton = true) @@ -397,33 +389,28 @@ void ShowOnlyMenuAndActiveToolButtons() } } - void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton) + void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton, bool selectAfterSettingButtonOrder = true) { Debug.LogError(" SetupButtonOrderThenSelectTool - Selecting of type : " + pinnedToolButton.toolType); var mainMenu = IsMainMenuButton(pinnedToolButton); - var showMenuButton = false; if (mainMenu) { mainMenuActivatorSelected(rayOrigin); return; } - if (!aboveMinimumButtonCount) - showMenuButton = true; + var showMenuButton = !aboveMinimumButtonCount; Reinsert(pinnedToolButton, k_ActiveToolOrderPosition); this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1f, showMenuButton)); - if (buttonSelected != null) + if (selectAfterSettingButtonOrder && buttonSelected != null) { bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); if (!existingButton) - buttonSelected(rayOrigin, pinnedToolButton.toolType); + buttonSelected(rayOrigin, pinnedToolButton.toolType); // Select the tool in the PinnedToolsMenu } - - Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); - //this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); } /// @@ -437,7 +424,24 @@ public void SelectExistingToolType(Type type) { if (button.toolType == type) { - SetupButtonOrderThenSelectTool(button); + SetupButtonOrderThenSelectTool(button, false); + return; + } + } + } + + /// + /// Utilized by PinnedToolsMenuButtons to select an existing button by type, without creating a new button + /// + /// Button ToolType to compare against existing button types + void SelectExistingToolTypeFromButton(Type type) + { + Debug.LogError("Selecting Existing ToolType : " + type.ToString()); + foreach (var button in m_OrderedButtons) + { + if (button.toolType == type) + { + SetupButtonOrderThenSelectTool(button, true); return; } } @@ -448,8 +452,8 @@ public void SelectNextExistingToolButton() var button = m_OrderedButtons[aboveMinimumButtonCount ? k_ActiveToolOrderPosition + 1 : k_ActiveToolOrderPosition]; SetupButtonOrderThenSelectTool(button); - if (buttonSelected != null) - buttonSelected(rayOrigin, button.toolType); + //if (buttonSelected != null) + //buttonSelected(rayOrigin, button.toolType); } public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) @@ -476,6 +480,9 @@ public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) } } + /// + /// Used when spatially selecting a highlighted button + /// public void SelectHighlightedButton() { for (int i = 0; i < m_OrderedButtons.Count; ++i) @@ -493,13 +500,16 @@ public void SelectHighlightedButton() buttonClicked(); allButtonsVisible = false; - //SpatialHintState = SpatialHintModule.SpatialHintStateFlags.Hidden; return; } } } + /// + /// Delete a highlighted button, then select the next active tool button + /// + /// Bool denoting that a highlighted button other than the selection tool button was deleted public bool DeleteHighlightedButton() { IPinnedToolButton button = null; @@ -519,10 +529,10 @@ public bool DeleteHighlightedButton() { m_OrderedButtons.Remove(button); button.destroy(); - button = m_OrderedButtons[k_ActiveToolOrderPosition]; + button = m_OrderedButtons[k_ActiveToolOrderPosition]; // Assign next ordered button if (buttonSelected != null) - buttonSelected(rayOrigin, button.toolType); + buttonSelected(rayOrigin, button.toolType); // Select the new active tool button } return button != null; diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 58a4c2fb7..e0755fbdf 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -59,7 +59,7 @@ internal void ClearPinnedToolButtonPreview() internal void OnToolButtonClicked(Transform rayOrigin, Type toolType) { - Debug.LogError("Selecting Tool in EditorVR.PinnedToolButtons"); + Debug.LogError(" OnToolButtonClicked : Selecting Tool in EditorVR.PinnedToolButtons : " + toolType.ToString()); if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 634b4da34..c61a8e17f 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -178,10 +178,6 @@ public Vector3 scrollVisualsRotation get { return m_ScrollVisualsRotation ; } set { - // Set null In order to hide the scroll visuals - if (value == Vector3.zero) - Debug.LogError("??????????????????????!!!!!!!!!!!!!!!!!!!!!!!"); - if (m_ScrollVisualsRotation == value) return; From a576fffb56846f32a218bf0dc6cc602cbb8b1dbd Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Tue, 15 Aug 2017 13:41:49 -0700 Subject: [PATCH 716/870] move to using an object cleanup list --- .../Editor/Unit/Utilities/ObjectUtilsTests.cs | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs index 141eb1bec..1fd2d714d 100644 --- a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs +++ b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs @@ -2,6 +2,7 @@ using UnityEditor; using NUnit.Framework; using System.Collections; +using System.Collections.Generic; using UnityEngine.TestTools; using UnityEditor.Experimental.EditorVR.Utilities; @@ -12,7 +13,7 @@ public class ObjectUtilsTests { GameObject go, parent, other; GameObject currentObject; - GameObject boundsA, boundsB; + List toCleanupAfterEach = new List(); float delta = 0.00000001f; @@ -24,6 +25,8 @@ public void BeforeEach() parent.transform.position += new Vector3(2, 4, 8); other = new GameObject("other"); other.transform.position += new Vector3(-5, 1, 2); + + toCleanupAfterEach.AddRange(new GameObject[] { go, parent, other }); } [Test] @@ -141,12 +144,15 @@ public void GetBounds_WithoutExtents() [Test] public void GetBounds_Array() { - boundsA = new GameObject(); + var boundsA = new GameObject(); boundsA.transform.position += new Vector3(-5, -2, 8); - boundsB = new GameObject(); + var boundsB = new GameObject(); boundsB.transform.position += new Vector3(2, 6, 4); var transforms = new Transform[] { boundsA.transform, boundsB.transform }; + // if you want to work with more than one object in a test, add them to cleanup list manually + toCleanupAfterEach.AddRange(new GameObject[] { boundsA, boundsB }); + var bounds = ObjectUtils.GetBounds(transforms); Bounds expected = new Bounds(new Vector3(-1.5f, 2f, 6f), new Vector3(7f, 8f, 4f)); @@ -156,23 +162,15 @@ public void GetBounds_Array() [TearDown] public void CleanupAfterEach() { - ObjectUtils.Destroy(go); - ObjectUtils.Destroy(parent); - ObjectUtils.Destroy(other); - if (currentObject != null) + toCleanupAfterEach.Add(currentObject); + + foreach (var o in toCleanupAfterEach) { - ObjectUtils.Destroy(currentObject); + ObjectUtils.Destroy(o); } } - [OneTimeTearDown] - public void CleanupAfterAll() - { - ObjectUtils.Destroy(boundsA); - ObjectUtils.Destroy(boundsB); - } - // this doesn't actually do it recursively yet private void AssertRunInEditModeSet(GameObject go, bool expected) { From a6c776919a28e4da499b65d6d560883abc1a68a4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 15 Aug 2017 22:57:44 -0700 Subject: [PATCH 717/870] In PinnedToolsMenuUI, fix existing button selected logic; add DeleteButtonOfType() method; add support for fetching of visible button count based on the button type that is requesting; used by PinnedToolButtons that are requesting their order/position; this allows the main menu button rotation to reset to a neutral zero position if no buttons other than the select & main menu button remain --- .../Scripts/PinnedToolsMenuUI.cs | 32 +++++++++++++++++-- Scripts/Core/Interfaces/IPinnedToolButton.cs | 2 +- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index a3ab84619..db8a7f897 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -408,7 +408,7 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton, bool sel if (selectAfterSettingButtonOrder && buttonSelected != null) { bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); - if (!existingButton) + if (existingButton) buttonSelected(rayOrigin, pinnedToolButton.toolType); // Select the tool in the PinnedToolsMenu } } @@ -538,6 +538,30 @@ public bool DeleteHighlightedButton() return button != null; } + /// + /// Delete a button of a given type, then select the next active tool button + /// + /// Bool denoting that a button of the given type was deleted + public bool DeleteButtonOfType(Type type) + { + Debug.LogError("Delete button of type : " + type); + + bool buttonDeleted = false; + for (int i = 0; i < m_OrderedButtons.Count; ++i) + { + var button = m_OrderedButtons[i]; + if (button.toolType == type && !IsMainMenuButton(button) && !IsSelectionToolButton(button)) + { + buttonDeleted = true; + m_OrderedButtons.Remove(button); + button.destroy(); + break; + } + } + + return buttonDeleted; + } + bool IsMainMenuButton(IPinnedToolButton button) { return button.toolType == typeof(IMainMenu); @@ -548,9 +572,11 @@ bool IsSelectionToolButton(IPinnedToolButton button) return button.toolType == typeof(SelectionTool); } - int VisibleButtonCount() + int VisibleButtonCount(Type buttonType) { - return m_VisibleButtonCount; + // If button type is main menu, and only the selection tool and main menu buttons are available + // return a value of ZERO so the main menu button is centered + return m_VisibleButtonCount - (aboveMinimumButtonCount ? 0 : 1); } IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) diff --git a/Scripts/Core/Interfaces/IPinnedToolButton.cs b/Scripts/Core/Interfaces/IPinnedToolButton.cs index 00f5b76dc..633d87df1 100644 --- a/Scripts/Core/Interfaces/IPinnedToolButton.cs +++ b/Scripts/Core/Interfaces/IPinnedToolButton.cs @@ -24,7 +24,7 @@ public interface IPinnedToolButton string previewToolDescription { set; } Action destroy { get; } Action selectTool { set; } - Func visibileButtonCount { set; } + Func visibileButtonCount { set; } Func closeButton { set; } Action showAllButtons { set; } Action hoverExit { set; } From dcaf17d4a28e35402ebf8cf6d29bb71f947c0bcf Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 15 Aug 2017 23:11:46 -0700 Subject: [PATCH 718/870] Set the mainMenuButton to a centered (x) position, if it is the only button (other than the selectionTool button) remaining --- Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index cb94aa190..b121800c5 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -333,7 +333,7 @@ public string tooltipText //public Action deleteHighlightedButton { get; set; } public Action selectHighlightedButton { get; set; } public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu - public Func visibileButtonCount { get; set; } + public Func visibileButtonCount { get; set; } public bool implementsSecondaryButton { get; set; } public Action destroy { get { return DestroyButton; } } public Action showAllButtons { get; set; } @@ -1025,7 +1025,7 @@ IEnumerator AnimatePosition(int orderPosition) const float kCircularRange = 360f; const int kDurationShapeAmount = 3; var rotationSpacing = kCircularRange / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = orderPosition > -1 ? rotationSpacing * kCenterLocationAmount - (visibileButtonCount() * kCenterLocationAmount) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + var phaseOffset = orderPosition > -1 ? rotationSpacing * kCenterLocationAmount - (visibileButtonCount(m_ToolType) * kCenterLocationAmount) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; var duration = 0f; From 0711f61189874314a316fbfe9122eb531e6a74f3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 15 Aug 2017 23:26:01 -0700 Subject: [PATCH 719/870] Add despawnOnReselect functionality to ISelectTool; allow the selection of existing tools, without the re-creation of existing PinnedToolsMenu UI elements --- Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs b/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs index 984ae2169..31e098583 100644 --- a/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs +++ b/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs @@ -13,7 +13,7 @@ public interface ISelectTool public static class ISelectToolMethods { - internal static Func selectTool { get; set; } + internal static Func selectTool { get; set; } internal static Func isToolActive { get; set; } /// @@ -22,9 +22,10 @@ public static class ISelectToolMethods /// /// The rayOrigin that the tool should spawn under /// Type of tool to spawn/select - public static bool SelectTool(this ISelectTool obj, Transform rayOrigin, Type toolType) + /// Despawn the tool, if re-selected while already the current tool + public static bool SelectTool(this ISelectTool obj, Transform rayOrigin, Type toolType, bool despawnOnReselect = true) { - return selectTool(rayOrigin, toolType); + return selectTool(rayOrigin, toolType, despawnOnReselect); } /// From 96872cb2860d3043f6998f96cb39e1d707c209d6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 15 Aug 2017 23:28:08 -0700 Subject: [PATCH 720/870] Add deletePinnedToolButton action to IPinnedToolsMenu --- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 2ea200d89..23a205ea9 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -14,7 +14,13 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod Transform rayOrigin { get; set; } IPinnedToolButton previewToolButton { get; } // This method isn't hooked up in EVR, it should reside in the implementing class - Action createPinnedToolButton { get; } + Action SetButtonForType { get; } + + /// + /// Delete the tool button with corresponding type of the first parameter. + /// Then, select the tool button with corresponds to the type of the second parameter. + /// + Action deletePinnedToolButton { get; } } public static class IPinnedToolsMenuMethods From a19b48111675f49c6bc225e16f6e8a928e03a323 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 15 Aug 2017 23:31:01 -0700 Subject: [PATCH 721/870] Add support for new PinnedToolsMenu tool selection logic to SelectTool () --- Scripts/Core/EditorVR.Tools.cs | 45 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 814f42cfd..3577f9d83 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -121,8 +121,8 @@ internal static void SpawnDefaultTools(IProxy proxy) var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); deviceData.pinnedToolsMenu = pinnedToolsMenu; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; - pinnedToolsMenu.createPinnedToolButton(typeof(IMainMenu), null, deviceData.node); - pinnedToolsMenu.createPinnedToolButton(typeof(SelectionTool), selectionToolData.icon, deviceData.node); + pinnedToolsMenu.SetButtonForType(typeof(IMainMenu), null); + pinnedToolsMenu.SetButtonForType(typeof(SelectionTool), selectionToolData.icon); } evr.GetModule().UpdatePlayerHandleMaps(); @@ -182,12 +182,8 @@ static bool IsToolActive(Transform targetRayOrigin, Type toolType) return result; } - internal static bool SelectTool(Transform rayOrigin, Type toolType) + internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawnOnReselect = true) { - //Debug.LogError("SelectionTool TYPE : " + toolType.ToString() + ""); - //if (toolType == typeof(SelectionTool)) - //Debug.LogError("!!!!! SelectionTool detected"); - var result = false; var deviceInputModule = evr.GetModule(); Rays.ForEachProxyDevice(deviceData => @@ -197,23 +193,33 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " : setting type to : " + toolType); var spawnTool = true; var pinnedToolButtonAdded = false; - var setSelectAsCurrentTool = toolType == typeof(SelectionTool);//deviceData.currentTool is ILocomotor; + var currentTool = deviceData.currentTool; + var currentToolType = currentTool.GetType(); + var currentToolIsSelect = currentToolType == typeof(SelectionTool); + var setSelectAsCurrentTool = toolType == typeof(SelectionTool) && !currentToolIsSelect;//deviceData.currentTool is ILocomotor; var pinnedToolsMenu = deviceData.pinnedToolsMenu; - // If this tool was on the current device already, remove it, if it is selected while already being the current tool - var despawn = deviceData.currentTool.GetType() == toolType || setSelectAsCurrentTool || toolType == typeof(IMainMenu); - var defaultTool = IsDefaultTool(toolType); // TODO initially set spawnTool to this default/permatool value - if (deviceData.currentTool != null && despawn) + var despawn = (!currentToolIsSelect && currentToolType == toolType && despawnOnReselect) || setSelectAsCurrentTool;// || setSelectAsCurrentTool || toolType == typeof(IMainMenu); + if (currentTool != null && despawn) { Debug.LogError("Despawing tool !!!! : toolType == typeof(SelectionTool) : " + (toolType == typeof(SelectionTool)).ToString()); - DespawnTool(deviceData, deviceData.currentTool); - pinnedToolsMenu.createPinnedToolButton(toolType, null, deviceData.node); + DespawnTool(deviceData, currentTool); + + if (!currentToolIsSelect && !setSelectAsCurrentTool) + { + // Delete a button of the first type parameter; then select a button the second type param (the new current tool) + pinnedToolsMenu.deletePinnedToolButton(toolType, currentToolType); + // Don't spawn a new tool, since we are only removing the old tool + } + else if (!currentToolIsSelect && setSelectAsCurrentTool) + { + pinnedToolsMenu.SetButtonForType(typeof(SelectionTool), null); + } - // Don't spawn a new tool, since we are only removing the old tool spawnTool = false; } - if (spawnTool && !defaultTool) + if (spawnTool && !IsDefaultTool(toolType)) { Debug.LogError("SPAWN TOOL : " + toolType); // Spawn tool and collect all devices that this tool will need @@ -242,11 +248,8 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType) AddToolToStack(dd, newTool); - if (!setSelectAsCurrentTool) - { - pinnedToolButtonAdded = true; - pinnedToolsMenu.createPinnedToolButton(toolType, newTool.icon, deviceData.node); - } + //if (!setSelectAsCurrentTool) + pinnedToolsMenu.SetButtonForType(toolType, newTool.icon); } } From 4a5da61ff15f60a15ec201a4d1179a56e73dfdf6 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 15 Aug 2017 23:39:28 -0700 Subject: [PATCH 722/870] Add support for deleting PinnedToolButtons by type in PinnedToolsMenu; add support for new selection logic --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 40 ++++++++++++++++++------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 17a3b2cd7..5c18614c3 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -63,7 +63,8 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Action deleteHighlightedButton { get; set; } public Action onButtonHoverEnter { get; set; } public Action onButtonHoverExit { get; set; } - public Action createPinnedToolButton { get; set; } + public Action SetButtonForType { get; set; } + public Action deletePinnedToolButton { get; set; } public Node? node { get; set; } public IPinnedToolButton previewToolButton { get { return m_MainMenuButton; } } @@ -102,7 +103,8 @@ public Transform alternateMenuOrigin void Awake() { - createPinnedToolButton = CreatePinnedToolButton; + SetButtonForType = CreatePinnedToolButton; + deletePinnedToolButton = DeletePinnedToolButton; } void OnDestroy() @@ -128,16 +130,10 @@ void CreatePinnedToolsUI() pinnedToolsUITransform.localRotation = Quaternion.identity; } - void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) + void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) { Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); //var buttons = deviceData.buttons; - if (buttons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button - { - // TODO: kick out the oldest tool, and allow the new tool to become the active tool - Debug.LogWarning("New pinned tool button cannot be added. The maximum number of pinned tool buttons are currently being displayed"); - return; - } // Select an existing ToolButton if the type is already present in a button if (buttons.Any( (x) => x.toolType == toolType)) @@ -146,6 +142,13 @@ void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) return; } + if (buttons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button + { + // TODO: kick out the oldest tool, and allow the new tool to become the active tool + Debug.LogWarning("New pinned tool button cannot be added. The maximum number of pinned tool buttons are currently being displayed"); + return; + } + // Before adding new button, offset each button to a position greater than the zeroth/active tool position //foreach (var pair in buttons) //{ @@ -186,6 +189,22 @@ void CreatePinnedToolButton(Type toolType, Sprite buttonIcon, Node node) m_PinnedToolsMenuUI.AddButton(button, buttonTransform); } + void DeletePinnedToolButton(Type toolTypeToDelete, Type toolTypeToSelectAfterDelete) + { + //CreatePinnedToolButton(toolType, null, node); + + if (m_PinnedToolsMenuUI.DeleteButtonOfType(toolTypeToDelete)) + { + m_PinnedToolsMenuUI.SelectNextExistingToolButton(); + //buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + //if (buttonCount <= k_ActiveToolOrderPosition + 1) + //return; + + //allowSpatialScrollBeforeThisTime = null; + //spatialDirection = null; + } + } + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount @@ -319,7 +338,8 @@ void OnButtonHover() void OnButtonSelected(Transform rayOrigin, Type buttonType) { Debug.LogError("Selecting Tool in PinnedToolsMenu : " + buttonType.ToString()); - this.SelectTool(rayOrigin, buttonType); + //Debug.Log("" + System.Environment.StackTrace + ""); + this.SelectTool(rayOrigin, buttonType, false); } } } From f8303ceb2633d3416dd782535c6db6d47658240c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 16 Aug 2017 10:21:25 -0700 Subject: [PATCH 723/870] Remove class-level currentObject and add objects to cleanup list in each test --- .../Editor/Unit/Utilities/ObjectUtilsTests.cs | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs index 1fd2d714d..1d67e27dd 100644 --- a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs +++ b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs @@ -12,7 +12,6 @@ namespace UnityEditor.Experimental.EditorVR.Tests.Utilities public class ObjectUtilsTests { GameObject go, parent, other; - GameObject currentObject; List toCleanupAfterEach = new List(); float delta = 0.00000001f; @@ -26,39 +25,43 @@ public void BeforeEach() other = new GameObject("other"); other.transform.position += new Vector3(-5, 1, 2); - toCleanupAfterEach.AddRange(new GameObject[] { go, parent, other }); + toCleanupAfterEach.AddRange(new[] { go, parent, other }); } [Test] public void Instantiate_OneArg_ClonesActiveAtOrigin() { - currentObject = ObjectUtils.Instantiate(go); - Assert.IsTrue(currentObject.activeSelf); - Assert.AreEqual(new Vector3(0, 0, 0), currentObject.transform.position); + var clone = ObjectUtils.Instantiate(go); + Assert.IsTrue(clone.activeSelf); + Assert.AreEqual(new Vector3(0, 0, 0), clone.transform.position); + toCleanupAfterEach.Add(clone); } [Test] public void Instantiate_InactiveClone() { - currentObject = ObjectUtils.Instantiate(go, null, true, true, false); - Assert.IsFalse(currentObject.activeSelf); + var clone = ObjectUtils.Instantiate(go, null, true, true, false); + Assert.IsFalse(clone.activeSelf); + toCleanupAfterEach.Add(clone); } [Test] public void Instantiate_WithParent_WorldPositionStays() { - currentObject = ObjectUtils.Instantiate(go, parent.transform); - Assert.AreEqual(parent.transform, currentObject.transform.parent); - Assert.AreNotEqual(parent.transform.position, currentObject.transform.position); + var clone = ObjectUtils.Instantiate(go, parent.transform); + Assert.AreEqual(parent.transform, clone.transform.parent); + Assert.AreNotEqual(parent.transform.position, clone.transform.position); + toCleanupAfterEach.Add(clone); } [Test] public void Instantiate_WithParent_WorldPositionMoves() { - currentObject = ObjectUtils.Instantiate(go, parent.transform, false); - Assert.AreEqual(parent.transform, currentObject.transform.parent); - Assert.AreEqual(parent.transform.position, currentObject.transform.position); - Assert.AreEqual(parent.transform.rotation, currentObject.transform.rotation); + var clone = ObjectUtils.Instantiate(go, parent.transform, false); + Assert.AreEqual(parent.transform, clone.transform.parent); + Assert.AreEqual(parent.transform.position, clone.transform.position); + Assert.AreEqual(parent.transform.rotation, clone.transform.rotation); + toCleanupAfterEach.Add(clone); } [TestCase(true)] @@ -66,8 +69,9 @@ public void Instantiate_WithParent_WorldPositionMoves() public void Instantiate_SetRunInEditMode(bool expected) { Assert.IsFalse(Application.isPlaying); - currentObject = ObjectUtils.Instantiate(go, null, true, expected); - AssertRunInEditModeSet(currentObject, expected); + var clone = ObjectUtils.Instantiate(go, null, true, expected); + AssertRunInEditModeSet(clone, expected); + toCleanupAfterEach.Add(clone); } [UnityTest] @@ -75,7 +79,7 @@ public IEnumerator Destroy_OneArg_DestroysImmediately_InEditMode() { Assert.IsFalse(Application.isPlaying); ObjectUtils.Destroy(other); - yield return null; // skip frame to allow destruction to run + yield return null; // skip frame to allow destruction to run Assert.IsTrue(other == null); } @@ -87,7 +91,7 @@ public IEnumerator Destroy_OneArg_DestroysImmediately_InEditMode() public void CreateGameObjectWithComponent_OneArg_TypeAsGeneric() { var renderer = ObjectUtils.CreateGameObjectWithComponent(); - currentObject = renderer.gameObject; + toCleanupAfterEach.Add(renderer.gameObject); // the object name assigned is based on the component's type name var foundObject = GameObject.Find(typeof(MeshRenderer).Name); Assert.IsInstanceOf(renderer); @@ -98,7 +102,7 @@ public void CreateGameObjectWithComponent_OneArg_TypeAsGeneric() public void CreateGameObjectWithComponent_SetsParent_WorldPositionStays() { var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform); - currentObject = comp.gameObject; + toCleanupAfterEach.Add(comp.gameObject); Assert.AreEqual(parent.transform, comp.transform.parent); Assert.AreNotEqual(parent.transform.position, comp.transform.position); } @@ -107,7 +111,7 @@ public void CreateGameObjectWithComponent_SetsParent_WorldPositionStays() public void CreateGameObjectWithComponent_SetsParent_WorldPositionMoves() { var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform, false); - currentObject = comp.gameObject; + toCleanupAfterEach.Add(comp.gameObject); Assert.AreEqual(parent.transform, comp.transform.parent); Assert.AreEqual(parent.transform.position, comp.transform.position); } @@ -162,9 +166,6 @@ public void GetBounds_Array() [TearDown] public void CleanupAfterEach() { - if (currentObject != null) - toCleanupAfterEach.Add(currentObject); - foreach (var o in toCleanupAfterEach) { ObjectUtils.Destroy(o); From dd5e48bef4e76cb2456a2b021001d00737c9e279 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 16 Aug 2017 10:28:32 -0700 Subject: [PATCH 724/870] Cleanup ObjectUtilsTests and match conventions --- .../Editor/Unit/Utilities/ObjectUtilsTests.cs | 114 +++++++++--------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs index 1d67e27dd..166bd5a0b 100644 --- a/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs +++ b/Tests/Editor/Unit/Utilities/ObjectUtilsTests.cs @@ -1,67 +1,66 @@ -using UnityEngine; -using UnityEditor; -using NUnit.Framework; +using NUnit.Framework; using System.Collections; using System.Collections.Generic; -using UnityEngine.TestTools; using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; +using UnityEngine.TestTools; namespace UnityEditor.Experimental.EditorVR.Tests.Utilities { - [TestFixture] - public class ObjectUtilsTests - { - GameObject go, parent, other; - List toCleanupAfterEach = new List(); + [TestFixture] + public class ObjectUtilsTests + { + const float k_Delta = 1e-6f; - float delta = 0.00000001f; + GameObject m_GO, m_Parent, m_Other; + List m_ToCleanupAfterEach = new List(); [SetUp] public void BeforeEach() { - go = new GameObject("object utils test"); - parent = new GameObject("parent"); - parent.transform.position += new Vector3(2, 4, 8); - other = new GameObject("other"); - other.transform.position += new Vector3(-5, 1, 2); + m_GO = new GameObject("object utils test"); + m_Parent = new GameObject("parent"); + m_Parent.transform.position += new Vector3(2, 4, 8); + m_Other = new GameObject("other"); + m_Other.transform.position += new Vector3(-5, 1, 2); - toCleanupAfterEach.AddRange(new[] { go, parent, other }); + m_ToCleanupAfterEach.AddRange(new[] { m_GO, m_Parent, m_Other }); } [Test] public void Instantiate_OneArg_ClonesActiveAtOrigin() { - var clone = ObjectUtils.Instantiate(go); + var clone = ObjectUtils.Instantiate(m_GO); Assert.IsTrue(clone.activeSelf); Assert.AreEqual(new Vector3(0, 0, 0), clone.transform.position); - toCleanupAfterEach.Add(clone); + m_ToCleanupAfterEach.Add(clone); } [Test] public void Instantiate_InactiveClone() { - var clone = ObjectUtils.Instantiate(go, null, true, true, false); + var clone = ObjectUtils.Instantiate(m_GO, null, true, true, false); Assert.IsFalse(clone.activeSelf); - toCleanupAfterEach.Add(clone); + m_ToCleanupAfterEach.Add(clone); } [Test] public void Instantiate_WithParent_WorldPositionStays() { - var clone = ObjectUtils.Instantiate(go, parent.transform); - Assert.AreEqual(parent.transform, clone.transform.parent); - Assert.AreNotEqual(parent.transform.position, clone.transform.position); - toCleanupAfterEach.Add(clone); + var clone = ObjectUtils.Instantiate(m_GO, m_Parent.transform); + Assert.AreEqual(m_Parent.transform, clone.transform.parent); + Assert.AreNotEqual(m_Parent.transform.position, clone.transform.position); + m_ToCleanupAfterEach.Add(clone); } [Test] public void Instantiate_WithParent_WorldPositionMoves() { - var clone = ObjectUtils.Instantiate(go, parent.transform, false); - Assert.AreEqual(parent.transform, clone.transform.parent); - Assert.AreEqual(parent.transform.position, clone.transform.position); - Assert.AreEqual(parent.transform.rotation, clone.transform.rotation); - toCleanupAfterEach.Add(clone); + var clone = ObjectUtils.Instantiate(m_GO, m_Parent.transform, false); + Assert.AreEqual(m_Parent.transform, clone.transform.parent); + Assert.AreEqual(m_Parent.transform.position, clone.transform.position); + Assert.AreEqual(m_Parent.transform.rotation, clone.transform.rotation); + m_ToCleanupAfterEach.Add(clone); } [TestCase(true)] @@ -69,18 +68,18 @@ public void Instantiate_WithParent_WorldPositionMoves() public void Instantiate_SetRunInEditMode(bool expected) { Assert.IsFalse(Application.isPlaying); - var clone = ObjectUtils.Instantiate(go, null, true, expected); + var clone = ObjectUtils.Instantiate(m_GO, null, true, expected); AssertRunInEditModeSet(clone, expected); - toCleanupAfterEach.Add(clone); + m_ToCleanupAfterEach.Add(clone); } [UnityTest] public IEnumerator Destroy_OneArg_DestroysImmediately_InEditMode() { Assert.IsFalse(Application.isPlaying); - ObjectUtils.Destroy(other); + ObjectUtils.Destroy(m_Other); yield return null; // skip frame to allow destruction to run - Assert.IsTrue(other == null); + Assert.IsTrue(m_Other == null); } // here, we could test the other types of calls to Destroy / Instantiate, but that @@ -91,7 +90,8 @@ public IEnumerator Destroy_OneArg_DestroysImmediately_InEditMode() public void CreateGameObjectWithComponent_OneArg_TypeAsGeneric() { var renderer = ObjectUtils.CreateGameObjectWithComponent(); - toCleanupAfterEach.Add(renderer.gameObject); + m_ToCleanupAfterEach.Add(renderer.gameObject); + // the object name assigned is based on the component's type name var foundObject = GameObject.Find(typeof(MeshRenderer).Name); Assert.IsInstanceOf(renderer); @@ -101,46 +101,46 @@ public void CreateGameObjectWithComponent_OneArg_TypeAsGeneric() [Test] public void CreateGameObjectWithComponent_SetsParent_WorldPositionStays() { - var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform); - toCleanupAfterEach.Add(comp.gameObject); - Assert.AreEqual(parent.transform, comp.transform.parent); - Assert.AreNotEqual(parent.transform.position, comp.transform.position); + var comp = ObjectUtils.CreateGameObjectWithComponent(m_Parent.transform); + m_ToCleanupAfterEach.Add(comp.gameObject); + Assert.AreEqual(m_Parent.transform, comp.transform.parent); + Assert.AreNotEqual(m_Parent.transform.position, comp.transform.position); } [Test] public void CreateGameObjectWithComponent_SetsParent_WorldPositionMoves() { - var comp = ObjectUtils.CreateGameObjectWithComponent(parent.transform, false); - toCleanupAfterEach.Add(comp.gameObject); - Assert.AreEqual(parent.transform, comp.transform.parent); - Assert.AreEqual(parent.transform.position, comp.transform.position); + var comp = ObjectUtils.CreateGameObjectWithComponent(m_Parent.transform, false); + m_ToCleanupAfterEach.Add(comp.gameObject); + Assert.AreEqual(m_Parent.transform, comp.transform.parent); + Assert.AreEqual(m_Parent.transform.position, comp.transform.position); } [Test] public void AddComponent_AddsToObject_TypeAsGeneric() { - var instance = ObjectUtils.AddComponent(other); - var onObject = other.GetComponent(); + var instance = ObjectUtils.AddComponent(m_Other); + var onObject = m_Other.GetComponent(); Assert.IsInstanceOf(instance); Assert.AreEqual(instance, onObject); - AssertRunInEditModeSet(other, true); + AssertRunInEditModeSet(m_Other, true); } [Test] public void AddComponent_AddsToObject_TypeAsArg() { - var instance = ObjectUtils.AddComponent(typeof(MeshRenderer), other); - var onObject = other.GetComponent(); + var instance = ObjectUtils.AddComponent(typeof(MeshRenderer), m_Other); + var onObject = m_Other.GetComponent(); Assert.IsInstanceOf(instance); Assert.AreEqual((MeshRenderer)instance, onObject); - AssertRunInEditModeSet(other, true); + AssertRunInEditModeSet(m_Other, true); } [Test] public void GetBounds_WithoutExtents() { - var localBounds = new Bounds(other.transform.position, new Vector3(0, 0, 0)); - var bounds = ObjectUtils.GetBounds(other.transform); + var localBounds = new Bounds(m_Other.transform.position, new Vector3(0, 0, 0)); + var bounds = ObjectUtils.GetBounds(m_Other.transform); Assert.AreEqual(localBounds, bounds); } @@ -152,28 +152,28 @@ public void GetBounds_Array() boundsA.transform.position += new Vector3(-5, -2, 8); var boundsB = new GameObject(); boundsB.transform.position += new Vector3(2, 6, 4); - var transforms = new Transform[] { boundsA.transform, boundsB.transform }; + var transforms = new[] { boundsA.transform, boundsB.transform }; // if you want to work with more than one object in a test, add them to cleanup list manually - toCleanupAfterEach.AddRange(new GameObject[] { boundsA, boundsB }); + m_ToCleanupAfterEach.AddRange(new[] { boundsA, boundsB }); var bounds = ObjectUtils.GetBounds(transforms); - Bounds expected = new Bounds(new Vector3(-1.5f, 2f, 6f), new Vector3(7f, 8f, 4f)); + var expected = new Bounds(new Vector3(-1.5f, 2f, 6f), new Vector3(7f, 8f, 4f)); - Assert.That(bounds, Is.EqualTo(expected).Within(delta)); + Assert.That(bounds, Is.EqualTo(expected).Within(k_Delta)); } [TearDown] public void CleanupAfterEach() { - foreach (var o in toCleanupAfterEach) + foreach (var o in m_ToCleanupAfterEach) { ObjectUtils.Destroy(o); } } // this doesn't actually do it recursively yet - private void AssertRunInEditModeSet(GameObject go, bool expected) + static void AssertRunInEditModeSet(GameObject go, bool expected) { var MBs = go.GetComponents(); foreach (var mb in MBs) @@ -181,5 +181,5 @@ private void AssertRunInEditModeSet(GameObject go, bool expected) Assert.AreEqual(expected, mb.runInEditMode); } } - } + } } From 4286f2a9d5a97700997f2559788f6ad94d258d24 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 16 Aug 2017 11:06:49 -0700 Subject: [PATCH 725/870] Re-format and update tests to follow conventions --- .../Unit/Utilities/GradientPairTests.cs | 83 +++++++------- .../Unit/Utilities/MaterialUtilsTests.cs | 103 +++++++++--------- .../Unit/Utilities/MathUtilsExtTests.cs | 76 ++++++------- Tests/Test Helpers/TestImage.cs | 9 +- 4 files changed, 136 insertions(+), 135 deletions(-) diff --git a/Tests/Editor/Unit/Utilities/GradientPairTests.cs b/Tests/Editor/Unit/Utilities/GradientPairTests.cs index afa3911c2..20087a6fa 100644 --- a/Tests/Editor/Unit/Utilities/GradientPairTests.cs +++ b/Tests/Editor/Unit/Utilities/GradientPairTests.cs @@ -4,49 +4,52 @@ namespace UnityEditor.Experimental.EditorVR.Tests.Utilities { - [TestFixture] - public class GradientPairTests - { - Color colorA, colorB, colorC, colorD, defaultColor; + [TestFixture] + public class GradientPairTests + { + Color m_ColorA; + Color m_ColorB; + Color m_ColorC; + Color m_ColorD; + Color m_DefaultColor; - [OneTimeSetUp] - public void Setup() - { - defaultColor = new Color(0f, 0f, 0f, 0f); - colorA = new Color(0.2f, 0.4f, 0.8f); - colorB = new Color(0.4f, 0.8f, 0.2f); - colorC = new Color(0.5f, 0.6f, 0.7f); - colorD = new Color(0.1f, 0.2f, 0.3f); - } + [OneTimeSetUp] + public void Setup() + { + m_DefaultColor = new Color(0f, 0f, 0f, 0f); + m_ColorA = new Color(0.2f, 0.4f, 0.8f); + m_ColorB = new Color(0.4f, 0.8f, 0.2f); + m_ColorC = new Color(0.5f, 0.6f, 0.7f); + m_ColorD = new Color(0.1f, 0.2f, 0.3f); + } - [Test] - public void Construct_Parameterless_HasDefaultColors() - { - var pair = new GradientPair(); - Assert.AreEqual(defaultColor, pair.a); - Assert.AreEqual(defaultColor, pair.b); - } + [Test] + public void Construct_Parameterless_HasDefaultColors() + { + var pair = new GradientPair(); + Assert.AreEqual(m_DefaultColor, pair.a); + Assert.AreEqual(m_DefaultColor, pair.b); + } - [Test] - public void Construct_FromTwoColors() - { - var pair = new GradientPair(colorA, colorB); - Assert.AreEqual(colorA, pair.a); - Assert.AreEqual(colorB, pair.b); - } + [Test] + public void Construct_FromTwoColors() + { + var pair = new GradientPair(m_ColorA, m_ColorB); + Assert.AreEqual(m_ColorA, pair.a); + Assert.AreEqual(m_ColorB, pair.b); + } - [Test] - public void Lerp_Interpolates_StartAndEndColors() - { - var x = new GradientPair(colorA, colorB); - var y = new GradientPair(colorC, colorD); - var lerped = GradientPair.Lerp(x, y, .1f); - Assert.AreEqual(Color.Lerp(x.a, y.a, .1f), lerped.a); - Assert.AreEqual(Color.Lerp(x.b, y.b, .1f), lerped.b); - } + [Test] + public void Lerp_Interpolates_StartAndEndColors() + { + var x = new GradientPair(m_ColorA, m_ColorB); + var y = new GradientPair(m_ColorC, m_ColorD); + var lerped = GradientPair.Lerp(x, y, .1f); + Assert.AreEqual(Color.Lerp(x.a, y.a, .1f), lerped.a); + Assert.AreEqual(Color.Lerp(x.b, y.b, .1f), lerped.b); + } - [TearDown] - public void Cleanup() { } - } + [TearDown] + public void Cleanup() { } + } } - diff --git a/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs b/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs index 6d7481396..dd72d3153 100644 --- a/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs +++ b/Tests/Editor/Unit/Utilities/MaterialUtilsTests.cs @@ -6,63 +6,62 @@ namespace UnityEditor.Experimental.EditorVR.Tests.Utilities { - public class MaterialUtilsTests - { - GameObject go; - Renderer renderer; - Graphic graphic; - Material clone; + public class MaterialUtilsTests + { + GameObject m_GO; + Renderer m_Renderer; + Graphic m_Graphic; + Material m_Clone; - [OneTimeSetUp] - public void Setup() - { - go = new GameObject("renderer object"); - Shader shader = Shader.Find("Standard"); + [OneTimeSetUp] + public void Setup() + { + m_GO = new GameObject("renderer object"); + var shader = Shader.Find("Standard"); - renderer = go.AddComponent(); - renderer.sharedMaterial = new Material(shader); - graphic = go.AddComponent(); - graphic.material = renderer.sharedMaterial; - } + m_Renderer = m_GO.AddComponent(); + m_Renderer.sharedMaterial = new Material(shader); + m_Graphic = m_GO.AddComponent(); + m_Graphic.material = m_Renderer.sharedMaterial; + } - [Test] - public void GetMaterialClone_ClonesRendererSharedMaterial() - { - clone = MaterialUtils.GetMaterialClone(renderer); - Assert.AreEqual(renderer.sharedMaterial, clone); - ObjectUtils.Destroy(clone); - } + [Test] + public void GetMaterialClone_ClonesRendererSharedMaterial() + { + m_Clone = MaterialUtils.GetMaterialClone(m_Renderer); + Assert.AreEqual(m_Renderer.sharedMaterial, m_Clone); + ObjectUtils.Destroy(m_Clone); + } - [Test] - public void GetMaterialClone_ClonesGraphicMaterial() - { - clone = MaterialUtils.GetMaterialClone(graphic); - Assert.AreEqual(graphic.material, clone); - ObjectUtils.Destroy(clone); - } + [Test] + public void GetMaterialClone_ClonesGraphicMaterial() + { + m_Clone = MaterialUtils.GetMaterialClone(m_Graphic); + Assert.AreEqual(m_Graphic.material, m_Clone); + ObjectUtils.Destroy(m_Clone); + } - // normally you can directly assert equality on Colors, but - // creating them based on the float coming from this results in mismatches due to rounding - private void AssertColorsEqual(Color expected, Color actual) - { - float tolerance = 0.334f; - Assert.That(actual.r, Is.EqualTo(expected.r).Within(tolerance)); - Assert.That(actual.g, Is.EqualTo(expected.g).Within(tolerance)); - Assert.That(actual.b, Is.EqualTo(expected.b).Within(tolerance)); - Assert.That(actual.a, Is.EqualTo(expected.a).Within(tolerance)); - } + // normally you can directly assert equality on Colors, but + // creating them based on the float coming from this results in mismatches due to rounding + static void AssertColorsEqual(Color expected, Color actual) + { + const float tolerance = 0.334f; + Assert.That(actual.r, Is.EqualTo(expected.r).Within(tolerance)); + Assert.That(actual.g, Is.EqualTo(expected.g).Within(tolerance)); + Assert.That(actual.b, Is.EqualTo(expected.b).Within(tolerance)); + Assert.That(actual.a, Is.EqualTo(expected.a).Within(tolerance)); + } - [TestCase("#000000", 0f, 0f, 0f, 1f)] // rgb: 0, 0, 0 - [TestCase("#002244", 0f, 0.133f, 0.267f, 1f)] // rgb: 136, 221, 102 - [TestCase("#4488BBBB", 0.267f, 0.533f, 0.733f, 0.733f)] // rgb: 68, 136, 187 - [TestCase("#FFFFFF", 1f, 1f, 1f, 1f)] // rgb: 255,255,255 - public void HextoColor_DoesValidConversion(string hex, float r, float g, float b, float a) - { - AssertColorsEqual(new Color(r, g, b, a), MaterialUtils.HexToColor(hex)); - } - - [TearDown] - public void Cleanup() {} - } + [TestCase("#000000", 0f, 0f, 0f, 1f)] // rgb: 0, 0, 0 + [TestCase("#002244", 0f, 0.133f, 0.267f, 1f)] // rgb: 136, 221, 102 + [TestCase("#4488BBBB", 0.267f, 0.533f, 0.733f, 0.733f)] // rgb: 68, 136, 187 + [TestCase("#FFFFFF", 1f, 1f, 1f, 1f)] // rgb: 255,255,255 + public void HextoColor_DoesValidConversion(string hex, float r, float g, float b, float a) + { + AssertColorsEqual(new Color(r, g, b, a), MaterialUtils.HexToColor(hex)); + } + [TearDown] + public void Cleanup() { } + } } diff --git a/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs b/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs index 063f07ae1..f9e603478 100644 --- a/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs +++ b/Tests/Editor/Unit/Utilities/MathUtilsExtTests.cs @@ -1,48 +1,48 @@ -using UnityEngine; -using NUnit.Framework; +using NUnit.Framework; using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Tests.Utilities { - [TestFixture] - public class MathUtilsExtTests - { - [OneTimeSetUp] - public void Setup() {} + [TestFixture] + public class MathUtilsExtTests + { + [OneTimeSetUp] + public void Setup() { } - [Test] - public void SmoothDamp_DividesSmoothTimeBy3_Float() - { - var velocity = 1f; - var damped = MathUtilsExt.SmoothDamp(2f, 8f, ref velocity, .3f, 10f, .1f); - velocity = 1f; - var dampedExpected = Mathf.SmoothDamp(2f, 8f, ref velocity, .1f, 10f, .1f); + [Test] + public void SmoothDamp_DividesSmoothTimeBy3_Float() + { + var velocity = 1f; + var damped = MathUtilsExt.SmoothDamp(2f, 8f, ref velocity, .3f, 10f, .1f); + velocity = 1f; + var dampedExpected = Mathf.SmoothDamp(2f, 8f, ref velocity, .1f, 10f, .1f); - Assert.AreEqual(dampedExpected, damped); - } + Assert.AreEqual(dampedExpected, damped); + } - [Test] - public void SmoothDamp_DividesSmoothTimeBy3_Vector3() - { - var velocity = new Vector3(2, 1, 0); - var current = new Vector3(0, 0, 0); - var target = new Vector3(2, 4, 8); - var damped = MathUtilsExt.SmoothDamp(current, target, ref velocity, .3f, 10f, .1f); - velocity = new Vector3(2, 1, 0); - var dampedExpected = Vector3.SmoothDamp(current, target, ref velocity, .1f, 10f, .1f); + [Test] + public void SmoothDamp_DividesSmoothTimeBy3_Vector3() + { + var velocity = new Vector3(2, 1, 0); + var current = new Vector3(0, 0, 0); + var target = new Vector3(2, 4, 8); + var damped = MathUtilsExt.SmoothDamp(current, target, ref velocity, .3f, 10f, .1f); + velocity = new Vector3(2, 1, 0); + var dampedExpected = Vector3.SmoothDamp(current, target, ref velocity, .1f, 10f, .1f); - Assert.AreEqual(dampedExpected, damped); - } - - [Test] - public void ConstrainYawRotation () - { - var rotation = new Quaternion(4, 3, 2, 1); - var newRotation = MathUtilsExt.ConstrainYawRotation(rotation); - Assert.AreEqual(new Quaternion(0, rotation.y, 0, rotation.w), newRotation); - } + Assert.AreEqual(dampedExpected, damped); + } - [TearDown] - public void Cleanup() { } - } + [Test] + public void ConstrainYawRotation() + { + var rotation = new Quaternion(4, 3, 2, 1); + var newRotation = MathUtilsExt.ConstrainYawRotation(rotation); + Assert.AreEqual(new Quaternion(0, rotation.y, 0, rotation.w), newRotation); + } + + [TearDown] + public void Cleanup() { } + } } diff --git a/Tests/Test Helpers/TestImage.cs b/Tests/Test Helpers/TestImage.cs index 1e50b090a..1ce444c50 100644 --- a/Tests/Test Helpers/TestImage.cs +++ b/Tests/Test Helpers/TestImage.cs @@ -4,9 +4,8 @@ // MaterialUtils.GetMaterialClone that takes a Graphic-derived class namespace UnityEditor.Experimental.EditorVR.Tests.TestHelpers { - public class TestImage : Graphic - { - protected override void OnPopulateMesh(VertexHelper vh) { } - } + public class TestImage : Graphic + { + protected override void OnPopulateMesh(VertexHelper vh) { } + } } - From 37d140d2981a64c17004d594dbfade2440162733 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 13:49:42 -0700 Subject: [PATCH 726/870] Remove unused class members from PinnedToolButton --- Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index b121800c5..e7bf8f32a 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -294,10 +294,8 @@ public string tooltipText Type m_previewToolType; Type m_ToolType; GradientPair m_GradientPair; - //Transform m_AlternateMenuOrigin; Material m_FrameMaterial; Material m_InsetMaterial; - //Vector3 m_InactivePosition; // Inactive button offset from the main menu activator Vector3 m_OriginalLocalPosition; Vector3 m_OriginalLocalScale; Material m_IconMaterial; @@ -322,15 +320,11 @@ public string tooltipText public int activeButtonCount { get; set; } public int maxButtonCount { get; set; } public Transform menuOrigin { get; set; } - //public Action revealAllToolButtons { get; set; } - //public Action revealAllToolButtons { get; set; } - //public Action hideAllToolButtons { get; set; } public Action OpenMenu { get; set; } public Action selectTool { get; set; } public Func closeButton { get; set; } public Action highlightSingleButton { get; set; } - //public Action deleteHighlightedButton { get; set; } public Action selectHighlightedButton { get; set; } public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu public Func visibileButtonCount { get; set; } From 63e7f2e04a92bfcc558700dbeea8e1b98b50045a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 13:50:26 -0700 Subject: [PATCH 727/870] Remove unused logic and class members from PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 49 +------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 5c18614c3..dd40df84b 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -13,7 +13,6 @@ namespace UnityEditor.Experimental.EditorVR.Menus sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics, IUsesViewerScale, IControlSpatialHinting, ISetDefaultRayVisibility, IUsesRayOrigin { - const int k_MenuButtonOrderPosition = 0; // A shared menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation const int k_MaxButtonCount = 16; // @@ -52,17 +51,10 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Transform menuOrigin { get; set; } List buttons { get { return m_PinnedToolsMenuUI.buttons; } } - public Dictionary icons { get; set; } - public int activeToolOrderPosition { get; private set; } - public bool revealed { get; set; } public bool alternateMenuVisible { set { m_PinnedToolsMenuUI.moveToAlternatePosition = value; } } - public Vector3 alternateMenuItem { get; private set; } public Action HighlightSingleButton { get; set; } public Action SelectHighlightedButton { get; set; } - public Action deleteHighlightedButton { get; set; } - public Action onButtonHoverEnter { get; set; } - public Action onButtonHoverExit { get; set; } public Action SetButtonForType { get; set; } public Action deletePinnedToolButton { get; set; } public Node? node { get; set; } @@ -97,10 +89,6 @@ public Transform alternateMenuOrigin } } - public event Action hoverEnter; - public event Action hoverExit; - public event Action selected; - void Awake() { SetButtonForType = CreatePinnedToolButton; @@ -133,7 +121,6 @@ void CreatePinnedToolsUI() void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) { Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); - //var buttons = deviceData.buttons; // Select an existing ToolButton if the type is already present in a button if (buttons.Any( (x) => x.toolType == toolType)) @@ -149,15 +136,6 @@ void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) return; } - // Before adding new button, offset each button to a position greater than the zeroth/active tool position - //foreach (var pair in buttons) - //{ - // if (pair.Value.order != pair.Value.menuButtonOrderPosition) // don't move the main menu button - // pair.Value.order++; - // } - - //var button = SpawnPinnedToolButton(deviceData.inputDevice); - //var buttonTransform = this.InstantiateUI(m_PinnedToolButtonTemplate.gameObject, m_PinnedToolsMenuUI.buttonContainer, false).transform; var buttonTransform = ObjectUtils.Instantiate(m_PinnedToolButtonTemplate.gameObject, m_PinnedToolsMenuUI.buttonContainer, false).transform; var button = buttonTransform.GetComponent(); this.ConnectInterfaces(button); @@ -191,27 +169,16 @@ void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) void DeletePinnedToolButton(Type toolTypeToDelete, Type toolTypeToSelectAfterDelete) { - //CreatePinnedToolButton(toolType, null, node); - if (m_PinnedToolsMenuUI.DeleteButtonOfType(toolTypeToDelete)) - { m_PinnedToolsMenuUI.SelectNextExistingToolButton(); - //buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount - //if (buttonCount <= k_ActiveToolOrderPosition + 1) - //return; - - //allowSpatialScrollBeforeThisTime = null; - //spatialDirection = null; - } } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { - var buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount + var buttonCount = buttons.Count; if (buttonCount <= k_ActiveToolOrderPosition + 1) return; - const float kAutoHideDuration = 10f; const float kAllowToggleDuration = 0.25f; var pinnedToolInput = (PinnedToolslMenuInput) input; @@ -224,24 +191,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (pinnedToolInput.cancel.wasJustPressed) Debug.LogError("CANCELLING SPATIAL SELECTION!!!!"); - /* - if (spatialDirection == null) - { - // Hide if no direction as been defined after a given duration - Debug.LogWarning("Perform an increasing visual presence of visuals as time progresses, and the drag threshold hasn't been met."); - m_PinnedToolsMenuUI.allButtonsVisible = false; - this.SetSpatialHintControlObject(null); // Hide Spatial Hint Visuals - - return; - } - */ - if (pinnedToolInput.show.wasJustPressed) { this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); - //consumeControl(pinnedToolInput.show); - //m_PinnedToolsMenuUI.allButtonsVisible = true; m_SpatialScrollStartPosition = m_AlternateMenuOrigin.position; Debug.LogError("Start position : " + m_SpatialScrollStartPosition + ""); allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; From a9a5c0d592ee09eb17483437587f98a5c3b72552 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 13:52:01 -0700 Subject: [PATCH 728/870] Update VRLineRenderer to current master head --- libs/VRLineRenderer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/VRLineRenderer b/libs/VRLineRenderer index 6ed5f3638..19473f5bc 160000 --- a/libs/VRLineRenderer +++ b/libs/VRLineRenderer @@ -1 +1 @@ -Subproject commit 6ed5f3638aca8d0ab1a7270b9772f0f7b2a83bb6 +Subproject commit 19473f5bc5fbe8211a08bf969d7c2fcfebdf5f74 From 02f7f1f31b6c754471268cf67527137dba23f015 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 14:06:04 -0700 Subject: [PATCH 729/870] Remove unused logic and class members from PinnedToolsMenuUI --- .../Scripts/PinnedToolsMenuUI.cs | 73 +++---------------- 1 file changed, 12 insertions(+), 61 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index db8a7f897..7209727bb 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -3,7 +3,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Tools; @@ -47,6 +46,9 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IUsesNode, IIn Quaternion m_HintContentContainerInitialRotation; Quaternion m_HintContentContainerCurrentRotation; Vector3 m_HintContentWorldPosition; + Vector3 m_StartingDragOrigin; + Vector3 m_DragTarget; + IUsesNode m_UsesNodeImplementation; public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } @@ -69,8 +71,6 @@ public bool allButtonsVisible } else { - //this.Pulse(rayOrigin, 0.5f, 0.065f, false, true); - //spatialDragDistance = 0f; ShowOnlyMenuAndActiveToolButtons(); spatiallyScrolling = false; this.SetSpatialHintRotationTarget(Vector3.zero); @@ -96,12 +96,12 @@ private bool aboveMinimumButtonCount { get { - const int selectionToolButtonHideCount = 2; + const int kSelectionToolButtonHideCount = 2; var count = m_OrderedButtons.Count; - var aboveMinCount = count > selectionToolButtonHideCount; // Has at least one tool been added beyond the default MainMenu & SelectionTool + var aboveMinCount = count > kSelectionToolButtonHideCount; // Has at least one tool been added beyond the default MainMenu & SelectionTool // Prevent the display of the SelectionTool button, if only the MainMenu and SelectionTool buttons reside in the buttons collection - if (count == selectionToolButtonHideCount) + if (count == kSelectionToolButtonHideCount) aboveMinCount = buttons.All( x => x.toolType != typeof(SelectionTool) ); return aboveMinCount; @@ -121,12 +121,11 @@ public bool spatiallyScrolling if (value) { Debug.LogWarning("SETTING Spatial Drag Distance : " + value); - m_SpatialDragDistance = 0f; var currentRotation = transform.rotation.eulerAngles; - m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); // Quaternion.AngleAxis(transform.forward.y, Vector3.up); + m_SpatialDragDistance = 0f; + m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); m_HintContentWorldPosition = transform.position; this.SetSpatialHintPosition(m_HintContentWorldPosition); - //spatialHintContentContainer.position = m_HintContentWorldPosition; } } } @@ -136,7 +135,6 @@ public float spatialDragDistance set { m_SpatialDragDistance = value; - //m_SpatialScrollOrientation = transform.rotation; } } @@ -145,27 +143,18 @@ public Vector3? startingDragOrigin set { Debug.LogWarning("SETTING STARTING DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); + //Debug.LogError(value.Value.ToString("F4")); m_StartingDragOrigin = transform.position; - - //var orig = spatialHintContentContainer.rotation; - //this.SetSpatialHintLookAT(value.Value); - //spatialHintContentContainer.LookAt(value.Value); - Debug.LogError(value.Value.ToString("F4")); - //m_SpatialScrollOrientation = Quaternion.Euler(value.Value); // Quaternion.FromToRotation(m_HintContentContainer.forward, value.Value); // Quaternion.Euler(value.Value); Quaternion.RotateTowards(m_HintContentContainerInitialRotation, Quaternion.Euler(value.Value), 180f); - //this.SetSpatialHintRotation(orig); - //spatialHintContentContainer.rotation = orig; this.SetSpatialHintLookATRotation(value.Value); } } + public Node? node { set { m_UsesNodeImplementation.node = value; } } + public event Action buttonHovered; public event Action buttonClicked; public event Action buttonSelected; - private Vector3 m_StartingDragOrigin; - private Vector3 m_DragTarget; - private IUsesNode m_UsesNodeImplementation; - void Awake() { m_OriginalLocalScale = transform.localScale; @@ -302,35 +291,6 @@ IEnumerator ShowThenHideAllButtons(float delayBeforeHiding = 1.25f, bool showMen m_ShowHideAllButtonsCoroutine = null; } - IPinnedToolButton PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType) - { - // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions - if (!toolType.GetInterfaces().Contains(typeof(ITool))) - return null; - - IPinnedToolButton pinnedToolButton = null; - /* - Rays.ForEachProxyDevice((deviceData) => - { - if (deviceData.rayOrigin == rayOrigin) // enable pinned tool preview on the opposite (handed) device - { - var pinnedToolButtons = deviceData.pinnedToolButtons; - foreach (var pair in pinnedToolButtons) - { - var button = pair.Value; - if (button.order == button.activeToolOrderPosition) - { - pinnedToolButton = button; - pinnedToolButton.previewToolType = toolType; - break; - } - } - } - }); - */ - return pinnedToolButton; - } - void Reinsert(IPinnedToolButton button, int newOrderPosition, bool updateButtonOrder = false) { var removed = m_OrderedButtons.Remove(button); @@ -451,9 +411,6 @@ public void SelectNextExistingToolButton() { var button = m_OrderedButtons[aboveMinimumButtonCount ? k_ActiveToolOrderPosition + 1 : k_ActiveToolOrderPosition]; SetupButtonOrderThenSelectTool(button); - - //if (buttonSelected != null) - //buttonSelected(rayOrigin, button.toolType); } public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) @@ -630,9 +587,8 @@ void ButtonHoverExitPerformed() IEnumerator DelayedHoverExitCheck() { - m_RayHovered = false; - var duration = Time.unscaledDeltaTime; + m_RayHovered = false; while (duration < 0.25f) { duration += Time.unscaledDeltaTime; @@ -652,11 +608,6 @@ void OnButtonHover() if (buttonHovered != null) buttonHovered(); } - - public Node? node - { - set { m_UsesNodeImplementation.node = value; } - } } } #endif From 5ad82c34781fb06992e202a594a67383f279dc20 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 14:19:35 -0700 Subject: [PATCH 730/870] Cleanup GradientButton formatting --- Scripts/UI/GradientButton.cs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index aaa488c92..7a19973b3 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -137,6 +137,18 @@ public Sprite icon } } + public bool invertHighlightScale { private get; set; } + public float containerContentsAnimationSpeedMultiplier { set { m_ContainerContentsAnimationSpeedMultiplier = value; }} + + public float iconHighlightedLocalZOffset + { + set + { + m_IconHighlightedLocalZOffset = value; + m_IconHighlightedLocalPosition = m_OriginalIconLocalPosition + Vector3.forward * m_IconHighlightedLocalZOffset; + } + } + public GradientPair normalGradientPair { get { return m_NormalGradientPair; } set { m_NormalGradientPair = value; } } [SerializeField] GradientPair m_NormalGradientPair; @@ -219,18 +231,6 @@ public Sprite icon Coroutine m_HighlightCoroutine; Coroutine m_IconHighlightCoroutine; - public bool invertHighlightScale { private get; set; } - public float containerContentsAnimationSpeedMultiplier { set { m_ContainerContentsAnimationSpeedMultiplier = value; }} - - public float iconHighlightedLocalZOffset - { - set - { - m_IconHighlightedLocalZOffset = value; - m_IconHighlightedLocalPosition = m_OriginalIconLocalPosition + Vector3.forward * m_IconHighlightedLocalZOffset; - } - } - void Awake() { m_OriginalIconSprite = m_Icon.sprite; @@ -581,7 +581,7 @@ GradientPair GetMaterialColors() /// Set this button's gradient colors /// /// The gradient pair to set on this button's material - public void SetMaterialColors(GradientPair gradientPair) + void SetMaterialColors(GradientPair gradientPair) { m_ButtonMaterial.SetColor(k_MaterialColorTopProperty, gradientPair.a); m_ButtonMaterial.SetColor(k_MaterialColorBottomProperty, gradientPair.b); From ddcc555102044b138f65d58d566569a656285b74 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 15:12:25 -0700 Subject: [PATCH 731/870] Reduce ToolTip transition duration --- Scripts/Modules/TooltipModule/TooltipModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index 36be4e4e8..10012a7e8 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules sealed class TooltipModule : MonoBehaviour, IUsesViewerScale { const float k_Delay = 0; // In case we want to bring back a delay - const float k_TransitionDuration = 0.175f; + const float k_TransitionDuration = 0.1f; const float k_UVScale = 100f; const float k_UVScrollSpeed = 1.5f; const float k_Offset = 0.05f; From 5bea769bf867a86b52660fe7af65c50597aa8dad Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 16 Aug 2017 15:22:55 -0700 Subject: [PATCH 732/870] Fix spelling error in comment and remove redundant .transform in GetTransformOffset --- Scripts/Utilities/MathUtilsExt.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/Utilities/MathUtilsExt.cs b/Scripts/Utilities/MathUtilsExt.cs index 0a5fbd420..c2074dbc2 100644 --- a/Scripts/Utilities/MathUtilsExt.cs +++ b/Scripts/Utilities/MathUtilsExt.cs @@ -166,7 +166,7 @@ public static Quaternion ConstrainYawRotation(Quaternion rotation) } /// - /// Get the position and rotatoin difference between two objects for the purpose of maintaining that offset + /// Get the position and rotation difference between two objects for the purpose of maintaining that offset /// /// The object whose position will be changing (parent) /// The object whose position will be updated (child) @@ -175,8 +175,8 @@ public static Quaternion ConstrainYawRotation(Quaternion rotation) public static void GetTransformOffset(Transform from, Transform to, out Vector3 positionOffset, out Quaternion rotationOffset) { var inverseRotation = Quaternion.Inverse(from.rotation); - positionOffset = inverseRotation * (to.transform.position - from.position); - rotationOffset = inverseRotation * to.transform.rotation; + positionOffset = inverseRotation * (to.position - from.position); + rotationOffset = inverseRotation * to.rotation; } /// From 4ed0b44d7adc681c418b6c023dd83a7999cb4113 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 16 Aug 2017 15:23:53 -0700 Subject: [PATCH 733/870] Add missing meta for Unit folder --- Tests/Editor/Unit.meta | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Tests/Editor/Unit.meta diff --git a/Tests/Editor/Unit.meta b/Tests/Editor/Unit.meta new file mode 100644 index 000000000..c06cb7602 --- /dev/null +++ b/Tests/Editor/Unit.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: feb08fd67bad3cf458ec1121e188c519 +folderAsset: yes +timeCreated: 1502922220 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: From c04abe92f08f7e7f50f9c6667d48ab866a19a102 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 16:15:39 -0700 Subject: [PATCH 734/870] Perform various format, summary, and convention cleanups throughout branch --- Menus/MainMenu/MainMenu.cs | 5 +-- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 3 +- Scripts/Core/EditorVR.Tools.cs | 36 ++++++------------- Scripts/Core/EditorVR.cs | 2 -- Scripts/Interfaces/Entity/IMainMenu.cs | 7 ++-- .../FunctionalityInjection/IControlHaptics.cs | 2 -- .../Modules/TooltipModule/TooltipModule.cs | 5 +-- 7 files changed, 20 insertions(+), 40 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index de21124c9..ec3933393 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -92,10 +92,8 @@ public bool visible public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } public Node? node { get; set; } - public GameObject menuContent { get { return m_MainMenuUI.gameObject; } } - - public Transform rayOrigin { private get; set; } // TODO: still needed for previewToolInPinnedToolButton - consider changing to NODE + public Transform rayOrigin { private get; set; } void Start() { @@ -169,7 +167,6 @@ void CreateFaceButtons(List types) { sectionName = customMenuAttribute.sectionName, description = customMenuAttribute.description - }; } diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index b9fd5ceae..ffe6c4f04 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -282,11 +282,12 @@ IEnumerator AnimateShow() semiTransparent = false; semiTransparent = true; + const float kSpeedScalar = 8f; var revealAmount = 0f; var hiddenSlotRotation = RadialMenuSlot.hiddenLocalRotation; while (revealAmount < 1) { - revealAmount += Time.unscaledDeltaTime * 8; + revealAmount += Time.unscaledDeltaTime * kSpeedScalar; var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(revealAmount); for (int i = 0; i < m_RadialMenuSlots.Count; ++i) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 3577f9d83..41d672cf8 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -74,7 +74,6 @@ internal static void SpawnDefaultTools(IProxy proxy) var vacuumables = evr.GetNestedModule(); var lockModule = evr.GetModule(); var defaultTools = evr.m_DefaultTools; - var pinnedTools = evr.GetNestedModule(); foreach (var deviceData in evr.m_DeviceData) { @@ -138,7 +137,6 @@ internal static void SpawnDefaultTools(IProxy proxy) /// Returns tool that was spawned or null if the spawn failed. static ToolData SpawnTool(Type toolType, out HashSet usedDevices, InputDevice device = null) { - Debug.LogWarning("SPAWN TOOL CALLED! : " + toolType); usedDevices = new HashSet(); if (!typeof(ITool).IsAssignableFrom(toolType)) return null; @@ -190,29 +188,28 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn { if (deviceData.rayOrigin == rayOrigin) { - Debug.LogError("deviceDate.CurrentTool : " + deviceData.currentTool.ToString() + " : setting type to : " + toolType); var spawnTool = true; - var pinnedToolButtonAdded = false; var currentTool = deviceData.currentTool; var currentToolType = currentTool.GetType(); var currentToolIsSelect = currentToolType == typeof(SelectionTool); - var setSelectAsCurrentTool = toolType == typeof(SelectionTool) && !currentToolIsSelect;//deviceData.currentTool is ILocomotor; + var setSelectAsCurrentTool = toolType == typeof(SelectionTool) && !currentToolIsSelect; var pinnedToolsMenu = deviceData.pinnedToolsMenu; // If this tool was on the current device already, remove it, if it is selected while already being the current tool var despawn = (!currentToolIsSelect && currentToolType == toolType && despawnOnReselect) || setSelectAsCurrentTool;// || setSelectAsCurrentTool || toolType == typeof(IMainMenu); if (currentTool != null && despawn) { - Debug.LogError("Despawing tool !!!! : toolType == typeof(SelectionTool) : " + (toolType == typeof(SelectionTool)).ToString()); DespawnTool(deviceData, currentTool); if (!currentToolIsSelect && !setSelectAsCurrentTool) { - // Delete a button of the first type parameter; then select a button the second type param (the new current tool) - pinnedToolsMenu.deletePinnedToolButton(toolType, currentToolType); + // Delete a button of the first type parameter + // Then select a button the second type param (the new current tool) // Don't spawn a new tool, since we are only removing the old tool + pinnedToolsMenu.deletePinnedToolButton(toolType, currentToolType); } else if (!currentToolIsSelect && setSelectAsCurrentTool) { + // Set the selection tool as the active tool, if select is to be the new current tool pinnedToolsMenu.SetButtonForType(typeof(SelectionTool), null); } @@ -221,12 +218,10 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn if (spawnTool && !IsDefaultTool(toolType)) { - Debug.LogError("SPAWN TOOL : " + toolType); // Spawn tool and collect all devices that this tool will need HashSet usedDevices; var device = deviceData.inputDevice; var newTool = SpawnTool(toolType, out usedDevices, device); - var evrDeviceData = evr.m_DeviceData; // Exclusive mode tools always take over all tool stacks @@ -238,32 +233,23 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn } } - foreach (var dd in evrDeviceData) + foreach (var data in evrDeviceData) { - if (!usedDevices.Contains(dd.inputDevice)) + if (!usedDevices.Contains(data.inputDevice)) continue; if (deviceData.currentTool != null) // Remove the current tool on all devices this tool will be spawned on DespawnTool(deviceData, deviceData.currentTool); - AddToolToStack(dd, newTool); - - //if (!setSelectAsCurrentTool) - pinnedToolsMenu.SetButtonForType(toolType, newTool.icon); + AddToolToStack(data, newTool); + + pinnedToolsMenu.SetButtonForType(toolType, newTool.icon); } } - - // TODO remove after refactor - //pinnedToolsMenu.SetupPinnedToolButtonsForDevice(rayOrigin, toolType, deviceData.node); - + deviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; } - else - { - // TODO: Remove the below line after additional design review approval - //deviceData.menuHideFlags[deviceData.mainMenu] |= Menus.MenuHideFlags.Hidden; - } }); return result; diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index ad4fd2f31..07f312f4d 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -5,9 +5,7 @@ using System.Linq; using System.Reflection; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; -using UnityEditor.Experimental.EditorVR.Tools; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 417e4cffe..61224ac24 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -42,10 +42,9 @@ public static class IMainMenuMethods /// /// Highlights a pinned tool button when a menu button is highlighted - /// Transform: Ray origin to check - /// Type: MenuButton's tool type to preview - /// String: The tool description to display as a Tooltip - /// + /// Transform: Ray origin to check + /// Type: MenuButton's tool type to preview + /// String: The tool description to display as a Tooltip public static void PreviewInPinnedToolButton (this IMainMenu obj, Transform rayOrigin, Type toolType, string toolDescription) { previewInPinnedToolButton(rayOrigin, toolType, toolDescription); diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs index d330f46c7..00ecc6442 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlHaptics.cs @@ -36,8 +36,6 @@ public static void Pulse(this IControlHaptics obj, Node? node, HapticPulse hapti /// Stop all haptic feedback on a specific device, or all devices /// /// Device RayOrigin/Transform on which to stop all pulses. A NULL value will stop pulses on all devices - /// (Optional) Multiplier value applied to the hapticPulse duration - /// (Optional) Multiplier value applied to the hapticPulse intensity public static void StopPulses(this IControlHaptics obj, Node? node) { stopPulses(node); diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index 10012a7e8..485795dca 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -125,9 +125,10 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa var customToolTipColor = tooltip as ISetCustomTooltipColor; if (customToolTipColor != null) { + var customToolTipHighlightColor = customToolTipColor.customToolTipHighlightColor; tooltipUI.highlight.material= m_CustomHighlightMaterial; - m_CustomHighlightMaterial.SetColor(k_MaterialColorTopProperty, customToolTipColor.customToolTipHighlightColor.a); - m_CustomHighlightMaterial.SetColor(k_MaterialColorBottomProperty, customToolTipColor.customToolTipHighlightColor.b); + m_CustomHighlightMaterial.SetColor(k_MaterialColorTopProperty, customToolTipHighlightColor.a); + m_CustomHighlightMaterial.SetColor(k_MaterialColorBottomProperty, customToolTipHighlightColor.b); } m_TooltipBackgroundMaterial.SetColor("_Color", Color.Lerp(UnityBrandColorScheme.darker, m_OriginalBackgroundColor, lerp)); From acb8510f4d04d0354c0ab1adb9ab3c50fee1cf96 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 16:56:38 -0700 Subject: [PATCH 735/870] Cleanup formatting in HintLine --- Menus/PinnedToolMenu/Scripts/HintLine.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/PinnedToolMenu/Scripts/HintLine.cs index 156da862f..11d4327be 100644 --- a/Menus/PinnedToolMenu/Scripts/HintLine.cs +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -9,29 +10,18 @@ public class HintLine : MonoBehaviour { const string k_ShaderLineRadiusPropertyName = "_lineRadius"; - [SerializeField] - bool m_HideOnInitialize = true; - [SerializeField] VRLineRenderer m_ScrollLineRenderer; - [SerializeField] - float m_LineWidth = 1f; - [SerializeField] Color m_VisibleColor = Color.white; - [SerializeField] - Color m_HiddenColor = Color.clear; - [SerializeField] Color m_PulseColor = Color.white; [SerializeField] MeshRenderer m_MeshRenderer; - readonly Vector3 k_HiddenScale = Vector3.zero; - Transform m_IconTransform; Vector3 m_VisibleLocalScale; Coroutine m_VisibilityCoroutine; @@ -69,7 +59,6 @@ IEnumerator AnimatePulseColor() var minShaderLineRadius = new Vector3 (0.005f, 0f, 100f); var currentVector3ShaderLineRadius = m_HintLineMaterial.GetVector(k_ShaderLineRadiusPropertyName); var currentColor = m_ScrollLineRenderer.colorStart; // The line stand & end colors are the same; fetch only one of them - var currentShaderLineRadius = m_HintLineMaterial.GetFloat(k_ShaderLineRadiusPropertyName); while (m_PulseDuration < kTargetDuration) { var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(m_PulseDuration / kTargetDuration); @@ -95,3 +84,4 @@ IEnumerator AnimatePulseColor() } } } +#endif \ No newline at end of file From 1b906163dc7aff73049d3c1145000ca48cbf91c3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 18:05:26 -0700 Subject: [PATCH 736/870] Remove usings, prints, and add UNITY_EDITOR if block to HintIcon --- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index 7940b41df..c507204cf 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -1,5 +1,5 @@ -using System.Collections; -using System.Security.Cryptography.X509Certificates; +#if UNITY_EDITOR +using System.Collections; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -131,7 +131,6 @@ public void PulseColor() IEnumerator AnimatePulseColor() { - //Debug.LogError("Pulsing color of hint arrow : " + gameObject.name); const float kTargetDuration = 1f; m_PulseDuration = 0f; var currentColor = m_Icon.color; @@ -156,3 +155,4 @@ IEnumerator AnimatePulseColor() } } } +#endif From 8c441801df5fe4d5191d9a841381e092367c1a98 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 18:05:59 -0700 Subject: [PATCH 737/870] Add summaries to IControlSpatialScrolling --- .../IControlSpatialScrolling.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs index fefcf9355..f67f5e89d 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs @@ -13,13 +13,23 @@ public interface IControlSpatialScrolling public static class IControlSpatialScrollingMethods { - internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDelegate (object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1); + internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDelegate (object caller, Node? node, Vector3 startingPosition, + Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1); internal static PerformSpatialScrollDelegate performSpatialScroll { private get; set; } /// - /// + /// Perform a spatial scroll action /// - public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IControlSpatialHinting obj, object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) + /// The object requesting the performance of a spatial scroll action + /// The node on which to display & perform the spatial scroll + /// The initial position of the spatial scroll + /// The current/updated position of the spatial scroll + /// The length at which a scroll action will return a repeating/looping value + /// The number of items being scrolled through with this action + /// The maximum number of items that can be scrolled through for this action + /// The spatial scroll data for a single scroll action, but an individual caller object + public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IControlSpatialHinting obj, object caller, Node? node, + Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) { return performSpatialScroll(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount); } @@ -28,8 +38,9 @@ public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IC internal static EndSpatialScrollDelegate endSpatialScroll { private get; set; } /// - /// + /// End a spatial scrolling action for a given caller /// + /// The caller whose spatial scroll action will be ended public static void EndSpatialScroll(this IControlSpatialHinting obj, object caller) { endSpatialScroll(caller); From 7c13e757445aaa657f94e4368c438c8eb94df954 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 18:07:13 -0700 Subject: [PATCH 738/870] Reformat IPinnedToolButton structure --- Scripts/Core/Interfaces/IPinnedToolButton.cs | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Scripts/Core/Interfaces/IPinnedToolButton.cs b/Scripts/Core/Interfaces/IPinnedToolButton.cs index 633d87df1..60c7060bc 100644 --- a/Scripts/Core/Interfaces/IPinnedToolButton.cs +++ b/Scripts/Core/Interfaces/IPinnedToolButton.cs @@ -5,34 +5,34 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Gives decorated class Pinned Tool Button functionality + /// Provides an interface for handling Pinned Tool Button functionality /// public interface IPinnedToolButton { Type previewToolType { set; } - Type toolType { get; set; } + Type toolType { get; } + int order { get; set; } - int maxButtonCount { get; set; } + int maxButtonCount { set; } float iconHighlightedLocalZOffset { set; } bool highlighted { get; set; } bool secondaryButtonHighlighted { get; } - bool isActiveTool { get; set; } + bool isActiveTool { set; } bool toolTipVisible { set; } - bool implementsSecondaryButton { get; set; } + bool implementsSecondaryButton { set; } Vector3 primaryUIContentContainerLocalScale { get; set; } - Transform tooltipTarget { get; set; } + Transform tooltipTarget { set; } string previewToolDescription { set; } + Action destroy { get; } Action selectTool { set; } - Func visibileButtonCount { set; } - Func closeButton { set; } Action showAllButtons { set; } Action hoverExit { set; } - event Action hovered; - } - public static class IPinnedToolButtonMethods - { + Func visibileButtonCount { set; } + Func closeButton { set; } + + event Action hovered; } } #endif From 5d12a497047e21f510202cde6b9fafd582f75d4d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 18:16:38 -0700 Subject: [PATCH 739/870] Remove warnings from PinnedToolsMenuUI --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 7209727bb..270fde24f 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IUsesNode, IInstantiateUI, + sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IInstantiateUI, IConnectInterfaces, IControlSpatialHinting, IControlHaptics, IUsesRayOrigin { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation @@ -46,9 +46,7 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IUsesNode, IIn Quaternion m_HintContentContainerInitialRotation; Quaternion m_HintContentContainerCurrentRotation; Vector3 m_HintContentWorldPosition; - Vector3 m_StartingDragOrigin; Vector3 m_DragTarget; - IUsesNode m_UsesNodeImplementation; public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } @@ -144,13 +142,10 @@ public Vector3? startingDragOrigin { Debug.LogWarning("SETTING STARTING DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); //Debug.LogError(value.Value.ToString("F4")); - m_StartingDragOrigin = transform.position; this.SetSpatialHintLookATRotation(value.Value); } } - public Node? node { set { m_UsesNodeImplementation.node = value; } } - public event Action buttonHovered; public event Action buttonClicked; public event Action buttonSelected; From 9544cd8ad9c5ffa54ee52dda8acb7752af5daa76 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 18:18:01 -0700 Subject: [PATCH 740/870] Cleanup SpatialHintModuleUI warnings --- Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index c61a8e17f..7e6e94c52 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -40,7 +40,6 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt bool m_SecondaryArrowsVisible; Vector3 m_ScrollVisualsRotation; Transform m_ScrollVisualsTransform; - GameObject m_ScrollVisualsGameObject; Coroutine m_ScrollVisualsVisibilityCoroutine; Coroutine m_VisibilityCoroutine; Transform m_ScrollVisualsDragTargetArrowTransform; @@ -220,7 +219,6 @@ public Node? controllingNode void Awake() { m_ScrollVisualsTransform = m_ScrollVisualsCanvasGroup.transform; - m_ScrollVisualsGameObject = m_ScrollVisualsTransform.gameObject; m_ScrollVisualsCanvasGroup.alpha = 0f; //m_ScrollVisualsGameObject.SetActive(false); @@ -288,7 +286,6 @@ IEnumerator ShowScrollVisuals() var targetLocalScale = Vector3.one; var currentAlpha = m_ScrollVisualsCanvasGroup.alpha; var secondArrowCurrentPosition = m_ScrollVisualsDragTargetArrowTransform.position; - var normalizedScrollVisualsForward = Vector3.Normalize(m_ScrollVisualsTransform.forward); while (currentDuration < kTargetDuration) { From 341414ae0d734ce93e023624cd18cadc5bb4c6c9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 18:19:21 -0700 Subject: [PATCH 741/870] Remove log print from PinnedToolButtons --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index e0755fbdf..567c57980 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -59,8 +59,6 @@ internal void ClearPinnedToolButtonPreview() internal void OnToolButtonClicked(Transform rayOrigin, Type toolType) { - Debug.LogError(" OnToolButtonClicked : Selecting Tool in EditorVR.PinnedToolButtons : " + toolType.ToString()); - if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); else From af175584d5a101bcaf2370be44b66df9a9d5b266 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 18:25:00 -0700 Subject: [PATCH 742/870] Remove now unused logic in SpatialHintModuleUI --- .../SpatialHintModule/SpatialHintModuleUI.cs | 72 ------------------- 1 file changed, 72 deletions(-) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 7e6e94c52..e927bfffb 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -41,9 +41,7 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt Vector3 m_ScrollVisualsRotation; Transform m_ScrollVisualsTransform; Coroutine m_ScrollVisualsVisibilityCoroutine; - Coroutine m_VisibilityCoroutine; Transform m_ScrollVisualsDragTargetArrowTransform; - Transform m_ScrollVisualsDragSourceArrowTransform; public bool visible { @@ -82,34 +80,6 @@ public bool visible } } - /* - /// - /// Enables/disables the visual elements that should be shown when beginning to initiate a spatial selection action - /// This is only enabled before the enabling of the main select visuals - /// - public bool preScrollVisualsVisible - { - get { return m_PreScrollVisualsVisible; } - set - { - m_PreScrollVisualsVisible = value; - - this.RestartCoroutine(ref m_VisibilityCoroutine, m_PreScrollVisualsVisible ? AnimateShow() : AnimateHide()); - - var semiTransparentWhite = new Color(1f, 1f, 1f, 0.5f); - foreach (var arrow in m_PrimaryDirectionalHintArrows) - { - arrow.visibleColor = semiTransparentWhite; - } - - foreach (var arrow in m_SecondaryDirectionalHintArrows) - { - arrow.visible = m_PreScrollVisualsVisible; - } - } - } - */ - public bool scrollVisualsVisible { set @@ -222,51 +192,9 @@ void Awake() m_ScrollVisualsCanvasGroup.alpha = 0f; //m_ScrollVisualsGameObject.SetActive(false); - m_ScrollVisualsDragSourceArrowTransform = m_ScrollVisualsDragSourceArrow.transform; m_ScrollVisualsDragTargetArrowTransform = m_ScrollVisualsDragTargetArrow.transform; } - IEnumerator AnimateShow() - { - //m_SpatialHintUI.enablePreviewVisuals = true; - - transform.localScale = Vector3.zero; - var currentScale = transform.localScale; - var timeElapsed = currentScale.x; // Proportionally lessen the duration according to the current state of the visuals - var targetScale = Vector3.one * this.GetViewerScale(); - while (timeElapsed < 1f) - { - timeElapsed += Time.unscaledDeltaTime * 3f; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(timeElapsed), 6); - transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); - yield return null; - } - - transform.localScale = targetScale; - m_VisibilityCoroutine = null; - } - - IEnumerator AnimateHide() - { - //m_SpatialHintUI.enableVisuals = false; - - yield break; - - var currentScale = transform.localScale; - var timeElapsed = 1 - currentScale.x; - var targetScale = Vector3.zero; - while (timeElapsed < 1f) - { - timeElapsed += Time.unscaledDeltaTime * 4f; - var durationShaped = MathUtilsExt.SmoothInOutLerpFloat(timeElapsed); - transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); - yield return null; - } - - transform.localScale = targetScale; - m_VisibilityCoroutine = null; - } - IEnumerator ShowScrollVisuals() { Debug.LogError("SHOWING SPATIAL SCROLL VISUALS : viewscale is " + this.GetViewerScale()); From d922fb5f384f2344ba986341ea608bfc989865e1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 18:26:09 -0700 Subject: [PATCH 743/870] Remove unused logic and warnings from PinnedToolButton --- .../PinnedToolButton/PinnedToolButton.cs | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index e7bf8f32a..3fce47abc 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -15,7 +15,6 @@ namespace UnityEditor.Experimental.EditorVR.Menus public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor { static Color s_FrameOpaqueColor; - static Color s_SemiTransparentFrameColor; static bool s_Hovered; const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation @@ -304,7 +303,6 @@ public string tooltipText Sprite m_PreviewIcon; bool m_Highlighted; bool m_ActiveTool; - bool m_Visible; public Transform tooltipTarget { get { return m_TooltipTarget; } set { m_TooltipTarget = value; } } public Transform tooltipSource { get { return m_TooltipSource; } } @@ -356,18 +354,6 @@ public bool isActiveTool } } - public bool visible - { - //get { return m_Highlighted; } - set - { - if (m_Visible == value) - return; - - gameObject.SetActive(value); - } - } - public bool highlighted { get { return m_Highlighted; } @@ -534,7 +520,6 @@ void Awake() var frameMaterialColor = m_FrameMaterial.color; s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); - s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, kSemiTransparentAlphaValue); m_IconMaterial = MaterialUtils.GetMaterialClone(m_ButtonIcon); m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); @@ -753,24 +738,6 @@ void ActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); hoverExit(); - - return; - Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); - // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons - - // Hide both action buttons if the user is no longer hovering over the button - //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) - //{ - //Debug.LogWarning("!!!"); - //m_ButtonCollider.enabled = true; - //m_LeftPinnedToolActionButton.visible = false; - //m_RightPinnedToolActionButton.visible = false; - //m_GradientButton.visible = true; - m_GradientButton.highlighted = false; - //revealAllToolButtons(rayOrigin, false); - //} - - m_GradientButton.UpdateMaterialColors(); } /* @@ -889,15 +856,11 @@ IEnumerator AnimateHide() //primaryButtonCollidersEnabled = false; //secondaryButtonCollidersEnabled = false; const float kTimeScalar = 8f; - var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var targetPosition = Vector3.zero; var currentPosition = transform.localPosition; var currentFrameColor = m_FrameMaterial.color; var targetFrameColor = Color.clear; - var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); - var targetInsetAlpha = 0f; - var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); var targetIconColor = Color.clear; //var currentInsetScale = m_Inset.localScale; //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; @@ -949,9 +912,6 @@ IEnumerator AnimateShow() var currentFrameColor = m_FrameMaterial.color; var targetFrameColor = Color.clear; - var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); - var targetInsetAlpha = 0f; - var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); var targetIconColor = Color.clear; //var currentInsetScale = m_Inset.localScale; //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; From c240b1bc74d76fed2287edd0cfc218f608abaf97 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 19:41:38 -0700 Subject: [PATCH 744/870] Add summaries, perform convention & formatting cleanups throughout spatial hint and pinned tools arch --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 -- .../Scripts/PinnedToolsMenuUI.cs | 10 +++--- .../SpatialHintModuleConnector.cs | 4 +-- .../IControlSpatialHinting.cs | 34 ++++++++++++------- .../SpatialHintModule/SpatialHintModule.cs | 4 +-- 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index dd40df84b..7094a33c5 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -43,7 +43,6 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac Transform m_RayOrigin; Transform m_AlternateMenuOrigin; float allowToolToggleBeforeThisTime; - float? continuedInputConsumptionStartTime; Vector3 m_SpatialScrollStartPosition; IPinnedToolButton m_MainMenuButton; PinnedToolsMenuUI m_PinnedToolsMenuUI; @@ -254,7 +253,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon else if (pinnedToolInput.show.wasJustReleased) { const float kAdditionalConsumptionDuration = 0.25f; - continuedInputConsumptionStartTime = Time.realtimeSinceStartup + kAdditionalConsumptionDuration; if (m_SpatialScrollData.passedMinDragActivationThreshold) { Debug.LogWarning("PinnedToolButton was just released"); diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 270fde24f..6ab7168b3 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -71,7 +71,7 @@ public bool allButtonsVisible { ShowOnlyMenuAndActiveToolButtons(); spatiallyScrolling = false; - this.SetSpatialHintRotationTarget(Vector3.zero); + this.SetSpatialHintShowHideRotationTarget(Vector3.zero); } } } @@ -142,7 +142,7 @@ public Vector3? startingDragOrigin { Debug.LogWarning("SETTING STARTING DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); //Debug.LogError(value.Value.ToString("F4")); - this.SetSpatialHintLookATRotation(value.Value); + this.SetSpatialHintLookAtRotation(value.Value); } } @@ -174,7 +174,7 @@ void Update() // Update the dragTarget with the current device position, to allow for visuals to better match the expected rotation/position m_DragTarget = transform.position; this.SetSpatialHintDragThresholdTriggerPosition(transform.position); - this.SetSpatialHintRotation(newHintContainerRotation); + this.SetSpatialHintContainerRotation(newHintContainerRotation); // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold m_SpatialDragDistance += Time.unscaledDeltaTime * 8; // Continue to increase the amount @@ -196,8 +196,8 @@ void Update() { //spatialHintScrollVisualsRotation = m_DragTarget; this.SetSpatialHintDragThresholdTriggerPosition(transform.position); - this.SetSpatialHintRotation(newHintContainerRotation); - this.SetSpatialHintRotationTarget(m_DragTarget); + this.SetSpatialHintContainerRotation(newHintContainerRotation); + this.SetSpatialHintShowHideRotationTarget(m_DragTarget); } //spatialHintScrollVisualsDragThresholdTriggerPosition = transform.position; diff --git a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs index 784a789b1..ead1d8d2a 100644 --- a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs +++ b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs @@ -11,8 +11,8 @@ public void LateBindInterfaceMethods(SpatialHintModule provider) { IControlSpatialHintingMethods.setSpatialHintState = provider.SetState; IControlSpatialHintingMethods.setSpatialHintPosition = provider.SetPosition; - IControlSpatialHintingMethods.setSpatialHintRotation = provider.SetRotation; - IControlSpatialHintingMethods.setSpatialHintRotationTarget = provider.SetRotationTarget; + IControlSpatialHintingMethods.setSpatialHintContainerRotation = provider.SetContainerRotation; + IControlSpatialHintingMethods.setSpatialHintShowHideRotationTarget = provider.SetShowHideRotationTarget; IControlSpatialHintingMethods.setSpatialHintLookAtRotation = provider.LookAt; IControlSpatialHintingMethods.setSpatialHintDragThresholdTriggerPosition = provider.SetDragThresholdTriggerPosition; IControlSpatialHintingMethods.pulseSpatialHintScrollArrows = provider.PulseScrollArrows; diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs index c9e7538d5..4ad82cf6b 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs @@ -17,8 +17,9 @@ public static class IControlSpatialHintingMethods internal static SetSpatialHintStateDelegate setSpatialHintState { get; set; } /// - /// + /// Set the spatial hint state /// + /// SpatialHintState to set public static void SetSpatialHintState(this IControlSpatialHinting obj, SpatialHintModule.SpatialHintStateFlags state) { setSpatialHintState(state); @@ -28,42 +29,46 @@ public static void SetSpatialHintState(this IControlSpatialHinting obj, SpatialH internal static SetSpatialHintPositionDelegate setSpatialHintPosition { get; set; } /// - /// + /// Set the position of the spatial hint visuals /// + /// The position at which the spatial hint visuals should be displayed public static void SetSpatialHintPosition(this IControlSpatialHinting obj, Vector3 position) { setSpatialHintPosition(position); } internal delegate void SetSpatialHintRotationDelegate(Quaternion rotation); - internal static SetSpatialHintRotationDelegate setSpatialHintRotation { get; set; } + internal static SetSpatialHintRotationDelegate setSpatialHintContainerRotation { get; set; } /// - /// + /// Set the rotation of the spatial hint visuals container game object /// - public static void SetSpatialHintRotation(this IControlSpatialHinting obj, Quaternion rotation) + /// The rotation to set on the spatial visuals + public static void SetSpatialHintContainerRotation(this IControlSpatialHinting obj, Quaternion rotation) { - setSpatialHintRotation(rotation); + setSpatialHintContainerRotation(rotation); } internal delegate void SetSpatialHintRotationTargetDelegate(Vector3 target); - internal static SetSpatialHintRotationTargetDelegate setSpatialHintRotationTarget { get; set; } + internal static SetSpatialHintRotationTargetDelegate setSpatialHintShowHideRotationTarget { get; set; } /// - /// + /// Sets the target for the spatial hint visuals to look at while performing an animated show or hide /// - public static void SetSpatialHintRotationTarget(this IControlSpatialHinting obj, Vector3 target) + /// The position to target + public static void SetSpatialHintShowHideRotationTarget(this IControlSpatialHinting obj, Vector3 target) { - setSpatialHintRotationTarget(target); + setSpatialHintShowHideRotationTarget(target); } internal delegate void SetSpatialHintLookATRotationDelegate(Vector3 position); internal static SetSpatialHintLookATRotationDelegate setSpatialHintLookAtRotation { get; set; } /// - /// + /// Set the LookAt target /// - public static void SetSpatialHintLookATRotation(this IControlSpatialHinting obj, Vector3 position) + /// The position the visuals should look at + public static void SetSpatialHintLookAtRotation(this IControlSpatialHinting obj, Vector3 position) { setSpatialHintLookAtRotation(position); } @@ -83,8 +88,9 @@ public static void PulseSpatialHintScrollArrows(this IControlSpatialHinting obj) internal static SetSpatialHintDragThresholdTriggerPositionDelegate setSpatialHintDragThresholdTriggerPosition { get; set; } /// - /// + /// Set the magnitude at which the user will trigger spatial scrolling /// + /// The position, whose magnitude from the origin will be used to detect an initiation of spatial scrolling public static void SetSpatialHintDragThresholdTriggerPosition(this IControlSpatialHinting obj, Vector3 position) { setSpatialHintDragThresholdTriggerPosition(position); @@ -95,7 +101,9 @@ public static void SetSpatialHintDragThresholdTriggerPosition(this IControlSpati /// /// Set reference to the object, RayOrigin, controlling the Spatial Hint visuals + /// Each control-object has it's spatial scrolling processed independently /// + /// Control-object whose spatial scrolling will be processed independently public static void SetSpatialHintControlObject(this IControlSpatialHinting obj, Transform controlObject) { setSpatialHintControlObject(controlObject); diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index 0d44c84e4..17068ebfe 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -110,12 +110,12 @@ internal void SetPosition(Vector3 newPosition) spatialHintContentContainer.position = newPosition; } - internal void SetRotation(Quaternion newRotation) + internal void SetContainerRotation(Quaternion newRotation) { m_SpatialHintModuleUI.transform.rotation = newRotation; } - internal void SetRotationTarget(Vector3 target) + internal void SetShowHideRotationTarget(Vector3 target) { spatialHintScrollVisualsRotation = target; } From 9a67131980dc8528b6e3996d5af7d12809b159e7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 19:56:51 -0700 Subject: [PATCH 745/870] Fix if def ordering in ISetCustomTootipColor --- Scripts/Interfaces/ISetCustomTooltipColor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Interfaces/ISetCustomTooltipColor.cs b/Scripts/Interfaces/ISetCustomTooltipColor.cs index 6fe88e889..8333da62f 100644 --- a/Scripts/Interfaces/ISetCustomTooltipColor.cs +++ b/Scripts/Interfaces/ISetCustomTooltipColor.cs @@ -1,6 +1,6 @@ -using UnityEditor.Experimental.EditorVR.Helpers; +#if UNITY_EDITOR +using UnityEditor.Experimental.EditorVR.Helpers; -#if UNITY_EDITOR namespace UnityEditor.Experimental.EditorVR { /// From 34220c345cad04d8dce85ca6f59aff48d820dbfa Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 20:00:38 -0700 Subject: [PATCH 746/870] Remove now unused ISpatialScrolling interface --- Scripts/Interfaces/ISpatialScrolling.cs | 48 -------------------- Scripts/Interfaces/ISpatialScrolling.cs.meta | 12 ----- 2 files changed, 60 deletions(-) delete mode 100644 Scripts/Interfaces/ISpatialScrolling.cs delete mode 100644 Scripts/Interfaces/ISpatialScrolling.cs.meta diff --git a/Scripts/Interfaces/ISpatialScrolling.cs b/Scripts/Interfaces/ISpatialScrolling.cs deleted file mode 100644 index 3b5cbbd5b..000000000 --- a/Scripts/Interfaces/ISpatialScrolling.cs +++ /dev/null @@ -1,48 +0,0 @@ -#if UNITY_EDITOR -using System; -using UnityEngine; -using UnityEditor.Experimental.EditorVR.Helpers; - -namespace UnityEditor.Experimental.EditorVR -{ - /// - /// Gives decorated class spatial scrolling functionality - /// - public interface ISpatialScrolling : IUsesMenuOrigins - { - /* - int menuButtonOrderPosition { get; } - int activeToolOrderPosition { get; } - int order { get; set; } - int activeButtonCount { set; } - bool revealed { set; } - bool moveToAlternatePosition { get; set; } - Transform rayOrigin { get; set; } - Type toolType { get; set; } - Type previewToolType { set; } - Vector3 toolButtonActivePosition { get; } // Shared active button offset from the alternate menu - Sprite icon { set; } - Node node { set; } - GradientPair gradientPair { get; } - - event Action hoverEnter; - event Action hoverExit; - event Action selected; - - Action selectTool { set; } - Action deletePinnedToolButton { set; } - Action revealAllToolButtons { set; } - */ - - Vector3 initialPosition { set; } // Position of the input device when spatial-scrolling is initiated - Vector3 currentPosition { set; } - - // start pos, current pos, world length before repeat, returns normalized repeating projection position - //Func - } - - public static class ISpatialScrollingMethods - { - } -} -#endif diff --git a/Scripts/Interfaces/ISpatialScrolling.cs.meta b/Scripts/Interfaces/ISpatialScrolling.cs.meta deleted file mode 100644 index 639b32f26..000000000 --- a/Scripts/Interfaces/ISpatialScrolling.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8360e5cd01a472d4294dcc004cf09274 -timeCreated: 1491960255 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 725aa65897d645b9cda177032dec82f6de5323e7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 21:41:53 -0700 Subject: [PATCH 747/870] Remove duplicate PinnedToolButton --- .../PinnedToolButton/PinnedToolButton.cs.orig | 1240 ----------------- .../PinnedToolButton.cs.orig.meta | 8 - 2 files changed, 1248 deletions(-) delete mode 100644 Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig delete mode 100644 Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig deleted file mode 100644 index 2f08edcb5..000000000 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig +++ /dev/null @@ -1,1240 +0,0 @@ -#if UNITY_EDITOR -using System; -using System.Collections; -using System.Text; -<<<<<<< HEAD:Scripts/UI/PinnedToolButton.cs -using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Helpers; -======= -using UnityEditor.Experimental.EditorVR.Core; ->>>>>>> improvements/dylanu/haptics:Menus/PinnedToolButton/PinnedToolButton.cs -using UnityEditor.Experimental.EditorVR.UI; -using UnityEditor.Experimental.EditorVR.Utilities; -using UnityEngine; -using UnityEngine.InputNew; -using UnityEngine.UI; -using UnityEngine.EventSystems; - -namespace UnityEditor.Experimental.EditorVR.Menus -{ -<<<<<<< HEAD:Scripts/UI/PinnedToolButton.cs - public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor, IPerformHaptics -======= - sealed class PinnedToolButton : MonoBehaviour, ISelectTool, IPointerEnterHandler, IControlHaptics, IUsesNode ->>>>>>> improvements/dylanu/haptics:Menus/PinnedToolButton/PinnedToolButton.cs - { - static Color s_FrameOpaqueColor; - static Color s_SemiTransparentFrameColor; - static bool s_Hovered; - - const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation - const float k_alternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu - const string k_MaterialColorProperty = "_Color"; - const string k_MaterialAlphaProperty = "_Alpha"; - const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; - const string k_MainMenuTipText = "Main Menu (cannot be closed)"; - readonly Vector3 k_ToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); - readonly Vector3 k_SemiTransparentIconContainerScale = new Vector3(1.375f, 1.375f, 1f); - - public Type toolType - { - get - { - return m_ToolType; - } - - set - { - m_ToolType = value; - - m_GradientButton.gameObject.SetActive(true); - - if (m_ToolType != null) - { - Debug.LogError("Setting up button type : " + m_ToolType.ToString()); - if (isSelectionTool || isMainMenu) - { - //order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; - tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; - gradientPair = UnityBrandColorScheme.sessionGradient; // Select tool uses session gradientPair - secondaryButtonCollidersEnabled = false; - } - else - { - tooltipText = toolType.Name; - - // Tools other than select fetch a random gradientPair; also used by the device when revealed - gradientPair = UnityBrandColorScheme.GetRandomCuratedLightGradient(); - } - - activeTool = activeTool; - m_GradientButton.visible = true; - //m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); - - //var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - //var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; - //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateInitialReveal(targetPosition, targetScale)); - } - else - { - m_GradientButton.visible = false; - gradientPair = UnityBrandColorScheme.grayscaleSessionGradient; - } - } - } - - public int order - { - get { return m_Order; } - set - { - //if (m_Order == value) - //return; - - m_Order = value; // Position of this button in relation to other pinned tool buttons - - //Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order + " - current button count : " + visibileButtonCount); - - highlighted = false; - //m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive - //activeTool = activeTool; - //const float kSmoothingMax = 50f; - //const int kSmoothingIncreaseFactor = 10; - //var smoothingFactor = Mathf.Clamp(kSmoothingMax- m_Order * kSmoothingIncreaseFactor, 0f, kSmoothingMax); - //m_SmoothMotion.SetPositionSmoothing(smoothingFactor); - //m_SmoothMotion.SetRotationSmoothing(smoothingFactor); - //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); - //m_LeftPinnedToolActionButton.visible = false; - //m_RightPinnedToolActionButton.visible = false; - - // We move in counter-clockwise direction - // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered - //const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice - //const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; - //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); - - //var mainMenuAndActiveButtonCount = 2; - //var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order)); - - if(m_Order == -1) - this.HideTooltip(this); - - /* - if (aboluteMenuButtonCount > mainMenuAndActiveButtonCount) - this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); - else - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); - */ - } - } - - /// - /// GradientPair should be set with new random gradientPair each time a new Tool is associated with this Button - /// This gradientPair is also used to highlight the input device when appropriate - /// - public GradientPair gradientPair - { - get { return m_GradientPair; } - set - { - m_GradientPair = value; - customToolTipHighlightColor = value; - } - } - - /// - /// Type, that if not null, denotes that preview-mode is enabled - /// This is enabled when highlighting a tool on the main menu - /// - public Type previewToolType - { - get { return m_previewToolType; } - set - { - m_previewToolType = value; - - if (m_previewToolType != null) // Show the highlight if the preview type is valid; hide otherwise - { - var tempToolGo = ObjectUtils.AddComponent(m_previewToolType, gameObject); - var tempTool = tempToolGo as ITool; - if (tempTool != null) - { - var iMenuIcon = tempTool as IMenuIcon; - if (iMenuIcon != null) - previewIcon = iMenuIcon.icon; - - ObjectUtils.Destroy(tempToolGo); - } - - // Show the grayscale highlight when previewing a tool on this button - m_GradientButton.highlightGradientPair = UnityBrandColorScheme.grayscaleSessionGradient; - - if (!previewIcon) - m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); - - //tooltipText = "Assign " + m_previewToolType.Name; - //customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; - //this.ShowTooltip(this); - } - else - { - activeTool = activeTool; // Set active tool back to pre-preview state - icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button - m_GradientButton.highlightGradientPair = gradientPair; - //customToolTipHighlightColor = gradientPair; - //this.HideTooltip(this); - //tooltipText = (isSelectionTool || isMainMenu) ? (isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText) : toolType.Name; - } - - m_GradientButton.highlighted = m_previewToolType != null; - //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); - } - } - - /* - public Transform alternateMenuOrigin - { - get { return m_AlternateMenuOrigin; } - set - { - if (m_AlternateMenuOrigin == value) - return; - - m_AlternateMenuOrigin = value; - transform.SetParent(m_AlternateMenuOrigin); - transform.localPosition = Vector3.zero; - transform.localRotation = Quaternion.identity; - } - } -*/ - - [SerializeField] - GradientButton m_GradientButton; - - [SerializeField] -<<<<<<< HEAD:Scripts/UI/PinnedToolButton.cs - SmoothMotion m_SmoothMotion; - - //[SerializeField] - //PinnedToolActionButton m_LeftPinnedToolActionButton; - - //[SerializeField] - //PinnedToolActionButton m_RightPinnedToolActionButton; - - [SerializeField] - Transform m_IconContainer; - - [SerializeField] - CanvasGroup m_IconContainerCanvasGroup; - - //[SerializeField] - //Collider m_RootCollider; - - [SerializeField] - SkinnedMeshRenderer m_FrameRenderer; - - [SerializeField] - SkinnedMeshRenderer m_InsetMeshRenderer; - - [SerializeField] - Collider[] m_PrimaryButtonColliders; - - [SerializeField] - GradientButton m_SecondaryGradientButton; - - [SerializeField] - CanvasGroup m_SecondaryButtonContainerCanvasGroup; - - [SerializeField] - SkinnedMeshRenderer m_SecondaryInsetMeshRenderer; - - [SerializeField] - SkinnedMeshRenderer m_SecondaryInsetMaskMeshRenderer; - - [SerializeField] - Collider[] m_SecondaryButtonColliders; // disable for the main menu button & solitary active tool button - - [SerializeField] - Transform m_TooltipTarget; - - [SerializeField] - Transform m_TooltipSource; - - [SerializeField] - Vector3 m_AlternateLocalPosition; - - [SerializeField] - Transform m_Inset; - - [SerializeField] - Transform m_InsetMask; - - [SerializeField] - Image m_ButtonIcon; - - [SerializeField] - AudioClip m_HighlightedHapticClip; - - Coroutine m_PositionCoroutine; - Coroutine m_VisibilityCoroutine; - Coroutine m_HighlightCoroutine; - Coroutine m_ActivatorMoveCoroutine; - Coroutine m_HoverCheckCoroutine; - Coroutine m_SecondaryButtonVisibilityCoroutine; - - string m_TooltipText; - bool m_Revealed; - bool m_MoveToAlternatePosition; - int m_Order = -1; - Type m_previewToolType; - Type m_ToolType; - GradientPair m_GradientPair; - //Transform m_AlternateMenuOrigin; - Material m_FrameMaterial; - Material m_InsetMaterial; - //Vector3 m_InactivePosition; // Inactive button offset from the main menu activator - Vector3 m_OriginalLocalPosition; - Vector3 m_OriginalLocalScale; - Material m_IconMaterial; - Vector3 m_OriginalIconContainerLocalScale; - Sprite m_Icon; - Sprite m_PreviewIcon; - bool m_Highlighted; - bool m_ActiveTool; - bool m_Visible; - - public string tooltipText { get { return tooltip != null ? tooltip.tooltipText : m_TooltipText; } set { m_TooltipText = value; } } - public Transform tooltipTarget { get { return m_TooltipTarget; } } - public Transform tooltipSource { get { return m_TooltipSource; } } - public TextAlignment tooltipAlignment { get; private set; } -======= - HapticPulse m_HoverPulse; - - [SerializeField] - HapticPulse m_ClickPulse; - ->>>>>>> improvements/dylanu/haptics:Menus/PinnedToolButton/PinnedToolButton.cs - public Transform rayOrigin { get; set; } - public Node node { get; set; } - public ITooltip tooltip { private get; set; } // Overrides text - public Action showTooltip { private get; set; } - public Action hideTooltip { private get; set; } - public GradientPair customToolTipHighlightColor { get; set; } - public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } - public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } - public int activeButtonCount { get; set; } - public int maxButtonCount { get; set; } - public Transform menuOrigin { get; set; } - //public Action revealAllToolButtons { get; set; } - //public Action revealAllToolButtons { get; set; } - //public Action hideAllToolButtons { get; set; } - public Action OpenMenu { get; set; } - public Action selectTool { get; set; } - public Func closeButton { get; set; } - public Action highlightSingleButton { get; set; } - //public Action deleteHighlightedButton { get; set; } - public Action selectHighlightedButton { get; set; } - public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu - public Func visibileButtonCount { get; set; } - public bool implementsSecondaryButton { get; set; } - public Action destroy { get { return DestroyButton; } } - public Action showAllButtons { get; set; } - public Action hoverExit { get; set; } - - //public event Action hoverEnter; - //public event Action hoverExit; - public event Action selected; - - public bool activeTool - { - get { return m_ActiveTool; } - set - { - //if (m_ActiveTool == value) - //return; - - m_ActiveTool = value; - - m_GradientButton.normalGradientPair = !m_ActiveTool ? gradientPair : UnityBrandColorScheme.grayscaleSessionGradient; - m_GradientButton.highlightGradientPair = !m_ActiveTool ? UnityBrandColorScheme.grayscaleSessionGradient : gradientPair; - - //if (activeTool) // TODO REMOVE IF NOT NEEDED - //m_GradientButton.invertHighlightScale = value; - - m_GradientButton.highlighted = true; - m_GradientButton.highlighted = false; - } - } - - public bool visible - { - //get { return m_Highlighted; } - set - { - if (m_Visible == value) - return; - - gameObject.SetActive(value); - } - } - - public bool highlighted - { - get { return m_Highlighted; } - set - { - if (m_Highlighted == value) - return; - - m_Highlighted = value; - m_GradientButton.highlighted = m_Highlighted; - - if (!m_Highlighted) - this.HideTooltip(this); - else - this.Pulse(rayOrigin, 0.005f, 0.2f); // Used for spatial selection highlighting only - - if (implementsSecondaryButton && (!isMainMenu || !isSelectionTool)) - { - if (m_Highlighted) - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); - else - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - } - } - } - - public bool secondaryButtonHighlighted { get { return m_SecondaryGradientButton.highlighted; } } - - public bool toolTipVisible - { - set - { - if (!value) - this.HideTooltip(this); - } - } - - bool primaryButtonCollidersEnabled - { - set - { - foreach (var collider in m_PrimaryButtonColliders) - { - collider.enabled = value; - } - } - } - - bool secondaryButtonCollidersEnabled - { - set - { - foreach (var collider in m_SecondaryButtonColliders) - { - collider.enabled = value; - } - } - } - - public bool revealed - { - get { return m_Revealed; } - set - { - if (m_Revealed == value || !gameObject.activeSelf || activeButtonCount <= k_ActiveToolOrderPosition + 1) - return; - - m_Revealed = value; - - if (isMainMenu) - { - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor * (value ? 0f : 1f)); - m_GradientButton.visible = !value; - primaryButtonCollidersEnabled = !m_Revealed; - return; - } - else - { - primaryButtonCollidersEnabled = m_Revealed; - } - - //Debug.LogError(Time.frameCount + " : Highlighting : " + toolType); - - var newOrderPosition = order; - var buttonCount = 2; // MainMenu + ActiveTool button count - var targetRotation = Quaternion.identity; - if (m_Revealed) - { - buttonCount = activeButtonCount - 1; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - newOrderPosition -= 1; - order = order; - secondaryButtonCollidersEnabled = true; - } - else - { - // Set all buttons back to the center - // Tools with orders greater than that of the active tool should hide themseleves when the pinned tools arent being hovered - newOrderPosition = isMainMenu ? 0 : k_ActiveToolOrderPosition; - secondaryButtonCollidersEnabled = false; - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - } - - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newOrderPosition)); - //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value && order < 1)); - } - - //get { return m_Revealed; } - } - - public Sprite icon - { - get { return m_Icon; } - set - { - m_PreviewIcon = null; // clear any cached preview icons - m_Icon = value; - - if (m_Icon) - m_GradientButton.SetContent(m_Icon); - else - m_GradientButton.SetContent(GetTypeAbbreviation(m_ToolType)); // Set backup tool abbreviation if no icon is set - } - } - - public Sprite previewIcon - { - get { return m_PreviewIcon; } - set - { - m_PreviewIcon = value; - m_GradientButton.SetContent(m_PreviewIcon); - } - } - - public bool moveToAlternatePosition - { - get { return m_MoveToAlternatePosition; } - set - { - if (m_MoveToAlternatePosition == value) - return; - - m_MoveToAlternatePosition = value; - - this.StopCoroutine(ref m_ActivatorMoveCoroutine); - - m_ActivatorMoveCoroutine = StartCoroutine(AnimateMoveActivatorButton(m_MoveToAlternatePosition)); - } - } - - void Awake() - { - m_OriginalLocalPosition = transform.localPosition; - m_OriginalLocalScale = transform.localScale; - - m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); - var frameMaterialColor = m_FrameMaterial.color; - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); - s_FrameOpaqueColor = new Color(frameMaterialColor.r, frameMaterialColor.g, frameMaterialColor.b, 1f); - s_SemiTransparentFrameColor = new Color(s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0.5f); - - m_IconMaterial = MaterialUtils.GetMaterialClone(m_ButtonIcon); - m_InsetMaterial = MaterialUtils.GetMaterialClone(m_InsetMeshRenderer); - m_OriginalIconContainerLocalScale = m_IconContainer.localScale; - //m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - } - - public Node? node { get; set; } - - void Start() - { - //m_GradientButton.onClick += ButtonClicked; // TODO remove after action button refactor - - Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); - - //transform.parent = alternateMenuOrigin; - - if (m_ToolType == null) - { - //transform.localPosition = m_InactivePosition; - m_GradientButton.gameObject.SetActive(false); - } - else - { - //transform.localPosition = activePosition; - } - - var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); - var tooltipXOffset = node == Node.LeftHand ? -0.15f : 0.15f; - tooltipSource.localPosition = tooltipSourcePosition; - tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; - m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); - - m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions - m_GradientButton.hoverExit += OnActionButtonHoverExit; - m_GradientButton.click += OnBackgroundButtonClick; - m_GradientButton.containerContentsAnimationSpeedMultiplier = 2.5f; - - m_FrameRenderer.SetBlendShapeWeight(1, 0f); - m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, 100f); - m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, 100f); - - m_SecondaryGradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions - m_SecondaryGradientButton.hoverExit += OnActionButtonHoverExit; - m_SecondaryGradientButton.click += OnSecondaryButtonClicked; - m_SecondaryButtonContainerCanvasGroup.alpha = 0f; - //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; - //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; - //m_LeftPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; - //m_RightPinnedToolActionButton.clicked = ActionButtonClicked; - //m_RightPinnedToolActionButton.hoverEnter = HoverButton; - //m_RightPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; - - // Assign the select action button to the side closest to the opposite hand, that allows the arrow to also point in the direction the - //var leftHand = node == Node.LeftHand; - //m_RightPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.SelectTool : PinnedToolActionButton.ButtonType.Close; - //m_LeftPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.Close : PinnedToolActionButton.ButtonType.SelectTool; - - //m_RightPinnedToolActionButton.rotateIcon = leftHand ? false : true; - //m_LeftPinnedToolActionButton.rotateIcon = leftHand ? false : true; - - //m_LeftPinnedToolActionButton.visible = false; - //m_RightPinnedToolActionButton.visible = false; - - //m_LeftPinnedToolActionButton.mainButtonCollider = m_RootCollider; - //m_RightPinnedToolActionButton.mainButtonCollider = m_RootCollider; - - //m_ButtonCollider.enabled = true; - //m_GradientButton.click += OnClick; - //m_GradientButton.gameObject.SetActive(false); - } - - void OnDestroy() - { -<<<<<<< HEAD:Scripts/UI/PinnedToolButton.cs - ObjectUtils.Destroy(m_InsetMaterial); - ObjectUtils.Destroy(m_IconMaterial); - ObjectUtils.Destroy(m_FrameMaterial); - - this.StopCoroutine(ref m_PositionCoroutine); - this.StopCoroutine(ref m_VisibilityCoroutine); - this.StopCoroutine(ref m_HighlightCoroutine); - this.StopCoroutine(ref m_ActivatorMoveCoroutine); - this.StopCoroutine(ref m_HoverCheckCoroutine); - this.StopCoroutine(ref m_SecondaryButtonVisibilityCoroutine); - this.Pulse(rayOrigin, 0.5f, 0.2f, true, true); -======= - SetButtonGradients(this.SelectTool(rayOrigin, m_ToolType)); - this.Pulse(node, m_ClickPulse); ->>>>>>> improvements/dylanu/haptics:Menus/PinnedToolButton/PinnedToolButton.cs - } - - void DestroyButton() - { - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); - } - - public void OnPointerEnter(PointerEventData eventData) - { - this.Pulse(node, m_HoverPulse); - } - - // Create periodic table-style names for types - string GetTypeAbbreviation(Type type) - { - var abbreviation = new StringBuilder(); - foreach (var ch in type.Name.ToCharArray()) - { - if (char.IsUpper(ch)) - abbreviation.Append(abbreviation.Length > 0 ? char.ToLower(ch) : ch); - - if (abbreviation.Length >= 2) - break; - } - - return abbreviation.ToString(); - } - - bool IsSelectToolButton (PinnedToolActionButton.ButtonType buttonType) - { - return buttonType == PinnedToolActionButton.ButtonType.SelectTool; - } - - void OnBackgroundHoverEnter () - { - //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); - //if (m_PositionCoroutine != null || m_SecondaryGradientButton.highlighted) - //return; - - s_Hovered = true; - - this.Pulse(rayOrigin, 0.005f, 0.175f); - - if (isMainMenu) - { - m_GradientButton.highlighted = true; - return; - } - else if (implementsSecondaryButton) - { - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); - } - - //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) - //{ - //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); - //m_RootCollider.enabled = false; - m_GradientButton.highlighted = true; - //m_GradientButton.visible = false; - - //Debug.LogWarning("Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); - - //revealAllToolButtons(rayOrigin, true); - showAllButtons(this); - //HoverButton(); - //m_ButtonCollider.enabled = false; - //} - - } - - /* - void HoverButton() - { - if (order < 2 && (isSelectionTool || isMainMenu)) // The main menu and the active tool occupy orders 0 and 1; don't show any action buttons for buttons in either position - { - //m_RightPinnedToolActionButton.visible = false; - //m_LeftPinnedToolActionButton.visible = false; - //m_RootCollider.enabled = true; - //StartCoroutine(DelayedCollderEnable()); - } - else if (isSelectionTool) - { - - if (activeTool) - { - m_RightPinnedToolActionButton.visible = false; - m_LeftPinnedToolActionButton.visible = false; - StartCoroutine(DelayedCollderEnable()); - } - else - - { - //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? true : false; - //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; - } - } else - { - // Hide the select action button if this tool button is already the selected tool, else show the close button for inactive tools - //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? !activeTool : true; - //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; - } - - revealAllToolButtons(rayOrigin, true); - } - */ - - void OnActionButtonHoverExit() - { - ActionButtonHoverExit(); - } - - void ActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) - { - if (m_PositionCoroutine != null) - return; - - if (isMainMenu) - { - m_GradientButton.highlighted = false; - return; - } - - //this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); - - if (!m_SecondaryGradientButton.highlighted) - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - - hoverExit(); - - return; - Debug.LogWarning("OnActionButtonHoverExit : " + name + " : " + toolType); - // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons - - // Hide both action buttons if the user is no longer hovering over the button - //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) - //{ - //Debug.LogWarning("!!!"); - //m_ButtonCollider.enabled = true; - //m_LeftPinnedToolActionButton.visible = false; - //m_RightPinnedToolActionButton.visible = false; - //m_GradientButton.visible = true; - m_GradientButton.highlighted = false; - //revealAllToolButtons(rayOrigin, false); - //} - - m_GradientButton.UpdateMaterialColors(); - } - - /* - void ActionButtonClicked(PinnedToolActionButton button) - { - Debug.LogError("Action Button selectTool!"); - if (order > menuButtonOrderPosition) - { - // TODO: SELECT ACTION BUTTONS should be able to be interacted with due to their being hidden, so no need to handle for that case - // Buttons in the activeToolOrderPosition cannot be selected when selectTool - if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool && order > activeToolOrderPosition) - { - selectTool(rayOrigin, m_ToolType); // ButtonClicked will set button order to 0 - activeTool = activeTool; - //SetButtonGradients(this.ButtonClicked(rayOrigin, m_ToolType)); - } - else // Handle action buttons assigned Close-Tool functionality - { - //if (!isSelectionTool) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); - //else - //Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); - - deletePinnedToolButton(rayOrigin, this); - } - - OnActionButtonHoverExit(false); - //m_LeftPinnedToolActionButton.revealed = false; - //m_RightPinnedToolActionButton.revealed = false; - } - } - */ - - void OnBackgroundButtonClick() - { - Debug.LogWarning("OnBackgroundButtonClick : " + name + " : " + toolType); - // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons - - // Hide both action buttons if the user is no longer hovering over the button - //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) - //{ - //} - - selectTool(toolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons - - if (!isMainMenu) - { - ActionButtonHoverExit(false); - //revealAllToolButtons(rayOrigin, true); - } - - m_GradientButton.UpdateMaterialColors(); - } - - void OnSecondaryButtonClicked() - { - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); - closeButton(); - this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); - //deleteHighlightedButton(rayOrigin); - //deletePinnedToolButton(rayOrigin, this); - ActionButtonHoverExit(false); - } - - IEnumerator AnimateInitialReveal(Vector3 targetPosition, Vector3 targetScale) - { - m_IconContainerCanvasGroup.alpha = 1f; - var duration = 0f; - while (duration < 2) - { - duration += Time.unscaledDeltaTime * 3f; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); - m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, k_SemiTransparentIconContainerScale, durationShaped * 2f); - transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); - transform.localScale = Vector3.Lerp(Vector3.zero, targetScale, durationShaped); - yield return null; - } - - m_IconContainer.localScale = k_SemiTransparentIconContainerScale; - transform.localPosition = targetPosition; - transform.localScale = targetScale; - m_VisibilityCoroutine = null; - } - - IEnumerator AnimateHideAndDestroy() - { - this.StopCoroutine(ref m_PositionCoroutine); - this.StopCoroutine(ref m_HighlightCoroutine); - this.StopCoroutine(ref m_ActivatorMoveCoroutine); - this.StopCoroutine(ref m_HoverCheckCoroutine); - this.StopCoroutine(ref m_SecondaryButtonVisibilityCoroutine); - - this.HideTooltip(this); - var duration = 0f; - var currentScale = transform.localScale; - var targetScale = Vector3.zero; - while (duration < 1) - { - duration += Time.unscaledDeltaTime * 3f; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); - transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); - yield return null; - } - - transform.localScale = targetScale; - m_VisibilityCoroutine = null; - ObjectUtils.Destroy(gameObject, 0.1f); - } - - IEnumerator AnimateHide() - { - //primaryButtonCollidersEnabled = false; - //secondaryButtonCollidersEnabled = false; - var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - var targetPosition = Vector3.zero; - var currentPosition = transform.localPosition; - - var currentFrameColor = m_FrameMaterial.color; - var targetFrameColor = Color.clear; - var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); - var targetInsetAlpha = 0f; - var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); - var targetIconColor = Color.clear; - //var currentInsetScale = m_Inset.localScale; - //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; - //var currentInsetMaskScale = m_InsetMask.localScale; - //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; - var currentIconScale = m_IconContainer.localScale; - var targetIconContainerScale = Vector3.zero; - var transitionAmount = 0f; - var currentScale = transform.localScale; - while (transitionAmount < 1) - { - transitionAmount += Time.unscaledDeltaTime * 8; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); - /* - m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); - //m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); - //m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); - m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); - //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - */ - //CorrectIconRotation(); - m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); - transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); - transform.localScale = Vector3.Lerp(currentScale, Vector3.zero, shapedAmount); - yield return null; - } - - /* - m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); - //m_Inset.localScale = targetInsetScale; - //m_InsetMask.localScale = targetInsetMaskScale; - m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - */ - m_IconContainer.localScale = targetIconContainerScale; - transform.localPosition = targetPosition; - m_VisibilityCoroutine = null; - } - - IEnumerator AnimateShow() - { - //primaryButtonCollidersEnabled = false; - //secondaryButtonCollidersEnabled = false; - - var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; - - var currentFrameColor = m_FrameMaterial.color; - var targetFrameColor = Color.clear; - var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); - var targetInsetAlpha = 0f; - var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); - var targetIconColor = Color.clear; - //var currentInsetScale = m_Inset.localScale; - //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; - //var currentInsetMaskScale = m_InsetMask.localScale; - //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; - var currentIconScale = m_IconContainer.localScale; - var targetIconContainerScale = m_OriginalIconContainerLocalScale; - var transitionAmount = 0f; - var currentScale = transform.localScale; - var currentPosition = transform.localPosition; - while (transitionAmount < 1) - { - transitionAmount += Time.unscaledDeltaTime * 8; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); - /* - m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); - //m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); - //m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); - m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); - //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); - */ - //CorrectIconRotation(); - m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); - transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); - transform.localScale = Vector3.Lerp(currentScale, targetScale, shapedAmount); - yield return null; - } - - /* - m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); - //m_Inset.localScale = targetInsetScale; - //m_InsetMask.localScale = targetInsetMaskScale; - m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - */ - transform.localPosition = targetPosition; - transform.localScale = targetScale; - m_IconContainer.localScale = targetIconContainerScale; - m_VisibilityCoroutine = null; - } - - //IEnumerator AnimatePosition(int orderPosition, int buttonCount) - IEnumerator AnimatePosition(int orderPosition) - { - //Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition + " - BUTTON COUNT: " + visibileButtonCount); - primaryButtonCollidersEnabled = false; - secondaryButtonCollidersEnabled = false; - //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed - //gameObject.SetActive(true); - - //if (order != activeToolOrderPosition) - //m_RootCollider.enabled = false; - - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - - if (orderPosition == -1) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); - else - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); - - var rotationSpacing = 360f / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = orderPosition > -1 ? rotationSpacing * 0.5f - (visibileButtonCount() * 0.5f) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu - var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; - - var duration = 0f; - //var currentPosition = transform.localPosition; - //var targetPosition = activeTool ? activePosition : m_InactivePosition; - var currentCanvasAlpha = m_IconContainerCanvasGroup.alpha; - var targetCanvasAlpha = orderPosition > -1 ? 1f : 0f; - var currentRotation = transform.localRotation; - var positionWait = 1f;// (order + 5) * 0.1f; - while (duration < 1) - { - duration += Time.unscaledDeltaTime * 6f * positionWait; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 3); - transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); - m_IconContainerCanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, targetCanvasAlpha, durationShaped); - CorrectIconRotation(); - //transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); - yield return null; - } - - //if (!m_Revealed && orderPosition == 0 && buttonCount == 1 && !activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed - //gameObject.SetActive(false); - - //transform.localPosition = targetPosition; - transform.localRotation = targetRotation; - CorrectIconRotation(); - primaryButtonCollidersEnabled = orderPosition > -1 ? true : false; - secondaryButtonCollidersEnabled = orderPosition > -1 ? true : false; - m_PositionCoroutine = null; - - if (implementsSecondaryButton && orderPosition > -1 && m_GradientButton.highlighted) - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); - } - - /* - IEnumerator AnimateSemiTransparentX(bool makeSemiTransparent) - { - //if (!makeSemiTransparent) - //yield return new WaitForSeconds(1f); // Pause before making opaque - - if (makeSemiTransparent && activeTool) - yield break; - - //Debug.LogWarning("AnimateSemiTransparent : " + makeSemiTransparent); - //const float kFasterMotionMultiplier = 2f; - var transitionAmount = 0f; - //var positionWait = (order + 1) * 0.25f; // pad the order index for a faster start to the transition - //var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); - //var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); - var currentFrameColor = m_FrameMaterial.color; - var targetFrameColor = makeSemiTransparent ? s_SemiTransparentFrameColor : s_FrameOpaqueColor; - var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); - var targetInsetAlpha = makeSemiTransparent ? 0.25f : 1f; - var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); - var targetIconColor = makeSemiTransparent ? s_SemiTransparentFrameColor : Color.white; - var currentInsetScale = m_Inset.localScale; - var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; - var currentInsetMaskScale = m_InsetMask.localScale; - var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; - var currentIconScale = m_IconContainer.localScale; - var targetIconContainerScale = makeSemiTransparent ? k_SemiTransparentIconContainerScale : Vector3.one; - var speedMultiplier = makeSemiTransparent ? 4f : 6.5f; // Slower transparent fade; faster opaque fade - while (transitionAmount < 1) - { - transitionAmount += Time.unscaledDeltaTime * speedMultiplier; - var shapedAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(transitionAmount), 3); - m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); - m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); - m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); - m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); - //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); - CorrectIconRotation(); - yield return null; - } - - m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); - m_Inset.localScale = targetInsetScale; - m_InsetMask.localScale = targetInsetMaskScale; - m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - m_IconContainer.localScale = targetIconContainerScale; - } - */ - - IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) - { - var amount = 0f; - var currentPosition = transform.localPosition; - var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; - var currentLocalScale = transform.localScale; - var targetLocalScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - var speed = moveToAlternatePosition ? 5f : 4.5f; // perform faster is returning to original position - speed += (order + 1) * 0.275f; - while (amount < 1f) - { - amount += Time.unscaledDeltaTime * speed; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); - transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); - transform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedAmount); - yield return null; - } - - transform.localPosition = targetPosition; - transform.localScale = targetLocalScale; - m_ActivatorMoveCoroutine = null; - } - -/* - IEnumerator DelayedCollderEnable() - { - yield return new WaitForSeconds(0.5f); - //m_RootCollider.enabled = true; - } -*/ - - IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) - { - s_Hovered = false; - - if (waitBeforeClosingAllButtons) - { - var duration = Time.unscaledDeltaTime; - while (duration < 0.25f) - { - duration += Time.unscaledDeltaTime; - yield return null; - - if ((s_Hovered || m_PositionCoroutine != null) || m_SecondaryGradientButton.highlighted) - { - m_HoverCheckCoroutine = null; - yield break; - } - } - } - - // Only proceed if no other button is being hovered - m_GradientButton.highlighted = false; - hoverExit(); - m_GradientButton.UpdateMaterialColors(); - m_HoverCheckCoroutine = null; - } - - void CorrectIconRotation() - { - const float kIconLookForwardOffset = 0.5f; - var iconLookDirection = m_IconContainer.transform.position + transform.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation - m_IconContainer.LookAt(iconLookDirection); - m_IconContainer.localEulerAngles = new Vector3(0f, 0f, m_IconContainer.localEulerAngles.z); - var angle = m_IconContainer.localEulerAngles.z; - m_TooltipTarget.localEulerAngles = new Vector3(90f, 0f, angle); - - var yaw = transform.localRotation.eulerAngles.y; - //tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Right : TextAlignment.Left; - } - - IEnumerator ShowSecondaryButton() - { - //Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); - const float kFrameSecondaryButtonVisibleBlendShapeWeight = 61f; - const float kSecondaryButtonVisibleBlendShapeWeight = 46f; - - var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); - var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; - var amount = 0f; - while (amount < 0.25f) - { - amount += Time.unscaledDeltaTime; - yield return null; - } - - //Debug.LogError("SHOWING SECONDARY BUTTON"); - this.ShowTooltip(this); - - amount = 0f; - while (amount < 1f) - { - amount += Time.unscaledDeltaTime * 10f; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kFrameSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); - m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); - m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); - m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 1f, shapedAmount); - yield return null; - } - - m_SecondaryButtonVisibilityCoroutine = null; - } - - IEnumerator HideSecondaryButton() - { - const float kSecondaryButtonHiddenBlendShapeWeight = 100f; - - var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); - var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; - var amount = 0f; - while (amount < 1f) - { - yield return null; - - if (m_SecondaryGradientButton.highlighted) - { - m_SecondaryButtonVisibilityCoroutine = null; - yield break; - } - - amount += Time.unscaledDeltaTime * 8f; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); - m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); - m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); - m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); - m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 0f, shapedAmount); - } - - m_SecondaryButtonVisibilityCoroutine = null; - } - } -} -#endif diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig.meta b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig.meta deleted file mode 100644 index 89e8b4c17..000000000 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.orig.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6142a178a6ef6404dbc449b542128a2d -timeCreated: 1497907343 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: From 6456d23c1be35e31b70373f877b00219b1b4c584 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 16 Aug 2017 21:43:07 -0700 Subject: [PATCH 748/870] Add various summaries; cleaup formatting & conventions throughout --- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 9 +++ Menus/PinnedToolMenu/Scripts/HintLine.cs | 10 +++ Scripts/Core/Interfaces/IPinnedToolButton.cs | 78 +++++++++++++++++++ Scripts/Interfaces/ISetCustomTooltipColor.cs | 2 +- .../SpatialHintModule/SpatialHintModule.cs | 15 +--- .../SpatialHintModule/SpatialHintModuleUI.cs | 35 ++++++--- 6 files changed, 125 insertions(+), 24 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index c507204cf..34eee4625 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -42,6 +42,9 @@ public class HintIcon : MonoBehaviour Coroutine m_ScrollArrowPulseCoroutine; float m_PulseDuration; + /// + /// Bool denoting the visibility state of this icon + /// public bool visible { set @@ -53,6 +56,9 @@ public bool visible } } + /// + /// The color to be displayed by this icon when it is visible + /// public Color visibleColor { set @@ -123,6 +129,9 @@ IEnumerator AnimateHide() m_IconTransform.localScale = k_HiddenScale; } + /// + /// Perform a colored visual pulse + /// public void PulseColor() { if (Mathf.Approximately(m_PulseDuration, 0f) || m_PulseDuration > 0.85f) diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/PinnedToolMenu/Scripts/HintLine.cs index 11d4327be..593661d92 100644 --- a/Menus/PinnedToolMenu/Scripts/HintLine.cs +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs @@ -29,7 +29,14 @@ public class HintLine : MonoBehaviour float m_PulseDuration; Material m_HintLineMaterial; + /// + /// Set the width of the line visuals + /// public float LineWidth { set { m_ScrollLineRenderer.SetWidth(value, value); } } + + /// + /// set the start & end positions for the line visuals + /// public Vector3[] Positions { set { m_ScrollLineRenderer.SetPositions(value) ; } } void Awake() @@ -45,6 +52,9 @@ void OnDestroy() ObjectUtils.Destroy(m_HintLineMaterial); } + /// + /// Perform an animated visual pusling of color + /// public void PulseColor() { if (Mathf.Approximately(m_PulseDuration, 0f) || m_PulseDuration > 0.85f) diff --git a/Scripts/Core/Interfaces/IPinnedToolButton.cs b/Scripts/Core/Interfaces/IPinnedToolButton.cs index 60c7060bc..872c6ee4b 100644 --- a/Scripts/Core/Interfaces/IPinnedToolButton.cs +++ b/Scripts/Core/Interfaces/IPinnedToolButton.cs @@ -9,29 +9,107 @@ namespace UnityEditor.Experimental.EditorVR /// public interface IPinnedToolButton { + /// + /// The type to preview in the button temporarily + /// Type previewToolType { set; } + + /// + /// The toolType assigned to this button + /// Type toolType { get; } + /// + /// The order of this button + /// Position/rotation may change according to order + /// int order { get; set; } + + /// + /// The maximum number of buttons that can be displayed by a given PinnedToolsMenu + /// int maxButtonCount { set; } + + /// + /// The z positional offset to apply when button if highlighted + /// float iconHighlightedLocalZOffset { set; } + + /// + /// Bool denothing button highlight state + /// bool highlighted { get; set; } + + /// + /// Bool denoting the secondary button highlight state + /// bool secondaryButtonHighlighted { get; } + + /// + /// Bool denoting that this button represents the active tool + /// bool isActiveTool { set; } + + /// + /// Bool denoting that the tooltip is visible + /// bool toolTipVisible { set; } + + /// + /// Bool denoting that this button implements a secondary button + /// The MainMenu & SelectionTool are examples of buttons that don't implement a secondary button for closing + /// bool implementsSecondaryButton { set; } + + /// + /// The scale of the ui content in the primary content container + /// Vector3 primaryUIContentContainerLocalScale { get; set; } + + /// + /// Transform used for reference when placing toolTips + /// Transform tooltipTarget { set; } + + /// + /// String description of the tool that this button represents + /// string previewToolDescription { set; } + /// + /// Destroys this button + /// Action destroy { get; } + + /// + /// Selects the tool based on the type assigned to this button + /// Action selectTool { set; } + + /// + /// Shows all tool buttons for a given PinnedToolsMenu + /// Action showAllButtons { set; } + + /// + /// Performed when a hover exit is detected on this button + /// Action hoverExit { set; } + /// + /// Returns the visible button count for a given PinnedToolsMenu + /// used by buttons to position themselves + /// Func visibileButtonCount { set; } + + /// + /// Closes this button + /// Func closeButton { set; } + /// + /// Performed when a hover action is detected by this button + /// event Action hovered; } } diff --git a/Scripts/Interfaces/ISetCustomTooltipColor.cs b/Scripts/Interfaces/ISetCustomTooltipColor.cs index 8333da62f..53d5f5d39 100644 --- a/Scripts/Interfaces/ISetCustomTooltipColor.cs +++ b/Scripts/Interfaces/ISetCustomTooltipColor.cs @@ -14,4 +14,4 @@ public interface ISetCustomTooltipColor GradientPair customToolTipHighlightColor { get; } } } -#endif \ No newline at end of file +#endif diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index 17068ebfe..a766b65cd 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -31,20 +31,17 @@ public SpatialHintStateFlags state switch (m_State) { case SpatialHintStateFlags.Hidden: - Debug.LogError("SpatialHintState : Hidden"); m_SpatialHintModuleUI.preScrollArrowsVisible = false; m_SpatialHintModuleUI.secondaryArrowsVisible = false; controllingRayOrigin = null; break; case SpatialHintStateFlags.PreDragReveal: - Debug.LogError("SpatialHintState : Pre drag reveal state"); m_SpatialHintModuleUI.preScrollArrowsVisible = true; m_SpatialHintModuleUI.secondaryArrowsVisible = true; break; case SpatialHintStateFlags.Scrolling: m_SpatialHintModuleUI.preScrollArrowsVisible = false; m_SpatialHintModuleUI.scrollVisualsVisible = true; - Debug.LogError("SpatialHintState : Scrolling"); break; } } @@ -52,11 +49,7 @@ public SpatialHintStateFlags state private Transform controllingRayOrigin { - get - { - return m_ControllingRayOrigin; - } - + get { return m_ControllingRayOrigin; } set { if (value == m_ControllingRayOrigin) @@ -75,9 +68,6 @@ private Transform controllingRayOrigin } } - /// - /// Description - /// Vector3 spatialHintScrollVisualsRotation { get { return m_SpatialHintModuleUI.scrollVisualsRotation; } @@ -92,9 +82,6 @@ void Awake() this.ConnectInterfaces(m_SpatialHintModuleUI); } - /// - /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatiatil scroll - /// internal void PulseScrollArrows() { m_SpatialHintModuleUI.PulseScrollArrows(); diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index e927bfffb..52e35d8fa 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -42,7 +42,11 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt Transform m_ScrollVisualsTransform; Coroutine m_ScrollVisualsVisibilityCoroutine; Transform m_ScrollVisualsDragTargetArrowTransform; + Node? m_ControllingNode; + /// + /// Bool denoting the visibility of the Spatial Hint UI elements + /// public bool visible { get { return m_Visible; } @@ -80,6 +84,9 @@ public bool visible } } + /// + /// Bool denoting the visibility of the Spatial Scroll visual elements + /// public bool scrollVisualsVisible { set @@ -92,6 +99,9 @@ public bool scrollVisualsVisible } } + /// + /// Bool denoting the visibility of the UI elements shown before a spatial scroll has been initiated + /// public bool preScrollArrowsVisible { get { return m_PreScrollArrowsVisible; } @@ -116,6 +126,9 @@ public bool preScrollArrowsVisible } } + /// + /// Bool denoting the visibility of the secondary arrow visuals + /// public bool secondaryArrowsVisible { get { return m_SecondaryArrowsVisible; } @@ -154,19 +167,14 @@ public Vector3 scrollVisualsRotation } } - Node? m_ControllingNode; + /// + /// The node currently controlling the spatial hint visuals + /// public Node? controllingNode { - get - { - return m_ControllingNode; - } - + get { return m_ControllingNode; } set { - //if (m_ControllingNode == value.Value) - //return; - m_ControllingNode = value; if (m_ControllingNode != null) @@ -182,8 +190,14 @@ public Node? controllingNode } } + /// + /// The position, whose magnitude from the scroll origin is used to trigger a spatial scroll + /// public Vector3 scrollVisualsDragThresholdTriggerPosition { get; set; } + /// + /// The content container housing the spatial scroll visuals + /// public Transform contentContainer { get { return transform; } } void Awake() @@ -270,6 +284,9 @@ IEnumerator HideScrollVisuals() //m_ScrollVisualsGameObject.SetActive(false); } + /// + /// Pulse the scroll arrows + /// public void PulseScrollArrows() { m_ScrollVisualsDragSourceArrow.PulseColor(); From db0f584af47c764e8c5a197b23c817b7e7f81f41 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 17 Aug 2017 13:31:43 -0700 Subject: [PATCH 749/870] Rename temp tools directory --- Tools/{Temp.meta => TempTestingTools.meta} | 0 Tools/{Temp => TempTestingTools}/MakeCubeTool.cs | 0 Tools/{Temp => TempTestingTools}/MakeCubeTool.cs.meta | 0 Tools/{Temp => TempTestingTools}/MakeCubeToolIcon.png | 0 Tools/{Temp => TempTestingTools}/MakeCubeToolIcon.png.meta | 0 Tools/{Temp => TempTestingTools}/MakeSphereTool.cs | 0 Tools/{Temp => TempTestingTools}/MakeSphereTool.cs.meta | 0 Tools/{Temp => TempTestingTools}/MakeSphereToolIcon.png | 0 Tools/{Temp => TempTestingTools}/MakeSphereToolIcon.png.meta | 0 Tools/{Temp => TempTestingTools}/TempToolIcon.png | 0 Tools/{Temp => TempTestingTools}/TempToolIcon.png.meta | 0 Tools/{Temp => TempTestingTools}/ToolFourDemo.cs | 0 Tools/{Temp => TempTestingTools}/ToolFourDemo.cs.meta | 0 Tools/{Temp => TempTestingTools}/ToolOneDemo.cs | 0 Tools/{Temp => TempTestingTools}/ToolOneDemo.cs.meta | 0 Tools/{Temp => TempTestingTools}/ToolThreeDemo.cs | 0 Tools/{Temp => TempTestingTools}/ToolThreeDemo.cs.meta | 0 Tools/{Temp => TempTestingTools}/ToolTwoDemo.cs | 0 Tools/{Temp => TempTestingTools}/ToolTwoDemo.cs.meta | 0 19 files changed, 0 insertions(+), 0 deletions(-) rename Tools/{Temp.meta => TempTestingTools.meta} (100%) rename Tools/{Temp => TempTestingTools}/MakeCubeTool.cs (100%) rename Tools/{Temp => TempTestingTools}/MakeCubeTool.cs.meta (100%) rename Tools/{Temp => TempTestingTools}/MakeCubeToolIcon.png (100%) rename Tools/{Temp => TempTestingTools}/MakeCubeToolIcon.png.meta (100%) rename Tools/{Temp => TempTestingTools}/MakeSphereTool.cs (100%) rename Tools/{Temp => TempTestingTools}/MakeSphereTool.cs.meta (100%) rename Tools/{Temp => TempTestingTools}/MakeSphereToolIcon.png (100%) rename Tools/{Temp => TempTestingTools}/MakeSphereToolIcon.png.meta (100%) rename Tools/{Temp => TempTestingTools}/TempToolIcon.png (100%) rename Tools/{Temp => TempTestingTools}/TempToolIcon.png.meta (100%) rename Tools/{Temp => TempTestingTools}/ToolFourDemo.cs (100%) rename Tools/{Temp => TempTestingTools}/ToolFourDemo.cs.meta (100%) rename Tools/{Temp => TempTestingTools}/ToolOneDemo.cs (100%) rename Tools/{Temp => TempTestingTools}/ToolOneDemo.cs.meta (100%) rename Tools/{Temp => TempTestingTools}/ToolThreeDemo.cs (100%) rename Tools/{Temp => TempTestingTools}/ToolThreeDemo.cs.meta (100%) rename Tools/{Temp => TempTestingTools}/ToolTwoDemo.cs (100%) rename Tools/{Temp => TempTestingTools}/ToolTwoDemo.cs.meta (100%) diff --git a/Tools/Temp.meta b/Tools/TempTestingTools.meta similarity index 100% rename from Tools/Temp.meta rename to Tools/TempTestingTools.meta diff --git a/Tools/Temp/MakeCubeTool.cs b/Tools/TempTestingTools/MakeCubeTool.cs similarity index 100% rename from Tools/Temp/MakeCubeTool.cs rename to Tools/TempTestingTools/MakeCubeTool.cs diff --git a/Tools/Temp/MakeCubeTool.cs.meta b/Tools/TempTestingTools/MakeCubeTool.cs.meta similarity index 100% rename from Tools/Temp/MakeCubeTool.cs.meta rename to Tools/TempTestingTools/MakeCubeTool.cs.meta diff --git a/Tools/Temp/MakeCubeToolIcon.png b/Tools/TempTestingTools/MakeCubeToolIcon.png similarity index 100% rename from Tools/Temp/MakeCubeToolIcon.png rename to Tools/TempTestingTools/MakeCubeToolIcon.png diff --git a/Tools/Temp/MakeCubeToolIcon.png.meta b/Tools/TempTestingTools/MakeCubeToolIcon.png.meta similarity index 100% rename from Tools/Temp/MakeCubeToolIcon.png.meta rename to Tools/TempTestingTools/MakeCubeToolIcon.png.meta diff --git a/Tools/Temp/MakeSphereTool.cs b/Tools/TempTestingTools/MakeSphereTool.cs similarity index 100% rename from Tools/Temp/MakeSphereTool.cs rename to Tools/TempTestingTools/MakeSphereTool.cs diff --git a/Tools/Temp/MakeSphereTool.cs.meta b/Tools/TempTestingTools/MakeSphereTool.cs.meta similarity index 100% rename from Tools/Temp/MakeSphereTool.cs.meta rename to Tools/TempTestingTools/MakeSphereTool.cs.meta diff --git a/Tools/Temp/MakeSphereToolIcon.png b/Tools/TempTestingTools/MakeSphereToolIcon.png similarity index 100% rename from Tools/Temp/MakeSphereToolIcon.png rename to Tools/TempTestingTools/MakeSphereToolIcon.png diff --git a/Tools/Temp/MakeSphereToolIcon.png.meta b/Tools/TempTestingTools/MakeSphereToolIcon.png.meta similarity index 100% rename from Tools/Temp/MakeSphereToolIcon.png.meta rename to Tools/TempTestingTools/MakeSphereToolIcon.png.meta diff --git a/Tools/Temp/TempToolIcon.png b/Tools/TempTestingTools/TempToolIcon.png similarity index 100% rename from Tools/Temp/TempToolIcon.png rename to Tools/TempTestingTools/TempToolIcon.png diff --git a/Tools/Temp/TempToolIcon.png.meta b/Tools/TempTestingTools/TempToolIcon.png.meta similarity index 100% rename from Tools/Temp/TempToolIcon.png.meta rename to Tools/TempTestingTools/TempToolIcon.png.meta diff --git a/Tools/Temp/ToolFourDemo.cs b/Tools/TempTestingTools/ToolFourDemo.cs similarity index 100% rename from Tools/Temp/ToolFourDemo.cs rename to Tools/TempTestingTools/ToolFourDemo.cs diff --git a/Tools/Temp/ToolFourDemo.cs.meta b/Tools/TempTestingTools/ToolFourDemo.cs.meta similarity index 100% rename from Tools/Temp/ToolFourDemo.cs.meta rename to Tools/TempTestingTools/ToolFourDemo.cs.meta diff --git a/Tools/Temp/ToolOneDemo.cs b/Tools/TempTestingTools/ToolOneDemo.cs similarity index 100% rename from Tools/Temp/ToolOneDemo.cs rename to Tools/TempTestingTools/ToolOneDemo.cs diff --git a/Tools/Temp/ToolOneDemo.cs.meta b/Tools/TempTestingTools/ToolOneDemo.cs.meta similarity index 100% rename from Tools/Temp/ToolOneDemo.cs.meta rename to Tools/TempTestingTools/ToolOneDemo.cs.meta diff --git a/Tools/Temp/ToolThreeDemo.cs b/Tools/TempTestingTools/ToolThreeDemo.cs similarity index 100% rename from Tools/Temp/ToolThreeDemo.cs rename to Tools/TempTestingTools/ToolThreeDemo.cs diff --git a/Tools/Temp/ToolThreeDemo.cs.meta b/Tools/TempTestingTools/ToolThreeDemo.cs.meta similarity index 100% rename from Tools/Temp/ToolThreeDemo.cs.meta rename to Tools/TempTestingTools/ToolThreeDemo.cs.meta diff --git a/Tools/Temp/ToolTwoDemo.cs b/Tools/TempTestingTools/ToolTwoDemo.cs similarity index 100% rename from Tools/Temp/ToolTwoDemo.cs rename to Tools/TempTestingTools/ToolTwoDemo.cs diff --git a/Tools/Temp/ToolTwoDemo.cs.meta b/Tools/TempTestingTools/ToolTwoDemo.cs.meta similarity index 100% rename from Tools/Temp/ToolTwoDemo.cs.meta rename to Tools/TempTestingTools/ToolTwoDemo.cs.meta From 228c23708fdb5ce07530fd6d177a6c1a0b2559db Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 17 Aug 2017 15:33:55 -0700 Subject: [PATCH 750/870] Add & refine summaries in IPinnedToolsMenu --- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 30 ++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 23a205ea9..bece28e8d 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -11,9 +11,21 @@ namespace UnityEditor.Experimental.EditorVR public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode, ISelectTool { bool alternateMenuVisible { set; } + + /// + /// This menu's RayOrigin + /// Transform rayOrigin { get; set; } + + /// + /// The PinnedToolButton that the menu uses to display tool previews + /// IPinnedToolButton previewToolButton { get; } - // This method isn't hooked up in EVR, it should reside in the implementing class + + /// + /// Function that assigns & sets up a tool button for a given tool type + /// This method isn't hooked up in EVR, it should reside in the implementing class + /// Action SetButtonForType { get; } /// @@ -28,10 +40,10 @@ public static class IPinnedToolsMenuMethods public static Action highlightDevice { get; set; } /// - /// + /// Visually highlights an input device /// - /// - /// + /// This menu's RayOrigin + /// The gradient pair used in the highlight visuals public static void HighlightDevice(this IPinnedToolsMenu obj, Transform rayOrigin, GradientPair gradientPair) { highlightDevice(rayOrigin, gradientPair); @@ -40,9 +52,9 @@ public static void HighlightDevice(this IPinnedToolsMenu obj, Transform rayOrigi public static Action mainMenuActivatorSelected { get; set; } /// - /// + /// Called when selecting the main menu activator /// - /// + /// This menu's RayOrigin public static void MainMenuActivatorSelected(this IPinnedToolsMenu obj, Transform rayOrigin) { mainMenuActivatorSelected(rayOrigin); @@ -51,10 +63,10 @@ public static void MainMenuActivatorSelected(this IPinnedToolsMenu obj, Transfor public static Action selectTool { get; set; } /// - /// + /// Selects a tool, based on type, from a pinned tool button /// - /// - /// + /// This menu's RayOrigin + /// The type of the tool that is to be selected public static void SelectTool(this IPinnedToolsMenu obj, Transform rayOrigin, Type type) { selectTool(rayOrigin, type); From 07394cb1ee224ed911bd8443742b969634dc48c9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 17 Aug 2017 16:13:31 -0700 Subject: [PATCH 751/870] Cleanup usings and remove PinnedToolButton prefab member from EditorVR.Menus --- Scripts/Core/EditorVR.Menus.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 54bcd4eba..f1b4fbdb8 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEditor.Experimental.EditorVR.Workspaces; @@ -14,9 +13,6 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - [SerializeField] - PinnedToolButton m_PinnedToolButtonPrefab; - class Menus : Nested, IInterfaceConnector, ILateBindInterfaceMethods { [Flags] From 40e79620232152440f0e559d9215b9aeabc70f7f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 17 Aug 2017 16:34:10 -0700 Subject: [PATCH 752/870] Remove additional unused logic in PinnedToolButton --- .../PinnedToolButton/PinnedToolButton.cs | 400 +----------------- 1 file changed, 16 insertions(+), 384 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 3fce47abc..34787a61d 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -41,29 +41,20 @@ public Type toolType if (m_ToolType != null) { - Debug.LogError("Setting up button type : " + m_ToolType.ToString()); gradientPair = UnityBrandColorScheme.saturatedSessionGradient; + if (isSelectionTool || isMainMenu) { - //order = isMainMenu ? menuButtonOrderPosition : activeToolOrderPosition; tooltipText = isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText; secondaryButtonCollidersEnabled = false; } else { tooltipText = toolType.Name; - - // Tools other than select fetch a random gradientPair; also used by the device when revealed - //gradientPair = UnityBrandColorScheme.GetRandomCuratedLightGradient(); } isActiveTool = isActiveTool; m_GradientButton.visible = true; - //m_IconMaterial.SetColor(k_MaterialColorProperty, s_SemiTransparentFrameColor); - - //var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - //var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; - //this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateInitialReveal(targetPosition, targetScale)); } else { @@ -78,45 +69,14 @@ public int order get { return m_Order; } set { - //if (m_Order == value) - //return; - m_Order = value; // Position of this button in relation to other pinned tool buttons - //Debug.LogError(m_ToolType.ToString() + " : SETTING BUTTON ORDER TO : " + m_Order + " - current button count : " + visibileButtonCount); - highlighted = false; - //m_InactivePosition = s_ActivePosition * ++value; // Additional offset for the button when it is visible and inactive - //activeTool = activeTool; - //const float kSmoothingMax = 50f; - //const int kSmoothingIncreaseFactor = 10; - //var smoothingFactor = Mathf.Clamp(kSmoothingMax- m_Order * kSmoothingIncreaseFactor, 0f, kSmoothingMax); - //m_SmoothMotion.SetPositionSmoothing(smoothingFactor); - //m_SmoothMotion.SetRotationSmoothing(smoothingFactor); - //this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition()); - //m_LeftPinnedToolActionButton.visible = false; - //m_RightPinnedToolActionButton.visible = false; - - // We move in counter-clockwise direction - // Account for the input & position phase offset, based on the number of actions, rotating the menu content to be bottom-centered - //const float kMaxPinnedToolButtonCount = 16; // TODO: add max count support in selectTool/setupPinnedToolButtonsForDevice - //const float kRotationSpacing = 360f / kMaxPinnedToolButtonCount; // dividend should be the count of pinned tool buttons showing at this time - //var phaseOffset = kRotationSpacing * 0.5f - (activeButtonCount * 0.5f) * kRotationSpacing; - //var newTargetRotation = Quaternion.AngleAxis(phaseOffset + kRotationSpacing * m_Order, Vector3.down); - - //var mainMenuAndActiveButtonCount = 2; - //var aboluteMenuButtonCount = isMainMenu ? mainMenuAndActiveButtonCount : activeButtonCount; // madates a fixed position for the MainMenu button, next to the ActiveToolButton + this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order)); if(m_Order == -1) this.HideTooltip(this); - - /* - if (aboluteMenuButtonCount > mainMenuAndActiveButtonCount) - this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); - else - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor); - */ } } @@ -163,10 +123,6 @@ public Type previewToolType if (!previewIcon) m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); - - //tooltipText = "Assign " + m_previewToolType.Name; - //customToolTipHighlightColor = UnityBrandColorScheme.grayscaleSessionGradient; - //this.ShowTooltip(this); } else { @@ -174,13 +130,9 @@ public Type previewToolType isActiveTool = isActiveTool; // Set active tool back to pre-preview state icon = icon; // Gradient button will set its icon back to that representing the current tool, if one existed before previewing new tool type in this button m_GradientButton.highlightGradientPair = gradientPair; - //customToolTipHighlightColor = gradientPair; - //this.HideTooltip(this); - //tooltipText = (isSelectionTool || isMainMenu) ? (isSelectionTool ? k_SelectionToolTipText : k_MainMenuTipText) : toolType.Name; } m_GradientButton.highlighted = m_previewToolType != null; - //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(m_Order != k_ActiveToolOrderPosition)); } } @@ -215,15 +167,6 @@ public string tooltipText [SerializeField] GradientButton m_GradientButton; - [SerializeField] - SmoothMotion m_SmoothMotion; - - //[SerializeField] - //PinnedToolActionButton m_LeftPinnedToolActionButton; - - //[SerializeField] - //PinnedToolActionButton m_RightPinnedToolActionButton; - [SerializeField] Transform m_IconContainer; // TODO: eliminate the reference to the icon container, use only the primary UI content container for any transformation @@ -233,9 +176,6 @@ public string tooltipText [SerializeField] CanvasGroup m_IconContainerCanvasGroup; - //[SerializeField] - //Collider m_RootCollider; - [SerializeField] SkinnedMeshRenderer m_FrameRenderer; @@ -258,7 +198,7 @@ public string tooltipText SkinnedMeshRenderer m_SecondaryInsetMaskMeshRenderer; [SerializeField] - Collider[] m_SecondaryButtonColliders; // disable for the main menu button & solitary active tool button + Collider[] m_SecondaryButtonColliders; // disable for the main menu button & solitary primary tool button [SerializeField] Transform m_TooltipTarget; @@ -269,12 +209,6 @@ public string tooltipText [SerializeField] Vector3 m_AlternateLocalPosition; - [SerializeField] - Transform m_Inset; - - [SerializeField] - Transform m_InsetMask; - [SerializeField] Image m_ButtonIcon; @@ -338,17 +272,11 @@ public bool isActiveTool get { return m_ActiveTool; } set { - //if (m_ActiveTool == value) - //return; - m_ActiveTool = value; m_GradientButton.normalGradientPair = m_ActiveTool ? gradientPair : UnityBrandColorScheme.darkGrayscaleSessionGradient; m_GradientButton.highlightGradientPair = m_ActiveTool ? UnityBrandColorScheme.darkGrayscaleSessionGradient : gradientPair; - //if (activeTool) // TODO REMOVE IF NOT NEEDED - //m_GradientButton.invertHighlightScale = value; - m_GradientButton.highlighted = true; m_GradientButton.highlighted = false; } @@ -414,59 +342,6 @@ bool secondaryButtonCollidersEnabled } } - /* - public bool revealed - { - get { return m_Revealed; } - set - { - if (m_Revealed == value || !gameObject.activeSelf || activeButtonCount <= k_ActiveToolOrderPosition + 1) - return; - - m_Revealed = value; - - if (isMainMenu) - { - m_FrameMaterial.SetColor(k_MaterialColorProperty, s_FrameOpaqueColor * (value ? 0f : 1f)); - m_GradientButton.visible = !value; - primaryButtonCollidersEnabled = !m_Revealed; - return; - } - else - { - primaryButtonCollidersEnabled = m_Revealed; - } - - //Debug.LogError(Time.frameCount + " : Highlighting : " + toolType); - - var newOrderPosition = order; - var buttonCount = 2; // MainMenu + ActiveTool button count - var targetRotation = Quaternion.identity; - if (m_Revealed) - { - buttonCount = activeButtonCount - 1; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - newOrderPosition -= 1; - order = order; - secondaryButtonCollidersEnabled = true; - } - else - { - // Set all buttons back to the center - // Tools with orders greater than that of the active tool should hide themseleves when the pinned tools arent being hovered - newOrderPosition = isMainMenu ? 0 : k_ActiveToolOrderPosition; - secondaryButtonCollidersEnabled = false; - this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - } - - this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(newOrderPosition)); - //this.RestartCoroutine(ref m_HighlightCoroutine, AnimateSemiTransparent(!value && order < 1)); - } - - //get { return m_Revealed; } - } - */ - public Sprite icon { get { return m_Icon; } @@ -607,9 +482,6 @@ void OnDestroy() this.StopCoroutine(ref m_ActivatorMoveCoroutine); this.StopCoroutine(ref m_HoverCheckCoroutine); this.StopCoroutine(ref m_SecondaryButtonVisibilityCoroutine); - - Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); - //this.Pulse(rayOrigin, 0.5f, 0.2f, true, true); } void DestroyButton() @@ -619,7 +491,6 @@ void DestroyButton() public void OnPointerEnter(PointerEventData eventData) { - //this.Pulse(rayOrigin, 0.005f, 0.2f); Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); } @@ -641,15 +512,8 @@ string GetTypeAbbreviation(Type type) void OnBackgroundHoverEnter () { - //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); - //if (m_PositionCoroutine != null || m_SecondaryGradientButton.highlighted) - //return; - s_Hovered = true; - //this.Pulse(rayOrigin, 0.005f, 0.175f); - Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); - if (isMainMenu) { m_GradientButton.highlighted = true; @@ -663,65 +527,15 @@ void OnBackgroundHoverEnter () if (hovered != null) // Raised in order to trigger the haptic in the PinnedToolsMenu hovered(); - //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) - //{ - //Debug.LogWarning("Background button was hovered, now triggereing the foreground action button visuals"); - //m_RootCollider.enabled = false; - m_GradientButton.highlighted = true; - //m_GradientButton.visible = false; - - //Debug.LogWarning("Handle for disabled buttons not being shown, ie the promotote(green) button on the first/selected tool"); - - //revealAllToolButtons(rayOrigin, true); showAllButtons(this); - //HoverButton(); - //m_ButtonCollider.enabled = false; - - //} } - /* - void HoverButton() - { - if (order < 2 && (isSelectionTool || isMainMenu)) // The main menu and the active tool occupy orders 0 and 1; don't show any action buttons for buttons in either position - { - //m_RightPinnedToolActionButton.visible = false; - //m_LeftPinnedToolActionButton.visible = false; - //m_RootCollider.enabled = true; - //StartCoroutine(DelayedCollderEnable()); - } - else if (isSelectionTool) - { - - if (activeTool) - { - m_RightPinnedToolActionButton.visible = false; - m_LeftPinnedToolActionButton.visible = false; - StartCoroutine(DelayedCollderEnable()); - } - else - - { - //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? true : false; - //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? true : false; - } - } else - { - // Hide the select action button if this tool button is already the selected tool, else show the close button for inactive tools - //m_RightPinnedToolActionButton.visible = IsSelectToolButton(m_RightPinnedToolActionButton.buttonType) ? !activeTool : true; - //m_LeftPinnedToolActionButton.visible = IsSelectToolButton(m_LeftPinnedToolActionButton.buttonType) ? !activeTool : true; - } - - revealAllToolButtons(rayOrigin, true); - } - */ - void OnActionButtonHoverExit() { ActionButtonHoverExit(); } - void ActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) + void ActionButtonHoverExit() { if (m_PositionCoroutine != null) return; @@ -732,62 +546,18 @@ void ActionButtonHoverExit(bool waitBeforeClosingAllButtons = true) return; } - //this.RestartCoroutine(ref m_HoverCheckCoroutine, DelayedHoverExitCheck(waitBeforeClosingAllButtons)); - if (!m_SecondaryGradientButton.highlighted) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); hoverExit(); } - /* - void ActionButtonClicked(PinnedToolActionButton button) - { - Debug.LogError("Action Button selectTool!"); - if (order > menuButtonOrderPosition) - { - // TODO: SELECT ACTION BUTTONS should be able to be interacted with due to their being hidden, so no need to handle for that case - // Buttons in the activeToolOrderPosition cannot be selected when selectTool - if (button.buttonType == PinnedToolActionButton.ButtonType.SelectTool && order > activeToolOrderPosition) - { - selectTool(rayOrigin, m_ToolType); // ButtonClicked will set button order to 0 - activeTool = activeTool; - //SetButtonGradients(this.ButtonClicked(rayOrigin, m_ToolType)); - } - else // Handle action buttons assigned Close-Tool functionality - { - //if (!isSelectionTool) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); - //else - //Debug.LogError("CANNOT DELETE THE SELECT TOOL!!!!!"); - - deletePinnedToolButton(rayOrigin, this); - } - - OnActionButtonHoverExit(false); - //m_LeftPinnedToolActionButton.revealed = false; - //m_RightPinnedToolActionButton.revealed = false; - } - } - */ - void OnBackgroundButtonClick() { - Debug.LogWarning("OnBackgroundButtonClick : " + name + " : " + toolType); - // in this case display the hover state for the gradient button, then enable visibility for each of the action buttons - - // Hide both action buttons if the user is no longer hovering over the button - //if (!m_LeftPinnedToolActionButton.revealed && !m_RightPinnedToolActionButton.revealed) - //{ - //} - - selectTool(toolType); // Perform clik for a ToolButton that doesn't utilize ToolActionButtons + selectTool(toolType); if (!isMainMenu) - { - ActionButtonHoverExit(false); - //revealAllToolButtons(rayOrigin, true); - } + ActionButtonHoverExit(); m_GradientButton.UpdateMaterialColors(); } @@ -796,11 +566,7 @@ void OnSecondaryButtonClicked() { this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); closeButton(); - //this.Pulse(rayOrigin, 0.5f, 0.1f, true, true); - Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); - //deleteHighlightedButton(rayOrigin); - //deletePinnedToolButton(rayOrigin, this); - ActionButtonHoverExit(false); + ActionButtonHoverExit(); } IEnumerator AnimateInitialReveal(Vector3 targetPosition, Vector3 targetScale) @@ -835,13 +601,13 @@ IEnumerator AnimateHideAndDestroy() this.StopCoroutine(ref m_SecondaryButtonVisibilityCoroutine); this.HideTooltip(this); + const int kDurationScalar = 3; var duration = 0f; var currentScale = transform.localScale; var targetScale = Vector3.zero; while (duration < 1) { - duration += Time.unscaledDeltaTime * 3f; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), 4); + var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration += Time.unscaledDeltaTime * kDurationScalar), 4); transform.localScale = Vector3.Lerp(currentScale, targetScale, durationShaped); yield return null; } @@ -853,49 +619,22 @@ IEnumerator AnimateHideAndDestroy() IEnumerator AnimateHide() { - //primaryButtonCollidersEnabled = false; - //secondaryButtonCollidersEnabled = false; const float kTimeScalar = 8f; var targetPosition = Vector3.zero; var currentPosition = transform.localPosition; - - var currentFrameColor = m_FrameMaterial.color; - var targetFrameColor = Color.clear; - var targetIconColor = Color.clear; - //var currentInsetScale = m_Inset.localScale; - //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; - //var currentInsetMaskScale = m_InsetMask.localScale; - //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; var currentIconScale = m_IconContainer.localScale; var targetIconContainerScale = Vector3.zero; var transitionAmount = 0f; var currentScale = transform.localScale; while (transitionAmount < 1) { - transitionAmount += Time.unscaledDeltaTime * kTimeScalar; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); - /* - m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); - //m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); - //m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); - m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); - //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - */ - //CorrectIconRotation(); + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount += Time.unscaledDeltaTime * kTimeScalar); m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); transform.localScale = Vector3.Lerp(currentScale, Vector3.zero, shapedAmount); yield return null; } - /* - m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); - //m_Inset.localScale = targetInsetScale; - //m_InsetMask.localScale = targetInsetMaskScale; - m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - */ m_IconContainer.localScale = targetIconContainerScale; transform.localPosition = targetPosition; m_VisibilityCoroutine = null; @@ -903,20 +642,9 @@ IEnumerator AnimateHide() IEnumerator AnimateShow() { - //primaryButtonCollidersEnabled = false; - //secondaryButtonCollidersEnabled = false; - const float kTimeScalar = 8f; var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; - - var currentFrameColor = m_FrameMaterial.color; - var targetFrameColor = Color.clear; - var targetIconColor = Color.clear; - //var currentInsetScale = m_Inset.localScale; - //var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; - //var currentInsetMaskScale = m_InsetMask.localScale; - //var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; var currentIconScale = m_IconContainer.localScale; var targetIconContainerScale = m_OriginalIconContainerLocalScale; var transitionAmount = 0f; @@ -924,48 +652,23 @@ IEnumerator AnimateShow() var currentPosition = transform.localPosition; while (transitionAmount < 1) { - transitionAmount += Time.unscaledDeltaTime * kTimeScalar; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount); - /* - m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); - //m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); - //m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); - m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); - //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); - */ - //CorrectIconRotation(); + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount += Time.unscaledDeltaTime * kTimeScalar); m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); transform.localScale = Vector3.Lerp(currentScale, targetScale, shapedAmount); yield return null; } - /* - m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); - //m_Inset.localScale = targetInsetScale; - //m_InsetMask.localScale = targetInsetMaskScale; - m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - */ transform.localPosition = targetPosition; transform.localScale = targetScale; m_IconContainer.localScale = targetIconContainerScale; m_VisibilityCoroutine = null; } - //IEnumerator AnimatePosition(int orderPosition, int buttonCount) IEnumerator AnimatePosition(int orderPosition) { - //Debug.LogError(m_ToolType + " - Animate Button position : " + orderPosition + " - BUTTON COUNT: " + visibileButtonCount); primaryButtonCollidersEnabled = false; secondaryButtonCollidersEnabled = false; - //if (!activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed - //gameObject.SetActive(true); - - //if (order != activeToolOrderPosition) - //m_RootCollider.enabled = false; this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); @@ -983,12 +686,10 @@ IEnumerator AnimatePosition(int orderPosition) var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; var duration = 0f; - //var currentPosition = transform.localPosition; - //var targetPosition = activeTool ? activePosition : m_InactivePosition; var currentCanvasAlpha = m_IconContainerCanvasGroup.alpha; var targetCanvasAlpha = orderPosition > -1 ? 1f : 0f; var currentRotation = transform.localRotation; - var positionWait = 1f;// (order + 5) * 0.1f; + var positionWait = 1f; while (duration < 1) { duration += Time.unscaledDeltaTime * kTimeScalar * positionWait; @@ -996,14 +697,9 @@ IEnumerator AnimatePosition(int orderPosition) transform.localRotation = Quaternion.Lerp(currentRotation, targetRotation, durationShaped); m_IconContainerCanvasGroup.alpha = Mathf.Lerp(currentCanvasAlpha, targetCanvasAlpha, durationShaped); CorrectIconRotation(); - //transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, durationShaped); yield return null; } - //if (!m_Revealed && orderPosition == 0 && buttonCount == 1 && !activeTool) // hide a button if it is not the active tool button and the buttons are no longer revealed - //gameObject.SetActive(false); - - //transform.localPosition = targetPosition; transform.localRotation = targetRotation; CorrectIconRotation(); primaryButtonCollidersEnabled = orderPosition > -1 ? true : false; @@ -1014,58 +710,6 @@ IEnumerator AnimatePosition(int orderPosition) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); } - /* - IEnumerator AnimateSemiTransparentX(bool makeSemiTransparent) - { - //if (!makeSemiTransparent) - //yield return new WaitForSeconds(1f); // Pause before making opaque - - if (makeSemiTransparent && activeTool) - yield break; - - //Debug.LogWarning("AnimateSemiTransparent : " + makeSemiTransparent); - //const float kFasterMotionMultiplier = 2f; - var transitionAmount = 0f; - //var positionWait = (order + 1) * 0.25f; // pad the order index for a faster start to the transition - //var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); - //var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); - var currentFrameColor = m_FrameMaterial.color; - var targetFrameColor = makeSemiTransparent ? s_SemiTransparentFrameColor : s_FrameOpaqueColor; - var currentInsetAlpha = m_InsetMaterial.GetFloat(k_MaterialAlphaProperty); - var targetInsetAlpha = makeSemiTransparent ? 0.25f : 1f; - var currentIconColor = m_IconMaterial.GetColor(k_MaterialColorProperty); - var targetIconColor = makeSemiTransparent ? s_SemiTransparentFrameColor : Color.white; - var currentInsetScale = m_Inset.localScale; - var targetInsetScale = makeSemiTransparent ? new Vector3(1f, 0f, 1f) : Vector3.one; - var currentInsetMaskScale = m_InsetMask.localScale; - var targetInsetMaskScale = makeSemiTransparent ? Vector3.one * 1.45f : Vector3.one; - var currentIconScale = m_IconContainer.localScale; - var targetIconContainerScale = makeSemiTransparent ? k_SemiTransparentIconContainerScale : Vector3.one; - var speedMultiplier = makeSemiTransparent ? 4f : 6.5f; // Slower transparent fade; faster opaque fade - while (transitionAmount < 1) - { - transitionAmount += Time.unscaledDeltaTime * speedMultiplier; - var shapedAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(transitionAmount), 3); - m_FrameMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentFrameColor, targetFrameColor, shapedAmount)); - m_Inset.localScale = Vector3.Lerp(currentInsetScale, targetInsetScale, shapedAmount); - m_InsetMask.localScale = Vector3.Lerp(currentInsetMaskScale, targetInsetMaskScale, Mathf.Pow(shapedAmount, 3)); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, shapedAmount)); - m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, shapedAmount * 2)); - //var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; - m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); - CorrectIconRotation(); - yield return null; - } - - m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); - m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); - m_Inset.localScale = targetInsetScale; - m_InsetMask.localScale = targetInsetMaskScale; - m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); - m_IconContainer.localScale = targetIconContainerScale; - } - */ - IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) { const float kSpeedDecreaseScalar = 0.275f; @@ -1078,8 +722,7 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) speed += (order + 1) * kSpeedDecreaseScalar; while (amount < 1f) { - amount += Time.unscaledDeltaTime * speed; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount += Time.unscaledDeltaTime * speed); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); transform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedAmount); yield return null; @@ -1123,19 +766,10 @@ void CorrectIconRotation() var iconLookDirection = m_IconContainer.transform.position + transform.forward * kIconLookForwardOffset; // set a position offset above the icon, regardless of the icon's rotation m_IconContainer.LookAt(iconLookDirection); m_IconContainer.localEulerAngles = new Vector3(0f, 0f, m_IconContainer.localEulerAngles.z); - - //tooltipSource.localRotation = m_IconContainer.localRotation; - //var angle = m_IconContainer.localEulerAngles.z; - //m_TooltipTarget.localEulerAngles = new Vector3(0, 0, angle); - - //var yaw = transform.localRotation.eulerAngles.y; - //tooltipAlignment = yaw > 90 && yaw <= 270 ? TextAlignment.Center : TextAlignment.Center; } IEnumerator ShowSecondaryButton() { - //Debug.LogError("Waiting before SHOWING SECONDARY BUTTON"); - // Don't perform additional animated visuals if already in a fully revealed state if (Mathf.Approximately(m_SecondaryButtonContainerCanvasGroup.alpha, 1f)) { @@ -1156,7 +790,7 @@ IEnumerator ShowSecondaryButton() } const float kDelayBeforeSecondaryButtonReveal = 0.25f; - currentDuration = 0f; + currentDuration = 0f; // Reset current duration while (currentDuration < kDelayBeforeSecondaryButtonReveal) { currentDuration += Time.unscaledDeltaTime; @@ -1175,8 +809,7 @@ IEnumerator ShowSecondaryButton() currentDuration = 0f; while (currentDuration < 1f) { - currentDuration += Time.unscaledDeltaTime * kDurationMultiplier; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration); + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * kDurationMultiplier); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kFrameSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); @@ -1215,8 +848,7 @@ IEnumerator HideSecondaryButton() this.StopCoroutine(ref m_HighlightCoroutine); - amount += Time.unscaledDeltaTime * kDurationMultiplier; - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount); + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount += Time.unscaledDeltaTime * kDurationMultiplier); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); From c3d8525d3f8913235a7604c10912b8bfaaadbae7 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 17 Aug 2017 17:33:35 -0700 Subject: [PATCH 753/870] Rename IMainMenu.hovering to focus --- Menus/MainMenu/MainMenu.cs | 2 +- Scripts/Core/EditorVR.Menus.cs | 2 +- Scripts/Interfaces/Entity/IMainMenu.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index f647c6118..e4aa8b680 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -101,7 +101,7 @@ public bool visible public Bounds localBounds { get { return m_MainMenuUI.localBounds; } } - public bool hovering { get { return m_MainMenuUI.hovering; } } + public bool focus { get { return m_MainMenuUI.hovering; } } void Start() { diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 5cc22726a..215ec4b3a 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -227,7 +227,7 @@ internal void UpdateMenuVisibilities() { var mainMenu = deviceData.mainMenu; var mainMenuHideFlags = deviceData.menuHideFlags[mainMenu]; - if (mainMenuHideFlags != 0 && !mainMenu.hovering) + if (mainMenuHideFlags != 0 && !mainMenu.focus) { if ((mainMenuHideFlags & MenuHideFlags.Hidden) != 0) { diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 0e36d4f39..924f8bb85 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -41,9 +41,9 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool Bounds localBounds { get; } /// - /// Is the UI pointer hovering over the menu? + /// Does this menu have focus? /// - bool hovering { get; } + bool focus { get; } /// /// Send a haptic pulse indicating the menu visibility has changed From 578a35d9d789aa8cb7a910912160f3a927adf8ab Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 17 Aug 2017 17:49:33 -0700 Subject: [PATCH 754/870] Removing log prints from PinnedToolsMenu --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 7094a33c5..e3041021a 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -119,8 +119,6 @@ void CreatePinnedToolsUI() void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) { - Debug.LogError("SPAWNING pinned tool button for type of : " + toolType); - // Select an existing ToolButton if the type is already present in a button if (buttons.Any( (x) => x.toolType == toolType)) { @@ -184,9 +182,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (pinnedToolInput.show.wasJustPressed) Debug.LogError("SHOW pressed in PinnedToolButton"); - if (pinnedToolInput.select.wasJustPressed) - Debug.LogError("SELECT pressed in PinnedToolButton"); - if (pinnedToolInput.cancel.wasJustPressed) Debug.LogError("CANCELLING SPATIAL SELECTION!!!!"); From f9469bbb28254ab05ba5b42c9986c6b22e3b56b3 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 17 Aug 2017 17:50:26 -0700 Subject: [PATCH 755/870] Simplify logic and cleanup unused code in PinnedToolButton --- .../PinnedToolButton/PinnedToolButton.cs | 58 ++----------------- 1 file changed, 6 insertions(+), 52 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 34787a61d..9eb58b2d1 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -403,32 +403,10 @@ void Awake() void Start() { - //m_GradientButton.onClick += ButtonClicked; // TODO remove after action button refactor - - Debug.LogWarning("Hide (L+R) pinned tool action buttons if button is the main menu button Hide select action button if button is in the first position (next to menu button)"); - - //transform.parent = alternateMenuOrigin; - if (m_ToolType == null) - { - //transform.localPosition = m_InactivePosition; m_GradientButton.gameObject.SetActive(false); - } - else - { - //transform.localPosition = activePosition; - } - - //var tooltipSourcePosition = new Vector3(node == Node.LeftHand ? -0.01267f : 0.01267f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); - //var tooltipXOffset = node == Node.LeftHand ? -0.15f : 0.15f; - //tooltipSource.localPosition = tooltipSourcePosition; - //tooltipAlignment = node == Node.LeftHand ? TextAlignment.Right : TextAlignment.Left; - //m_TooltipTarget.localPosition = new Vector3(tooltipXOffset, tooltipSourcePosition.y, tooltipSourcePosition.z); - //var tooltipSourcePosition = new Vector3(0f, tooltipSource.localPosition.y, tooltipSource.localPosition.z); - //tooltipSource.localPosition = tooltipSourcePosition; tooltipAlignment = TextAlignment.Center; - //m_TooltipTarget.localPosition = new Vector3(0, 0, -0.5f); const float kIncreasedContainerContentsSpeedMultiplier = 2.5f; m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions @@ -444,30 +422,6 @@ void Start() m_SecondaryGradientButton.hoverExit += OnActionButtonHoverExit; m_SecondaryGradientButton.click += OnSecondaryButtonClicked; m_SecondaryButtonContainerCanvasGroup.alpha = 0f; - //m_LeftPinnedToolActionButton.clicked = ActionButtonClicked; - //m_LeftPinnedToolActionButton.hoverEnter = HoverButton; - //m_LeftPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; - //m_RightPinnedToolActionButton.clicked = ActionButtonClicked; - //m_RightPinnedToolActionButton.hoverEnter = HoverButton; - //m_RightPinnedToolActionButton.hoverExit = OnActionButtonHoverExit; - - // Assign the select action button to the side closest to the opposite hand, that allows the arrow to also point in the direction the - //var leftHand = node == Node.LeftHand; - //m_RightPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.SelectTool : PinnedToolActionButton.ButtonType.Close; - //m_LeftPinnedToolActionButton.buttonType = leftHand ? PinnedToolActionButton.ButtonType.Close : PinnedToolActionButton.ButtonType.SelectTool; - - //m_RightPinnedToolActionButton.rotateIcon = leftHand ? false : true; - //m_LeftPinnedToolActionButton.rotateIcon = leftHand ? false : true; - - //m_LeftPinnedToolActionButton.visible = false; - //m_RightPinnedToolActionButton.visible = false; - - //m_LeftPinnedToolActionButton.mainButtonCollider = m_RootCollider; - //m_RightPinnedToolActionButton.mainButtonCollider = m_RootCollider; - - //m_ButtonCollider.enabled = true; - //m_GradientButton.click += OnClick; - //m_GradientButton.gameObject.SetActive(false); } void OnDestroy() @@ -494,9 +448,9 @@ public void OnPointerEnter(PointerEventData eventData) Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); } - // Create periodic table-style names for types string GetTypeAbbreviation(Type type) { + // Create periodic table-style names for types var abbreviation = new StringBuilder(); foreach (var ch in type.Name.ToCharArray()) { @@ -519,10 +473,9 @@ void OnBackgroundHoverEnter () m_GradientButton.highlighted = true; return; } - else if (implementsSecondaryButton) - { + + if (implementsSecondaryButton) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); - } if (hovered != null) // Raised in order to trigger the haptic in the PinnedToolsMenu hovered(); @@ -682,7 +635,8 @@ IEnumerator AnimatePosition(int orderPosition) const float kCircularRange = 360f; const int kDurationShapeAmount = 3; var rotationSpacing = kCircularRange / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time - var phaseOffset = orderPosition > -1 ? rotationSpacing * kCenterLocationAmount - (visibileButtonCount(m_ToolType) * kCenterLocationAmount) * rotationSpacing : 0; // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu + var phaseOffset = orderPosition > -1 ? rotationSpacing * kCenterLocationAmount - (visibileButtonCount(m_ToolType) * kCenterLocationAmount) * rotationSpacing : 0; var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; var duration = 0f; @@ -718,7 +672,7 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; var currentLocalScale = transform.localScale; var targetLocalScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; - var speed = moveToAlternatePosition ? 5f : 4.5f; // perform faster is returning to original position + var speed = moveToAlternatePosition ? 5f : 4.5f; // Perform faster is returning to original position speed += (order + 1) * kSpeedDecreaseScalar; while (amount < 1f) { From cbd445f6daf1775ac4b63366e4256ef7df02ff21 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 17 Aug 2017 17:52:28 -0700 Subject: [PATCH 756/870] Simplify logic and cleanup unused code in PinnedToolsMenuUI --- .../Scripts/PinnedToolsMenuUI.cs | 103 +++--------------- 1 file changed, 13 insertions(+), 90 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 6ab7168b3..129558408 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -44,7 +44,6 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IInstantiateUI bool m_RayHovered; float m_SpatialDragDistance; Quaternion m_HintContentContainerInitialRotation; - Quaternion m_HintContentContainerCurrentRotation; Vector3 m_HintContentWorldPosition; Vector3 m_DragTarget; @@ -60,7 +59,6 @@ public bool allButtonsVisible set { m_AllButtonsVisible = value; - Debug.LogError("AllButtonsVisible set to : " + value); if (m_AllButtonsVisible) { @@ -90,7 +88,7 @@ public bool moveToAlternatePosition } } - private bool aboveMinimumButtonCount + bool aboveMinimumButtonCount { get { @@ -118,7 +116,6 @@ public bool spatiallyScrolling if (value) { - Debug.LogWarning("SETTING Spatial Drag Distance : " + value); var currentRotation = transform.rotation.eulerAngles; m_SpatialDragDistance = 0f; m_HintContentContainerInitialRotation = Quaternion.Euler(0f, currentRotation.y, 0f); @@ -128,23 +125,9 @@ public bool spatiallyScrolling } } - public float spatialDragDistance - { - set - { - m_SpatialDragDistance = value; - } - } + public float spatialDragDistance { set { m_SpatialDragDistance = value; } } - public Vector3? startingDragOrigin - { - set - { - Debug.LogWarning("SETTING STARTING DRAG DEFINITON POSITION : " + value.Value.ToString("F4")); - //Debug.LogError(value.Value.ToString("F4")); - this.SetSpatialHintLookAtRotation(value.Value); - } - } + public Vector3? startingDragOrigin { set { if (value != null) this.SetSpatialHintLookAtRotation(value.Value); } } public event Action buttonHovered; public event Action buttonClicked; @@ -166,7 +149,7 @@ void Update() { if (Mathf.Approximately(m_SpatialDragDistance, 1f)) { - m_DragTarget = transform.position; // Cache the initial drag target position, before performing any extra shapting to the target Vec3 + m_DragTarget = transform.position; // Cache the initial drag target position, before performing any extra shaping to the target Vec3 this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Scrolling); } @@ -178,19 +161,6 @@ void Update() // Perform a smooth lerp of the hint contents after dragging beyond the distance trigger threshold m_SpatialDragDistance += Time.unscaledDeltaTime * 8; // Continue to increase the amount - /////var extentedDragDurationSmoothed = 1 - MathUtilsExt.SmoothInOutLerpFloat(m_SpatialDragDistance - 1f); - /////m_SpatialHintUI.scrollVisualsRotation = Vector3.Lerp(m_InitialDragTarget, transform.position, extentedDragDurationSmoothed); - - // Add additional smoothed rotation to the scroll visuals to better align them with the user's continued device movemet after crossing the threshold - // The m_InitialDragTarget is the actualy vector being scrolled against, however adding a slight continuation of the user's device input position - // allows for the scroll visuals to appear to be more closely aligned to the user's expected rotation. - - //Debug.LogError("INSIDE rotation update loop"); - /* - var shapedDragAmount = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(m_SmoothedSpatialDragDistance), 6); - m_HintContentContainerCurrentRotation = Quaternion.Lerp(m_HintContentContainerInitialRotation, m_SpatialScrollOrientation, shapedDragAmount); - newHintContainerRotation = m_HintContentContainerCurrentRotation; - */ } else if (m_AllButtonsVisible && m_SpatialDragDistance > 2) { @@ -199,25 +169,6 @@ void Update() this.SetSpatialHintContainerRotation(newHintContainerRotation); this.SetSpatialHintShowHideRotationTarget(m_DragTarget); } - - //spatialHintScrollVisualsDragThresholdTriggerPosition = transform.position; - - //m_SpatialHintUI.scrollVisualsRotation = Quaternion.Euler(endingDragDefinitionPosition - startingDragDefinitionPosition); - /* - else if (Mathf.Approximately(m_SmoothedSpatialDragDistance, 1f)) - newHintContainerRotation = m_HintContentContainerCurrentRotation; - else - m_HintContentWorldPosition = Vector3.Lerp(m_HintContentWorldPosition, transform.position, Time.unscaledDeltaTime * 6); - */ - - //Debug.LogError("Hint Container" + m_HintContentContainerInitialRotation); - //Debug.LogError("UI" + transform.rotation); - - //spatialHintContentContainer.rotation = newHintContainerRotation; - - //m_SpatialHintContentContainer.position = m_HintContentWorldPosition; - - //Debug.LogError(gameObject.GetInstanceID() + " : World position of UI : " + transform.position + " - starting drag definition position : " + m_StartingDragOrigin + ""); } public void AddButton(IPinnedToolButton button, Transform buttonTransform) @@ -233,12 +184,8 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) button.hovered += OnButtonHover; bool allowSecondaryButton = false; // Secondary button is the close button - var insertPosition = k_InactiveButtonInitialOrderPosition; - if (IsMainMenuButton(button)) - { - insertPosition = k_MenuButtonOrderPosition; - } - else + var insertPosition = k_MenuButtonOrderPosition; + if (!IsMainMenuButton(button)) { insertPosition = k_ActiveToolOrderPosition; allowSecondaryButton = !IsSelectionToolButton(button); @@ -256,8 +203,6 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) buttonTransform.localPosition = Vector3.zero; buttonTransform.localScale = Vector3.zero; - Debug.LogWarning("Setting up button : " + button.toolType + " - ORDER : " + button.order); - if (aboveMinimumButtonCount) this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1.25f, false)); else @@ -290,10 +235,7 @@ void Reinsert(IPinnedToolButton button, int newOrderPosition, bool updateButtonO { var removed = m_OrderedButtons.Remove(button); if (!removed) - { - Debug.LogError("Could not remove button"); return; - } m_OrderedButtons.Insert(newOrderPosition, button); @@ -303,7 +245,6 @@ void Reinsert(IPinnedToolButton button, int newOrderPosition, bool updateButtonO void SetupButtonOrder() { - Debug.LogError("SetupButtonOrder"); for (int i = 0; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i]; @@ -315,20 +256,18 @@ void SetupButtonOrder() void ShowAllExceptMenuButton() { - Debug.LogError("ShowAllExceptMenuButton"); // The MainMenu button will be hidden, subtract 1 from the m_VisibleButtonCount m_VisibleButtonCount = Mathf.Max(0, m_OrderedButtons.Count - 1); for (int i = 0; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i]; - button.isActiveTool = i == k_ActiveToolOrderPosition; // Set the button gradients // TODO Consider handling insid button via k_ActiveToolOrder position comparison + button.isActiveTool = i == k_ActiveToolOrderPosition; button.order = i == k_MenuButtonOrderPosition ? k_InactiveButtonInitialOrderPosition : i - 1; // Hide the menu buttons when revealing all tools buttons } } void ShowOnlyMenuAndActiveToolButtons() { - Debug.LogError("Showing only the MainMenu and ACTIVE tool buttons"); if (!aboveMinimumButtonCount) // If only the Selection and MainMenu buttons exist, don't proceed return; @@ -346,7 +285,6 @@ void ShowOnlyMenuAndActiveToolButtons() void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton, bool selectAfterSettingButtonOrder = true) { - Debug.LogError(" SetupButtonOrderThenSelectTool - Selecting of type : " + pinnedToolButton.toolType); var mainMenu = IsMainMenuButton(pinnedToolButton); if (mainMenu) { @@ -374,7 +312,6 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton, bool sel /// Button ToolType to compare against existing button types public void SelectExistingToolType(Type type) { - Debug.LogError("Selecting Existing ToolType : " + type.ToString()); foreach (var button in m_OrderedButtons) { if (button.toolType == type) @@ -391,12 +328,11 @@ public void SelectExistingToolType(Type type) /// Button ToolType to compare against existing button types void SelectExistingToolTypeFromButton(Type type) { - Debug.LogError("Selecting Existing ToolType : " + type.ToString()); foreach (var button in m_OrderedButtons) { if (button.toolType == type) { - SetupButtonOrderThenSelectTool(button, true); + SetupButtonOrderThenSelectTool(button); return; } } @@ -410,7 +346,6 @@ public void SelectNextExistingToolButton() public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) { - //Debug.LogError("Highlighting SINGLE BUTTON at position : "+ buttonOrderPosition); for (int i = 1; i < m_OrderedButtons.Count; ++i) { var button = m_OrderedButtons[i]; @@ -420,7 +355,9 @@ public void HighlightSingleButtonWithoutMenu(int buttonOrderPosition) { // Process haptic pulse if button was not already highlighted this.PulseSpatialHintScrollArrows(); - buttonHovered(); + + if (buttonHovered != null) + buttonHovered(); } button.highlighted = true; @@ -443,7 +380,6 @@ public void SelectHighlightedButton() var isHighlighted = button.highlighted; if (isHighlighted) { - Debug.LogError("Selecting highlighted button : "+ button.toolType); // Force the selection of the button regardless of it previously existing via a call to EVR that triggers a call to SelectExistingType() if (buttonSelected != null) buttonSelected(rayOrigin, button.toolType); @@ -469,10 +405,7 @@ public bool DeleteHighlightedButton() { button = m_OrderedButtons[i]; if ((button.highlighted || button.secondaryButtonHighlighted) && !IsSelectionToolButton(button)) - { - Debug.LogError("DeleteHighlightedButton : " + button.toolType); break; - } button = null; } @@ -496,8 +429,6 @@ public bool DeleteHighlightedButton() /// Bool denoting that a button of the given type was deleted public bool DeleteButtonOfType(Type type) { - Debug.LogError("Delete button of type : " + type); - bool buttonDeleted = false; for (int i = 0; i < m_OrderedButtons.Count; ++i) { @@ -514,12 +445,12 @@ public bool DeleteButtonOfType(Type type) return buttonDeleted; } - bool IsMainMenuButton(IPinnedToolButton button) + static bool IsMainMenuButton(IPinnedToolButton button) { return button.toolType == typeof(IMainMenu); } - bool IsSelectionToolButton(IPinnedToolButton button) + static bool IsSelectionToolButton(IPinnedToolButton button) { return button.toolType == typeof(SelectionTool); } @@ -562,19 +493,11 @@ IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) void ShowAllButtons(IPinnedToolButton button) { - Debug.LogError("ShowAllButtons : " + button.toolType); m_RayHovered = true; if (!allButtonsVisible && aboveMinimumButtonCount && !IsMainMenuButton(button) && m_ButtonHoverExitDelayCoroutine == null) allButtonsVisible = true; } - void HideAllButtons(IPinnedToolButton button) - { - Debug.LogError("HideAllButtons : " + button.toolType); - if (allButtonsVisible && !IsMainMenuButton(button)) - allButtonsVisible = false; - } - void ButtonHoverExitPerformed() { this.RestartCoroutine(ref m_ButtonHoverExitDelayCoroutine, DelayedHoverExitCheck()); From 724fab1de2448bbb99956bd2432ba49d400b477c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 17 Aug 2017 20:53:01 -0700 Subject: [PATCH 757/870] Perform many code cleanups, logic fixes, and formatting changes throughout the branch --- Menus/MainMenu/Scripts/MainMenuButton.cs | 1 - Menus/MainMenu/Scripts/MainMenuUI.cs | 1 - .../PinnedToolButton/PinnedToolButton.cs | 106 ++++-------------- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 61 ++-------- Menus/PinnedToolMenu/Scripts/HintLine.cs | 5 +- .../Scripts/PinnedToolsMenuUI.cs | 2 +- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 4 +- Menus/RadialMenu/Scripts/RadialMenuUI.cs | 6 +- Scripts/Core/EditorVR.PinnedToolButtons.cs | 1 - Scripts/Core/EditorVR.Tools.cs | 5 +- Scripts/Core/EditorVR.cs | 5 - Scripts/Core/Interfaces/IPinnedToolButton.cs | 4 +- Scripts/Helpers/SmoothMotion.cs | 4 +- Scripts/Interfaces/Entity/IMainMenu.cs | 1 + Scripts/Interfaces/Entity/IProxy.cs | 1 + .../IControlSpatialHinting.cs | 2 +- .../Modules/HapticsModule/HapticsModule.cs | 2 +- .../SpatialHintModule/SpatialHintModule.cs | 11 +- .../SpatialHintModule/SpatialHintModuleUI.cs | 40 +------ .../SpatialScrollModule.cs | 9 +- .../Modules/TooltipModule/TooltipModule.cs | 2 +- Scripts/Modules/TooltipModule/TooltipUI.cs | 2 +- Scripts/UI/GradientButton.cs | 8 +- Scripts/Utilities/UnityBrandColorScheme.cs | 10 +- 24 files changed, 73 insertions(+), 220 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 82a8f6ca4..671e9bf05 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -18,7 +18,6 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExi Text m_ButtonTitle; Color m_OriginalColor; - Transform m_RayOrigin; public Button button { get { return m_Button; } } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 150060f93..2b5029aae 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -94,7 +94,6 @@ public int targetFaceIndex Coroutine m_VisibilityCoroutine; Coroutine m_FrameRevealCoroutine; int m_Direction; - GradientPair m_GradientPair; Transform[] m_MenuFaceContentTransforms; Vector3[] m_MenuFaceContentOriginalLocalPositions; diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 9eb58b2d1..dc1757d2e 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -15,16 +15,12 @@ namespace UnityEditor.Experimental.EditorVR.Menus public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor { static Color s_FrameOpaqueColor; - static bool s_Hovered; - const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation - const float k_alternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu + const float k_AlternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu const string k_MaterialColorProperty = "_Color"; - const string k_MaterialAlphaProperty = "_Alpha"; const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; const string k_MainMenuTipText = "Main Menu"; readonly Vector3 k_ToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); - readonly Vector3 k_SemiTransparentIconContainerScale = new Vector3(1.375f, 1.375f, 1f); public Type toolType { @@ -100,14 +96,14 @@ public GradientPair gradientPair /// public Type previewToolType { - get { return m_previewToolType; } + get { return m_PreviewToolType; } set { - m_previewToolType = value; + m_PreviewToolType = value; - if (m_previewToolType != null) // Show the highlight if the preview type is valid; hide otherwise + if (m_PreviewToolType != null) // Show the highlight if the preview type is valid; hide otherwise { - var tempToolGo = ObjectUtils.AddComponent(m_previewToolType, gameObject); + var tempToolGo = ObjectUtils.AddComponent(m_PreviewToolType, gameObject); var tempTool = tempToolGo as ITool; if (tempTool != null) { @@ -122,7 +118,7 @@ public Type previewToolType m_GradientButton.highlightGradientPair = UnityBrandColorScheme.saturatedSessionGradient; // UnityBrandColorScheme.grayscaleSessionGradient; if (!previewIcon) - m_GradientButton.SetContent(GetTypeAbbreviation(m_previewToolType)); + m_GradientButton.SetContent(GetTypeAbbreviation(m_PreviewToolType)); } else { @@ -132,23 +128,23 @@ public Type previewToolType m_GradientButton.highlightGradientPair = gradientPair; } - m_GradientButton.highlighted = m_previewToolType != null; + m_GradientButton.highlighted = m_PreviewToolType != null; } } public string previewToolDescription { - get { return m_previewToolDescription; } + get { return m_PreviewToolDescription; } set { if (value != null) { - m_previewToolDescription = value; + m_PreviewToolDescription = value; this.ShowTooltip(this); } else { - m_previewToolDescription = null; + m_PreviewToolDescription = null; toolTipVisible = false; } } @@ -168,7 +164,7 @@ public string tooltipText GradientButton m_GradientButton; [SerializeField] - Transform m_IconContainer; // TODO: eliminate the reference to the icon container, use only the primary UI content container for any transformation + Transform m_IconContainer; [SerializeField] Transform m_PrimaryUIContentContainer; @@ -220,11 +216,10 @@ public string tooltipText Coroutine m_SecondaryButtonVisibilityCoroutine; string m_TooltipText; - string m_previewToolDescription; - bool m_Revealed; + string m_PreviewToolDescription; bool m_MoveToAlternatePosition; int m_Order = -1; - Type m_previewToolType; + Type m_PreviewToolType; Type m_ToolType; GradientPair m_GradientPair; Material m_FrameMaterial; @@ -244,14 +239,13 @@ public string tooltipText public Transform rayOrigin { get; set; } public Node node { get; set; } public ITooltip tooltip { private get; set; } // Overrides text - public Action showTooltip { private get; set; } - public Action hideTooltip { private get; set; } public GradientPair customToolTipHighlightColor { get; set; } public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } public int activeButtonCount { get; set; } public int maxButtonCount { get; set; } public Transform menuOrigin { get; set; } + public bool implementsSecondaryButton { get; set; } public Action OpenMenu { get; set; } public Action selectTool { get; set; } @@ -259,14 +253,11 @@ public string tooltipText public Action highlightSingleButton { get; set; } public Action selectHighlightedButton { get; set; } public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu - public Func visibileButtonCount { get; set; } - public bool implementsSecondaryButton { get; set; } + public Func visibleButtonCount { get; set; } public Action destroy { get { return DestroyButton; } } public Action showAllButtons { get; set; } public Action hoverExit { get; set; } - public event Action hovered; - public bool isActiveTool { get { return m_ActiveTool; } @@ -386,9 +377,10 @@ public bool moveToAlternatePosition public Vector3 primaryUIContentContainerLocalScale { get { return m_PrimaryUIContentContainer.localScale; } set { m_PrimaryUIContentContainer.localScale = value; } } public float iconHighlightedLocalZOffset { set { m_GradientButton.iconHighlightedLocalZOffset = value; } } + public event Action hovered; + void Awake() { - const float kSemiTransparentAlphaValue = 0.5f; m_OriginalLocalPosition = transform.localPosition; m_OriginalLocalScale = transform.localScale; m_FrameMaterial = MaterialUtils.GetMaterialClone(m_FrameRenderer); @@ -448,7 +440,7 @@ public void OnPointerEnter(PointerEventData eventData) Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); } - string GetTypeAbbreviation(Type type) + static string GetTypeAbbreviation(Type type) { // Create periodic table-style names for types var abbreviation = new StringBuilder(); @@ -466,8 +458,6 @@ string GetTypeAbbreviation(Type type) void OnBackgroundHoverEnter () { - s_Hovered = true; - if (isMainMenu) { m_GradientButton.highlighted = true; @@ -522,29 +512,6 @@ void OnSecondaryButtonClicked() ActionButtonHoverExit(); } - IEnumerator AnimateInitialReveal(Vector3 targetPosition, Vector3 targetScale) - { - m_IconContainerCanvasGroup.alpha = 1f; - const int kDurationShapeAmount = 4; - const float kTimeScalar = 3f; - const float kAdditionalIconContainerScaleSpeed = 2f; - var duration = 0f; - while (duration < 2) - { - duration += Time.unscaledDeltaTime * kTimeScalar; - var durationShaped = Mathf.Pow(MathUtilsExt.SmoothInOutLerpFloat(duration), kDurationShapeAmount); - m_IconContainer.localScale = Vector3.Lerp(Vector3.zero, k_SemiTransparentIconContainerScale, durationShaped * kAdditionalIconContainerScaleSpeed); - transform.localPosition = Vector3.Lerp(Vector3.zero, targetPosition, durationShaped); - transform.localScale = Vector3.Lerp(Vector3.zero, targetScale, durationShaped); - yield return null; - } - - m_IconContainer.localScale = k_SemiTransparentIconContainerScale; - transform.localPosition = targetPosition; - transform.localScale = targetScale; - m_VisibilityCoroutine = null; - } - IEnumerator AnimateHideAndDestroy() { this.StopCoroutine(ref m_PositionCoroutine); @@ -596,7 +563,7 @@ IEnumerator AnimateHide() IEnumerator AnimateShow() { const float kTimeScalar = 8f; - var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_AlternateLocalScaleMultiplier; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; var currentIconScale = m_IconContainer.localScale; var targetIconContainerScale = m_OriginalIconContainerLocalScale; @@ -636,7 +603,7 @@ IEnumerator AnimatePosition(int orderPosition) const int kDurationShapeAmount = 3; var rotationSpacing = kCircularRange / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu - var phaseOffset = orderPosition > -1 ? rotationSpacing * kCenterLocationAmount - (visibileButtonCount(m_ToolType) * kCenterLocationAmount) * rotationSpacing : 0; + var phaseOffset = orderPosition > -1 ? rotationSpacing * kCenterLocationAmount - (visibleButtonCount(m_ToolType) * kCenterLocationAmount) * rotationSpacing : 0; var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; var duration = 0f; @@ -656,8 +623,8 @@ IEnumerator AnimatePosition(int orderPosition) transform.localRotation = targetRotation; CorrectIconRotation(); - primaryButtonCollidersEnabled = orderPosition > -1 ? true : false; - secondaryButtonCollidersEnabled = orderPosition > -1 ? true : false; + primaryButtonCollidersEnabled = orderPosition > -1; + secondaryButtonCollidersEnabled = orderPosition > -1; m_PositionCoroutine = null; if (implementsSecondaryButton && orderPosition > -1 && m_GradientButton.highlighted) @@ -671,7 +638,7 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) var currentPosition = transform.localPosition; var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; var currentLocalScale = transform.localScale; - var targetLocalScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_alternateLocalScaleMultiplier; + var targetLocalScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_AlternateLocalScaleMultiplier; var speed = moveToAlternatePosition ? 5f : 4.5f; // Perform faster is returning to original position speed += (order + 1) * kSpeedDecreaseScalar; while (amount < 1f) @@ -687,33 +654,6 @@ IEnumerator AnimateMoveActivatorButton(bool moveToAlternatePosition = true) m_ActivatorMoveCoroutine = null; } - IEnumerator DelayedHoverExitCheck(bool waitBeforeClosingAllButtons = true) - { - s_Hovered = false; - - if (waitBeforeClosingAllButtons) - { - var duration = Time.unscaledDeltaTime; - while (duration < 0.25f) - { - duration += Time.unscaledDeltaTime; - yield return null; - - if ((s_Hovered || m_PositionCoroutine != null) || m_SecondaryGradientButton.highlighted) - { - m_HoverCheckCoroutine = null; - yield break; - } - } - } - - // Only proceed if no other button is being hovered - m_GradientButton.highlighted = false; - hoverExit(); - m_GradientButton.UpdateMaterialColors(); - m_HoverCheckCoroutine = null; - } - void CorrectIconRotation() { const float kIconLookForwardOffset = 0.5f; diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index e3041021a..b78389a54 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -34,15 +34,12 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac [SerializeField] HapticPulse m_ButtonHoverPulse; - [SerializeField] - HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection, but not passing the trigger threshold - [SerializeField] HapticPulse m_HidingPulse; // The pulse performed when ending a spatial selection Transform m_RayOrigin; Transform m_AlternateMenuOrigin; - float allowToolToggleBeforeThisTime; + float m_AllowToolToggleBeforeThisTime; Vector3 m_SpatialScrollStartPosition; IPinnedToolButton m_MainMenuButton; PinnedToolsMenuUI m_PinnedToolsMenuUI; @@ -101,7 +98,6 @@ void OnDestroy() void CreatePinnedToolsUI() { - Debug.LogWarning("Spawing pinned tools menu UI"); m_PinnedToolsMenuUI = m_PinnedToolsMenuUI ?? this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; m_PinnedToolsMenuUI.mainMenuActivatorSelected = this.MainMenuActivatorSelected; @@ -110,7 +106,7 @@ void CreatePinnedToolsUI() m_PinnedToolsMenuUI.buttonClicked += OnButtonClick; m_PinnedToolsMenuUI.buttonSelected += OnButtonSelected; - // Alternate menu origin isnt set when awake or start run + // Alternate menu origin isn't set when awake or start run var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; pinnedToolsUITransform.SetParent(m_AlternateMenuOrigin); pinnedToolsUITransform.localPosition = Vector3.zero; @@ -126,36 +122,18 @@ void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) return; } - if (buttons.Count >= k_MaxButtonCount) // Return if tooltype already occupies a pinned tool button - { - // TODO: kick out the oldest tool, and allow the new tool to become the active tool - Debug.LogWarning("New pinned tool button cannot be added. The maximum number of pinned tool buttons are currently being displayed"); + if (buttons.Count >= k_MaxButtonCount) // Return if tool type already occupies a pinned tool button return; - } var buttonTransform = ObjectUtils.Instantiate(m_PinnedToolButtonTemplate.gameObject, m_PinnedToolsMenuUI.buttonContainer, false).transform; var button = buttonTransform.GetComponent(); this.ConnectInterfaces(button); - // Initialize button in alternate position if the alternate menu is hidden - /* - IPinnedToolButton mainMenu = null; - if (toolType == typeof(IMainMenu)) - mainMenu = button; - else - buttons.TryGetValue(typeof(IMainMenu), out mainMenu); - */ - - //button.moveToAlternatePosition = mainMenu != null && mainMenu.moveToAlternatePosition; - //button.node = deviceData.node; button.rayOrigin = rayOrigin; button.toolType = toolType; // Assign Tool Type before assigning order button.icon = toolType != typeof(IMainMenu) ? buttonIcon : m_MainMenuIcon; button.highlightSingleButton = HighlightSingleButton; button.selectHighlightedButton = SelectHighlightedButton; - //button.selected += OnMainMenuActivatorSelected; - //button.hoverEnter += onButtonHoverExit; - //button.hoverExit += onButtonHoverExit; button.rayOrigin = rayOrigin; if (toolType == typeof(IMainMenu)) @@ -179,42 +157,22 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon const float kAllowToggleDuration = 0.25f; var pinnedToolInput = (PinnedToolslMenuInput) input; - if (pinnedToolInput.show.wasJustPressed) - Debug.LogError("SHOW pressed in PinnedToolButton"); - - if (pinnedToolInput.cancel.wasJustPressed) - Debug.LogError("CANCELLING SPATIAL SELECTION!!!!"); - if (pinnedToolInput.show.wasJustPressed) { this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); m_SpatialScrollStartPosition = m_AlternateMenuOrigin.position; - Debug.LogError("Start position : " + m_SpatialScrollStartPosition + ""); - allowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; + m_AllowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; this.SetSpatialHintControlObject(rayOrigin); m_PinnedToolsMenuUI.spatiallyScrolling = true; // Triggers the display of the directional hint arrows - - //Dont show if the user hasnt passed the threshold in the given duration } else if (pinnedToolInput.show.isHeld && !pinnedToolInput.select.isHeld && !pinnedToolInput.select.wasJustPressed) { // Don't scroll if the trigger is held, allowing the user to setting on a single button to select with release if (pinnedToolInput.select.wasJustReleased) { - Debug.LogError("DELETING PinnedToolButton"); - //selectHighlightedButton(rayOrigin); - //OnActionButtonHoverExit(false); - if (m_PinnedToolsMenuUI.DeleteHighlightedButton()) - { buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount - //if (buttonCount <= k_ActiveToolOrderPosition + 1) - //return; - - //allowSpatialScrollBeforeThisTime = null; - //spatialDirection = null; - } if (buttonCount <= k_ActiveToolOrderPosition + 1) { @@ -235,7 +193,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Scrolling); m_PinnedToolsMenuUI.allButtonsVisible = true; } - else if (m_SpatialScrollData.spatialDirection != null)// && m_PinnedToolsMenuUI.startingDragOrigin != m_SpatialScrollData.spatialDirection) + else if (m_SpatialScrollData.spatialDirection != null) { m_PinnedToolsMenuUI.startingDragOrigin = m_SpatialScrollData.spatialDirection; } @@ -247,16 +205,13 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else if (pinnedToolInput.show.wasJustReleased) { - const float kAdditionalConsumptionDuration = 0.25f; if (m_SpatialScrollData.passedMinDragActivationThreshold) { - Debug.LogWarning("PinnedToolButton was just released"); m_PinnedToolsMenuUI.SelectHighlightedButton(); - //m_PinnedToolsMenuUI.spatialDragDistance = 0f; // Triggers the display of the directional hint arrows consumeControl(pinnedToolInput.select); this.Pulse(node, m_HidingPulse); } - else if (Time.realtimeSinceStartup < allowToolToggleBeforeThisTime) + else if (Time.realtimeSinceStartup < m_AllowToolToggleBeforeThisTime) { // Allow for single press+release to cycle through tools m_PinnedToolsMenuUI.SelectNextExistingToolButton(); @@ -283,10 +238,8 @@ void OnButtonHover() void OnButtonSelected(Transform rayOrigin, Type buttonType) { - Debug.LogError("Selecting Tool in PinnedToolsMenu : " + buttonType.ToString()); - //Debug.Log("" + System.Environment.StackTrace + ""); this.SelectTool(rayOrigin, buttonType, false); } } } -#endif \ No newline at end of file +#endif diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/PinnedToolMenu/Scripts/HintLine.cs index 593661d92..c9f73fc2b 100644 --- a/Menus/PinnedToolMenu/Scripts/HintLine.cs +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs @@ -22,9 +22,6 @@ public class HintLine : MonoBehaviour [SerializeField] MeshRenderer m_MeshRenderer; - Transform m_IconTransform; - Vector3 m_VisibleLocalScale; - Coroutine m_VisibilityCoroutine; Coroutine m_ScrollArrowPulseCoroutine; float m_PulseDuration; Material m_HintLineMaterial; @@ -53,7 +50,7 @@ void OnDestroy() } /// - /// Perform an animated visual pusling of color + /// Perform an animated visual pulsing of color /// public void PulseColor() { diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 129558408..2d4124a2c 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -178,7 +178,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) button.maxButtonCount = maxButtonCount; button.selectTool = SelectExistingToolTypeFromButton; button.closeButton = DeleteHighlightedButton; - button.visibileButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount + button.visibleButtonCount = VisibleButtonCount; // allow buttons to fetch local buttonCount button.iconHighlightedLocalZOffset = k_RaySelectIconHighlightedZOffset; button.tooltipTarget = m_ButtonTooltipTarget; button.hovered += OnButtonHover; diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 7a4b1eae9..5b2ced4ea 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -236,7 +236,7 @@ void OnDisable() this.StopCoroutine(ref m_IconHighlightCoroutine); } - private void OnDestroy() + void OnDestroy() { ObjectUtils.Destroy(m_InsetMaterial); ObjectUtils.Destroy(m_IconMaterial); @@ -448,7 +448,7 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) { if (m_InsetRevealCoroutine != null) { - // In case semiTransparency is triggered immedlately upon showing the radial menu + // In case semiTransparency is triggered immediately upon showing the radial menu this.StopCoroutine(ref m_InsetRevealCoroutine); m_CanvasGroup.alpha = 1f; PostReveal(); diff --git a/Menus/RadialMenu/Scripts/RadialMenuUI.cs b/Menus/RadialMenu/Scripts/RadialMenuUI.cs index ffe6c4f04..3c4f2797f 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuUI.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuUI.cs @@ -153,7 +153,7 @@ public Vector2 buttonInputDirection } Vector2 m_ButtonInputDirection; - private bool semiTransparent + bool semiTransparent { set { @@ -165,11 +165,11 @@ private bool semiTransparent for (int i = 0; i < m_RadialMenuSlots.Count; ++i) { // Only set the semiTransparent value on menu slots representing actions - m_RadialMenuSlots[i].semiTransparent = m_Actions.Count > i ? m_SemiTransparent : false; + m_RadialMenuSlots[i].semiTransparent = m_Actions.Count > i && m_SemiTransparent; } } } - private bool m_SemiTransparent; + bool m_SemiTransparent; public event Action buttonHovered; public event Action buttonClicked; diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 567c57980..27f7a3ba8 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -44,7 +44,6 @@ internal void PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, var previewPinnedToolButton = deviceData.pinnedToolsMenu.previewToolButton; previewPinnedToolButton.previewToolType = toolType; previewPinnedToolButton.previewToolDescription = toolDescription; - return; } }); } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 41d672cf8..71a80857c 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -121,7 +121,7 @@ internal static void SpawnDefaultTools(IProxy proxy) deviceData.pinnedToolsMenu = pinnedToolsMenu; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; pinnedToolsMenu.SetButtonForType(typeof(IMainMenu), null); - pinnedToolsMenu.SetButtonForType(typeof(SelectionTool), selectionToolData.icon); + pinnedToolsMenu.SetButtonForType(typeof(SelectionTool), selectionToolData != null ? selectionToolData.icon : null); } evr.GetModule().UpdatePlayerHandleMaps(); @@ -314,7 +314,8 @@ static void SetToolsEnabled(DeviceData deviceData, bool value) foreach (var td in deviceData.toolData) { var mb = td.tool as MonoBehaviour; - mb.enabled = value; + if (mb) + mb.enabled = value; } } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 07f312f4d..3f3b3feb7 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -340,11 +340,6 @@ void OnDestroy() nested.OnDestroy(); } } - - void LateUpdate() - { - OVRHaptics.Process(); - } void Update() { diff --git a/Scripts/Core/Interfaces/IPinnedToolButton.cs b/Scripts/Core/Interfaces/IPinnedToolButton.cs index 872c6ee4b..d844d6aef 100644 --- a/Scripts/Core/Interfaces/IPinnedToolButton.cs +++ b/Scripts/Core/Interfaces/IPinnedToolButton.cs @@ -36,7 +36,7 @@ public interface IPinnedToolButton float iconHighlightedLocalZOffset { set; } /// - /// Bool denothing button highlight state + /// Bool denoting button highlight state /// bool highlighted { get; set; } @@ -100,7 +100,7 @@ public interface IPinnedToolButton /// Returns the visible button count for a given PinnedToolsMenu /// used by buttons to position themselves /// - Func visibileButtonCount { set; } + Func visibleButtonCount { set; } /// /// Closes this button diff --git a/Scripts/Helpers/SmoothMotion.cs b/Scripts/Helpers/SmoothMotion.cs index efe4a9d9e..df4455ae1 100644 --- a/Scripts/Helpers/SmoothMotion.cs +++ b/Scripts/Helpers/SmoothMotion.cs @@ -13,7 +13,7 @@ sealed class SmoothMotion : MonoBehaviour, IUsesViewerScale /// /// If true, smooth the rotation of this transform, according to the TightenRotation amount /// - public bool smoothRotation { private get { return m_SmoothRotation; } set { m_SmoothRotation = value; } } + public bool smoothRotation { set { m_SmoothRotation = value; } } [Header("Rotation")] [SerializeField] bool m_SmoothRotation; @@ -24,7 +24,7 @@ sealed class SmoothMotion : MonoBehaviour, IUsesViewerScale /// /// If true, smooth the position of this transform, according to the TightenPosition amount /// - public bool smoothPosition { private get { return m_SmoothPosition; } set { m_SmoothPosition = value; } } + public bool smoothPosition { set { m_SmoothPosition = value; } } [Header("Position")] [SerializeField] bool m_SmoothPosition; diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 61224ac24..f9d09bf3e 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -45,6 +45,7 @@ public static class IMainMenuMethods /// Transform: Ray origin to check /// Type: MenuButton's tool type to preview /// String: The tool description to display as a Tooltip + /// public static void PreviewInPinnedToolButton (this IMainMenu obj, Transform rayOrigin, Type toolType, string toolDescription) { previewInPinnedToolButton(rayOrigin, toolType, toolDescription); diff --git a/Scripts/Interfaces/Entity/IProxy.cs b/Scripts/Interfaces/Entity/IProxy.cs index 2a9564b9c..d0b3b5b1f 100644 --- a/Scripts/Interfaces/Entity/IProxy.cs +++ b/Scripts/Interfaces/Entity/IProxy.cs @@ -79,6 +79,7 @@ Dictionary previewOrigins get; set; } + /// /// Origins for grabbed list fields /// Key = ray origin /// Value = field grab transform diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs index 4ad82cf6b..30c2332f6 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs @@ -77,7 +77,7 @@ public static void SetSpatialHintLookAtRotation(this IControlSpatialHinting obj, internal static PulseSpatialHintScrollArrowsDelegate pulseSpatialHintScrollArrows { get; set; } /// - /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatiatil scroll + /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatial scroll /// public static void PulseSpatialHintScrollArrows(this IControlSpatialHinting obj) { diff --git a/Scripts/Modules/HapticsModule/HapticsModule.cs b/Scripts/Modules/HapticsModule/HapticsModule.cs index b26ef8b3f..d155f1c93 100644 --- a/Scripts/Modules/HapticsModule/HapticsModule.cs +++ b/Scripts/Modules/HapticsModule/HapticsModule.cs @@ -70,7 +70,7 @@ public void Pulse(Node? node, HapticPulse hapticPulse, float durationMultiplier var fadeOut = hapticPulse.fadeOut; if (duration > MaxDuration) { - duration = Mathf.Clamp(duration, 0f, MaxDuration); // Clamp at maxiumum 800ms for sample buffer + duration = Mathf.Clamp(duration, 0f, MaxDuration); // Clamp at maximum 800ms for sample buffer if (!m_SampleLengthWarningShown) Debug.LogWarning("Pulse durations greater than 0.8f are not currently supported"); diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index a766b65cd..8ce6d7a9f 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -47,9 +47,8 @@ public SpatialHintStateFlags state } } - private Transform controllingRayOrigin + Transform controllingRayOrigin { - get { return m_ControllingRayOrigin; } set { if (value == m_ControllingRayOrigin) @@ -62,17 +61,13 @@ private Transform controllingRayOrigin } else { - state = SpatialHintModule.SpatialHintStateFlags.PreDragReveal; + state = SpatialHintStateFlags.PreDragReveal; m_SpatialHintModuleUI.controllingNode = this.RequestNodeFromRayOrigin(m_ControllingRayOrigin); } } } - Vector3 spatialHintScrollVisualsRotation - { - get { return m_SpatialHintModuleUI.scrollVisualsRotation; } - set { m_SpatialHintModuleUI.scrollVisualsRotation = value; } - } + Vector3 spatialHintScrollVisualsRotation { set { m_SpatialHintModuleUI.scrollVisualsRotation = value; } } Transform spatialHintContentContainer { get { return m_SpatialHintModuleUI.contentContainer; } } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 52e35d8fa..790665a9e 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -35,7 +35,6 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt HintIcon[] m_SecondaryDirectionalHintArrows; bool m_Visible; - bool m_PreScrollVisualsVisible; bool m_PreScrollArrowsVisible; bool m_SecondaryArrowsVisible; Vector3 m_ScrollVisualsRotation; @@ -52,7 +51,6 @@ public bool visible get { return m_Visible; } set { - Debug.LogError("Setting Hint Module visibility to : " + value); m_Visible = value; if (m_Visible) @@ -92,10 +90,7 @@ public bool scrollVisualsVisible set { if (value) - { - Debug.LogError("scrollVisualsRotation was set to a Vec3 non-zero value' beginning showing of scroll visuals : " + m_ScrollVisualsRotation); this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, ShowScrollVisuals()); - } } } @@ -143,7 +138,7 @@ public bool secondaryArrowsVisible } } - private bool scrollArrowsVisible + bool scrollArrowsVisible { set { @@ -155,17 +150,7 @@ private bool scrollArrowsVisible /// /// If non-null, enable and set the world rotation of the scroll visuals /// - public Vector3 scrollVisualsRotation - { - get { return m_ScrollVisualsRotation ; } - set - { - if (m_ScrollVisualsRotation == value) - return; - - m_ScrollVisualsRotation = value; - } - } + public Vector3 scrollVisualsRotation { get { return m_ScrollVisualsRotation ; } set { m_ScrollVisualsRotation = value; } } /// /// The node currently controlling the spatial hint visuals @@ -177,11 +162,7 @@ public Node? controllingNode { m_ControllingNode = value; - if (m_ControllingNode != null) - { - Debug.LogError("Setting Spatial Hinting Control node to : " + m_ControllingNode); - } - else + if (m_ControllingNode == null) { scrollVisualsRotation = Vector3.zero; this.RestartCoroutine(ref m_ScrollVisualsVisibilityCoroutine, HideScrollVisuals()); @@ -204,21 +185,18 @@ void Awake() { m_ScrollVisualsTransform = m_ScrollVisualsCanvasGroup.transform; m_ScrollVisualsCanvasGroup.alpha = 0f; - //m_ScrollVisualsGameObject.SetActive(false); m_ScrollVisualsDragTargetArrowTransform = m_ScrollVisualsDragTargetArrow.transform; } IEnumerator ShowScrollVisuals() { - Debug.LogError("SHOWING SPATIAL SCROLL VISUALS : viewscale is " + this.GetViewerScale()); // Display two arrows denoting the positive and negative directions allow for spatial scrolling, as defined by the drag vector - //m_ScrollVisualsGameObject.SetActive(true); scrollArrowsVisible = true; preScrollArrowsVisible = false; secondaryArrowsVisible = false; transform.localScale = Vector3.one * this.GetViewerScale(); - m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, Vector3.up);// CameraUtils.GetMainCamera().transform.forward); // Scroll arrows should face/billboard the user. + m_ScrollVisualsTransform.LookAt(m_ScrollVisualsRotation, Vector3.up); // Scroll arrows should face/billboard the user. m_ScrollVisualsCanvasGroup.alpha = 1f; // remove m_ScrollVisualsDragTargetArrowTransform.localPosition = Vector3.zero; @@ -235,16 +213,14 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 1f, shapedDuration); // Only validate movement in the initial direction with which the user began the drag - //var movingAwayFromSource = Vector3.Dot(normalizedScrollVisualsForward, Vector3.Normalize(scrollVisualsDragThresholdTriggerPosition - secondArrowCurrentPosition)) > 0; - //if (movingAwayFromSource && (scrollVisualsDragThresholdTriggerPosition - secondArrowCurrentPosition).magnitude >= (m_ScrollVisualsDragTargetArrow.position - secondArrowCurrentPosition).magnitude) - m_ScrollVisualsDragTargetArrowTransform.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); + m_ScrollVisualsDragTargetArrowTransform.position = Vector3.Lerp(secondArrowCurrentPosition, scrollVisualsDragThresholdTriggerPosition, shapedDuration); currentDuration += Time.unscaledDeltaTime * 2f; m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsDragTargetArrowTransform.position - m_ScrollVisualsTransform.position); m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsTransform.position - m_ScrollVisualsDragTargetArrowTransform.position); m_ScrollVisualsTransform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedDuration); - var lineRendererPositions = new Vector3[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrowTransform.position }; + var lineRendererPositions = new[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrowTransform.position }; m_ScrollHintLine.Positions = lineRendererPositions; m_ScrollHintLine.LineWidth = shapedDuration * this.GetViewerScale(); @@ -258,8 +234,6 @@ IEnumerator ShowScrollVisuals() IEnumerator HideScrollVisuals() { - Debug.LogError("HIDING SPATIAL SCROLL VISUALS"); - // Hide the scroll visuals scrollArrowsVisible = false; const float kTargetDuration = 1f; @@ -280,8 +254,6 @@ IEnumerator HideScrollVisuals() m_ScrollVisualsCanvasGroup.alpha = 0; m_ScrollVisualsTransform.localScale = hiddenLocalScale; - //m_ScrollVisualsTransform.localRotation = Quaternion.identity; - //m_ScrollVisualsGameObject.SetActive(false); } /// diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index 3eeafaa84..0493e1d59 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -36,7 +36,7 @@ public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Ve public int scrollableItemCount { get; set; } public int maxItemCount { get; set; } - // Values populated by scoll processing + // Values populated by scroll processing public Vector3? spatialDirection { get; set; } public Vector3 startingDragOrigin { get; set; } public Vector3 previousWorldPosition { get; set; } @@ -76,13 +76,12 @@ internal SpatialScrollData PerformScroll(object caller, Node? node, Vector3 star m_ScrollData.Add(caller, spatialScrollData); } - return processSpatialScrolling(spatialScrollData); + return ProcessSpatialScrolling(spatialScrollData); } - SpatialScrollData processSpatialScrolling(SpatialScrollData scrollData) + SpatialScrollData ProcessSpatialScrolling(SpatialScrollData scrollData) { var directionVector = scrollData.currentPosition - scrollData.startingPosition; - const float kMaxFineTuneVelocity = 0.0005f; if (scrollData.spatialDirection == null) { var newDirectionVectorThreshold = 0.0175f; // Initial magnitude beyond which spatial scrolling will be evaluated @@ -93,7 +92,7 @@ SpatialScrollData processSpatialScrolling(SpatialScrollData scrollData) scrollData.dragDistance = dragMagnitude > 0 ? dragPercentage : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred this.Pulse(scrollData.node, m_ActivationPulse, repeatingPulseAmount, repeatingPulseAmount); if (dragMagnitude > newDirectionVectorThreshold) - scrollData.spatialDirection = directionVector; // Initialize vector defining the spatial scroll direciton + scrollData.spatialDirection = directionVector; // Initialize vector defining the spatial scroll direction } else { diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index 485795dca..42f9e2f37 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -72,7 +72,7 @@ void Update() var tooltipUI = tooltipData.tooltipUI; if (!tooltipUI) { - var tooltipObject = (GameObject)Instantiate(m_TooltipPrefab, m_TooltipCanvas); + var tooltipObject = Instantiate(m_TooltipPrefab, m_TooltipCanvas); tooltipUI = tooltipObject.GetComponent(); tooltipData.tooltipUI = tooltipUI; tooltipUI.highlight.material = m_HighlightMaterial; diff --git a/Scripts/Modules/TooltipModule/TooltipUI.cs b/Scripts/Modules/TooltipModule/TooltipUI.cs index bc42813a6..5f813eed9 100644 --- a/Scripts/Modules/TooltipModule/TooltipUI.cs +++ b/Scripts/Modules/TooltipModule/TooltipUI.cs @@ -27,4 +27,4 @@ sealed class TooltipUI : MonoBehaviour Image m_Background; } } -#endif \ No newline at end of file +#endif diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 7a19973b3..001ac470f 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -6,6 +6,7 @@ using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.EventSystems; +using UnityEngine.Serialization; using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.UI @@ -186,7 +187,7 @@ public float iconHighlightedLocalZOffset [SerializeField] Color m_NormalContentColor; - // The color that elements in the HighlighItems collection should inherit during the highlighted state + // The color that elements in the HighlightItems collection should inherit during the highlighted state [SerializeField] Color m_HighlightItemColor = UnityBrandColorScheme.light; @@ -211,7 +212,8 @@ public float iconHighlightedLocalZOffset float m_DelayBeforeReveal = 0.25f; [SerializeField] - float m_highlightZScaleMultiplier = 2f; + [FormerlySerializedAs("m_highlightZScaleMultiplier")] + float m_HighlightZScaleMultiplier = 2f; Material m_ButtonMaterial; Vector3 m_OriginalIconLocalPosition; @@ -238,7 +240,7 @@ void Awake() m_OriginalLocalScale = transform.localScale; m_OriginalIconLocalPosition = m_IconContainer.localPosition; m_OriginalContentContainerLocalScale = m_ContentContainer.localScale; - m_HighlightContentContainerLocalScale = new Vector3(m_OriginalContentContainerLocalScale.x, m_OriginalContentContainerLocalScale.y, m_OriginalContentContainerLocalScale.z * m_highlightZScaleMultiplier); + m_HighlightContentContainerLocalScale = new Vector3(m_OriginalContentContainerLocalScale.x, m_OriginalContentContainerLocalScale.y, m_OriginalContentContainerLocalScale.z * m_HighlightZScaleMultiplier); m_IconHighlightedLocalPosition = m_OriginalIconLocalPosition + Vector3.forward * m_IconHighlightedLocalZOffset; m_IconPressedLocalPosition = m_OriginalIconLocalPosition + Vector3.back * m_IconHighlightedLocalZOffset; diff --git a/Scripts/Utilities/UnityBrandColorScheme.cs b/Scripts/Utilities/UnityBrandColorScheme.cs index 32748f7ad..4329cead5 100644 --- a/Scripts/Utilities/UnityBrandColorScheme.cs +++ b/Scripts/Utilities/UnityBrandColorScheme.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Experimental.EditorVR.Utilities { /// - /// Class defining the Unity brancd color swatches & gradients + /// Class defining the Unity brand color swatches & gradients /// public static class UnityBrandColorScheme { @@ -194,7 +194,7 @@ static UnityBrandColorScheme() /// /// Setup Unity branded swatches and gradients /// - private static void SetupUnityBrandColors() + static void SetupUnityBrandColors() { s_Red = MaterialUtils.HexToColor("F44336"); s_RedLight = MaterialUtils.HexToColor("FFEBEE"); @@ -396,7 +396,7 @@ public static GradientPair GetRandomCuratedGradient() s_RandomCuratedGradientPairPosition = randomPosition; - return s_CuratedGradientPairs[s_RandomCuratedGradientPairPosition];; + return s_CuratedGradientPairs[s_RandomCuratedGradientPairPosition]; } /// @@ -413,7 +413,7 @@ public static GradientPair GetRandomCuratedLightGradient() s_RandomCuratedLightGradientPairPosition = randomPosition; - return s_CuratedLightGradientPairs[s_RandomCuratedLightGradientPairPosition];; + return s_CuratedLightGradientPairs[s_RandomCuratedLightGradientPairPosition]; } /// @@ -430,7 +430,7 @@ public static GradientPair GetRandomCuratedDarkGradient() s_RandomCuratedDarkGradientPairPosition = randomPosition; - return s_CuratedDarkGradientPairs[s_RandomCuratedDarkGradientPairPosition];; + return s_CuratedDarkGradientPairs[s_RandomCuratedDarkGradientPairPosition]; } /// From ee2f8021313e699dcb862410e77227dbc9c7828e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 17 Aug 2017 22:04:12 -0700 Subject: [PATCH 758/870] Replace menuHeight with localBounds; Fix issue where menu wouldn't hide after opening tools; Fix issue where primitive menu doesn't hide properly; Address PR comments --- Menus/MainMenu/MainMenu.cs | 2 -- Menus/MainMenu/Scripts/MainMenuUI.cs | 5 ---- Menus/RadialMenu/RadialMenu.cs | 2 +- Scripts/Core/EditorVR.Menus.cs | 28 ++++++++++++------- Scripts/Interfaces/Entity/IMainMenu.cs | 5 ---- Scripts/Interfaces/Entity/IMenu.cs | 4 +-- .../CreatePrimitiveMenu.cs | 10 +++++-- 7 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index e4aa8b680..1acd21441 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -97,8 +97,6 @@ public bool visible public Transform rayOrigin { private get; set; } - public float hideDistance { get { return m_MainMenuUI.menuHeight; } } - public Bounds localBounds { get { return m_MainMenuUI.localBounds; } } public bool focus { get { return m_MainMenuUI.hovering; } } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index fadfe02e4..99433eea5 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -39,9 +39,6 @@ enum VisibilityState TransitioningOut } - [SerializeField] - float m_MenuHeight = 0.2f; - [SerializeField] MainMenuButton m_ButtonTemplatePrefab; @@ -166,8 +163,6 @@ public bool visible } } - public float menuHeight { get { return m_MenuHeight; } } - int currentFaceIndex { get diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index 8652582c3..12678d06b 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -83,7 +83,7 @@ public bool visible public Node? node { get; set; } - public float hideDistance {get { return Mathf.Infinity; } } + public Bounds localBounds { get { return default(Bounds); } } void Start() { diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 215ec4b3a..88907ebdd 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && UNITY_EDITORVR +#if UNITY_EDITOR && UNITY_EDITORVR using System; using System.Collections.Generic; using System.Linq; @@ -47,6 +47,7 @@ internal enum MenuHideFlags readonly List m_ActiveDeviceData = new List(); readonly List m_WorkspaceComponents = new List(); readonly Collider[] m_WorkspaceOverlaps = new Collider[k_PossibleOverlaps]; + static readonly List k_Menus = new List(); public Menus() { @@ -169,7 +170,7 @@ internal void UpdateMenuVisibilities() var rayOrigin = deviceData.rayOrigin; var rayOriginPosition = rayOrigin.position; var heldObjects = directSelection.GetHeldObjects(rayOrigin); - var hasDirectSelection = directSelection != null && heldObjects != null && heldObjects.Count > 0; + var hasDirectSelection = heldObjects != null && heldObjects.Count > 0; if (hasDirectSelection) { foreach (var menu in menus) @@ -227,7 +228,8 @@ internal void UpdateMenuVisibilities() { var mainMenu = deviceData.mainMenu; var mainMenuHideFlags = deviceData.menuHideFlags[mainMenu]; - if (mainMenuHideFlags != 0 && !mainMenu.focus) + //Hide the main menu if any hideflags are set; if the menu is focused, only hide if Hidden is set (e.g. not temporary) + if (mainMenuHideFlags != 0 && ((mainMenuHideFlags & MenuHideFlags.Hidden) != 0 || !mainMenu.focus)) { if ((mainMenuHideFlags & MenuHideFlags.Hidden) != 0) { @@ -273,7 +275,7 @@ internal static bool IsValidHover(MultipleRayInputModule.RaycastSource source) if (!go) go = source.hoveredObject; - if (go == null) + if (!go) return true; if (go == evr.gameObject) @@ -288,20 +290,26 @@ internal static bool IsValidHover(MultipleRayInputModule.RaycastSource source) return false; var scaledPointerDistance = eventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); - var menus = deviceData.menuHideFlags.Keys.ToList(); - var hideDistance = deviceData.mainMenu.hideDistance; - if (scaledPointerDistance < hideDistance + k_MenuHideMargin) + var menuHideFlags = deviceData.menuHideFlags; + var mainMenu = deviceData.mainMenu; + IMenu openMenu = mainMenu; + if (deviceData.customMenu != null && menuHideFlags[mainMenu] != 0) + openMenu = deviceData.customMenu; + + if (scaledPointerDistance < openMenu.localBounds.size.y + k_MenuHideMargin) { - foreach (var menu in menus) + k_Menus.Clear(); + k_Menus.AddRange(menuHideFlags.Keys); + foreach (var menu in k_Menus) { // Only set if hidden--value is reset every frame - deviceData.menuHideFlags[menu] |= MenuHideFlags.OverUI; + menuHideFlags[menu] |= MenuHideFlags.OverUI; } return true; } - return (deviceData.menuHideFlags[deviceData.mainMenu] & MenuHideFlags.Hidden) != 0; + return (menuHideFlags[openMenu] & MenuHideFlags.Hidden) != 0; } return true; diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 924f8bb85..a3449fd97 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -35,11 +35,6 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Transform targetRayOrigin { set; } - /// - /// The local bounds of this menu - /// - Bounds localBounds { get; } - /// /// Does this menu have focus? /// diff --git a/Scripts/Interfaces/Entity/IMenu.cs b/Scripts/Interfaces/Entity/IMenu.cs index 91a185bdb..8905dc7a2 100644 --- a/Scripts/Interfaces/Entity/IMenu.cs +++ b/Scripts/Interfaces/Entity/IMenu.cs @@ -24,9 +24,9 @@ public interface IMenu GameObject menuContent { get; } /// - /// If the rayOrigin this menu is attached to is hovering UI, hide it if the raycast distance is less than this + /// The local bounds of this menu /// - float hideDistance { get; } + Bounds localBounds { get; } } } #endif diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs index 75c41e48e..e0ef7c68a 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs @@ -1,5 +1,6 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; +using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Tools @@ -12,7 +13,7 @@ sealed class CreatePrimitiveMenu : MonoBehaviour, IMenu public Action selectPrimitive; public Action close; - public float hideDistance {get { return Mathf.Infinity; } } + public Bounds localBounds { get; private set; } public bool visible { @@ -25,6 +26,11 @@ public GameObject menuContent get { return gameObject; } } + void Awake() + { + localBounds = ObjectUtils.GetBounds(transform); + } + public void SelectPrimitive(int type) { selectPrimitive((PrimitiveType)type, false); From 81f41ace9db5b4a493c49382e1a18e7aa2e7f495 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 17 Aug 2017 22:35:28 -0700 Subject: [PATCH 759/870] Switch to grip-crawl and use trigger for locomotion speed boost; Disable spheres that might extend beyond the target --- Scripts/Core/EditorVR.cs | 2 -- Tools/LocomotionTool/LocomotionInput.asset | 34 ++------------------ Tools/LocomotionTool/LocomotionInput.cs | 1 - Tools/LocomotionTool/LocomotionTool.cs | 21 ++++++------ Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 33 +++++++++++-------- 5 files changed, 33 insertions(+), 58 deletions(-) diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index cee46899e..584fb7b80 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -203,8 +203,6 @@ void Awake() AddModule(); - AddModule(); - viewer.AddPlayerModel(); GetNestedModule().CreateAllProxies(); diff --git a/Tools/LocomotionTool/LocomotionInput.asset b/Tools/LocomotionTool/LocomotionInput.asset index 4c828a70d..4773c678b 100644 --- a/Tools/LocomotionTool/LocomotionInput.asset +++ b/Tools/LocomotionTool/LocomotionInput.asset @@ -22,7 +22,6 @@ MonoBehaviour: - {fileID: 114894458248566326} - {fileID: 114795339600363638} - {fileID: 114866277550077874} - - {fileID: 114074002882361640} m_ControlSchemes: - m_Name: LocomotionInput m_DeviceSlots: @@ -43,7 +42,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 22 + - controlIndex: 3 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -52,7 +51,7 @@ MonoBehaviour: snap: 1 primaryIsButtonAxis: 0 - sources: - - controlIndex: 3 + - controlIndex: 22 deviceKey: 1 deadZone: 0.3 buttonAxisSources: [] @@ -123,15 +122,6 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 - - sources: - - controlIndex: 3 - deviceKey: 1 - deadZone: 0.3 - buttonAxisSources: [] - gravity: 1000 - sensitivity: 1000 - snap: 1 - primaryIsButtonAxis: 0 m_MapTypeName: LocomotionInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: @@ -275,26 +265,6 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: WorldReset defaultValue: 0 ---- !u!114 &114074002882361640 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: AltSpeed - m_EditorClassIdentifier: - m_ActionMap: {fileID: 11400000} - m_ActionIndex: 10 - m_ControlData: - componentControlIndices: - controlType: - m_TypeName: UnityEngine.InputNew.AxisInputControl, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - name: AltSpeed - defaultValue: 0 --- !u!114 &114795339600363638 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Tools/LocomotionTool/LocomotionInput.cs b/Tools/LocomotionTool/LocomotionInput.cs index ac7916223..df1a4ed93 100644 --- a/Tools/LocomotionTool/LocomotionInput.cs +++ b/Tools/LocomotionTool/LocomotionInput.cs @@ -17,6 +17,5 @@ public LocomotionInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @rotate { get { return (ButtonInputControl)this[7]; } } public AxisInputControl @horizontal { get { return (AxisInputControl)this[8]; } } public AxisInputControl @vertical { get { return (AxisInputControl)this[9]; } } - public AxisInputControl @altSpeed { get { return (AxisInputControl)this[10]; } } } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 20530017e..eab4b4389 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -85,6 +85,7 @@ class Preferences float m_OriginalNearClipPlane; float m_OriginalFarClipPlane; + ToggleGroup m_ToggleGroup; Toggle m_FlyToggle; Toggle m_BlinkToggle; bool m_BlockValueChangedListener; @@ -103,7 +104,9 @@ public GameObject settingsMenuItemInstance { set { + m_ToggleGroup = value.GetComponentInChildren(); var defaultToggleGroup = value.GetComponentInChildren(); + Debug.Log(m_ToggleGroup.GetInstanceID()); foreach (var toggle in value.GetComponentsInChildren()) { if (toggle == defaultToggleGroup.defaultToggle) @@ -122,10 +125,11 @@ public GameObject settingsMenuItemInstance if (locomotionTool != this) { locomotionTool.m_BlockValueChangedListener = true; - //linkedObject.m_ToggleGroup.NotifyToggleOn(isOn ? m_FlyToggle : m_BlinkToggle); + locomotionTool.m_ToggleGroup.NotifyToggleOn( + isOn ? locomotionTool.m_FlyToggle : locomotionTool.m_BlinkToggle); // HACK: Toggle Group claims these toggles are not a part of the group - locomotionTool.m_FlyToggle.isOn = isOn; - locomotionTool.m_BlinkToggle.isOn = !isOn; + //locomotionTool.m_FlyToggle.isOn = isOn; + //locomotionTool.m_BlinkToggle.isOn = !isOn; locomotionTool.m_BlockValueChangedListener = false; } } @@ -346,17 +350,14 @@ bool DoBlink(ConsumeControlDelegate consumeControl) if (m_BlinkVisuals.gameObject.activeInHierarchy) { - m_BlinkVisuals.extraSpeed = proxyType == typeof(ViveProxy) ? - m_LocomotionInput.speed.value : m_LocomotionInput.altSpeed.value; + m_BlinkVisuals.extraSpeed = m_LocomotionInput.speed.value; consumeControl(m_LocomotionInput.blink); return true; } - else - { - this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); - } + + this.UnlockRay(rayOrigin, this); + this.SetDefaultRayVisibility(rayOrigin, true); return m_BlinkMoving; } diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index 26701afea..59bbff943 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -167,19 +167,6 @@ void Update() if (segment == Vector3.zero) continue; - if (i < m_SphereCount) - { - var sphere = m_Spheres[i]; - if (i == 0) - sphere.localScale = m_SphereScale * m_SpherePosition; - - if (i == m_SphereCount - 1) - sphere.localScale = m_SphereScale * (1 - m_SpherePosition); - - m_Spheres[i].position = lastPosition + segment * m_SpherePosition; - m_Spheres[i].gameObject.SetActive(true); - } - var scaledEpsilon = k_Epsilon * viewerScale; var ray = new Ray(lastPosition - segment.normalized * scaledEpsilon, segment); RaycastHit hit; @@ -188,6 +175,26 @@ void Update() if (this.Raycast(ray, out hit, out go, segment.magnitude + scaledEpsilon, ignoreList)) targetPosition = hit.point; + if (i < m_SphereCount) + { + var sphere = m_Spheres[i]; + if (targetPosition.HasValue) + { + sphere.gameObject.SetActive(false); + } + else + { + if (i == 0) + sphere.localScale = m_SphereScale * m_SpherePosition; + + if (i == m_SphereCount - 1) + sphere.localScale = m_SphereScale * (1 - m_SpherePosition); + + m_Spheres[i].position = lastPosition + segment * m_SpherePosition; + m_Spheres[i].gameObject.SetActive(true); + } + } + lastPosition = nextPosition; } } From 55602fdecf4e5b1a256030db688eb09d426f835c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 18 Aug 2017 09:49:40 -0700 Subject: [PATCH 760/870] Use highlightModule to get default ray color --- Scripts/Core/EditorVR.Rays.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 6fe6de8a5..fdd4b1466 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -502,7 +502,8 @@ static Color GetDefaultRayColor(Transform rayOrigin) } } - return default(Color); + var highlightModule = evr.GetModule(); + return highlightModule.highlightColor; } } } From 731843ac91346bfc1469b0b17a72a217a030904f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 18 Aug 2017 09:50:28 -0700 Subject: [PATCH 761/870] Add documentation for returns in ITwoHandedScaler --- Scripts/Interfaces/Capability/ITwoHandedScaler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Interfaces/Capability/ITwoHandedScaler.cs b/Scripts/Interfaces/Capability/ITwoHandedScaler.cs index ae949963d..ec62cf979 100644 --- a/Scripts/Interfaces/Capability/ITwoHandedScaler.cs +++ b/Scripts/Interfaces/Capability/ITwoHandedScaler.cs @@ -12,7 +12,7 @@ public interface ITwoHandedScaler /// Returns whether the given ray origin is involved in two-handed scaling /// /// The ray origin to check - /// + /// Whether the given ray origin is involved in two-handed scaling bool IsTwoHandedScaling(Transform rayOrigin); } } From 54cb6bd4310c846c2908ca4d3ba501e55416ed18 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 18 Aug 2017 09:52:06 -0700 Subject: [PATCH 762/870] Always instantiate m_RayHighlightMaterial in HighlightModule --- Scripts/Modules/HighlightModule/HighlightModule.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs b/Scripts/Modules/HighlightModule/HighlightModule.cs index a14467fd7..0cea62bf4 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -38,12 +38,11 @@ void Awake() { s_BakedMesh = new Mesh(); + m_RayHighlightMaterial = Instantiate(m_RayHighlightMaterial); if (EditorPrefs.HasKey(k_SelectionOutlinePrefsKey)) { var selectionColor = MaterialUtils.PrefToColor(EditorPrefs.GetString(k_SelectionOutlinePrefsKey)); selectionColor.a = 1; - - m_RayHighlightMaterial = Instantiate(m_RayHighlightMaterial); m_RayHighlightMaterial.color = selectionColor.gamma; } } From 84ad6091c314d24d98af249f5e5e01a5a5509c9e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 18 Aug 2017 11:14:34 -0700 Subject: [PATCH 763/870] Remove ProxyGradientOutline material & shader --- Prefabs/UI/Materials/ProxyGradientOutline.mat | 160 ------------------ .../Materials/ProxyGradientOutline.mat.meta | 8 - Shaders/ProxyGradientOutline.shader | 123 -------------- Shaders/ProxyGradientOutline.shader.meta | 9 - 4 files changed, 300 deletions(-) delete mode 100644 Prefabs/UI/Materials/ProxyGradientOutline.mat delete mode 100644 Prefabs/UI/Materials/ProxyGradientOutline.mat.meta delete mode 100644 Shaders/ProxyGradientOutline.shader delete mode 100644 Shaders/ProxyGradientOutline.shader.meta diff --git a/Prefabs/UI/Materials/ProxyGradientOutline.mat b/Prefabs/UI/Materials/ProxyGradientOutline.mat deleted file mode 100644 index 155326182..000000000 --- a/Prefabs/UI/Materials/ProxyGradientOutline.mat +++ /dev/null @@ -1,160 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: ProxyGradientOutline - m_Shader: {fileID: 4800000, guid: 461584442bc21b24f94fbca006b8d4c7, type: 3} - m_ShaderKeywords: USE_HEIGHT_INSTEAD_OF_DEPTH _EMISSION - m_LightmapFlags: 1 - m_CustomRenderQueue: -1 - stringTagMap: {} - m_SavedProperties: - serializedVersion: 2 - m_TexEnvs: - - first: - name: _BumpMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailAlbedoMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailMask - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailNormalMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _EmissionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _MainTex - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _MetallicGlossMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _OcclusionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _ParallaxMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - first: - name: _Alpha - second: 1 - - first: - name: _BumpScale - second: 1 - - first: - name: _Cutoff - second: 0.5 - - first: - name: _DetailNormalMapScale - second: 1 - - first: - name: _DstBlend - second: 0 - - first: - name: _GlossMapScale - second: 1 - - first: - name: _Glossiness - second: 0.5 - - first: - name: _GlossyReflections - second: 1 - - first: - name: _Metallic - second: 0 - - first: - name: _Mode - second: 0 - - first: - name: _ObjectDepthScale - second: -0.05 - - first: - name: _ObjectScale - second: -0.05 - - first: - name: _OcclusionStrength - second: 1 - - first: - name: _Parallax - second: 0.02 - - first: - name: _RotateGradient - second: 0 - - first: - name: _SizeMultiplier - second: 1 - - first: - name: _SmoothnessTextureChannel - second: 0 - - first: - name: _SpecularHighlights - second: 1 - - first: - name: _SrcBlend - second: 1 - - first: - name: _StencilRef - second: 3 - - first: - name: _Thickness - second: 0.02 - - first: - name: _UVSec - second: 0 - - first: - name: _UseHeightInstead - second: 1 - - first: - name: _ZWrite - second: 1 - m_Colors: - - first: - name: _Color - second: {r: 1, g: 1, b: 1, a: 1} - - first: - name: _ColorBottom - second: {r: 0.889, g: 0.653225, b: 0.14579597, a: 1} - - first: - name: _ColorTop - second: {r: 0.328, g: 0.69412404, b: 1, a: 1} - - first: - name: _EmissionColor - second: {r: 0, g: 0, b: 0, a: 1} - - first: - name: _ObjectExtents - second: {r: 0, g: -0.05, b: -0.05, a: 0} diff --git a/Prefabs/UI/Materials/ProxyGradientOutline.mat.meta b/Prefabs/UI/Materials/ProxyGradientOutline.mat.meta deleted file mode 100644 index c02ead31b..000000000 --- a/Prefabs/UI/Materials/ProxyGradientOutline.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 40ce8f85e3653a84abffb13adb986781 -timeCreated: 1488846314 -licenseType: Pro -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Shaders/ProxyGradientOutline.shader b/Shaders/ProxyGradientOutline.shader deleted file mode 100644 index a1643a8dc..000000000 --- a/Shaders/ProxyGradientOutline.shader +++ /dev/null @@ -1,123 +0,0 @@ -Shader "EditorVR/ProxyGradientOutline" -{ - Properties - { - _ColorTop ("Top Color", Color) = (1,1,1,1) - _ColorBottom ("Bottom Color", Color) = (1,1,1,1) - _Alpha ("Alpha", Range(0, 1)) = 1 - _Thickness ("Thickness", Range (0, 0.025)) = 0.02 - _StencilRef ("StencilRef", Int) = 0 - _ObjectScale ("Object Scale", Range (-0.1, 0.1)) = -0.05 - [Toggle(ROTATE_GRADIENT)] _RotateGradient("Rotate Gradient", Float) = 0 - } - - SubShader - { - Tags{ "Queue" = "Geometry" "IgnoreProjector" = "True" "ForceNoShadowCasting" = "True" "LightMode" = "Always"} - - // Write stencil - Pass - { - ZTest LEqual - ZWrite Off - Cull Back - ColorMask 0 - - Stencil - { - Ref [_StencilRef] - Pass Replace - } - - CGPROGRAM - - #include "UnityCG.cginc" - #pragma vertex vertStencil - #pragma fragment fragStencil - - struct v2f - { - float4 position : SV_POSITION; - }; - - v2f vertStencil(appdata_full v) - { - v2f output; - output.position = UnityObjectToClipPos(v.vertex); - return output; - } - - float4 fragStencil(v2f input) : SV_Target - { - return 0; - } - - ENDCG - } - - // Draw outline - Pass - { - ZTest LEqual - ZWrite On - Cull Back - Blend SrcAlpha OneMinusSrcAlpha - - Stencil - { - Ref [_StencilRef] - Comp NotEqual - } - - CGPROGRAM - - #include "UnityCG.cginc" - #pragma vertex vertOutline - #pragma fragment fragOutline - #pragma multi_compile __ ROTATE_GRADIENT - - fixed4 _ColorTop; - fixed4 _ColorBottom; - half _Thickness; - half _ObjectScale; - half _Alpha; - - struct v2f - { - float4 position : SV_POSITION; - fixed4 color : COLOR; - half3 localPosition : FLOAT; - }; - - v2f vertOutline(appdata_full v) - { - v2f output; - - output.position = UnityObjectToClipPos(v.vertex); - output.color = lerp(_ColorBottom, _ColorTop, v.vertex); - output.localPosition = v.vertex.xyz; - - float3 norm = normalize( mul((float3x3)UNITY_MATRIX_IT_MV, v.normal) ); - float2 offset = TransformViewToProjection(norm.xy); - output.position.xy += offset * _Thickness * 0.1; - return output; - } - - float4 fragOutline(v2f input) : SV_Target - { - #ifdef ROTATE_GRADIENT - half localPos = input.localPosition.y; - #else - half localPos = input.localPosition.z; - #endif - - half4 color = lerp(_ColorTop, _ColorBottom, localPos / _ObjectScale); - color.a = _Alpha; - - return color; - } - - ENDCG - } - } -} diff --git a/Shaders/ProxyGradientOutline.shader.meta b/Shaders/ProxyGradientOutline.shader.meta deleted file mode 100644 index ee5e3f7c9..000000000 --- a/Shaders/ProxyGradientOutline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 461584442bc21b24f94fbca006b8d4c7 -timeCreated: 1488845989 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: From 2e7ea61aba5ad8c72f968d94e8265f0f72e6f192 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 18 Aug 2017 11:46:43 -0700 Subject: [PATCH 764/870] Rollback device highlight changes; moving to a separate branch --- Scripts/Core/EditorVR.PinnedToolButtons.cs | 13 -- Scripts/Interfaces/Entity/IProxy.cs | 8 - Scripts/Proxies/TwoHandedProxyBase.cs | 170 ++------------------- Scripts/Proxies/TwoHandedProxyBase.cs.meta | 9 +- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 13 -- 5 files changed, 12 insertions(+), 201 deletions(-) diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 27f7a3ba8..6b9598031 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -1,7 +1,6 @@ #if UNITY_EDITOR && UNITY_EDITORVR using System; using System.Linq; -using UnityEditor.Experimental.EditorVR.Helpers; using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Core @@ -12,7 +11,6 @@ class PinnedToolButtons : Nested { public PinnedToolButtons() { - IPinnedToolsMenuMethods.highlightDevice = HighlightDevice; IPinnedToolsMenuMethods.mainMenuActivatorSelected = OnMainMenuActivatorSelected; IPinnedToolsMenuMethods.selectTool = OnToolButtonClicked; @@ -20,17 +18,6 @@ public PinnedToolButtons() IMainMenuMethods.clearPinnedToolButtonPreview = ClearPinnedToolButtonPreview; } - internal void HighlightDevice(Transform rayOrigin, GradientPair gradientPair) - { - Rays.ForEachProxyDevice(deviceData => - { - if (deviceData.rayOrigin == rayOrigin) - { - deviceData.proxy.HighlightDevice(deviceData.node, gradientPair); - } - }); - } - internal void PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, string toolDescription) { // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions diff --git a/Scripts/Interfaces/Entity/IProxy.cs b/Scripts/Interfaces/Entity/IProxy.cs index d0b3b5b1f..bee9c4fe8 100644 --- a/Scripts/Interfaces/Entity/IProxy.cs +++ b/Scripts/Interfaces/Entity/IProxy.cs @@ -1,7 +1,6 @@ #if UNITY_EDITOR using System; using System.Collections.Generic; -using UnityEditor.Experimental.EditorVR.Helpers; using UnityEngine; using UnityEngine.InputNew; @@ -88,13 +87,6 @@ Dictionary fieldGrabOrigins { get; set; } - - /// - /// Display the highlight visuals for proxy device - /// Node = device node on which to display the highlight - /// GradientPair = gradientPair used in the highlight visuals - /// - void HighlightDevice (Node node, GradientPair gradientPair, bool pulseOnThenOff = false); } } #endif diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs b/Scripts/Proxies/TwoHandedProxyBase.cs index b1499c5bc..8790edc5f 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs +++ b/Scripts/Proxies/TwoHandedProxyBase.cs @@ -2,9 +2,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; -using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Input; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -15,10 +12,6 @@ namespace UnityEditor.Experimental.EditorVR.Proxies abstract class TwoHandedProxyBase : MonoBehaviour, IProxy { const int k_RendererQueue = 9000; - const float k_TargetHighlightThicknessAmount = 0.02f; - const string k_MaterialColorTopProperty = "_ColorTop"; - const string k_MaterialColorBottomProperty = "_ColorBottom"; - const string k_MaterialThicknessProperty = "_Thickness"; [SerializeField] protected GameObject m_LeftHandProxyPrefab; @@ -29,9 +22,6 @@ abstract class TwoHandedProxyBase : MonoBehaviour, IProxy [SerializeField] protected PlayerInput m_PlayerInput; - [SerializeField] - protected Material m_HighlightMaterial; - internal IInputToEvents m_InputToEvents; public Transform leftHand @@ -48,9 +38,8 @@ public Transform rightHand readonly List m_Materials = new List(); protected Dictionary m_RayOrigins; - protected Dictionary m_HighlightMaterials; - protected Dictionary m_ProxyMeshRoots; - Coroutine m_HighlightCoroutine; + + List m_ProxyMeshRoots = new List(); public virtual Dictionary rayOrigins { get { return m_RayOrigins; } } @@ -64,6 +53,7 @@ public event Action activeChanged remove { m_InputToEvents.activeChanged -= value; } } + public virtual bool hidden { set @@ -91,11 +81,8 @@ public virtual void Awake() var leftProxyHelper = m_LeftHand.GetComponent(); var rightProxyHelper = m_RightHand.GetComponent(); - m_ProxyMeshRoots = new Dictionary - { - { Node.LeftHand, leftProxyHelper.meshRoot }, - { Node.RightHand, rightProxyHelper.meshRoot } - }; + m_ProxyMeshRoots.Add(leftProxyHelper.meshRoot); + m_ProxyMeshRoots.Add(rightProxyHelper.meshRoot); m_RayOrigins = new Dictionary { @@ -134,27 +121,18 @@ public virtual IEnumerator Start() if (trackedObjectInput == null && m_PlayerInput) trackedObjectInput = m_PlayerInput.GetActions(); - List leftHandRenderers = new List(); - List rightHandRenderers = new List(); - while (leftHandRenderers.Count == 0) + List renderers = new List(); + while (renderers.Count == 0) { yield return null; foreach (var meshRoot in m_ProxyMeshRoots) { - // Only add device renderers and not anything else that is spawned underneath the hand (e.g. menu button, cone/ray) - if (meshRoot.Key == Node.LeftHand) - leftHandRenderers.AddRange(meshRoot.Value.GetComponentsInChildren()); - else if (meshRoot.Key == Node.RightHand) - rightHandRenderers.AddRange(meshRoot.Value.GetComponentsInChildren()); + // Only add models of the device and not anything else that is spawned underneath the hand (e.g. menu button, cone/ray) + renderers.AddRange(meshRoot.GetComponentsInChildren()); } } - foreach (var r in leftHandRenderers) - { - m_Materials.AddRange(MaterialUtils.CloneMaterials(r)); - } - - foreach (var r in rightHandRenderers) + foreach (var r in renderers) { m_Materials.AddRange(MaterialUtils.CloneMaterials(r)); } @@ -164,27 +142,6 @@ public virtual IEnumerator Start() { m.renderQueue = k_RendererQueue; } - - // Perform highlight material setup after default device material setup - var leftHandHighlightMaterial = Instantiate(m_HighlightMaterial); - var rightHandHighlightMaterial = Instantiate(m_HighlightMaterial); - m_HighlightMaterials = new Dictionary - { - { Node.LeftHand, leftHandHighlightMaterial }, - { Node.RightHand, rightHandHighlightMaterial } - }; - - // Add materials to collection after controller material queues have been re-assigned; these material queues shouldn't be altered - m_Materials.Add(leftHandHighlightMaterial); - m_Materials.Add(rightHandHighlightMaterial); - //leftHandHighlightMaterial.SetFloat(k_MaterialAlphaProperty, 1f); - leftHandHighlightMaterial.SetFloat(k_MaterialThicknessProperty, 0f); - //rightHandHighlightMaterial.SetFloat(k_MaterialAlphaProperty, 1f); - rightHandHighlightMaterial.SetFloat(k_MaterialThicknessProperty, 0f); - - AssignDeviceHighlightMaterials(Node.LeftHand, leftHandRenderers, leftHandHighlightMaterial); - AssignDeviceHighlightMaterials(Node.RightHand, rightHandRenderers, rightHandHighlightMaterial); - Debug.Log("Populate object scale in outline material (shader)"); } public virtual void OnDestroy() @@ -193,21 +150,6 @@ public virtual void OnDestroy() ObjectUtils.Destroy(m); } - public virtual void OnDisable() - { - this.StopCoroutine(ref m_HighlightCoroutine); - - // Set highlight material to hidden state in case it is re-enabled - if (m_HighlightMaterials != null && m_HighlightMaterials.Any()) - { - foreach (var pair in m_HighlightMaterials) - { - pair.Value.SetFloat(k_MaterialThicknessProperty, 0f); - break; - } - } - } - public virtual void Update() { if (active) @@ -219,98 +161,6 @@ public virtual void Update() m_RightHand.localRotation = trackedObjectInput.rightRotation.quaternion; } } - - void AssignDeviceHighlightMaterials(Node node, List deviceRenderers, Material deviceHighlightMaterial) - { - foreach (var meshRoot in m_ProxyMeshRoots) - { - // Only add device renderers and not anything else that is spawned underneath the hand (e.g. menu button, cone/ray) - if (meshRoot.Key == node) - { - foreach (var renderer in deviceRenderers) - { - var sharedMaterials = renderer.sharedMaterials; - var materialsWithHighlightAdded = new Material[sharedMaterials.Length + 1]; - for (var i = 0; i < sharedMaterials.Length; i++) - { - materialsWithHighlightAdded[i] = sharedMaterials[i]; - } - materialsWithHighlightAdded[materialsWithHighlightAdded.Length - 1] = deviceHighlightMaterial; - renderer.sharedMaterials = materialsWithHighlightAdded; - } - } - } - } - - public void HighlightDevice (Node deviceNode, GradientPair gradientPair, bool pulseOnThenOff = false) - { - if (m_HighlightMaterials == null) - return; - - Debug.LogWarning("HighlightDevice called!!!"); - - Material deviceMaterial = null; - foreach (var pair in m_HighlightMaterials) - { - if (pair.Key == deviceNode) - { - deviceMaterial = pair.Value; - break; - } - } - - if (!deviceMaterial) - { - Debug.LogWarning("Material was not found for the node : " + deviceNode.ToString()); - return; - } - - this.RestartCoroutine(ref m_HighlightCoroutine, ShowHighlight(deviceMaterial, gradientPair)); - } - - IEnumerator ShowHighlight(Material deviceMaterial, GradientPair gradientPair, bool pulseOnThenOff = false) - { - var currentThickness = deviceMaterial.GetFloat(k_MaterialThicknessProperty); - var currentTopColor = deviceMaterial.GetColor(k_MaterialColorTopProperty); - var currentBottomColor = deviceMaterial.GetColor(k_MaterialColorBottomProperty); - var targetTopColor = gradientPair.a; - var targetBottomColor = gradientPair.b; - var duration = 0f; - while (duration < 1) - { - duration += Time.unscaledDeltaTime * 3f; - var durationShaped = Mathf.Pow(duration, 3); - var topColor = Color.Lerp(currentTopColor, targetTopColor, durationShaped); - var bottomColor = Color.Lerp(currentBottomColor, targetBottomColor, durationShaped); - deviceMaterial.SetFloat(k_MaterialThicknessProperty, Mathf.Lerp(currentThickness, k_TargetHighlightThicknessAmount, durationShaped)); - deviceMaterial.SetColor(k_MaterialColorTopProperty, topColor); - deviceMaterial.SetColor(k_MaterialColorBottomProperty, bottomColor); - yield return null; - } - - deviceMaterial.SetFloat(k_MaterialThicknessProperty, k_TargetHighlightThicknessAmount); - deviceMaterial.SetColor(k_MaterialColorTopProperty, targetTopColor); - deviceMaterial.SetColor(k_MaterialColorBottomProperty, targetBottomColor); - - var pauseDuration = 0.5f; - while (pauseDuration > 0f) - { - pauseDuration -= Time.unscaledDeltaTime; - yield return null; - } - - while (pulseOnThenOff && duration > 0) - { - duration -= Time.unscaledDeltaTime * 0.5f; - var durationShaped = Mathf.Pow(duration, 2); - deviceMaterial.SetFloat(k_MaterialThicknessProperty, Mathf.Lerp(0f, k_TargetHighlightThicknessAmount, durationShaped)); - yield return null; - } - - deviceMaterial.SetFloat(k_MaterialThicknessProperty, pulseOnThenOff ? 0f : k_TargetHighlightThicknessAmount); - - m_HighlightCoroutine = null; - } } } #endif diff --git a/Scripts/Proxies/TwoHandedProxyBase.cs.meta b/Scripts/Proxies/TwoHandedProxyBase.cs.meta index ccd0349cd..c16aa1811 100644 --- a/Scripts/Proxies/TwoHandedProxyBase.cs.meta +++ b/Scripts/Proxies/TwoHandedProxyBase.cs.meta @@ -1,15 +1,10 @@ fileFormatVersion: 2 guid: 1075642011deb9841a2eecf5dc0bd444 -timeCreated: 1489018189 +timeCreated: 1466801922 licenseType: Pro MonoImporter: serializedVersion: 2 - defaultReferences: - - m_LeftHandProxyPrefab: {instanceID: 0} - - m_RightHandProxyPrefab: {instanceID: 0} - - m_PlayerInput: {instanceID: 0} - - m_HighlightMaterial: {fileID: 2100000, guid: 40ce8f85e3653a84abffb13adb986781, - type: 2} + defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index bece28e8d..123c3becd 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -1,6 +1,5 @@ #if UNITY_EDITOR using System; -using UnityEditor.Experimental.EditorVR.Helpers; using UnityEngine; namespace UnityEditor.Experimental.EditorVR @@ -37,18 +36,6 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod public static class IPinnedToolsMenuMethods { - public static Action highlightDevice { get; set; } - - /// - /// Visually highlights an input device - /// - /// This menu's RayOrigin - /// The gradient pair used in the highlight visuals - public static void HighlightDevice(this IPinnedToolsMenu obj, Transform rayOrigin, GradientPair gradientPair) - { - highlightDevice(rayOrigin, gradientPair); - } - public static Action mainMenuActivatorSelected { get; set; } /// From 840c0e3906ccbd59054e8a63de86464c2a58f9a1 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 18 Aug 2017 12:57:02 -0700 Subject: [PATCH 765/870] Perform additional logic and access modifier changes on PinnedTools Menu & button --- .../PinnedToolButton/PinnedToolButton.cs | 18 ++++++------------ Menus/PinnedToolMenu/PinnedToolsMenu.cs | 13 +------------ .../Scripts/PinnedToolsMenuUI.cs | 1 - 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index dc1757d2e..00837d4f2 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -8,7 +8,6 @@ using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.UI; -using UnityEngine.EventSystems; namespace UnityEditor.Experimental.EditorVR.Menus { @@ -16,7 +15,7 @@ public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, IToolt { static Color s_FrameOpaqueColor; - const float k_AlternateLocalScaleMultiplier = 0.85f; //0.64376f meets outer bounds of the radial menu + const float k_AlternateLocalScaleMultiplier = 0.85f; // Meets outer bounds of the radial menu const string k_MaterialColorProperty = "_Color"; const string k_SelectionToolTipText = "Selection Tool (cannot be closed)"; const string k_MainMenuTipText = "Main Menu"; @@ -96,7 +95,7 @@ public GradientPair gradientPair /// public Type previewToolType { - get { return m_PreviewToolType; } + private get { return m_PreviewToolType; } set { m_PreviewToolType = value; @@ -157,7 +156,7 @@ public string tooltipText return tooltip != null ? tooltip.tooltipText : (previewToolType == null ? m_TooltipText : previewToolDescription); } - set { m_TooltipText = value; } + private set { m_TooltipText = value; } } [SerializeField] @@ -255,12 +254,12 @@ public string tooltipText public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu public Func visibleButtonCount { get; set; } public Action destroy { get { return DestroyButton; } } - public Action showAllButtons { get; set; } + public Action showAllButtons { private get; set; } public Action hoverExit { get; set; } public bool isActiveTool { - get { return m_ActiveTool; } + private get { return m_ActiveTool; } set { m_ActiveTool = value; @@ -335,7 +334,7 @@ bool secondaryButtonCollidersEnabled public Sprite icon { - get { return m_Icon; } + private get { return m_Icon; } set { m_PreviewIcon = null; // clear any cached preview icons @@ -435,11 +434,6 @@ void DestroyButton() this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); } - public void OnPointerEnter(PointerEventData eventData) - { - Debug.LogError("Perform Pulse up in PinnedToolsMenu level"); - } - static string GetTypeAbbreviation(Type type) { // Create periodic table-style names for types diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index b78389a54..6ee27e37c 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -55,6 +55,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Action deletePinnedToolButton { get; set; } public Node? node { get; set; } public IPinnedToolButton previewToolButton { get { return m_MainMenuButton; } } + public Transform alternateMenuOrigin { get { return m_AlternateMenuOrigin; } set { m_AlternateMenuOrigin = value; } } public Transform rayOrigin { @@ -73,18 +74,6 @@ public ActionMap actionMap get { return m_MainMenuActionMap; } } - public Transform alternateMenuOrigin - { - get { return m_AlternateMenuOrigin; } - set - { - if (m_AlternateMenuOrigin == value) - return; - - m_AlternateMenuOrigin = value; - } - } - void Awake() { SetButtonForType = CreatePinnedToolButton; diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 2d4124a2c..b2d11d150 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -164,7 +164,6 @@ void Update() } else if (m_AllButtonsVisible && m_SpatialDragDistance > 2) { - //spatialHintScrollVisualsRotation = m_DragTarget; this.SetSpatialHintDragThresholdTriggerPosition(transform.position); this.SetSpatialHintContainerRotation(newHintContainerRotation); this.SetSpatialHintShowHideRotationTarget(m_DragTarget); From f18c1851946fd5505be401b376f8dd57948a5a46 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 18 Aug 2017 12:59:07 -0700 Subject: [PATCH 766/870] Remove ToolFlow testing tools --- Tools/TempTestingTools.meta | 9 --- Tools/TempTestingTools/MakeCubeTool.cs | 33 ---------- Tools/TempTestingTools/MakeCubeTool.cs.meta | 13 ---- Tools/TempTestingTools/MakeCubeToolIcon.png | 3 - .../MakeCubeToolIcon.png.meta | 64 ------------------- Tools/TempTestingTools/MakeSphereTool.cs | 33 ---------- Tools/TempTestingTools/MakeSphereTool.cs.meta | 13 ---- Tools/TempTestingTools/MakeSphereToolIcon.png | 3 - .../MakeSphereToolIcon.png.meta | 64 ------------------- Tools/TempTestingTools/TempToolIcon.png | 3 - Tools/TempTestingTools/TempToolIcon.png.meta | 64 ------------------- Tools/TempTestingTools/ToolFourDemo.cs | 28 -------- Tools/TempTestingTools/ToolFourDemo.cs.meta | 13 ---- Tools/TempTestingTools/ToolOneDemo.cs | 28 -------- Tools/TempTestingTools/ToolOneDemo.cs.meta | 13 ---- Tools/TempTestingTools/ToolThreeDemo.cs | 28 -------- Tools/TempTestingTools/ToolThreeDemo.cs.meta | 13 ---- Tools/TempTestingTools/ToolTwoDemo.cs | 28 -------- Tools/TempTestingTools/ToolTwoDemo.cs.meta | 13 ---- 19 files changed, 466 deletions(-) delete mode 100644 Tools/TempTestingTools.meta delete mode 100644 Tools/TempTestingTools/MakeCubeTool.cs delete mode 100644 Tools/TempTestingTools/MakeCubeTool.cs.meta delete mode 100644 Tools/TempTestingTools/MakeCubeToolIcon.png delete mode 100644 Tools/TempTestingTools/MakeCubeToolIcon.png.meta delete mode 100644 Tools/TempTestingTools/MakeSphereTool.cs delete mode 100644 Tools/TempTestingTools/MakeSphereTool.cs.meta delete mode 100644 Tools/TempTestingTools/MakeSphereToolIcon.png delete mode 100644 Tools/TempTestingTools/MakeSphereToolIcon.png.meta delete mode 100644 Tools/TempTestingTools/TempToolIcon.png delete mode 100644 Tools/TempTestingTools/TempToolIcon.png.meta delete mode 100644 Tools/TempTestingTools/ToolFourDemo.cs delete mode 100644 Tools/TempTestingTools/ToolFourDemo.cs.meta delete mode 100644 Tools/TempTestingTools/ToolOneDemo.cs delete mode 100644 Tools/TempTestingTools/ToolOneDemo.cs.meta delete mode 100644 Tools/TempTestingTools/ToolThreeDemo.cs delete mode 100644 Tools/TempTestingTools/ToolThreeDemo.cs.meta delete mode 100644 Tools/TempTestingTools/ToolTwoDemo.cs delete mode 100644 Tools/TempTestingTools/ToolTwoDemo.cs.meta diff --git a/Tools/TempTestingTools.meta b/Tools/TempTestingTools.meta deleted file mode 100644 index 9f38a6a32..000000000 --- a/Tools/TempTestingTools.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: daaa9a496c116a84f9bc157fa45ddb28 -folderAsset: yes -timeCreated: 1467308457 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/MakeCubeTool.cs b/Tools/TempTestingTools/MakeCubeTool.cs deleted file mode 100644 index f0077b4b1..000000000 --- a/Tools/TempTestingTools/MakeCubeTool.cs +++ /dev/null @@ -1,33 +0,0 @@ -#if UNITY_EDITOR -using UnityEngine; -using UnityEngine.InputNew; - -namespace UnityEditor.Experimental.EditorVR.Tools -{ - [MainMenuItem("Cube", "Create", "Create cubes in the scene")] - //[MainMenuItem(false)] - sealed class MakeCubeTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesSpatialHash, IMenuIcon - { - [SerializeField] - Sprite m_Icon; - - public Transform rayOrigin { get; set; } - public Sprite icon { get { return m_Icon; } } - - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) - { - var standardInput = (Standard)input; - if (standardInput.action.wasJustPressed) - { - var cube = GameObject.CreatePrimitive(PrimitiveType.Cube).transform; - if (rayOrigin) - cube.position = rayOrigin.position + rayOrigin.forward * 5f; - - this.AddToSpatialHash(cube.gameObject); - - consumeControl(standardInput.action); - } - } - } -} -#endif diff --git a/Tools/TempTestingTools/MakeCubeTool.cs.meta b/Tools/TempTestingTools/MakeCubeTool.cs.meta deleted file mode 100644 index 1a778c2f6..000000000 --- a/Tools/TempTestingTools/MakeCubeTool.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 27a3d8dde627a4d409b0dace5c1f3d4d -timeCreated: 1492561820 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: - - m_Icon: {fileID: 21300000, guid: f1cdb8f0b38ef8249b0748264b4db7a4, type: 3} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/MakeCubeToolIcon.png b/Tools/TempTestingTools/MakeCubeToolIcon.png deleted file mode 100644 index 5ec0317fc..000000000 --- a/Tools/TempTestingTools/MakeCubeToolIcon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2b2faf7fd9a724b5351a653f71d8861a5ece438f8349ac8928b1f8efaae8bd90 -size 10771 diff --git a/Tools/TempTestingTools/MakeCubeToolIcon.png.meta b/Tools/TempTestingTools/MakeCubeToolIcon.png.meta deleted file mode 100644 index 9ecc9535b..000000000 --- a/Tools/TempTestingTools/MakeCubeToolIcon.png.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: f1cdb8f0b38ef8249b0748264b4db7a4 -timeCreated: 1472714033 -licenseType: Pro -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - cubemapConvolution: 0 - cubemapConvolutionSteps: 7 - cubemapConvolutionExponent: 1.5 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 2048 - textureSettings: - filterMode: 2 - aniso: 3 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - rGBM: 0 - compressionQuality: 50 - allowsAlphaSplitting: 0 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 5 - buildTargetSettings: - - buildTarget: Standalone - maxTextureSize: 512 - textureFormat: 2 - compressionQuality: 50 - allowsAlphaSplitting: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: EditorVR - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/MakeSphereTool.cs b/Tools/TempTestingTools/MakeSphereTool.cs deleted file mode 100644 index 0acf45709..000000000 --- a/Tools/TempTestingTools/MakeSphereTool.cs +++ /dev/null @@ -1,33 +0,0 @@ -#if UNITY_EDITOR -using UnityEngine; -using UnityEngine.InputNew; - -namespace UnityEditor.Experimental.EditorVR.Tools -{ - [MainMenuItem("Sphere", "Create", "Create spheres in the scene")] - //[MainMenuItem(false)] - sealed class MakeSphereTool : MonoBehaviour, ITool, IStandardActionMap, IUsesRayOrigin, IUsesSpatialHash, IMenuIcon - { - [SerializeField] - Sprite m_Icon; - - public Transform rayOrigin { get; set; } - public Sprite icon { get { return m_Icon; } } - - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) - { - var standardInput = (Standard)input; - if (standardInput.action.wasJustPressed) - { - Transform sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; - if (rayOrigin) - sphere.position = rayOrigin.position + rayOrigin.forward * 5f; - - this.AddToSpatialHash(sphere.gameObject); - - consumeControl(standardInput.action); - } - } - } -} -#endif diff --git a/Tools/TempTestingTools/MakeSphereTool.cs.meta b/Tools/TempTestingTools/MakeSphereTool.cs.meta deleted file mode 100644 index 4ba2d465e..000000000 --- a/Tools/TempTestingTools/MakeSphereTool.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 6b7e16bac5117eb42925bb96b0937dbc -timeCreated: 1492561816 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: - - m_Icon: {fileID: 21300000, guid: aee6b5d653e81ab4aaab2a359a4e6b4b, type: 3} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/MakeSphereToolIcon.png b/Tools/TempTestingTools/MakeSphereToolIcon.png deleted file mode 100644 index 70324cf04..000000000 --- a/Tools/TempTestingTools/MakeSphereToolIcon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9fe931d032a22ae880b6da6325eb903c5463624c7b968095bed251b3c628894e -size 14560 diff --git a/Tools/TempTestingTools/MakeSphereToolIcon.png.meta b/Tools/TempTestingTools/MakeSphereToolIcon.png.meta deleted file mode 100644 index cb1f1ac1f..000000000 --- a/Tools/TempTestingTools/MakeSphereToolIcon.png.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: aee6b5d653e81ab4aaab2a359a4e6b4b -timeCreated: 1472714033 -licenseType: Pro -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - cubemapConvolution: 0 - cubemapConvolutionSteps: 7 - cubemapConvolutionExponent: 1.5 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 2048 - textureSettings: - filterMode: 2 - aniso: 3 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - rGBM: 0 - compressionQuality: 50 - allowsAlphaSplitting: 0 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 5 - buildTargetSettings: - - buildTarget: Standalone - maxTextureSize: 512 - textureFormat: 2 - compressionQuality: 50 - allowsAlphaSplitting: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: EditorVR - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/TempToolIcon.png b/Tools/TempTestingTools/TempToolIcon.png deleted file mode 100644 index 7c0ba70e1..000000000 --- a/Tools/TempTestingTools/TempToolIcon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:005868ccd75153f646bfd28e344c705e9cf53a8e12f4b0be3a20ed9d60f50bec -size 13465 diff --git a/Tools/TempTestingTools/TempToolIcon.png.meta b/Tools/TempTestingTools/TempToolIcon.png.meta deleted file mode 100644 index 7b67033c5..000000000 --- a/Tools/TempTestingTools/TempToolIcon.png.meta +++ /dev/null @@ -1,64 +0,0 @@ -fileFormatVersion: 2 -guid: 1576c75f020bdf04d8e3876527ab767e -timeCreated: 1472714033 -licenseType: Pro -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 2 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 - correctGamma: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 0 - cubemapConvolution: 0 - cubemapConvolutionSteps: 7 - cubemapConvolutionExponent: 1.5 - seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 2048 - textureSettings: - filterMode: 2 - aniso: 3 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - rGBM: 0 - compressionQuality: 50 - allowsAlphaSplitting: 0 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 5 - buildTargetSettings: - - buildTarget: Standalone - maxTextureSize: 512 - textureFormat: 2 - compressionQuality: 50 - allowsAlphaSplitting: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: EditorVR - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/ToolFourDemo.cs b/Tools/TempTestingTools/ToolFourDemo.cs deleted file mode 100644 index 25795e8f1..000000000 --- a/Tools/TempTestingTools/ToolFourDemo.cs +++ /dev/null @@ -1,28 +0,0 @@ -#if UNITY_EDITOR -using System; -using UnityEngine; -using UnityEngine.InputNew; - -namespace UnityEditor.Experimental.EditorVR.Tools -{ - [MainMenuItem("XTool4", "Create", "4 Extra Demo Tool")] - //[MainMenuItem(false)] - sealed class ToolFourDemo : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash - { - public Transform rayOrigin { get; set; } - - public ActionMap actionMap - { - get { return m_ActionMap; } - set { m_ActionMap = value; } - } - - [SerializeField] - private ActionMap m_ActionMap; - - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) - { - } - } -} -#endif diff --git a/Tools/TempTestingTools/ToolFourDemo.cs.meta b/Tools/TempTestingTools/ToolFourDemo.cs.meta deleted file mode 100644 index f36a7e913..000000000 --- a/Tools/TempTestingTools/ToolFourDemo.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 69ab7950a8430ba459c6b9cb0c12b965 -timeCreated: 1466723731 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: - - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/ToolOneDemo.cs b/Tools/TempTestingTools/ToolOneDemo.cs deleted file mode 100644 index bf61419b5..000000000 --- a/Tools/TempTestingTools/ToolOneDemo.cs +++ /dev/null @@ -1,28 +0,0 @@ -#if UNITY_EDITOR -using System; -using UnityEngine; -using UnityEngine.InputNew; - -namespace UnityEditor.Experimental.EditorVR.Tools -{ - [MainMenuItem("XTool1", "Create", "1 Extra Demo Tool")] - //[MainMenuItem(false)] - sealed class ToolOneDemo : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash - { - public Transform rayOrigin { get; set; } - - public ActionMap actionMap - { - get { return m_ActionMap; } - set { m_ActionMap = value; } - } - - [SerializeField] - private ActionMap m_ActionMap; - - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) - { - } - } -} -#endif diff --git a/Tools/TempTestingTools/ToolOneDemo.cs.meta b/Tools/TempTestingTools/ToolOneDemo.cs.meta deleted file mode 100644 index 1a9f887ab..000000000 --- a/Tools/TempTestingTools/ToolOneDemo.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: b4fe0bd8373b6064a9c156d29db1ee26 -timeCreated: 1466723731 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: - - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/ToolThreeDemo.cs b/Tools/TempTestingTools/ToolThreeDemo.cs deleted file mode 100644 index 86acb5528..000000000 --- a/Tools/TempTestingTools/ToolThreeDemo.cs +++ /dev/null @@ -1,28 +0,0 @@ -#if UNITY_EDITOR -using System; -using UnityEngine; -using UnityEngine.InputNew; - -namespace UnityEditor.Experimental.EditorVR.Tools -{ - [MainMenuItem("XTool3", "Create", "3 Extra Demo Tool")] - //[MainMenuItem(false)] - sealed class ToolThreeDemo : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash - { - public Transform rayOrigin { get; set; } - - public ActionMap actionMap - { - get { return m_ActionMap; } - set { m_ActionMap = value; } - } - - [SerializeField] - private ActionMap m_ActionMap; - - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) - { - } - } -} -#endif diff --git a/Tools/TempTestingTools/ToolThreeDemo.cs.meta b/Tools/TempTestingTools/ToolThreeDemo.cs.meta deleted file mode 100644 index 1e7626231..000000000 --- a/Tools/TempTestingTools/ToolThreeDemo.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: dde6653c14b4ff04fa5e5f7da36a6662 -timeCreated: 1466723731 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: - - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Tools/TempTestingTools/ToolTwoDemo.cs b/Tools/TempTestingTools/ToolTwoDemo.cs deleted file mode 100644 index 2aebd209d..000000000 --- a/Tools/TempTestingTools/ToolTwoDemo.cs +++ /dev/null @@ -1,28 +0,0 @@ -#if UNITY_EDITOR -using System; -using UnityEngine; -using UnityEngine.InputNew; - -namespace UnityEditor.Experimental.EditorVR.Tools -{ - [MainMenuItem("XTool2", "Create", "2 Extra Demo Tool")] - //[MainMenuItem(false)] - sealed class ToolTwoDemo : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IUsesSpatialHash - { - public Transform rayOrigin { get; set; } - - public ActionMap actionMap - { - get { return m_ActionMap; } - set { m_ActionMap = value; } - } - - [SerializeField] - private ActionMap m_ActionMap; - - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) - { - } - } -} -#endif diff --git a/Tools/TempTestingTools/ToolTwoDemo.cs.meta b/Tools/TempTestingTools/ToolTwoDemo.cs.meta deleted file mode 100644 index 21c6f5ae5..000000000 --- a/Tools/TempTestingTools/ToolTwoDemo.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: 09fb1e013aeb79e4ea15dd294ba654a9 -timeCreated: 1466723731 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: - - m_ActionMap: {fileID: 11400000, guid: e6bb2b6464c6f6048a424e326e2f2d89, type: 2} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 7e3185f0c47d9e1fce45fd74a8c56d4a0363255d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Sat, 19 Aug 2017 02:53:55 -0400 Subject: [PATCH 767/870] Combine MenuHideFlags with show/hide times into MenuHideData class to eliminate allocations in UpdateMenuVisibilities, etc. --- Scripts/Core/EditorVR.Menus.cs | 122 ++++++++++++++++++--------------- Scripts/Core/EditorVR.Tools.cs | 21 ++---- Scripts/Core/EditorVR.cs | 6 +- 3 files changed, 74 insertions(+), 75 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 88907ebdd..fd806c124 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -35,6 +35,13 @@ internal enum MenuHideFlags Temporary = OverUI | OverWorkspace | HasDirectSelection } + internal class MenuHideData + { + public MenuHideFlags hideFlags = Menus.MenuHideFlags.Hidden; + public float autoHideTime; + public float autoShowTime; + } + const float k_MenuHideMargin = 0.075f; const float k_TwoHandHideDistance = 0.25f; const int k_PossibleOverlaps = 16; @@ -47,7 +54,6 @@ internal enum MenuHideFlags readonly List m_ActiveDeviceData = new List(); readonly List m_WorkspaceComponents = new List(); readonly Collider[] m_WorkspaceOverlaps = new Collider[k_PossibleOverlaps]; - static readonly List k_Menus = new List(); public Menus() { @@ -94,7 +100,7 @@ public void LateBindInterfaceMethods(Tools provider) static void UpdateAlternateMenuForDevice(DeviceData deviceData) { var alternateMenu = deviceData.alternateMenu; - alternateMenu.visible = deviceData.menuHideFlags[alternateMenu] == 0 && !(deviceData.currentTool is IExclusiveMode); + alternateMenu.visible = deviceData.menuHideData[alternateMenu].hideFlags == 0 && !(deviceData.currentTool is IExclusiveMode); // Move the activator button to an alternate position if the alternate menu will be shown var mainMenuActivator = deviceData.mainMenuActivator; @@ -117,11 +123,18 @@ internal void UpdateMenuVisibilities() var alternateMenu = deviceData.alternateMenu; var mainMenu = deviceData.mainMenu; var customMenu = deviceData.customMenu; - var menuHideFlags = deviceData.menuHideFlags; + var menuHideData = deviceData.menuHideData; + MenuHideData customMenuHideData = null; - var mainMenuVisible = mainMenu != null && (menuHideFlags[mainMenu] & MenuHideFlags.Hidden) == 0; - var customMenuVisible = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.Hidden) == 0 && (menuHideFlags[customMenu] & MenuHideFlags.OtherMenu) == 0; - var alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; + var mainMenuVisible = mainMenu != null && (menuHideData[mainMenu].hideFlags & MenuHideFlags.Hidden) == 0; + var alternateMenuVisible = alternateMenu != null && (menuHideData[alternateMenu].hideFlags & MenuHideFlags.Hidden) == 0; + var customMenuVisible = false; + if (customMenu != null) + { + customMenuHideData = menuHideData[customMenu]; + var customMenuHideFlags = customMenuHideData.hideFlags; + customMenuVisible = (customMenuHideFlags & MenuHideFlags.Hidden) == 0 && (customMenuHideFlags & MenuHideFlags.OtherMenu) == 0; + } if (alternateMenuVisible && (mainMenuVisible || customMenuVisible)) { @@ -136,7 +149,7 @@ internal void UpdateMenuVisibilities() } if (customMenuVisible && (mainMenuVisible || alternateMenuVisible)) - menuHideFlags[customMenu] |= MenuHideFlags.OtherMenu; + customMenuHideData.hideFlags |= MenuHideFlags.OtherMenu; Array.Clear(m_WorkspaceOverlaps, 0, m_WorkspaceOverlaps.Length); var hoveringWorkspace = false; @@ -159,12 +172,11 @@ internal void UpdateMenuVisibilities() } } - var menus = menuHideFlags.Keys.ToList(); - foreach (var menu in menus) + foreach (var kvp in menuHideData) { // Only set if hidden--value is reset every frame if (hoveringWorkspace) - menuHideFlags[menu] |= MenuHideFlags.OverWorkspace; + kvp.Value.hideFlags |= MenuHideFlags.OverWorkspace; } var rayOrigin = deviceData.rayOrigin; @@ -173,10 +185,10 @@ internal void UpdateMenuVisibilities() var hasDirectSelection = heldObjects != null && heldObjects.Count > 0; if (hasDirectSelection) { - foreach (var menu in menus) + foreach (var kvp in menuHideData) { // Only set if hidden--value is reset every frame - menuHideFlags[menu] |= MenuHideFlags.HasDirectSelection; + kvp.Value.hideFlags |= MenuHideFlags.HasDirectSelection; } if (alternateMenuVisible) @@ -194,12 +206,10 @@ internal void UpdateMenuVisibilities() if (directSelection.IsHovering(otherRayOrigin) || directSelection.IsScaling(otherRayOrigin) || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * viewerScale) { - var otherHideFlags = otherDeviceData.menuHideFlags; - var otherMenus = otherHideFlags.Keys.ToList(); - foreach (var menu in otherMenus) + foreach (var kvp in otherDeviceData.menuHideData) { // Only set if hidden--value is reset every frame - otherHideFlags[menu] |= MenuHideFlags.HasDirectSelection; + kvp.Value.hideFlags |= MenuHideFlags.HasDirectSelection; } break; } @@ -210,16 +220,14 @@ internal void UpdateMenuVisibilities() // Set show/hide timings foreach (var deviceData in m_ActiveDeviceData) { - var menuHideFlags = deviceData.menuHideFlags; - var menus = menuHideFlags.Keys.ToList(); - foreach (var menu in menus) + foreach (var kvp in deviceData.menuHideData) { - var hideFlags = menuHideFlags[menu]; + var hideFlags = kvp.Value.hideFlags; if ((hideFlags & ~MenuHideFlags.Hidden & ~MenuHideFlags.OtherMenu) == 0) - deviceData.menuAutoHideTimes[menu] = Time.time; + kvp.Value.autoHideTime = Time.time; if (hideFlags != 0) - deviceData.menuAutoShowTimes[menu] = Time.time; + kvp.Value.autoShowTime = Time.time; } } @@ -227,7 +235,8 @@ internal void UpdateMenuVisibilities() foreach (var deviceData in m_ActiveDeviceData) { var mainMenu = deviceData.mainMenu; - var mainMenuHideFlags = deviceData.menuHideFlags[mainMenu]; + var mainMenuHideData = deviceData.menuHideData[mainMenu]; + var mainMenuHideFlags = mainMenuHideData.hideFlags; //Hide the main menu if any hideflags are set; if the menu is focused, only hide if Hidden is set (e.g. not temporary) if (mainMenuHideFlags != 0 && ((mainMenuHideFlags & MenuHideFlags.Hidden) != 0 || !mainMenu.focus)) { @@ -235,12 +244,12 @@ internal void UpdateMenuVisibilities() { mainMenu.visible = false; } - else if (Time.time > deviceData.menuAutoHideTimes[mainMenu] + k_MainMenuAutoHideDelay) + else if (Time.time > mainMenuHideData.autoHideTime + k_MainMenuAutoHideDelay) { mainMenu.visible = false; } } - else if (Time.time > deviceData.menuAutoShowTimes[mainMenu] + k_MainMenuAutoShowDelay) + else if (Time.time > mainMenuHideData.autoShowTime + k_MainMenuAutoShowDelay) { mainMenu.visible = true; } @@ -249,7 +258,7 @@ internal void UpdateMenuVisibilities() var customMenu = deviceData.customMenu; if (customMenu != null) - customMenu.visible = deviceData.menuHideFlags[customMenu] == 0; + customMenu.visible = deviceData.menuHideData[customMenu].hideFlags == 0; UpdateAlternateMenuForDevice(deviceData); Rays.UpdateRayForDevice(deviceData, deviceData.rayOrigin); @@ -258,11 +267,9 @@ internal void UpdateMenuVisibilities() // Reset Temporary states foreach (var deviceData in m_ActiveDeviceData) { - var menuHideFlags = deviceData.menuHideFlags; - var menus = menuHideFlags.Keys.ToList(); - foreach (var menu in menus) + foreach (var kvp in deviceData.menuHideData) { - menuHideFlags[menu] &= ~MenuHideFlags.Temporary; + kvp.Value.hideFlags &= ~MenuHideFlags.Temporary; } } @@ -290,26 +297,24 @@ internal static bool IsValidHover(MultipleRayInputModule.RaycastSource source) return false; var scaledPointerDistance = eventData.pointerCurrentRaycast.distance / Viewer.GetViewerScale(); - var menuHideFlags = deviceData.menuHideFlags; + var menuHideFlags = deviceData.menuHideData; var mainMenu = deviceData.mainMenu; IMenu openMenu = mainMenu; - if (deviceData.customMenu != null && menuHideFlags[mainMenu] != 0) + if (deviceData.customMenu != null && menuHideFlags[mainMenu].hideFlags != 0) openMenu = deviceData.customMenu; if (scaledPointerDistance < openMenu.localBounds.size.y + k_MenuHideMargin) { - k_Menus.Clear(); - k_Menus.AddRange(menuHideFlags.Keys); - foreach (var menu in k_Menus) + foreach (var kvp in menuHideFlags) { // Only set if hidden--value is reset every frame - menuHideFlags[menu] |= MenuHideFlags.OverUI; + kvp.Value.hideFlags |= MenuHideFlags.OverUI; } return true; } - return (menuHideFlags[openMenu] & MenuHideFlags.Hidden) != 0; + return (menuHideFlags[openMenu].hideFlags & MenuHideFlags.Hidden) != 0; } return true; @@ -327,21 +332,23 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl { Rays.ForEachProxyDevice(deviceData => { - var menuHideFlags = deviceData.menuHideFlags; + var menuHideFlags = deviceData.menuHideData; var alternateMenu = deviceData.alternateMenu; if (alternateMenu != null) { - var alternateMenuFlags = menuHideFlags[alternateMenu]; - menuHideFlags[alternateMenu] = (deviceData.rayOrigin == rayOrigin) && visible ? alternateMenuFlags & ~MenuHideFlags.Hidden : alternateMenuFlags | MenuHideFlags.Hidden; + var alternateMenuData = menuHideFlags[alternateMenu]; + var alternateMenuFlags = alternateMenuData.hideFlags; + alternateMenuData.hideFlags = (deviceData.rayOrigin == rayOrigin) + && visible ? alternateMenuFlags & ~MenuHideFlags.Hidden + : alternateMenuFlags | MenuHideFlags.Hidden; - if ((menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) != 0) + if ((alternateMenuData.hideFlags & MenuHideFlags.Hidden) != 0) { var customMenu = deviceData.customMenu; - if (customMenu != null && (menuHideFlags[deviceData.mainMenu] & MenuHideFlags.Hidden) != 0) - { - menuHideFlags[customMenu] &= ~MenuHideFlags.OtherMenu; - } + if (customMenu != null && + (menuHideFlags[deviceData.mainMenu].hideFlags & MenuHideFlags.Hidden) != 0) + menuHideFlags[customMenu].hideFlags &= ~MenuHideFlags.OtherMenu; } } }); @@ -359,22 +366,25 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform { var customMenu = deviceData.customMenu; var alternateMenu = deviceData.alternateMenu; - var menuHideFlags = deviceData.menuHideFlags; - var alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; + var menuHideData = deviceData.menuHideData; + var mainMenuHideData = menuHideData[mainMenu]; + var alternateMenuVisible = alternateMenu != null + && (menuHideData[alternateMenu].hideFlags & MenuHideFlags.Hidden) == 0; - deviceData.menuAutoShowTimes[mainMenu] = 0; + mainMenuHideData.autoShowTime = 0; if (deviceData.rayOrigin == rayOrigin) { - menuHideFlags[mainMenu] ^= MenuHideFlags.Hidden; + mainMenuHideData.hideFlags ^= MenuHideFlags.Hidden; mainMenu.targetRayOrigin = targetRayOrigin; mainMenu.SendVisibilityPulse(); } else { - menuHideFlags[mainMenu] |= MenuHideFlags.Hidden; + mainMenuHideData.hideFlags |= MenuHideFlags.Hidden; - var customMenuOverridden = customMenu != null && (menuHideFlags[customMenu] & MenuHideFlags.OtherMenu) != 0; + var customMenuOverridden = customMenu != null && + (menuHideData[customMenu].hideFlags & MenuHideFlags.OtherMenu) != 0; // Move alternate menu if overriding custom menu if (customMenuOverridden && alternateMenuVisible) { @@ -389,10 +399,10 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform } } - alternateMenuVisible = alternateMenu != null && (menuHideFlags[alternateMenu] & MenuHideFlags.Hidden) == 0; - var mainMenuVisible = (menuHideFlags[mainMenu] & MenuHideFlags.Hidden) == 0; + alternateMenuVisible = alternateMenu != null && (menuHideData[alternateMenu].hideFlags & MenuHideFlags.Hidden) == 0; + var mainMenuVisible = (menuHideData[mainMenu].hideFlags & MenuHideFlags.Hidden) == 0; if (customMenu != null && !alternateMenuVisible && !mainMenuVisible) - menuHideFlags[customMenu] &= ~MenuHideFlags.OtherMenu; + menuHideData[customMenu].hideFlags &= ~MenuHideFlags.OtherMenu; } } } @@ -416,7 +426,7 @@ static GameObject InstantiateMenuUI(Transform rayOrigin, IMenu prefab) var customMenu = go.GetComponent(); deviceData.customMenu = customMenu; - deviceData.menuHideFlags[customMenu] = 0; + deviceData.menuHideData[customMenu].hideFlags = 0; } } } @@ -487,7 +497,7 @@ static bool IsMainMenuVisible(Transform rayOrigin) foreach (var deviceData in evr.m_DeviceData) { if (deviceData.rayOrigin == rayOrigin) - return (deviceData.menuHideFlags[deviceData.mainMenu] & MenuHideFlags.Hidden) == 0; + return (deviceData.menuHideData[deviceData.mainMenu].hideFlags & MenuHideFlags.Hidden) == 0; } return false; diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 14ce9a1d0..971ec0584 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && UNITY_EDITORVR +#if UNITY_EDITOR && UNITY_EDITORVR using System; using System.Collections.Generic; using System.Linq; @@ -100,10 +100,10 @@ internal static void SpawnDefaultTools(IProxy proxy) } } - var menuHideFlags = deviceData.menuHideFlags; + var menuHideData = deviceData.menuHideData; var mainMenu = Menus.SpawnMainMenu(typeof(MainMenu), inputDevice, false, out deviceData.mainMenuInput); deviceData.mainMenu = mainMenu; - menuHideFlags[mainMenu] = Menus.MenuHideFlags.Hidden; + menuHideData[mainMenu] = new Menus.MenuHideData(); var mainMenuActivator = Menus.SpawnMainMenuActivator(inputDevice); deviceData.mainMenuActivator = mainMenuActivator; @@ -117,17 +117,8 @@ internal static void SpawnDefaultTools(IProxy proxy) var alternateMenu = Menus.SpawnAlternateMenu(typeof(RadialMenu), inputDevice, out deviceData.alternateMenuInput); deviceData.alternateMenu = alternateMenu; - menuHideFlags[alternateMenu] = Menus.MenuHideFlags.Hidden; + menuHideData[alternateMenu] = new Menus.MenuHideData(); alternateMenu.itemWasSelected += Menus.UpdateAlternateMenuOnSelectionChanged; - - var autoHideTimes = deviceData.menuAutoHideTimes; - var autoShowTimes = deviceData.menuAutoShowTimes; - foreach (var kvp in menuHideFlags) - { - var menu = kvp.Key; - autoHideTimes[menu] = 0; - autoShowTimes[menu] = 0; - } } evr.GetModule().UpdatePlayerHandleMaps(); @@ -242,7 +233,7 @@ static bool SelectTool(Transform rayOrigin, Type toolType) } else { - deviceData.menuHideFlags[deviceData.mainMenu] |= Menus.MenuHideFlags.Hidden; + deviceData.menuHideData[deviceData.mainMenu].hideFlags |= Menus.MenuHideFlags.Hidden; } }); @@ -287,7 +278,7 @@ static void DespawnTool(DeviceData deviceData, ITool tool) var customMenu = otherDeviceData.customMenu; if (customMenu != null) { - otherDeviceData.menuHideFlags.Remove(customMenu); + otherDeviceData.menuHideData.Remove(customMenu); otherDeviceData.customMenu = null; } } diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 9c9dc4460..016e1b7b1 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; using System.Collections; using System.Collections.Generic; @@ -79,9 +79,7 @@ class DeviceData public ITool currentTool; public IMenu customMenu; public PinnedToolButton previousToolButton; - public readonly Dictionary menuHideFlags = new Dictionary(); - public readonly Dictionary menuAutoHideTimes = new Dictionary(); - public readonly Dictionary menuAutoShowTimes = new Dictionary(); + public readonly Dictionary menuHideData = new Dictionary(); } class Nested From 1802d4349be5bb6863f60da32d4e2eb4515bcef7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 21 Aug 2017 03:20:05 -0700 Subject: [PATCH 768/870] Add support for scroll hint line expansion from the center of scroll trigger location. --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 +- .../IControlSpatialScrolling.cs | 7 +++--- .../SpatialHintModule/SpatialHintModule.cs | 9 +++++++ .../SpatialHintModule/SpatialHintModuleUI.cs | 25 ++++++++++++++++++- .../SpatialHintModule/SpatialHintUI.prefab | 7 ++---- .../SpatialScrollModule.cs | 11 +++++--- 6 files changed, 47 insertions(+), 14 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 6ee27e37c..1e5781d17 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -179,7 +179,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (!m_PinnedToolsMenuUI.allButtonsVisible) { m_PinnedToolsMenuUI.spatialDragDistance = m_SpatialScrollData.dragDistance; - this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Scrolling); + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.CenteredScrolling); m_PinnedToolsMenuUI.allButtonsVisible = true; } else if (m_SpatialScrollData.spatialDirection != null) diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs index f67f5e89d..00f70c383 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs @@ -14,7 +14,7 @@ public interface IControlSpatialScrolling public static class IControlSpatialScrollingMethods { internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDelegate (object caller, Node? node, Vector3 startingPosition, - Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1); + Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true); internal static PerformSpatialScrollDelegate performSpatialScroll { private get; set; } /// @@ -27,11 +27,12 @@ internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDele /// The length at which a scroll action will return a repeating/looping value /// The number of items being scrolled through with this action /// The maximum number of items that can be scrolled through for this action + /// If true, expand the scroll line visuals outward in both directions from the scroll start position /// The spatial scroll data for a single scroll action, but an individual caller object public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IControlSpatialHinting obj, object caller, Node? node, - Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) + Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true) { - return performSpatialScroll(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount); + return performSpatialScroll(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerVisuals); } internal delegate void EndSpatialScrollDelegate (object caller); diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index 8ce6d7a9f..423c2e6be 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -14,6 +14,7 @@ public enum SpatialHintStateFlags Hidden = 1 << 0, PreDragReveal = 1 << 1, Scrolling = 1 << 2, + CenteredScrolling = 2 << 3, } [SerializeField] @@ -31,15 +32,23 @@ public SpatialHintStateFlags state switch (m_State) { case SpatialHintStateFlags.Hidden: + m_SpatialHintModuleUI.centeredScrolling = false; m_SpatialHintModuleUI.preScrollArrowsVisible = false; m_SpatialHintModuleUI.secondaryArrowsVisible = false; controllingRayOrigin = null; break; case SpatialHintStateFlags.PreDragReveal: + m_SpatialHintModuleUI.centeredScrolling = false; m_SpatialHintModuleUI.preScrollArrowsVisible = true; m_SpatialHintModuleUI.secondaryArrowsVisible = true; break; case SpatialHintStateFlags.Scrolling: + m_SpatialHintModuleUI.centeredScrolling = false; + m_SpatialHintModuleUI.preScrollArrowsVisible = false; + m_SpatialHintModuleUI.scrollVisualsVisible = true; + break; + case SpatialHintStateFlags.CenteredScrolling: + m_SpatialHintModuleUI.centeredScrolling = true; m_SpatialHintModuleUI.preScrollArrowsVisible = false; m_SpatialHintModuleUI.scrollVisualsVisible = true; break; diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs index 790665a9e..2d4343ac4 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs @@ -181,6 +181,12 @@ public Node? controllingNode /// public Transform contentContainer { get { return transform; } } + /// + /// If TRUE, expand scroll hint arrows from center of initial scroll trigger. + /// If FALSE, draw scroll hint line visuals along the line the user is defining + /// + public bool centeredScrolling { get; set; } + void Awake() { m_ScrollVisualsTransform = m_ScrollVisualsCanvasGroup.transform; @@ -206,6 +212,8 @@ IEnumerator ShowScrollVisuals() var targetLocalScale = Vector3.one; var currentAlpha = m_ScrollVisualsCanvasGroup.alpha; var secondArrowCurrentPosition = m_ScrollVisualsDragTargetArrowTransform.position; + Vector3 scrollVisualsDragTargetArrowTransformOrigin; + Vector3 scrollVisualsDragTargetArrowTransformDestination; while (currentDuration < kTargetDuration) { @@ -220,7 +228,22 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsDragTargetArrowTransform.position - m_ScrollVisualsTransform.position); m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsTransform.position - m_ScrollVisualsDragTargetArrowTransform.position); m_ScrollVisualsTransform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedDuration); - var lineRendererPositions = new[] { m_ScrollVisualsTransform.position, m_ScrollVisualsDragTargetArrowTransform.position }; + + scrollVisualsDragTargetArrowTransformOrigin = m_ScrollVisualsTransform.position; + scrollVisualsDragTargetArrowTransformDestination = m_ScrollVisualsDragTargetArrowTransform.position; + if (centeredScrolling) + { + Vector3 offset = (scrollVisualsDragTargetArrowTransformOrigin - scrollVisualsDragTargetArrowTransformDestination) * -1; + var distance = (scrollVisualsDragTargetArrowTransformOrigin - scrollVisualsDragTargetArrowTransformDestination).magnitude; + // Increase the initial line position separation for scrolls of a smaller magnitude + // This mandates a sully visible scroll line, regardless of scroll start/end magnitude + var distanceShaped = Mathf.Clamp(2 - distance * 0.175f, 0.75f, 2f); + offset *= distanceShaped; + scrollVisualsDragTargetArrowTransformOrigin -= offset; + scrollVisualsDragTargetArrowTransformDestination += offset; + } + + var lineRendererPositions = new[] { scrollVisualsDragTargetArrowTransformOrigin, scrollVisualsDragTargetArrowTransformDestination }; m_ScrollHintLine.Positions = lineRendererPositions; m_ScrollHintLine.LineWidth = shapedDuration * this.GetViewerScale(); diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab index 06e1cb050..0035d19d3 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.prefab @@ -1588,7 +1588,7 @@ MonoBehaviour: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1981198264515682} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: @@ -1731,11 +1731,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 432cb07647e3e974aaf3aa9c640af385, type: 3} m_Name: m_EditorClassIdentifier: - m_HideOnInitialize: 1 m_ScrollLineRenderer: {fileID: 114922285208366486} - m_LineWidth: 1 m_VisibleColor: {r: 0, g: 0, b: 0, a: 0.42745098} - m_HiddenColor: {r: 1, g: 1, b: 1, a: 1} m_PulseColor: {r: 1, g: 1, b: 1, a: 1} m_MeshRenderer: {fileID: 23475728828767504} --- !u!114 &114403956001920920 @@ -2280,7 +2277,7 @@ MonoBehaviour: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1404278696444272} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index 0493e1d59..1f5593123 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -15,7 +15,7 @@ public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, ICont public class SpatialScrollData { - public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) + public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true) { this.caller = caller; this.node = node; @@ -24,6 +24,7 @@ public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Ve this.repeatingScrollLengthRange = repeatingScrollLengthRange; this.scrollableItemCount = scrollableItemCount; this.maxItemCount = maxItemCount; + this.centerVisuals = centerVisuals; spatialDirection = null; } @@ -35,6 +36,7 @@ public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Ve public float repeatingScrollLengthRange { get; set; } public int scrollableItemCount { get; set; } public int maxItemCount { get; set; } + public bool centerVisuals { get; set; } // Values populated by scroll processing public Vector3? spatialDirection { get; set; } @@ -55,7 +57,7 @@ void Awake() m_ScrollData = new Dictionary(); } - internal SpatialScrollData PerformScroll(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1) + internal SpatialScrollData PerformScroll(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerScrollVisuals = true) { // Continue processing of spatial scrolling for a given caller, // Or create new instance of scroll data for new callers. (Initial structure for support of simultaneous callers) @@ -72,7 +74,7 @@ internal SpatialScrollData PerformScroll(object caller, Node? node, Vector3 star if (spatialScrollData == null) { - spatialScrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount); + spatialScrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerScrollVisuals); m_ScrollData.Add(caller, spatialScrollData); } @@ -81,7 +83,8 @@ internal SpatialScrollData PerformScroll(object caller, Node? node, Vector3 star SpatialScrollData ProcessSpatialScrolling(SpatialScrollData scrollData) { - var directionVector = scrollData.currentPosition - scrollData.startingPosition; + var currentPosition = scrollData.currentPosition; + var directionVector = currentPosition - scrollData.startingPosition; if (scrollData.spatialDirection == null) { var newDirectionVectorThreshold = 0.0175f; // Initial magnitude beyond which spatial scrolling will be evaluated From 577da3281f8ea28757077923992212a87e0e25b1 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 21 Aug 2017 13:28:50 -0400 Subject: [PATCH 769/870] Fix custom menus; Remove LineRenderer color setting on DefaultProxyRay --- Prefabs/DefaultProxyRay.prefab | 4 ++-- Scripts/Core/EditorVR.Menus.cs | 4 ++-- Scripts/Modules/HighlightModule/HighlightModule.cs | 2 +- Scripts/Proxies/DefaultProxyRay.cs | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Prefabs/DefaultProxyRay.prefab b/Prefabs/DefaultProxyRay.prefab index f86dad478..219263624 100644 --- a/Prefabs/DefaultProxyRay.prefab +++ b/Prefabs/DefaultProxyRay.prefab @@ -470,8 +470,8 @@ MonoBehaviour: m_Positions: - {x: 0, y: 0, z: 0} - {x: 0, y: 0, z: 1} - m_ColorStart: {r: 0, g: 0.7372549, b: 0.83137256, a: 1} - m_ColorEnd: {r: 0, g: 0.7372549, b: 0.83137256, a: 1} + m_ColorStart: {r: 1, g: 1, b: 1, a: 1} + m_ColorEnd: {r: 1, g: 1, b: 1, a: 1} m_WidthStart: 0.02 m_WidthEnd: 0.02 m_WorldSpaceData: 0 diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index fd806c124..e4143349a 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -37,7 +37,7 @@ internal enum MenuHideFlags internal class MenuHideData { - public MenuHideFlags hideFlags = Menus.MenuHideFlags.Hidden; + public MenuHideFlags hideFlags = MenuHideFlags.Hidden; public float autoHideTime; public float autoShowTime; } @@ -426,7 +426,7 @@ static GameObject InstantiateMenuUI(Transform rayOrigin, IMenu prefab) var customMenu = go.GetComponent(); deviceData.customMenu = customMenu; - deviceData.menuHideData[customMenu].hideFlags = 0; + deviceData.menuHideData[customMenu] = new MenuHideData { hideFlags = 0 }; } } } diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs b/Scripts/Modules/HighlightModule/HighlightModule.cs index 0cea62bf4..ed1bd4779 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -43,7 +43,7 @@ void Awake() { var selectionColor = MaterialUtils.PrefToColor(EditorPrefs.GetString(k_SelectionOutlinePrefsKey)); selectionColor.a = 1; - m_RayHighlightMaterial.color = selectionColor.gamma; + m_RayHighlightMaterial.color = selectionColor; } } diff --git a/Scripts/Proxies/DefaultProxyRay.cs b/Scripts/Proxies/DefaultProxyRay.cs index 1761b10c1..17396b715 100644 --- a/Scripts/Proxies/DefaultProxyRay.cs +++ b/Scripts/Proxies/DefaultProxyRay.cs @@ -91,7 +91,6 @@ public void SetLength(float length) public void SetColor(Color c) { - m_LineRenderer.SetColors(c, c); m_RayMaterial.color = c; } From 99b07c51fd1bf5c2164c610e3c95f6007dad3b65 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 21 Aug 2017 14:35:22 -0400 Subject: [PATCH 770/870] Migrate HueShift code to a MaterialUtils method --- Scripts/Utilities/MaterialUtils.cs | 10 +++++++++- Tools/SelectionTool/SelectionTool.cs | 7 ++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Scripts/Utilities/MaterialUtils.cs b/Scripts/Utilities/MaterialUtils.cs index 24368da95..6ea7695a8 100644 --- a/Scripts/Utilities/MaterialUtils.cs +++ b/Scripts/Utilities/MaterialUtils.cs @@ -72,7 +72,7 @@ public static Color HexToColor(string hex) public static Color PrefToColor(string pref) { - string[] split = pref.Split(';'); + var split = pref.Split(';'); if (split.Length != 5) { Debug.LogError("Parsing PrefColor failed"); @@ -105,6 +105,14 @@ public static Color RandomColor() return new Color(r, g, b); } + public static Color HueShift(Color color, float shift) + { + Vector3 hsv; + Color.RGBToHSV(color, out hsv.x, out hsv.y, out hsv.z); + hsv.x = Mathf.Repeat(hsv.x + shift, 1f); + return Color.HSVToRGB(hsv.x, hsv.y, hsv.z); + } + public static void SetObjectColor(GameObject obj, Color col) { var material = new UnityMaterial(obj.GetComponent().sharedMaterial); diff --git a/Tools/SelectionTool/SelectionTool.cs b/Tools/SelectionTool/SelectionTool.cs index f151be24d..edf7bd911 100644 --- a/Tools/SelectionTool/SelectionTool.cs +++ b/Tools/SelectionTool/SelectionTool.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && UNITY_EDITORVR +#if UNITY_EDITOR && UNITY_EDITORVR using System; using System.Collections.Generic; using System.Linq; @@ -55,10 +55,7 @@ void Start() { m_NormalRayColor = this.GetDefaultRayColor(rayOrigin); m_MultiselectRayColor = m_NormalRayColor; - Vector3 hsv; - Color.RGBToHSV(m_MultiselectRayColor, out hsv.x, out hsv.y, out hsv.z); - hsv.x = Mathf.Repeat(hsv.x + k_MultiselectHueShift, 1f); - m_MultiselectRayColor = Color.HSVToRGB(hsv.x, hsv.y, hsv.z); + m_MultiselectRayColor = MaterialUtils.HueShift(m_MultiselectRayColor, k_MultiselectHueShift); tooltipTarget = ObjectUtils.CreateEmptyGameObject("SelectionTool Tooltip Target", rayOrigin).transform; tooltipTarget.localPosition = k_TooltipPosition; From 12f8bedddec4ed183ea0235cf78156a18cb39638 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 21 Aug 2017 14:45:07 -0400 Subject: [PATCH 771/870] Rename MainMenuActivator.disabled to interactable and invert usages --- Scripts/Core/EditorVR.Menus.cs | 4 ++-- Scripts/UI/MainMenuActivator.cs | 25 ++++++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index e4143349a..cb92ab609 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -254,7 +254,7 @@ internal void UpdateMenuVisibilities() mainMenu.visible = true; } - deviceData.mainMenuActivator.disabled = (mainMenuHideFlags & MenuHideFlags.Temporary) != 0; + deviceData.mainMenuActivator.interactable = (mainMenuHideFlags & MenuHideFlags.Temporary) == 0; var customMenu = deviceData.customMenu; if (customMenu != null) @@ -356,7 +356,7 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetRayOrigin) { - if (evr.m_DeviceData.Any(deviceData => deviceData.rayOrigin == rayOrigin && deviceData.mainMenuActivator.disabled)) + if (evr.m_DeviceData.Any(deviceData => deviceData.rayOrigin == rayOrigin && !deviceData.mainMenuActivator.interactable)) return; foreach (var deviceData in evr.m_DeviceData) diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index b4565ffaf..b3d959631 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -14,7 +14,7 @@ sealed class MainMenuActivator : MonoBehaviour, IPointerEnterHandler, IPointerEx IUsesMenuOrigins, IControlHaptics, IUsesHandedRayOrigin, ITooltip, ITooltipPlacement { readonly Vector3 m_OriginalActivatorLocalPosition = new Vector3(0f, 0f, -0.075f); - static readonly float k_AlternateLocationOffset = 0.06f; + const float k_AlternateLocationOffset = 0.06f; public Transform alternateMenuOrigin { @@ -80,7 +80,7 @@ public bool activatorButtonMoveAway Coroutine m_ActivatorMoveCoroutine; Vector3 m_AlternateActivatorLocalPosition; - bool m_Disabled; + bool m_Interactable; Material m_IconMaterial; Color m_EnabledColor; @@ -90,26 +90,26 @@ public bool activatorButtonMoveAway public event Action selected; - public bool disabled + public bool interactable { - get { return m_Disabled; } + get { return m_Interactable; } set { - if (value != m_Disabled) + if (value != m_Interactable) { - m_Icon.sharedMaterial.color = value ? m_DisabledColor : m_EnabledColor; + m_Icon.sharedMaterial.color = value ? m_EnabledColor : m_DisabledColor; - if (value) + if (!value) SetHighlight(false); } - m_Disabled = value; + m_Interactable = value; } } public string tooltipText { - get { return m_Disabled ? "Main Menu Hidden" : null; } + get { return m_Interactable ? null : "Main Menu Hidden"; } } public Transform tooltipTarget { get { return m_TooltipTarget; } } @@ -124,7 +124,7 @@ void Awake() public void OnPointerEnter(PointerEventData eventData) { - if (eventData.used || m_Disabled) + if (eventData.used || !m_Interactable) return; SetHighlight(true); @@ -144,7 +144,6 @@ void SetHighlight(bool highlighted) if (m_HighlightCoroutine != null) StopCoroutine(m_HighlightCoroutine); - m_HighlightCoroutine = null; m_HighlightCoroutine = StartCoroutine(Highlight(highlighted)); } @@ -161,8 +160,8 @@ IEnumerator Highlight(bool transitionIn = true) var iconTransform = m_Icon.transform; var currentScale = iconTransform.localScale; var currentPosition = iconTransform.localPosition; - var targetScale = transitionIn == true ? m_HighlightedActivatorIconLocalScale : m_OriginalActivatorIconLocalScale; - var targetLocalPosition = transitionIn == true ? m_HighlightedActivatorIconLocalPosition : m_OriginalActivatorIconLocalPosition; + var targetScale = transitionIn ? m_HighlightedActivatorIconLocalScale : m_OriginalActivatorIconLocalScale; + var targetLocalPosition = transitionIn ? m_HighlightedActivatorIconLocalPosition : m_OriginalActivatorIconLocalPosition; var speed = (currentScale.x + 0.5f / targetScale.x) * 4; // perform faster is returning to original position while (amount < 1f) From 50a2b555966159156bee2baed908e00b8f3753fc Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 21 Aug 2017 15:11:16 -0400 Subject: [PATCH 772/870] Move frameCollider and outerCollider to m_WorkspaceUI and check for m_WorkspaceUIs in Menus; This allows us to update the frameCollider in WorkspaceUI and avoid the need to update it every frame --- Scripts/Core/EditorVR.Menus.cs | 3 ++- Workspaces/Base/Workspace.cs | 15 ++++----------- Workspaces/Base/WorkspaceBase.prefab | 14 ++++++++++++++ Workspaces/Base/WorkspaceUI.cs | 10 ++++++++++ 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index cb92ab609..5f664417f 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -5,6 +5,7 @@ using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; +using UnityEditor.Experimental.EditorVR.Workspaces; using UnityEngine; using UnityEngine.InputNew; @@ -52,7 +53,7 @@ internal class MenuHideData // Local method use only -- created here to reduce garbage collection readonly List m_ActiveDeviceData = new List(); - readonly List m_WorkspaceComponents = new List(); + readonly List m_WorkspaceComponents = new List(); readonly Collider[] m_WorkspaceOverlaps = new Collider[k_PossibleOverlaps]; public Menus() diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 688d2dead..8e7c08f89 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -43,7 +43,6 @@ abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStenc Bounds m_ContentBounds; BoxCollider m_OuterCollider; - BoxCollider m_FrameCollider; Coroutine m_VisibilityCoroutine; Coroutine m_ResetSizeCoroutine; @@ -83,11 +82,11 @@ public Bounds outerBounds { get { - const float kOuterBoundsCenterOffset = 0.09275f; //Amount to extend the bounds to include frame - return new Bounds(contentBounds.center + Vector3.down * kOuterBoundsCenterOffset * 0.5f, + const float outerBoundsCenterOffset = 0.09275f; //Amount to extend the bounds to include frame + return new Bounds(contentBounds.center + Vector3.down * outerBoundsCenterOffset * 0.5f, new Vector3( contentBounds.size.x, - contentBounds.size.y + kOuterBoundsCenterOffset, + contentBounds.size.y + outerBoundsCenterOffset, contentBounds.size.z )); } @@ -161,10 +160,8 @@ public virtual void Setup() m_WorkspaceUI.sceneContainer.transform.localPosition = Vector3.zero; - m_OuterCollider = gameObject.AddComponent(); + m_OuterCollider = m_WorkspaceUI.gameObject.AddComponent(); m_OuterCollider.isTrigger = true; - m_FrameCollider = gameObject.AddComponent(); - m_FrameCollider.isTrigger = true; var startingBounds = m_CustomStartingBounds ?? DefaultBounds; //Do not set bounds directly, in case OnBoundsChanged requires Setup override to complete @@ -292,10 +289,6 @@ IEnumerator AnimateResetSize() public virtual void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { m_WorkspaceUI.ProcessInput((WorkspaceInput)input, consumeControl); - - var frameBounds = m_WorkspaceUI.adjustedBounds; - m_FrameCollider.size = frameBounds.size; - m_FrameCollider.center = frameBounds.center; } protected void OnButtonClicked(Transform rayOrigin) diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index f4762b823..82edee41a 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -222,6 +222,7 @@ GameObject: - component: {fileID: 114000011346188294} - component: {fileID: 114000014286123538} - component: {fileID: 114000013983468268} + - component: {fileID: 65736115287711426} m_Layer: 5 m_Name: WorkspaceBase m_TagString: Untagged @@ -1872,6 +1873,18 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 1, y: 1.0000001, z: 1} m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65736115287711426 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011022840156} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0, y: 0, z: 0} + m_Center: {x: 0, y: 0, z: 0} --- !u!114 &114000010013501312 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2746,6 +2759,7 @@ MonoBehaviour: m_DynamicFaceAdjustment: 1 m_CloseButton: {fileID: 114000013712785888} m_ResizeButton: {fileID: 114000012661725366} + m_FrameCollider: {fileID: 65736115287711426} --- !u!137 &137000012547310740 SkinnedMeshRenderer: m_ObjectHideFlags: 1 diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index c4bb2eb14..63abfa437 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -134,6 +134,9 @@ sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGe [SerializeField] WorkspaceButton m_ResizeButton; + [SerializeField] + BoxCollider m_FrameCollider; + Bounds m_Bounds; float? m_TopPanelDividerOffset; @@ -402,6 +405,10 @@ public Bounds bounds m_TopHighlightContainer.localScale = new Vector3(faceWidth + kHighlightMargin, 1f, faceDepth + kHighlightMargin); m_TopFaceContainer.localScale = new Vector3(faceWidth, 1f, faceDepth); + var frameBounds = adjustedBounds; + m_FrameCollider.size = frameBounds.size; + m_FrameCollider.center = frameBounds.center; + AdjustHandlesAndIcons(); } } @@ -633,6 +640,9 @@ void Update() m_FrontPanel.localPosition = Vector3.Lerp(Vector3.forward * kFrontPanelZStartOffset, new Vector3(0, kFrontPanelYOffset, kFrontPanelZEndOffset), paddedLerp); m_FrontZOffset = (k_FrontFrameZOffset + m_FrontFrameHandleSize) * Mathf.Clamp01(paddedLerp * kAdditionalFrontPanelLerpPadding); + var frameBounds = adjustedBounds; + m_FrameCollider.size = frameBounds.size; + m_FrameCollider.center = frameBounds.center; AdjustHandlesAndIcons(); From ff1a5049325e4fa5dec927d1ea396ba33c73de4b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 21 Aug 2017 21:03:15 -0400 Subject: [PATCH 773/870] Fix nullref in LocomotionTool if you hold grips at startup; Simplify and comment UpdateMenuVisibilities and other methods in Menus.cs --- Scripts/Core/EditorVR.Menus.cs | 210 ++++++++++++++----------- Scripts/Core/EditorVR.Rays.cs | 5 +- Tools/LocomotionTool/LocomotionTool.cs | 5 +- 3 files changed, 122 insertions(+), 98 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 5f664417f..30f4418fa 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -33,7 +33,7 @@ internal enum MenuHideFlags OverWorkspace = 1 << 3, HasDirectSelection = 1 << 4, - Temporary = OverUI | OverWorkspace | HasDirectSelection + Temporary = OtherMenu | OverUI | OverWorkspace | HasDirectSelection } internal class MenuHideData @@ -117,8 +117,6 @@ internal void UpdateMenuVisibilities() m_ActiveDeviceData.Add(deviceData); }); - var directSelection = evr.GetNestedModule(); - foreach (var deviceData in m_ActiveDeviceData) { var alternateMenu = deviceData.alternateMenu; @@ -126,17 +124,24 @@ internal void UpdateMenuVisibilities() var customMenu = deviceData.customMenu; var menuHideData = deviceData.menuHideData; MenuHideData customMenuHideData = null; + MenuHideData alternateMenuData = null; + + var mainMenuVisible = mainMenu != null && menuHideData[mainMenu].hideFlags == 0; + var alternateMenuVisible = false; + if (alternateMenu != null) + { + alternateMenuData = menuHideData[alternateMenu]; + alternateMenuVisible = alternateMenuData.hideFlags == 0; + } - var mainMenuVisible = mainMenu != null && (menuHideData[mainMenu].hideFlags & MenuHideFlags.Hidden) == 0; - var alternateMenuVisible = alternateMenu != null && (menuHideData[alternateMenu].hideFlags & MenuHideFlags.Hidden) == 0; var customMenuVisible = false; if (customMenu != null) { customMenuHideData = menuHideData[customMenu]; - var customMenuHideFlags = customMenuHideData.hideFlags; - customMenuVisible = (customMenuHideFlags & MenuHideFlags.Hidden) == 0 && (customMenuHideFlags & MenuHideFlags.OtherMenu) == 0; + customMenuVisible = customMenuHideData.hideFlags == 0; } + // Kick the alternate menu to the other hand if a main menu or custom menu is visible if (alternateMenuVisible && (mainMenuVisible || customMenuVisible)) { foreach (var otherDeviceData in m_ActiveDeviceData) @@ -149,73 +154,22 @@ internal void UpdateMenuVisibilities() } } - if (customMenuVisible && (mainMenuVisible || alternateMenuVisible)) + // Temporarily hide customMenu if other menus are visible + if (customMenuVisible && mainMenuVisible) customMenuHideData.hideFlags |= MenuHideFlags.OtherMenu; - Array.Clear(m_WorkspaceOverlaps, 0, m_WorkspaceOverlaps.Length); - var hoveringWorkspace = false; - var menuTransform = mainMenu.menuContent.transform; - var menuBounds = mainMenu.localBounds; - var menuRotation = menuTransform.rotation; - var viewerScale = Viewer.GetViewerScale(); - var center = menuTransform.position + menuRotation * menuBounds.center * viewerScale; - if (Physics.OverlapBoxNonAlloc(center, menuBounds.extents * viewerScale, m_WorkspaceOverlaps, menuRotation) > 0) - { - foreach (var overlap in m_WorkspaceOverlaps) - { - if (overlap) - { - m_WorkspaceComponents.Clear(); - overlap.GetComponents(m_WorkspaceComponents); - if (m_WorkspaceComponents.Count > 0) - hoveringWorkspace = true; - } - } - } + // Temporarily hide alternateMenu if other menus are visible + if (alternateMenuVisible && (customMenuVisible || mainMenuVisible)) + alternateMenuData.hideFlags |= MenuHideFlags.OtherMenu; + // Check if menu bounds overlap with any workspace colliders foreach (var kvp in menuHideData) { - // Only set if hidden--value is reset every frame - if (hoveringWorkspace) - kvp.Value.hideFlags |= MenuHideFlags.OverWorkspace; + CheckMenuWorkspaceOverlaps(kvp.Key, kvp.Value); } - var rayOrigin = deviceData.rayOrigin; - var rayOriginPosition = rayOrigin.position; - var heldObjects = directSelection.GetHeldObjects(rayOrigin); - var hasDirectSelection = heldObjects != null && heldObjects.Count > 0; - if (hasDirectSelection) - { - foreach (var kvp in menuHideData) - { - // Only set if hidden--value is reset every frame - kvp.Value.hideFlags |= MenuHideFlags.HasDirectSelection; - } - - if (alternateMenuVisible) - SetAlternateMenuVisibility(rayOrigin, false); - - foreach (var otherDeviceData in m_ActiveDeviceData) - { - if (otherDeviceData == deviceData) - continue; - - var otherRayOrigin = otherDeviceData.rayOrigin; - if (alternateMenuVisible && otherDeviceData.alternateMenu != null) - SetAlternateMenuVisibility(otherRayOrigin, true); - - if (directSelection.IsHovering(otherRayOrigin) || directSelection.IsScaling(otherRayOrigin) - || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * viewerScale) - { - foreach (var kvp in otherDeviceData.menuHideData) - { - // Only set if hidden--value is reset every frame - kvp.Value.hideFlags |= MenuHideFlags.HasDirectSelection; - } - break; - } - } - } + // Check if there are currently any held objects, or if the other hand is in proximity for scaling + CheckDirectSelection(deviceData, menuHideData, alternateMenuVisible); } // Set show/hide timings @@ -232,16 +186,19 @@ internal void UpdateMenuVisibilities() } } - // Apply state to UI visibility + // Apply MenuHideFlags to UI visibility foreach (var deviceData in m_ActiveDeviceData) { var mainMenu = deviceData.mainMenu; var mainMenuHideData = deviceData.menuHideData[mainMenu]; var mainMenuHideFlags = mainMenuHideData.hideFlags; - //Hide the main menu if any hideflags are set; if the menu is focused, only hide if Hidden is set (e.g. not temporary) - if (mainMenuHideFlags != 0 && ((mainMenuHideFlags & MenuHideFlags.Hidden) != 0 || !mainMenu.focus)) + var mainMenuHidden = (mainMenuHideFlags & MenuHideFlags.Hidden) != 0; + + // Hide the main menu if any hideflags are set; if the menu is focused, only hide if Hidden is set (e.g. not temporary) + if (mainMenuHideFlags != 0 && (mainMenuHidden || !mainMenu.focus)) { - if ((mainMenuHideFlags & MenuHideFlags.Hidden) != 0) + // Hidden state takes effect immediately; Temporary states take effect after a delay + if (mainMenuHidden) { mainMenu.visible = false; } @@ -250,13 +207,16 @@ internal void UpdateMenuVisibilities() mainMenu.visible = false; } } + // Showing the menu always waits--set autoShowTime to 0 to show instantly else if (Time.time > mainMenuHideData.autoShowTime + k_MainMenuAutoShowDelay) { mainMenu.visible = true; } + // Disable the main menu activator if any temporary states are set deviceData.mainMenuActivator.interactable = (mainMenuHideFlags & MenuHideFlags.Temporary) == 0; + // Show/hide custom menu, if it exists var customMenu = deviceData.customMenu; if (customMenu != null) customMenu.visible = deviceData.menuHideData[customMenu].hideFlags == 0; @@ -277,6 +237,78 @@ internal void UpdateMenuVisibilities() evr.GetModule().UpdatePlayerHandleMaps(); } + void CheckDirectSelection(DeviceData deviceData, Dictionary menuHideData, bool alternateMenuVisible) + { + var viewerScale = Viewer.GetViewerScale(); + var directSelection = evr.GetNestedModule(); + var rayOrigin = deviceData.rayOrigin; + var rayOriginPosition = rayOrigin.position; + var heldObjects = directSelection.GetHeldObjects(rayOrigin); + // If this hand is holding any objects, hide its menus + var hasDirectSelection = heldObjects != null && heldObjects.Count > 0; + if (hasDirectSelection) + { + foreach (var kvp in menuHideData) + { + // Only set if hidden--value is reset every frame + kvp.Value.hideFlags |= MenuHideFlags.HasDirectSelection; + } + + foreach (var otherDeviceData in m_ActiveDeviceData) + { + if (otherDeviceData == deviceData) + continue; + + var otherRayOrigin = otherDeviceData.rayOrigin; + if (alternateMenuVisible && otherDeviceData.alternateMenu != null) + SetAlternateMenuVisibility(otherRayOrigin, true); + + // If other hand is within range to do a two-handed scale, hide its menu as well + if (directSelection.IsHovering(otherRayOrigin) || directSelection.IsScaling(otherRayOrigin) + || Vector3.Distance(otherRayOrigin.position, rayOriginPosition) < k_TwoHandHideDistance * viewerScale) + { + foreach (var kvp in otherDeviceData.menuHideData) + { + // Only set if hidden--value is reset every frame + kvp.Value.hideFlags |= MenuHideFlags.HasDirectSelection; + } + break; + } + } + } + } + + void CheckMenuWorkspaceOverlaps(IMenu menu, MenuHideData menuHideData) + { + var menuBounds = menu.localBounds; + if (menuBounds.extents == Vector3.zero) + return; + + Array.Clear(m_WorkspaceOverlaps, 0, m_WorkspaceOverlaps.Length); + var hoveringWorkspace = false; + var menuTransform = menu.menuContent.transform; + var menuRotation = menuTransform.rotation; + var viewerScale = Viewer.GetViewerScale(); + var center = menuTransform.position + menuRotation * menuBounds.center * viewerScale; + if (Physics.OverlapBoxNonAlloc(center, menuBounds.extents * viewerScale, m_WorkspaceOverlaps, menuRotation) > 0) + { + foreach (var overlap in m_WorkspaceOverlaps) + { + if (overlap) + { + m_WorkspaceComponents.Clear(); + overlap.GetComponents(m_WorkspaceComponents); + if (m_WorkspaceComponents.Count > 0) + hoveringWorkspace = true; + } + } + } + + // Only set if hidden--value is reset every frame + if (hoveringWorkspace) + menuHideData.hideFlags |= MenuHideFlags.OverWorkspace; + } + internal static bool IsValidHover(MultipleRayInputModule.RaycastSource source) { var go = source.draggedObject; @@ -306,12 +338,8 @@ internal static bool IsValidHover(MultipleRayInputModule.RaycastSource source) if (scaledPointerDistance < openMenu.localBounds.size.y + k_MenuHideMargin) { - foreach (var kvp in menuHideFlags) - { - // Only set if hidden--value is reset every frame - kvp.Value.hideFlags |= MenuHideFlags.OverUI; - } - + // Only set if hidden--value is reset every frame + menuHideFlags[openMenu].hideFlags |= MenuHideFlags.OverUI; return true; } @@ -337,27 +365,20 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl var alternateMenu = deviceData.alternateMenu; if (alternateMenu != null) { + // Set alternate menu visible on this rayOrigin and hide it on all others var alternateMenuData = menuHideFlags[alternateMenu]; - var alternateMenuFlags = alternateMenuData.hideFlags; - alternateMenuData.hideFlags = (deviceData.rayOrigin == rayOrigin) - && visible ? alternateMenuFlags & ~MenuHideFlags.Hidden - : alternateMenuFlags | MenuHideFlags.Hidden; - - if ((alternateMenuData.hideFlags & MenuHideFlags.Hidden) != 0) - { - var customMenu = deviceData.customMenu; - - if (customMenu != null && - (menuHideFlags[deviceData.mainMenu].hideFlags & MenuHideFlags.Hidden) != 0) - menuHideFlags[customMenu].hideFlags &= ~MenuHideFlags.OtherMenu; - } + if (deviceData.rayOrigin == rayOrigin && visible) + alternateMenuData.hideFlags &= ~MenuHideFlags.Hidden; + else + alternateMenuData.hideFlags |= MenuHideFlags.Hidden; } }); } internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetRayOrigin) { - if (evr.m_DeviceData.Any(deviceData => deviceData.rayOrigin == rayOrigin && !deviceData.mainMenuActivator.interactable)) + if (evr.m_DeviceData.Any(deviceData => deviceData.rayOrigin == rayOrigin + && !deviceData.mainMenuActivator.interactable)) return; foreach (var deviceData in evr.m_DeviceData) @@ -372,10 +393,12 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform var alternateMenuVisible = alternateMenu != null && (menuHideData[alternateMenu].hideFlags & MenuHideFlags.Hidden) == 0; + // Do not delay when showing via activator mainMenuHideData.autoShowTime = 0; if (deviceData.rayOrigin == rayOrigin) { + // Toggle main menu hidden flag mainMenuHideData.hideFlags ^= MenuHideFlags.Hidden; mainMenu.targetRayOrigin = targetRayOrigin; mainMenu.SendVisibilityPulse(); @@ -399,11 +422,6 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform } } } - - alternateMenuVisible = alternateMenu != null && (menuHideData[alternateMenu].hideFlags & MenuHideFlags.Hidden) == 0; - var mainMenuVisible = (menuHideData[mainMenu].hideFlags & MenuHideFlags.Hidden) == 0; - if (customMenu != null && !alternateMenuVisible && !mainMenuVisible) - menuHideData[customMenu].hideFlags &= ~MenuHideFlags.OtherMenu; } } } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index fdd4b1466..eb22a766d 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && UNITY_EDITORVR +#if UNITY_EDITOR && UNITY_EDITORVR using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Helpers; @@ -204,6 +204,7 @@ void OnProxyActiveChanged(IProxy proxy) // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => { + // Do not invalidate UI raycasts in the middle of a drag operation if (!source.draggedObject) { var sourceRayOrigin = source.rayOrigin; @@ -211,10 +212,12 @@ void OnProxyActiveChanged(IProxy proxy) return false; var hoveredObject = source.hoveredObject; + // The manipulator needs rays to go through scene objects in order to work var isManipulator = hoveredObject && hoveredObject.GetComponentInParent() != null; float sceneObjectDistance; var raycastObject = intersectionModule.GetFirstGameObject(sourceRayOrigin, out sceneObjectDistance); var uiDistance = source.eventData.pointerCurrentRaycast.distance; + // If the distance to a scene object is less than the distance to the hovered UI, invalidate the UI raycast if (!isManipulator && raycastObject && sceneObjectDistance < uiDistance) return false; } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 28b867bfc..dc58cf9f5 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; using System.Collections; using System.Collections.Generic; @@ -391,6 +391,9 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) continue; var otherLocomotionInput = locomotionTool.m_LocomotionInput; + if (otherLocomotionInput == null) // This can occur if crawl is pressed when EVR is opened + continue; + var otherCrawl = otherLocomotionInput.crawl; if (otherCrawl.isHeld) { From 2452f30bbf1d1ffb0c14187c0ef65db90a997331 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 21 Aug 2017 21:42:10 -0400 Subject: [PATCH 774/870] Fix Workspace frame collider blocking UI ray; Fix main menu activator tooltip intersecting with pinned tool button --- Prefabs/UI/MainMenuActivator.prefab | 2 +- Workspaces/Base/WorkspaceBase.prefab | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Prefabs/UI/MainMenuActivator.prefab b/Prefabs/UI/MainMenuActivator.prefab index 4030f46f4..b20850063 100644 --- a/Prefabs/UI/MainMenuActivator.prefab +++ b/Prefabs/UI/MainMenuActivator.prefab @@ -185,7 +185,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1044445693346948} m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.045} + m_LocalPosition: {x: 0, y: 0.01, z: -0.045} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 4000012631310542} diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index 82edee41a..4650df42c 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -223,7 +223,7 @@ GameObject: - component: {fileID: 114000014286123538} - component: {fileID: 114000013983468268} - component: {fileID: 65736115287711426} - m_Layer: 5 + m_Layer: 0 m_Name: WorkspaceBase m_TagString: Untagged m_Icon: {fileID: 0} From 002acb1118da443b9f460d2d63e0f8996652bcff Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 21 Aug 2017 22:21:15 -0400 Subject: [PATCH 775/870] Remove SendVisibilityPulse from IMainMenu --- Menus/MainMenu/MainMenu.cs | 48 +++++++++++-------- Menus/RadialMenu/RadialMenu.cs | 33 +++++++------ Scripts/Core/EditorVR.Menus.cs | 27 +++++++---- Scripts/Core/EditorVR.Rays.cs | 2 +- Scripts/Core/EditorVR.Tools.cs | 4 +- Scripts/Core/EditorVR.cs | 4 +- Scripts/Interfaces/Entity/IMainMenu.cs | 5 -- Scripts/Interfaces/Entity/IMenu.cs | 9 +++- .../CreatePrimitiveMenu.cs | 16 ++++--- 9 files changed, 84 insertions(+), 64 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 1acd21441..3a67b0334 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -47,21 +47,6 @@ public Transform menuOrigin } Transform m_MenuOrigin; - public bool visible - { - get { return m_Visible; } - set - { - if (m_Visible != value) - { - m_Visible = value; - if (m_MainMenuUI) - m_MainMenuUI.visible = value; - } - } - } - bool m_Visible; - [SerializeField] HapticPulse m_FaceRotationPulse; @@ -80,6 +65,7 @@ public bool visible [SerializeField] HapticPulse m_ButtonHoverPulse; + bool m_Visible; MainMenuUI m_MainMenuUI; float m_LastRotationInput; readonly Dictionary m_ToolButtons = new Dictionary(); @@ -123,6 +109,25 @@ void Start() UpdateToolButtons(); } + public void SetVisible(bool visible, bool temporary = false) + { + if (m_Visible != visible) + { + m_Visible = visible; + if (m_MainMenuUI) + { + m_MainMenuUI.visible = visible; + if (!temporary) + SendVisibilityPulse(); + } + } + } + + public bool GetVisible() + { + return m_Visible; + } + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var mainMenuInput = (MainMenuInput)input; @@ -139,7 +144,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.Pulse(node, m_FaceRotationPulse); } - if (visible) + if (m_Visible) consumeControl(mainMenuInput.flickFace); m_LastRotationInput = rotationInput; @@ -181,7 +186,7 @@ void CreateFaceButtons(List types) if (buttonData == null) buttonData = new MainMenuUI.ButtonData(type.Name); - CreateFaceButton(buttonData, tooltip, () => + m_ToolButtons[type] = CreateFaceButton(buttonData, tooltip, () => { if (targetRayOrigin) { @@ -244,17 +249,18 @@ void CreateFaceButtons(List types) } } - void CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action buttonClickCallback) + MainMenuButton CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action buttonClickCallback) { var mainMenuButton = m_MainMenuUI.CreateFaceButton(buttonData); mainMenuButton.button.onClick.RemoveAllListeners(); mainMenuButton.button.onClick.AddListener(() => { - if (visible) + if (m_Visible) buttonClickCallback(); }); mainMenuButton.tooltip = tooltip; + return mainMenuButton; } void UpdateToolButtons() @@ -275,9 +281,9 @@ void OnButtonHovered(Transform rayOrigin) this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); } - public void SendVisibilityPulse() + void SendVisibilityPulse() { - this.Pulse(node, visible ? m_HidePulse : m_ShowPulse); + this.Pulse(node, m_Visible ? m_HidePulse : m_ShowPulse); } } } diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index 12678d06b..af7ae85a5 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -7,7 +7,8 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap, IControlHaptics, IUsesNode, IConnectInterfaces + sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMenuOrigins, ICustomActionMap, + IControlHaptics, IUsesNode, IConnectInterfaces { const float k_ActivationThreshold = 0.5f; // Do not consume thumbstick or activate menu if the control vector's magnitude is below this threshold @@ -58,19 +59,6 @@ public Transform alternateMenuOrigin } Transform m_AlternateMenuOrigin; - public bool visible - { - get { return m_Visible; } - set - { - if (m_Visible != value) - { - m_Visible = value; - if (m_RadialMenuUI) - m_RadialMenuUI.visible = value; - } - } - } bool m_Visible; public event Action itemWasSelected; @@ -97,10 +85,25 @@ void Start() m_RadialMenuUI.buttonClicked += OnButtonClicked; } + public void SetVisible(bool visible, bool temporary = false) + { + if (m_Visible != visible) + { + m_Visible = visible; + if (m_RadialMenuUI) + m_RadialMenuUI.visible = visible; + } + } + + public bool GetVisible() + { + return m_Visible; + } + public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var radialMenuInput = (RadialMenuInput)input; - if (radialMenuInput == null || !visible) + if (radialMenuInput == null || !m_Visible) return; var inputDirection = radialMenuInput.navigate.vector2; diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 30f4418fa..7b496fbb2 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -39,6 +39,7 @@ internal enum MenuHideFlags internal class MenuHideData { public MenuHideFlags hideFlags = MenuHideFlags.Hidden; + public MenuHideFlags lastHideFlags = MenuHideFlags.Hidden; public float autoHideTime; public float autoShowTime; } @@ -101,12 +102,13 @@ public void LateBindInterfaceMethods(Tools provider) static void UpdateAlternateMenuForDevice(DeviceData deviceData) { var alternateMenu = deviceData.alternateMenu; - alternateMenu.visible = deviceData.menuHideData[alternateMenu].hideFlags == 0 && !(deviceData.currentTool is IExclusiveMode); + alternateMenu.SetVisible(deviceData.menuHideData[alternateMenu].hideFlags == 0 + && !(deviceData.currentTool is IExclusiveMode)); // Move the activator button to an alternate position if the alternate menu will be shown var mainMenuActivator = deviceData.mainMenuActivator; if (mainMenuActivator != null) - mainMenuActivator.activatorButtonMoveAway = alternateMenu.visible; + mainMenuActivator.activatorButtonMoveAway = alternateMenu.GetVisible(); } internal void UpdateMenuVisibilities() @@ -182,7 +184,11 @@ internal void UpdateMenuVisibilities() kvp.Value.autoHideTime = Time.time; if (hideFlags != 0) + { + var menuHideData = kvp.Value; + menuHideData.lastHideFlags = menuHideData.hideFlags; kvp.Value.autoShowTime = Time.time; + } } } @@ -193,6 +199,7 @@ internal void UpdateMenuVisibilities() var mainMenuHideData = deviceData.menuHideData[mainMenu]; var mainMenuHideFlags = mainMenuHideData.hideFlags; var mainMenuHidden = (mainMenuHideFlags & MenuHideFlags.Hidden) != 0; + // Hide the main menu if any hideflags are set; if the menu is focused, only hide if Hidden is set (e.g. not temporary) if (mainMenuHideFlags != 0 && (mainMenuHidden || !mainMenu.focus)) @@ -200,17 +207,18 @@ internal void UpdateMenuVisibilities() // Hidden state takes effect immediately; Temporary states take effect after a delay if (mainMenuHidden) { - mainMenu.visible = false; + mainMenu.SetVisible(false); } else if (Time.time > mainMenuHideData.autoHideTime + k_MainMenuAutoHideDelay) { - mainMenu.visible = false; + mainMenu.SetVisible(false, true); } } // Showing the menu always waits--set autoShowTime to 0 to show instantly else if (Time.time > mainMenuHideData.autoShowTime + k_MainMenuAutoShowDelay) { - mainMenu.visible = true; + var wasTemporary = (mainMenuHideData.lastHideFlags & MenuHideFlags.Temporary) != 0; + mainMenu.SetVisible(true, wasTemporary); } // Disable the main menu activator if any temporary states are set @@ -219,13 +227,13 @@ internal void UpdateMenuVisibilities() // Show/hide custom menu, if it exists var customMenu = deviceData.customMenu; if (customMenu != null) - customMenu.visible = deviceData.menuHideData[customMenu].hideFlags == 0; + customMenu.SetVisible(deviceData.menuHideData[customMenu].hideFlags == 0); UpdateAlternateMenuForDevice(deviceData); Rays.UpdateRayForDevice(deviceData, deviceData.rayOrigin); } - // Reset Temporary states + // Reset Temporary states and set lastHideFlags foreach (var deviceData in m_ActiveDeviceData) { foreach (var kvp in deviceData.menuHideData) @@ -401,7 +409,6 @@ internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform // Toggle main menu hidden flag mainMenuHideData.hideFlags ^= MenuHideFlags.Hidden; mainMenu.targetRayOrigin = targetRayOrigin; - mainMenu.SendVisibilityPulse(); } else { @@ -464,7 +471,7 @@ internal static IMainMenu SpawnMainMenu(Type type, InputDevice device, bool visi var mainMenu = (IMainMenu)ObjectUtils.AddComponent(type, evr.gameObject); input = evr.GetModule().CreateActionMapInputForObject(mainMenu, device); evr.m_Interfaces.ConnectInterfaces(mainMenu, device); - mainMenu.visible = visible; + mainMenu.SetVisible(visible); return mainMenu; } @@ -479,7 +486,7 @@ internal static IAlternateMenu SpawnAlternateMenu(Type type, InputDevice device, var alternateMenu = (IAlternateMenu)ObjectUtils.AddComponent(type, evr.gameObject); input = evr.GetModule().CreateActionMapInputForObject(alternateMenu, device); evr.m_Interfaces.ConnectInterfaces(alternateMenu, device); - alternateMenu.visible = false; + alternateMenu.SetVisible(false); return alternateMenu; } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index eb22a766d..ca7adb5dd 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -109,7 +109,7 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig { var mainMenu = deviceData.mainMenu; var customMenu = deviceData.customMenu; - if (mainMenu.visible || (customMenu != null && customMenu.visible)) + if (mainMenu.GetVisible() || (customMenu != null && customMenu.GetVisible())) { AddVisibilitySettings(rayOrigin, mainMenu, false, false); } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 971ec0584..90d6e5c11 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -330,7 +330,7 @@ internal static void UpdatePlayerHandleMaps(List maps) var mainMenuInput = deviceData.mainMenuInput; if (mainMenu != null && mainMenuInput != null) { - mainMenuInput.active = mainMenu.visible; + mainMenuInput.active = mainMenu.GetVisible(); if (!maps.Contains(mainMenuInput)) maps.Add(mainMenuInput); @@ -340,7 +340,7 @@ internal static void UpdatePlayerHandleMaps(List maps) var alternateMenuInput = deviceData.alternateMenuInput; if (alternateMenu != null && alternateMenuInput != null) { - alternateMenuInput.active = alternateMenu.visible; + alternateMenuInput.active = alternateMenu.GetVisible(); if (!maps.Contains(alternateMenuInput)) maps.Add(alternateMenuInput); diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 016e1b7b1..be4f08b71 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -372,12 +372,12 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate var mainMenu = deviceData.mainMenu; var menuInput = mainMenu as IProcessInput; - if (menuInput != null && mainMenu.visible) + if (menuInput != null && mainMenu.GetVisible()) menuInput.ProcessInput(deviceData.mainMenuInput, consumeControl); var altMenu = deviceData.alternateMenu; var altMenuInput = altMenu as IProcessInput; - if (altMenuInput != null && altMenu.visible) + if (altMenuInput != null && altMenu.GetVisible()) altMenuInput.ProcessInput(deviceData.alternateMenuInput, consumeControl); foreach (var toolData in deviceData.toolData) diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index a3449fd97..4f93aeef6 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -39,11 +39,6 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Does this menu have focus? /// bool focus { get; } - - /// - /// Send a haptic pulse indicating the menu visibility has changed - /// - void SendVisibilityPulse(); } } #endif diff --git a/Scripts/Interfaces/Entity/IMenu.cs b/Scripts/Interfaces/Entity/IMenu.cs index 8905dc7a2..3b5a82c4d 100644 --- a/Scripts/Interfaces/Entity/IMenu.cs +++ b/Scripts/Interfaces/Entity/IMenu.cs @@ -9,9 +9,14 @@ namespace UnityEditor.Experimental.EditorVR public interface IMenu { /// - /// Controls whether the menu is visible or not + /// Set whether the menu is visible or not /// - bool visible { get; set; } + void SetVisible(bool visible, bool temporary = false); + + /// + /// Get whether the menu is visible or not + /// + bool GetVisible(); /// /// GameObject that this component is attached to diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs index e0ef7c68a..50984b4ef 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs @@ -15,12 +15,6 @@ sealed class CreatePrimitiveMenu : MonoBehaviour, IMenu public Bounds localBounds { get; private set; } - public bool visible - { - get { return gameObject.activeSelf; } - set { gameObject.SetActive(value); } - } - public GameObject menuContent { get { return gameObject; } @@ -31,6 +25,16 @@ void Awake() localBounds = ObjectUtils.GetBounds(transform); } + public void SetVisible(bool visible, bool temporary = false) + { + gameObject.SetActive(visible); + } + + public bool GetVisible() + { + return gameObject.activeSelf; + } + public void SelectPrimitive(int type) { selectPrimitive((PrimitiveType)type, false); From e2552d0105b07446db36ec306f14188493248b7f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 22 Aug 2017 15:03:44 -0700 Subject: [PATCH 776/870] Fix direction flipping of spatial scrolling, if scrolling behind/before the trigger position --- .../SpatialScrollModule.cs | 62 +++++++++++++++++-- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index 1f5593123..6f9a36bd3 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -28,22 +28,68 @@ public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Ve spatialDirection = null; } - // Data assigned by calling object requesting spatial scroll processing + // Below is Data assigned by calling object requesting spatial scroll processing + + /// + /// The object/caller initiating this particular spatial scroll action + /// public object caller { get; set; } + + /// + /// The node on which this spatial scroll is being processed + /// public Node? node { get; set; } + + /// + /// The origin/starting position of the scroll + /// public Vector3 startingPosition { get; set; } + + /// + /// The current scroll position + /// public Vector3 currentPosition { get; set; } + + /// + /// The magnitude at which a scroll will repeat/reset to its original scroll starting value + /// public float repeatingScrollLengthRange { get; set; } + + /// + /// Number of items being scrolled through + /// public int scrollableItemCount { get; set; } + + /// + /// Maximum number of items (to be scrolled through) that will be allowed + /// public int maxItemCount { get; set; } + + /// + /// If true, expand scroll visuals out from the center of the trigger/origin/start position + /// public bool centerVisuals { get; set; } - // Values populated by scroll processing + // The Values below are populated by scroll processing + + /// + /// The vector defining the spatial scroll direction + /// public Vector3? spatialDirection { get; set; } - public Vector3 startingDragOrigin { get; set; } - public Vector3 previousWorldPosition { get; set; } + + /// + /// 0-1 offset/magnitude of current scroll position, relative to the trigger/origin/start point, and the repeatingScrollLengthRange + /// public float normalizedLoopingPosition { get; set; } + + /// + /// Value representing how much of the pre-scroll drag amount has occurred + /// public float dragDistance { get; set; } + + /// + /// Bool denoting that the scroll trigger magnitude has been exceeded + /// public bool passedMinDragActivationThreshold { get { return spatialDirection != null; } } public void UpdateExistingScrollData(Vector3 newPosition) @@ -92,14 +138,18 @@ SpatialScrollData ProcessSpatialScrolling(SpatialScrollData scrollData) var dragMagnitude = Vector3.Magnitude(directionVector); var dragPercentage = dragMagnitude / newDirectionVectorThreshold; var repeatingPulseAmount = Mathf.Sin(Time.realtimeSinceStartup * 20) > 0.5f ? 1f : 0f; // Perform an on/off repeating pulse while waiting for the drag threshold to be crossed - scrollData.dragDistance = dragMagnitude > 0 ? dragPercentage : 0f; // Set normalized value representing how much of the pre-scroll drag amount has occurred + scrollData.dragDistance = dragMagnitude > 0 ? dragPercentage : 0f; // Set value representing how much of the pre-scroll drag amount has occurred this.Pulse(scrollData.node, m_ActivationPulse, repeatingPulseAmount, repeatingPulseAmount); if (dragMagnitude > newDirectionVectorThreshold) scrollData.spatialDirection = directionVector; // Initialize vector defining the spatial scroll direction } else { - var projectedAmount = Vector3.Project(directionVector, scrollData.spatialDirection.Value).magnitude / this.GetViewerScale(); + var scrollingAfterTriggerOirigin = Vector3.Dot(directionVector, scrollData.spatialDirection.Value) >= 0; // Detect that the user is scrolling forward from the trigger origin point + var projectionVector = scrollingAfterTriggerOirigin ? scrollData.spatialDirection.Value : scrollData.spatialDirection.Value + scrollData.spatialDirection.Value; + var projectedAmount = Vector3.Project(directionVector, projectionVector).magnitude / this.GetViewerScale(); + // Mandate that scrolling maintain the initial direction, regardless of the user scrolling before/after the trigger origin point; prevent direction flipping + projectedAmount = scrollingAfterTriggerOirigin ? projectedAmount : 1 - projectedAmount; scrollData.normalizedLoopingPosition = (Mathf.Abs(projectedAmount * (scrollData.maxItemCount / scrollData.scrollableItemCount)) % scrollData.repeatingScrollLengthRange) * (1 / scrollData.repeatingScrollLengthRange); } From 23d560f0f813485b688ab895b9a7279aa9f9c2ac Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 22 Aug 2017 18:06:06 -0700 Subject: [PATCH 777/870] Fix MainMenu button being rotated off-center upon menu initialization --- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index b2d11d150..29ec18f8e 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -190,10 +190,10 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) allowSecondaryButton = !IsSelectionToolButton(button); } + var initializingButtons = m_OrderedButtons.Count == 1; m_OrderedButtons.Insert(insertPosition, button); // If only the MainMenu & SelectionTool buttons exist, set visible button count to 1 - m_VisibleButtonCount = aboveMinimumButtonCount ? m_OrderedButtons.Count : 1; - + m_VisibleButtonCount = aboveMinimumButtonCount || initializingButtons ? m_OrderedButtons.Count : 1; button.implementsSecondaryButton = allowSecondaryButton; button.isActiveTool = true; button.order = insertPosition; @@ -202,7 +202,7 @@ public void AddButton(IPinnedToolButton button, Transform buttonTransform) buttonTransform.localPosition = Vector3.zero; buttonTransform.localScale = Vector3.zero; - if (aboveMinimumButtonCount) + if (aboveMinimumButtonCount) // aboveMinimumCount will change throughout function, don't cache for re-use this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1.25f, false)); else SetupButtonOrder(); // Setup the MainMenu and active tool buttons only From e8baee18ba519fb83dac72f28d05ba1922e794b5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 22 Aug 2017 19:47:35 -0700 Subject: [PATCH 778/870] Clear spatialScrollData automatically in EndScroll, in the SpatialScrollModule --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 20 ++++++++++--------- .../IControlSpatialScrolling.cs | 12 +++++++---- .../SpatialScrollModule.cs | 13 ++++++------ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 1e5781d17..86cde4783 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, - IControlHaptics, IUsesViewerScale, IControlSpatialHinting, ISetDefaultRayVisibility, IUsesRayOrigin + IControlHaptics, IUsesViewerScale, IControlSpatialScrolling, IControlSpatialHinting, ISetDefaultRayVisibility, IUsesRayOrigin { const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation const int k_MaxButtonCount = 16; // @@ -43,7 +43,6 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac Vector3 m_SpatialScrollStartPosition; IPinnedToolButton m_MainMenuButton; PinnedToolsMenuUI m_PinnedToolsMenuUI; - SpatialScrollModule.SpatialScrollData m_SpatialScrollData; public Transform menuOrigin { get; set; } List buttons { get { return m_PinnedToolsMenuUI.buttons; } } @@ -56,6 +55,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac public Node? node { get; set; } public IPinnedToolButton previewToolButton { get { return m_MainMenuButton; } } public Transform alternateMenuOrigin { get { return m_AlternateMenuOrigin; } set { m_AlternateMenuOrigin = value; } } + public SpatialScrollModule.SpatialScrollData spatialScrollData { get; set; } public Transform rayOrigin { @@ -165,26 +165,28 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (buttonCount <= k_ActiveToolOrderPosition + 1) { - this.EndSpatialScroll(this); + if (spatialScrollData != null) + this.EndSpatialScroll(this); + return; } } // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - m_SpatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.25f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); - var normalizedRepeatingPosition = m_SpatialScrollData.normalizedLoopingPosition; + spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.5f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); + var normalizedRepeatingPosition = spatialScrollData.normalizedLoopingPosition; if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { if (!m_PinnedToolsMenuUI.allButtonsVisible) { - m_PinnedToolsMenuUI.spatialDragDistance = m_SpatialScrollData.dragDistance; + m_PinnedToolsMenuUI.spatialDragDistance = spatialScrollData.dragDistance; this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.CenteredScrolling); m_PinnedToolsMenuUI.allButtonsVisible = true; } - else if (m_SpatialScrollData.spatialDirection != null) + else if (spatialScrollData.spatialDirection != null) { - m_PinnedToolsMenuUI.startingDragOrigin = m_SpatialScrollData.spatialDirection; + m_PinnedToolsMenuUI.startingDragOrigin = spatialScrollData.spatialDirection; } m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); @@ -194,7 +196,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } else if (pinnedToolInput.show.wasJustReleased) { - if (m_SpatialScrollData.passedMinDragActivationThreshold) + if (spatialScrollData.passedMinDragActivationThreshold) { m_PinnedToolsMenuUI.SelectHighlightedButton(); consumeControl(pinnedToolInput.select); diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs index 00f70c383..c8f1b162e 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs @@ -9,11 +9,15 @@ namespace UnityEditor.Experimental.EditorVR /// public interface IControlSpatialScrolling { + /// + /// The data defining a spatial scroll operation + /// + SpatialScrollModule.SpatialScrollData spatialScrollData { get; set; } } public static class IControlSpatialScrollingMethods { - internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDelegate (object caller, Node? node, Vector3 startingPosition, + internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDelegate (IControlSpatialScrolling caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true); internal static PerformSpatialScrollDelegate performSpatialScroll { private get; set; } @@ -29,20 +33,20 @@ internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDele /// The maximum number of items that can be scrolled through for this action /// If true, expand the scroll line visuals outward in both directions from the scroll start position /// The spatial scroll data for a single scroll action, but an individual caller object - public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IControlSpatialHinting obj, object caller, Node? node, + public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IControlSpatialScrolling obj, IControlSpatialScrolling caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true) { return performSpatialScroll(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerVisuals); } - internal delegate void EndSpatialScrollDelegate (object caller); + internal delegate void EndSpatialScrollDelegate (IControlSpatialScrolling caller); internal static EndSpatialScrollDelegate endSpatialScroll { private get; set; } /// /// End a spatial scrolling action for a given caller /// /// The caller whose spatial scroll action will be ended - public static void EndSpatialScroll(this IControlSpatialHinting obj, object caller) + public static void EndSpatialScroll(this IControlSpatialScrolling obj, IControlSpatialScrolling caller) { endSpatialScroll(caller); } diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index 6f9a36bd3..3a93591e3 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -11,11 +11,11 @@ public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, ICont HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection // Collection housing caller object & ScrollData pairs - Dictionary m_ScrollData; + Dictionary m_ScrollData; public class SpatialScrollData { - public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true) + public SpatialScrollData(IControlSpatialScrolling caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true) { this.caller = caller; this.node = node; @@ -33,7 +33,7 @@ public SpatialScrollData(object caller, Node? node, Vector3 startingPosition, Ve /// /// The object/caller initiating this particular spatial scroll action /// - public object caller { get; set; } + public IControlSpatialScrolling caller { get; set; } /// /// The node on which this spatial scroll is being processed @@ -100,10 +100,10 @@ public void UpdateExistingScrollData(Vector3 newPosition) void Awake() { - m_ScrollData = new Dictionary(); + m_ScrollData = new Dictionary(); } - internal SpatialScrollData PerformScroll(object caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerScrollVisuals = true) + internal SpatialScrollData PerformScroll(IControlSpatialScrolling caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerScrollVisuals = true) { // Continue processing of spatial scrolling for a given caller, // Or create new instance of scroll data for new callers. (Initial structure for support of simultaneous callers) @@ -156,7 +156,7 @@ SpatialScrollData ProcessSpatialScrolling(SpatialScrollData scrollData) return scrollData; } - internal void EndScroll(object caller) + internal void EndScroll(IControlSpatialScrolling caller) { if (m_ScrollData.Count == 0) return; @@ -165,6 +165,7 @@ internal void EndScroll(object caller) { if (kvp.Key == caller) { + caller.spatialScrollData = null; // clear reference to the previously used scrollData m_ScrollData.Remove(caller); return; } From 12989de4ebaa8419ae50a44df223063bbf452538 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 22 Aug 2017 22:59:28 -0700 Subject: [PATCH 779/870] Convert ScrollData dictionary/collection into list of IControlSpatialScolling callers, in SpatialScrollModule --- .../SpatialScrollModule.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index 3a93591e3..9e963cfb4 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -10,8 +10,8 @@ public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, ICont [SerializeField] HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection - // Collection housing caller object & ScrollData pairs - Dictionary m_ScrollData; + // Collection housing objects whose scroll data is being processed + List m_ScrollCallers; public class SpatialScrollData { @@ -100,7 +100,7 @@ public void UpdateExistingScrollData(Vector3 newPosition) void Awake() { - m_ScrollData = new Dictionary(); + m_ScrollCallers = new List(); } internal SpatialScrollData PerformScroll(IControlSpatialScrolling caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerScrollVisuals = true) @@ -108,11 +108,11 @@ internal SpatialScrollData PerformScroll(IControlSpatialScrolling caller, Node? // Continue processing of spatial scrolling for a given caller, // Or create new instance of scroll data for new callers. (Initial structure for support of simultaneous callers) SpatialScrollData spatialScrollData = null; - foreach (var kvp in m_ScrollData) + foreach (var scroller in m_ScrollCallers) { - if (kvp.Key == caller) + if (scroller == caller) { - spatialScrollData = kvp.Value; + spatialScrollData = scroller.spatialScrollData; spatialScrollData.UpdateExistingScrollData(currentPosition); break; } @@ -121,7 +121,7 @@ internal SpatialScrollData PerformScroll(IControlSpatialScrolling caller, Node? if (spatialScrollData == null) { spatialScrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerScrollVisuals); - m_ScrollData.Add(caller, spatialScrollData); + m_ScrollCallers.Add(caller); } return ProcessSpatialScrolling(spatialScrollData); @@ -158,15 +158,15 @@ SpatialScrollData ProcessSpatialScrolling(SpatialScrollData scrollData) internal void EndScroll(IControlSpatialScrolling caller) { - if (m_ScrollData.Count == 0) + if (m_ScrollCallers.Count == 0) return; - foreach (var kvp in m_ScrollData) + foreach (var scroller in m_ScrollCallers) { - if (kvp.Key == caller) + if (scroller == caller) { caller.spatialScrollData = null; // clear reference to the previously used scrollData - m_ScrollData.Remove(caller); + m_ScrollCallers.Remove(caller); return; } } From efa42f7e7c3f7f4250afe3976326b8415d350b04 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 22 Aug 2017 23:32:04 -0700 Subject: [PATCH 780/870] Fix locked ray/selection bug, when closing all active PinnedToolButtons via spatial selection --- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 16 +++++++++++----- .../PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 4 ++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 86cde4783..7dbcc70e5 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -94,6 +94,7 @@ void CreatePinnedToolsUI() m_PinnedToolsMenuUI.buttonHovered += OnButtonHover; m_PinnedToolsMenuUI.buttonClicked += OnButtonClick; m_PinnedToolsMenuUI.buttonSelected += OnButtonSelected; + m_PinnedToolsMenuUI.closeMenu += CloseMenu; // Alternate menu origin isn't set when awake or start run var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; @@ -200,7 +201,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { m_PinnedToolsMenuUI.SelectHighlightedButton(); consumeControl(pinnedToolInput.select); - this.Pulse(node, m_HidingPulse); } else if (Time.realtimeSinceStartup < m_AllowToolToggleBeforeThisTime) { @@ -209,10 +209,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon OnButtonClick(); } - this.SetDefaultRayVisibility(rayOrigin, true); - this.UnlockRay(rayOrigin, this); - this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); - this.EndSpatialScroll(this); // Free the spatial scroll data owned by this object + CloseMenu(); } } @@ -231,6 +228,15 @@ void OnButtonSelected(Transform rayOrigin, Type buttonType) { this.SelectTool(rayOrigin, buttonType, false); } + + void CloseMenu() + { + this.Pulse(node, m_HidingPulse); + this.SetDefaultRayVisibility(rayOrigin, true); + this.UnlockRay(rayOrigin, this); + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); + this.EndSpatialScroll(this); // Free the spatial scroll data owned by this object + } } } #endif diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 29ec18f8e..0eae7ca0c 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -132,6 +132,7 @@ public bool spatiallyScrolling public event Action buttonHovered; public event Action buttonClicked; public event Action buttonSelected; + public event Action closeMenu; void Awake() { @@ -419,6 +420,9 @@ public bool DeleteHighlightedButton() buttonSelected(rayOrigin, button.toolType); // Select the new active tool button } + if (!aboveMinimumButtonCount && closeMenu != null) + closeMenu(); // Close the menu if below the minimum button count (only MainMenu & SelectionTool are active) + return button != null; } From 4af374e2aeecb9bee10d8aac74616f3253383fc4 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 23 Aug 2017 17:41:33 -0700 Subject: [PATCH 781/870] Revert RadialMenuSlot AnimateSemiTransparent() scale regression --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 5b2ced4ea..65eb2f055 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -457,6 +457,9 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) const float kFasterMotionMultiplier = 2f; var transitionAmount = Time.deltaTime; var positionWait = (orderIndex + 4) * 0.25f; // pad the order index for a faster start to the transition + var currentScale = transform.localScale; + var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); + var targetScale = makeSemiTransparent ? semiTransparentTargetScale : Vector3.one; var currentFrameColor = m_FrameMaterial.color; var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); var targetFrameColor = m_CanvasGroup.interactable ? (makeSemiTransparent ? m_SemiTransparentFrameColor : s_FrameOpaqueColor) : transparentFrameColor; @@ -476,12 +479,14 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, Mathf.Lerp(currentInsetAlpha, targetInsetAlpha, transitionAmount)); m_IconMaterial.SetColor(k_MaterialColorProperty, Color.Lerp(currentIconColor, targetIconColor, transitionAmount)); var shapedTransitionAmount = Mathf.Pow(transitionAmount, makeSemiTransparent ? 2 : 1) * kFasterMotionMultiplier; + transform.localScale = Vector3.Lerp(currentScale, targetScale, shapedTransitionAmount); m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconScale, shapedTransitionAmount); transitionAmount += Time.deltaTime * positionWait * 3f; CorrectIconRotation(); yield return null; } + transform.localScale = targetScale; m_FrameMaterial.SetColor(k_MaterialColorProperty, targetFrameColor); m_InsetMaterial.SetFloat(k_MaterialAlphaProperty, targetInsetAlpha); m_IconMaterial.SetColor(k_MaterialColorProperty, targetIconColor); From a80bd9559a95f8f5da77ffcfdc8c0239313d06e5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 23 Aug 2017 18:02:48 -0700 Subject: [PATCH 782/870] Remove unused interface from PinnedToolsMenuUI; Trigger hapticPulse on all BackgroundButtonHover cases; Increase scroll range in PinnedToolsMenu PerformScroll() --- Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs | 6 +++--- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 2 +- Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 00837d4f2..6969b8897 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -452,6 +452,9 @@ static string GetTypeAbbreviation(Type type) void OnBackgroundHoverEnter () { + if (hovered != null) // Raised in order to trigger the haptic in the PinnedToolsMenu + hovered(); + if (isMainMenu) { m_GradientButton.highlighted = true; @@ -461,9 +464,6 @@ void OnBackgroundHoverEnter () if (implementsSecondaryButton) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, ShowSecondaryButton()); - if (hovered != null) // Raised in order to trigger the haptic in the PinnedToolsMenu - hovered(); - showAllButtons(this); } diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index 7dbcc70e5..ab8060ecd 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -175,7 +175,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.5f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); + spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.325f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); var normalizedRepeatingPosition = spatialScrollData.normalizedLoopingPosition; if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs index 0eae7ca0c..56875a311 100644 --- a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IInstantiateUI, - IConnectInterfaces, IControlSpatialHinting, IControlHaptics, IUsesRayOrigin + IConnectInterfaces, IControlSpatialHinting, IUsesRayOrigin { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation const int k_ActiveToolOrderPosition = 1; // Active-tool button position used in this particular ToolButton implementation From b1cc079c8215701632c00163275f114c5871bf0f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 23 Aug 2017 18:32:53 -0700 Subject: [PATCH 783/870] Reconcile scaling changes in the RadialMenuSlot when animating into the semi-transparent state; no longer scale, due to set position of PinnedToolButtons --- Menus/RadialMenu/Scripts/RadialMenuSlot.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs index 65eb2f055..514cc8d25 100644 --- a/Menus/RadialMenu/Scripts/RadialMenuSlot.cs +++ b/Menus/RadialMenu/Scripts/RadialMenuSlot.cs @@ -458,8 +458,7 @@ IEnumerator AnimateSemiTransparent(bool makeSemiTransparent) var transitionAmount = Time.deltaTime; var positionWait = (orderIndex + 4) * 0.25f; // pad the order index for a faster start to the transition var currentScale = transform.localScale; - var semiTransparentTargetScale = new Vector3(0.9f, 0.15f, 0.9f); - var targetScale = makeSemiTransparent ? semiTransparentTargetScale : Vector3.one; + var targetScale = Vector3.one; var currentFrameColor = m_FrameMaterial.color; var transparentFrameColor = new Color (s_FrameOpaqueColor.r, s_FrameOpaqueColor.g, s_FrameOpaqueColor.b, 0f); var targetFrameColor = m_CanvasGroup.interactable ? (makeSemiTransparent ? m_SemiTransparentFrameColor : s_FrameOpaqueColor) : transparentFrameColor; From aab2057f4a741b9baeec8f2f011c79cddbb726ae Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 23 Aug 2017 18:34:03 -0700 Subject: [PATCH 784/870] Disable shadow casting & receiving in ToolTip prefab contents; UI shouldn't be shadow casting in this case --- Prefabs/UI/Tooltip.prefab | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Prefabs/UI/Tooltip.prefab b/Prefabs/UI/Tooltip.prefab index 8a9485227..4379e812e 100644 --- a/Prefabs/UI/Tooltip.prefab +++ b/Prefabs/UI/Tooltip.prefab @@ -168,11 +168,11 @@ MeshRenderer: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011696208486} m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: fd8559955928a5b45bf39973c09cc269, type: 2} m_StaticBatchInfo: @@ -200,11 +200,11 @@ MeshRenderer: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011269692594} m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 m_Materials: - {fileID: 2100000, guid: fd8559955928a5b45bf39973c09cc269, type: 2} m_StaticBatchInfo: From 946434f96810bffe150ae2c9e30dc358dcf05f36 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 25 Aug 2017 00:53:12 -0400 Subject: [PATCH 785/870] Refactor IMenu.GetVisible and SetVisibility to IMenu.hideFlags --- Menus/MainMenu/MainMenu.cs | 105 +++++++++--------- Menus/MainMenu/Scripts/MainMenuUI.cs | 4 +- Menus/RadialMenu/RadialMenu.cs | 68 ++++++------ Scripts/Core/EditorVR.Menus.cs | 57 +++------- Scripts/Core/EditorVR.Rays.cs | 4 +- Scripts/Core/EditorVR.Tools.cs | 8 +- Scripts/Core/EditorVR.cs | 6 +- Scripts/Data/MenuHideFlags.cs | 21 ++++ Scripts/Data/MenuHideFlags.cs.meta | 12 ++ Scripts/Interfaces/Entity/IMenu.cs | 13 +-- .../CreatePrimitiveMenu.cs | 20 ++-- 11 files changed, 156 insertions(+), 162 deletions(-) create mode 100644 Scripts/Data/MenuHideFlags.cs create mode 100644 Scripts/Data/MenuHideFlags.cs.meta diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 3a67b0334..47610a9e4 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; using System.Collections.Generic; using System.Linq; @@ -16,37 +16,9 @@ sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantia { const string k_SettingsMenuSectionName = "Settings"; - public ActionMap actionMap { get {return m_MainMenuActionMap; } } [SerializeField] ActionMap m_MainMenuActionMap; - public Transform alternateMenuOrigin - { - get - { - return m_AlternateMenuOrigin; - } - set - { - m_AlternateMenuOrigin = value; - if (m_MainMenuUI) - m_MainMenuUI.alternateMenuOrigin = value; - } - } - Transform m_AlternateMenuOrigin; - - public Transform menuOrigin - { - get { return m_MenuOrigin; } - set - { - m_MenuOrigin = value; - if (m_MainMenuUI) - m_MainMenuUI.menuOrigin = value; - } - } - Transform m_MenuOrigin; - [SerializeField] HapticPulse m_FaceRotationPulse; @@ -65,9 +37,11 @@ public Transform menuOrigin [SerializeField] HapticPulse m_ButtonHoverPulse; - bool m_Visible; + Transform m_AlternateMenuOrigin; + Transform m_MenuOrigin; MainMenuUI m_MainMenuUI; float m_LastRotationInput; + MenuHideFlags m_MenuHideFlags = MenuHideFlags.Hidden; readonly Dictionary m_ToolButtons = new Dictionary(); public List menuTools { private get; set; } @@ -87,6 +61,51 @@ public Transform menuOrigin public bool focus { get { return m_MainMenuUI.hovering; } } + public ActionMap actionMap { get { return m_MainMenuActionMap; } } + + public Transform menuOrigin + { + get { return m_MenuOrigin; } + set + { + m_MenuOrigin = value; + if (m_MainMenuUI) + m_MainMenuUI.menuOrigin = value; + } + } + + public Transform alternateMenuOrigin + { + get { return m_AlternateMenuOrigin; } + set + { + m_AlternateMenuOrigin = value; + if (m_MainMenuUI) + m_MainMenuUI.alternateMenuOrigin = value; + } + } + + public MenuHideFlags menuHideFlags + { + get { return m_MenuHideFlags; } + set + { + var wasVisible = m_MenuHideFlags == 0; + var wasPermanent = (m_MenuHideFlags & MenuHideFlags.Hidden) != 0; + if (m_MenuHideFlags != value) + { + m_MenuHideFlags = value; + if (m_MainMenuUI) + { + var isPermanent = (value & MenuHideFlags.Hidden) != 0; + m_MainMenuUI.visible = value == 0; + if (wasPermanent && value == 0 || wasVisible && isPermanent) + SendVisibilityPulse(); + } + } + } + } + void Start() { m_MainMenuUI = this.InstantiateUI(m_MainMenuPrefab.gameObject).GetComponent(); @@ -94,7 +113,6 @@ void Start() m_MainMenuUI.alternateMenuOrigin = alternateMenuOrigin; m_MainMenuUI.menuOrigin = menuOrigin; m_MainMenuUI.Setup(); - m_MainMenuUI.visible = m_Visible; m_MainMenuUI.buttonHovered += OnButtonHovered; m_MainMenuUI.buttonClicked += OnButtonClicked; @@ -109,25 +127,6 @@ void Start() UpdateToolButtons(); } - public void SetVisible(bool visible, bool temporary = false) - { - if (m_Visible != visible) - { - m_Visible = visible; - if (m_MainMenuUI) - { - m_MainMenuUI.visible = visible; - if (!temporary) - SendVisibilityPulse(); - } - } - } - - public bool GetVisible() - { - return m_Visible; - } - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var mainMenuInput = (MainMenuInput)input; @@ -144,7 +143,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.Pulse(node, m_FaceRotationPulse); } - if (m_Visible) + if (m_MenuHideFlags == 0) consumeControl(mainMenuInput.flickFace); m_LastRotationInput = rotationInput; @@ -255,7 +254,7 @@ MainMenuButton CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip toolt mainMenuButton.button.onClick.RemoveAllListeners(); mainMenuButton.button.onClick.AddListener(() => { - if (m_Visible) + if (m_MenuHideFlags == 0) buttonClickCallback(); }); @@ -283,7 +282,7 @@ void OnButtonHovered(Transform rayOrigin) void SendVisibilityPulse() { - this.Pulse(node, m_Visible ? m_HidePulse : m_ShowPulse); + this.Pulse(node, m_MenuHideFlags == 0 ? m_HidePulse : m_ShowPulse); } } } diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 99433eea5..3b38af9f8 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; using System.Collections; using System.Collections.Generic; @@ -83,7 +83,7 @@ public int targetFaceIndex readonly string k_UncategorizedFaceName = "Uncategorized"; readonly Color k_MenuFacesHiddenColor = new Color(1f, 1f, 1f, 0.5f); - VisibilityState m_VisibilityState = VisibilityState.Visible; + VisibilityState m_VisibilityState = VisibilityState.Hidden; RotationState m_RotationState; MainMenuFace[] m_MenuFaces; Material m_MenuFacesMaterial; diff --git a/Menus/RadialMenu/RadialMenu.cs b/Menus/RadialMenu/RadialMenu.cs index af7ae85a5..4c182b5c2 100644 --- a/Menus/RadialMenu/RadialMenu.cs +++ b/Menus/RadialMenu/RadialMenu.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; @@ -29,6 +29,21 @@ sealed class RadialMenu : MonoBehaviour, IInstantiateUI, IAlternateMenu, IUsesMe HapticPulse m_ButtonClickedPulse; RadialMenuUI m_RadialMenuUI; + List m_MenuActions; + Transform m_AlternateMenuOrigin; + MenuHideFlags m_MenuHideFlags = MenuHideFlags.Hidden; + + public event Action itemWasSelected; + + public Transform rayOrigin { private get; set; } + + public Transform menuOrigin { get; set; } + + public GameObject menuContent { get { return m_RadialMenuUI.gameObject; } } + + public Node? node { get; set; } + + public Bounds localBounds { get { return default(Bounds); } } public List menuActions { @@ -41,14 +56,10 @@ public List menuActions m_RadialMenuUI.actions = value; } } - List m_MenuActions; public Transform alternateMenuOrigin { - get - { - return m_AlternateMenuOrigin; - } + get { return m_AlternateMenuOrigin; } set { m_AlternateMenuOrigin = value; @@ -57,21 +68,20 @@ public Transform alternateMenuOrigin m_RadialMenuUI.alternateMenuOrigin = value; } } - Transform m_AlternateMenuOrigin; - - bool m_Visible; - - public event Action itemWasSelected; - - public Transform rayOrigin { private get; set; } - - public Transform menuOrigin { get; set; } - public GameObject menuContent { get { return m_RadialMenuUI.gameObject; } } - - public Node? node { get; set; } - - public Bounds localBounds { get { return default(Bounds); } } + public MenuHideFlags menuHideFlags + { + get { return m_MenuHideFlags; } + set + { + if (m_MenuHideFlags != value) + { + m_MenuHideFlags = value; + if (m_RadialMenuUI) + m_RadialMenuUI.visible = value == 0; + } + } + } void Start() { @@ -80,30 +90,14 @@ void Start() m_RadialMenuUI.actions = menuActions; this.ConnectInterfaces(m_RadialMenuUI); // Connect interfaces before performing setup on the UI m_RadialMenuUI.Setup(); - m_RadialMenuUI.visible = m_Visible; m_RadialMenuUI.buttonHovered += OnButtonHovered; m_RadialMenuUI.buttonClicked += OnButtonClicked; } - public void SetVisible(bool visible, bool temporary = false) - { - if (m_Visible != visible) - { - m_Visible = visible; - if (m_RadialMenuUI) - m_RadialMenuUI.visible = visible; - } - } - - public bool GetVisible() - { - return m_Visible; - } - public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) { var radialMenuInput = (RadialMenuInput)input; - if (radialMenuInput == null || !m_Visible) + if (radialMenuInput == null || m_MenuHideFlags != 0) return; var inputDirection = radialMenuInput.navigate.vector2; diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 7b496fbb2..1f4875be1 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && UNITY_EDITORVR +#if UNITY_EDITOR && UNITY_EDITORVR using System; using System.Collections.Generic; using System.Linq; @@ -24,18 +24,6 @@ partial class EditorVR class Menus : Nested, IInterfaceConnector, ILateBindInterfaceMethods { - [Flags] - internal enum MenuHideFlags - { - Hidden = 1 << 0, - OtherMenu = 1 << 1, - OverUI = 1 << 2, - OverWorkspace = 1 << 3, - HasDirectSelection = 1 << 4, - - Temporary = OtherMenu | OverUI | OverWorkspace | HasDirectSelection - } - internal class MenuHideData { public MenuHideFlags hideFlags = MenuHideFlags.Hidden; @@ -102,13 +90,12 @@ public void LateBindInterfaceMethods(Tools provider) static void UpdateAlternateMenuForDevice(DeviceData deviceData) { var alternateMenu = deviceData.alternateMenu; - alternateMenu.SetVisible(deviceData.menuHideData[alternateMenu].hideFlags == 0 - && !(deviceData.currentTool is IExclusiveMode)); + alternateMenu.menuHideFlags = deviceData.currentTool is IExclusiveMode ? 0 : deviceData.menuHideData[alternateMenu].hideFlags; // Move the activator button to an alternate position if the alternate menu will be shown var mainMenuActivator = deviceData.mainMenuActivator; if (mainMenuActivator != null) - mainMenuActivator.activatorButtonMoveAway = alternateMenu.GetVisible(); + mainMenuActivator.activatorButtonMoveAway = alternateMenu.menuHideFlags == 0; } internal void UpdateMenuVisibilities() @@ -198,28 +185,19 @@ internal void UpdateMenuVisibilities() var mainMenu = deviceData.mainMenu; var mainMenuHideData = deviceData.menuHideData[mainMenu]; var mainMenuHideFlags = mainMenuHideData.hideFlags; - var mainMenuHidden = (mainMenuHideFlags & MenuHideFlags.Hidden) != 0; - + var lastMainMenuHideFlags = mainMenuHideData.lastHideFlags; - // Hide the main menu if any hideflags are set; if the menu is focused, only hide if Hidden is set (e.g. not temporary) - if (mainMenuHideFlags != 0 && (mainMenuHidden || !mainMenu.focus)) - { - // Hidden state takes effect immediately; Temporary states take effect after a delay - if (mainMenuHidden) - { - mainMenu.SetVisible(false); - } - else if (Time.time > mainMenuHideData.autoHideTime + k_MainMenuAutoHideDelay) - { - mainMenu.SetVisible(false, true); - } - } - // Showing the menu always waits--set autoShowTime to 0 to show instantly - else if (Time.time > mainMenuHideData.autoShowTime + k_MainMenuAutoShowDelay) - { - var wasTemporary = (mainMenuHideData.lastHideFlags & MenuHideFlags.Temporary) != 0; - mainMenu.SetVisible(true, wasTemporary); - } + var permanentlyHidden = (mainMenuHideFlags & MenuHideFlags.Hidden) != 0; + var wasPermanentlyHidden = (lastMainMenuHideFlags & MenuHideFlags.Hidden) != 0; + //Temporary states take effect after a delay + var temporarilyHidden = (mainMenuHideFlags & MenuHideFlags.Temporary) != 0 + && Time.time > mainMenuHideData.autoHideTime + k_MainMenuAutoHideDelay; + var wasTemporarilyHidden = (lastMainMenuHideFlags & MenuHideFlags.Temporary) != 0 + && Time.time > mainMenuHideData.autoShowTime + k_MainMenuAutoShowDelay; + + // If the menu is focused, only hide if Hidden is set (e.g. not temporary) in order to hide the selected tool + if (permanentlyHidden || wasPermanentlyHidden || !mainMenu.focus && (temporarilyHidden || wasTemporarilyHidden)) + mainMenu.menuHideFlags = mainMenuHideFlags; // Disable the main menu activator if any temporary states are set deviceData.mainMenuActivator.interactable = (mainMenuHideFlags & MenuHideFlags.Temporary) == 0; @@ -227,7 +205,7 @@ internal void UpdateMenuVisibilities() // Show/hide custom menu, if it exists var customMenu = deviceData.customMenu; if (customMenu != null) - customMenu.SetVisible(deviceData.menuHideData[customMenu].hideFlags == 0); + customMenu.menuHideFlags = deviceData.menuHideData[customMenu].hideFlags; UpdateAlternateMenuForDevice(deviceData); Rays.UpdateRayForDevice(deviceData, deviceData.rayOrigin); @@ -471,7 +449,7 @@ internal static IMainMenu SpawnMainMenu(Type type, InputDevice device, bool visi var mainMenu = (IMainMenu)ObjectUtils.AddComponent(type, evr.gameObject); input = evr.GetModule().CreateActionMapInputForObject(mainMenu, device); evr.m_Interfaces.ConnectInterfaces(mainMenu, device); - mainMenu.SetVisible(visible); + mainMenu.menuHideFlags = visible ? 0 : MenuHideFlags.Hidden; return mainMenu; } @@ -486,7 +464,6 @@ internal static IAlternateMenu SpawnAlternateMenu(Type type, InputDevice device, var alternateMenu = (IAlternateMenu)ObjectUtils.AddComponent(type, evr.gameObject); input = evr.GetModule().CreateActionMapInputForObject(alternateMenu, device); evr.m_Interfaces.ConnectInterfaces(alternateMenu, device); - alternateMenu.SetVisible(false); return alternateMenu; } diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index ca7adb5dd..94a86c5f5 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && UNITY_EDITORVR +#if UNITY_EDITOR && UNITY_EDITORVR using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Helpers; @@ -109,7 +109,7 @@ internal static void UpdateRayForDevice(DeviceData deviceData, Transform rayOrig { var mainMenu = deviceData.mainMenu; var customMenu = deviceData.customMenu; - if (mainMenu.GetVisible() || (customMenu != null && customMenu.GetVisible())) + if (mainMenu.menuHideFlags == 0 || (customMenu != null && customMenu.menuHideFlags == 0)) { AddVisibilitySettings(rayOrigin, mainMenu, false, false); } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 90d6e5c11..0159cbd5e 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR && UNITY_EDITORVR +#if UNITY_EDITOR && UNITY_EDITORVR using System; using System.Collections.Generic; using System.Linq; @@ -233,7 +233,7 @@ static bool SelectTool(Transform rayOrigin, Type toolType) } else { - deviceData.menuHideData[deviceData.mainMenu].hideFlags |= Menus.MenuHideFlags.Hidden; + deviceData.menuHideData[deviceData.mainMenu].hideFlags |= MenuHideFlags.Hidden; } }); @@ -330,7 +330,7 @@ internal static void UpdatePlayerHandleMaps(List maps) var mainMenuInput = deviceData.mainMenuInput; if (mainMenu != null && mainMenuInput != null) { - mainMenuInput.active = mainMenu.GetVisible(); + mainMenuInput.active = mainMenu.menuHideFlags == 0; if (!maps.Contains(mainMenuInput)) maps.Add(mainMenuInput); @@ -340,7 +340,7 @@ internal static void UpdatePlayerHandleMaps(List maps) var alternateMenuInput = deviceData.alternateMenuInput; if (alternateMenu != null && alternateMenuInput != null) { - alternateMenuInput.active = alternateMenu.GetVisible(); + alternateMenuInput.active = alternateMenu.menuHideFlags == 0; if (!maps.Contains(alternateMenuInput)) maps.Add(alternateMenuInput); diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index be4f08b71..d27162644 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; using System.Collections; using System.Collections.Generic; @@ -372,12 +372,12 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate var mainMenu = deviceData.mainMenu; var menuInput = mainMenu as IProcessInput; - if (menuInput != null && mainMenu.GetVisible()) + if (menuInput != null && mainMenu.menuHideFlags == 0) menuInput.ProcessInput(deviceData.mainMenuInput, consumeControl); var altMenu = deviceData.alternateMenu; var altMenuInput = altMenu as IProcessInput; - if (altMenuInput != null && altMenu.GetVisible()) + if (altMenuInput != null && altMenu.menuHideFlags == 0) altMenuInput.ProcessInput(deviceData.alternateMenuInput, consumeControl); foreach (var toolData in deviceData.toolData) diff --git a/Scripts/Data/MenuHideFlags.cs b/Scripts/Data/MenuHideFlags.cs new file mode 100644 index 000000000..f33d228c8 --- /dev/null +++ b/Scripts/Data/MenuHideFlags.cs @@ -0,0 +1,21 @@ +#if UNITY_EDITOR +using System; + +namespace UnityEditor.Experimental.EditorVR.Menus +{ + /// + /// Flags to describe why a menu is hidden. Anything > 0 is hidden + /// + [Flags] + public enum MenuHideFlags + { + Hidden = 1 << 0, + OtherMenu = 1 << 1, + OverUI = 1 << 2, + OverWorkspace = 1 << 3, + HasDirectSelection = 1 << 4, + + Temporary = OtherMenu | OverUI | OverWorkspace | HasDirectSelection + } +} +#endif diff --git a/Scripts/Data/MenuHideFlags.cs.meta b/Scripts/Data/MenuHideFlags.cs.meta new file mode 100644 index 000000000..b4107ec97 --- /dev/null +++ b/Scripts/Data/MenuHideFlags.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5ff1d8443e89e8d4896157039b874d84 +timeCreated: 1503629049 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Interfaces/Entity/IMenu.cs b/Scripts/Interfaces/Entity/IMenu.cs index 3b5a82c4d..556eecf0f 100644 --- a/Scripts/Interfaces/Entity/IMenu.cs +++ b/Scripts/Interfaces/Entity/IMenu.cs @@ -1,4 +1,6 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR +using System; +using UnityEditor.Experimental.EditorVR.Menus; using UnityEngine; namespace UnityEditor.Experimental.EditorVR @@ -9,14 +11,9 @@ namespace UnityEditor.Experimental.EditorVR public interface IMenu { /// - /// Set whether the menu is visible or not + /// Visibility state of this menu /// - void SetVisible(bool visible, bool temporary = false); - - /// - /// Get whether the menu is visible or not - /// - bool GetVisible(); + MenuHideFlags menuHideFlags { get; set; } /// /// GameObject that this component is attached to diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs index 50984b4ef..c8ea7e7e3 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs @@ -1,5 +1,6 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; +using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -15,26 +16,19 @@ sealed class CreatePrimitiveMenu : MonoBehaviour, IMenu public Bounds localBounds { get; private set; } - public GameObject menuContent + public MenuHideFlags menuHideFlags { - get { return gameObject; } + get { return gameObject.activeSelf ? MenuHideFlags.Hidden : 0; } + set { gameObject.SetActive(value == 0); } } + public GameObject menuContent { get { return gameObject; } } + void Awake() { localBounds = ObjectUtils.GetBounds(transform); } - public void SetVisible(bool visible, bool temporary = false) - { - gameObject.SetActive(visible); - } - - public bool GetVisible() - { - return gameObject.activeSelf; - } - public void SelectPrimitive(int type) { selectPrimitive((PrimitiveType)type, false); From 652600e62917424dd6be6db764b208294fe41ddc Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 25 Aug 2017 01:18:15 -0400 Subject: [PATCH 786/870] Implement remaining PR feedback --- Scripts/Core/EditorVR.MiniWorlds.cs | 2 +- .../IntersectionModule/IntersectionModule.cs | 7 +-- .../IntersectionModule/IntersectionTester.cs | 3 +- .../MultipleRayInputModule.cs | 45 +++++++++---------- Scripts/UI/MainMenuActivator.cs | 11 ++--- Tools/TransformTool/TransformTool.cs | 4 +- 6 files changed, 33 insertions(+), 39 deletions(-) diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index ab14ac019..b5e42f81d 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -193,7 +193,7 @@ bool IsInMiniWorld(Transform rayOrigin) { var rayOriginPosition = rayOrigin.position; var pointerPosition = rayOriginPosition + rayOrigin.forward * DirectSelection.GetPointerLength(rayOrigin); - if (miniWorld.Contains(rayOrigin.position) || miniWorld.Contains(pointerPosition)) + if (miniWorld.Contains(rayOriginPosition) || miniWorld.Contains(pointerPosition)) return true; } return false; diff --git a/Scripts/Modules/IntersectionModule/IntersectionModule.cs b/Scripts/Modules/IntersectionModule/IntersectionModule.cs index f8c6e8567..a6031ef98 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionModule.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionModule.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Data; using UnityEditor.Experimental.EditorVR.Utilities; @@ -74,9 +74,10 @@ void Update() { var intersectionFound = false; m_Intersections.Clear(); - if (m_SpatialHash.GetIntersections(m_Intersections, tester.collider.bounds)) + var testerCollider = tester.collider; + if (m_SpatialHash.GetIntersections(m_Intersections, testerCollider.bounds)) { - var testerBounds = tester.collider.bounds; + var testerBounds = testerCollider.bounds; var testerBoundsCenter = testerBounds.center; m_SortedIntersections.Clear(); diff --git a/Scripts/Modules/IntersectionModule/IntersectionTester.cs b/Scripts/Modules/IntersectionModule/IntersectionTester.cs index f9eac4a10..ea152a460 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionTester.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionTester.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using UnityEngine; namespace UnityEditor.Experimental.EditorVR.Modules @@ -80,6 +80,7 @@ public Vector3[] vertices { if (!m_Collider) m_Collider = GetComponentInChildren(); + return m_Collider; } } diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index fa5bd315c..ea51e0477 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -248,7 +248,8 @@ void HandlePointerExitAndEnter(RayEventData eventData, GameObject newEnterTarget // This will modify the event data (new target will be set) base.HandlePointerExitAndEnter(eventData, newEnterTarget); - if (newEnterTarget == null || cachedEventData.pointerEnter == null) + var pointerEnter = cachedEventData.pointerEnter; + if (newEnterTarget == null || pointerEnter == null) { for (var i = 0; i < cachedEventData.hovered.Count; ++i) { @@ -263,46 +264,44 @@ void HandlePointerExitAndEnter(RayEventData eventData, GameObject newEnterTarget return; } - Transform t = null; - if (!exitOnly) { // if we have not changed hover target - if (cachedEventData.pointerEnter == newEnterTarget && newEnterTarget) + if (newEnterTarget && pointerEnter == newEnterTarget) { - t = newEnterTarget.transform; - while (t != null) + var transform = newEnterTarget.transform; + while (transform != null) { - ExecuteEvents.Execute(t.gameObject, cachedEventData, ExecuteRayEvents.rayHoverHandler); + ExecuteEvents.Execute(transform.gameObject, cachedEventData, ExecuteRayEvents.rayHoverHandler); if (rayHovering != null) - rayHovering(t.gameObject, cachedEventData); + rayHovering(transform.gameObject, cachedEventData); - t = t.parent; + transform = transform.parent; } return; } } - GameObject commonRoot = FindCommonRoot(cachedEventData.pointerEnter, newEnterTarget); + GameObject commonRoot = FindCommonRoot(pointerEnter, newEnterTarget); // and we already an entered object from last time - if (cachedEventData.pointerEnter != null) + if (pointerEnter != null) { // send exit handler call to all elements in the chain // until we reach the new target, or null! - t = cachedEventData.pointerEnter.transform; + var transform = pointerEnter.transform; - while (t != null) + while (transform != null) { // if we reach the common root break out! - if (commonRoot != null && commonRoot.transform == t) + if (commonRoot != null && commonRoot.transform == transform) break; - ExecuteEvents.Execute(t.gameObject, cachedEventData, ExecuteRayEvents.rayExitHandler); + ExecuteEvents.Execute(transform.gameObject, cachedEventData, ExecuteRayEvents.rayExitHandler); if (rayExited != null) - rayExited(t.gameObject, cachedEventData); + rayExited(transform.gameObject, cachedEventData); - t = t.parent; + transform = transform.parent; } } @@ -310,19 +309,19 @@ void HandlePointerExitAndEnter(RayEventData eventData, GameObject newEnterTarget { // now issue the enter call up to but not including the common root cachedEventData.pointerEnter = newEnterTarget; - t = newEnterTarget.transform; - while (t != null && t.gameObject != commonRoot) + var transform = newEnterTarget.transform; + while (transform != null && transform.gameObject != commonRoot) { - ExecuteEvents.Execute(t.gameObject, cachedEventData, ExecuteRayEvents.rayEnterHandler); + ExecuteEvents.Execute(transform.gameObject, cachedEventData, ExecuteRayEvents.rayEnterHandler); if (rayEntered != null) - rayEntered(t.gameObject, cachedEventData); + rayEntered(transform.gameObject, cachedEventData); - t = t.parent; + transform = transform.parent; } } } - private void OnSelectPressed(RaycastSource source) + void OnSelectPressed(RaycastSource source) { Deselect(); diff --git a/Scripts/UI/MainMenuActivator.cs b/Scripts/UI/MainMenuActivator.cs index b3d959631..fb0bafa9f 100644 --- a/Scripts/UI/MainMenuActivator.cs +++ b/Scripts/UI/MainMenuActivator.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; using System.Collections; using UnityEditor.Experimental.EditorVR.Core; @@ -47,9 +47,7 @@ public bool activatorButtonMoveAway m_ActivatorButtonMoveAway = value; - this.StopCoroutine(ref m_ActivatorMoveCoroutine); - - m_ActivatorMoveCoroutine = StartCoroutine(AnimateMoveActivatorButton(m_ActivatorButtonMoveAway)); + this.RestartCoroutine(ref m_ActivatorMoveCoroutine, AnimateMoveActivatorButton(m_ActivatorButtonMoveAway)); } } bool m_ActivatorButtonMoveAway; @@ -141,10 +139,7 @@ public void OnPointerExit(PointerEventData eventData) void SetHighlight(bool highlighted) { - if (m_HighlightCoroutine != null) - StopCoroutine(m_HighlightCoroutine); - - m_HighlightCoroutine = StartCoroutine(Highlight(highlighted)); + this.RestartCoroutine(ref m_HighlightCoroutine, Highlight(highlighted)); } public void OnPointerClick(PointerEventData eventData) diff --git a/Tools/TransformTool/TransformTool.cs b/Tools/TransformTool/TransformTool.cs index 7e5775bf3..9fa2d1d3c 100644 --- a/Tools/TransformTool/TransformTool.cs +++ b/Tools/TransformTool/TransformTool.cs @@ -1,4 +1,4 @@ -#if UNITY_EDITOR +#if UNITY_EDITOR using System; using System.Collections.Generic; using System.Linq; @@ -307,8 +307,6 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (manipulatorGameObject.activeSelf && (hoveringSelection || hasLeft || hasRight)) manipulatorGameObject.SetActive(false); - //Debug.Log(directSelection.Count); - foreach (var kvp in directSelection) { var directRayOrigin = kvp.Key; From ebba95dcadf342daa42b9c35736ee5b4784c2404 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 25 Aug 2017 00:35:59 -0700 Subject: [PATCH 787/870] Perform first round of PR suggested changes --- Menus/MainMenu/MainMenu.cs | 22 +- Menus/MainMenu/Scripts/MainMenuButton.cs | 15 +- .../PinnedToolButton/PinnedToolButton.cs | 248 +++++++++--------- .../PinnedToolButton/PinnedToolButton.prefab | 20 +- Menus/PinnedToolMenu/PinnedToolsMenu.cs | 36 ++- Menus/PinnedToolMenu/Scripts/HintIcon.cs | 2 +- Menus/PinnedToolMenu/Scripts/HintLine.cs | 2 +- Scripts/Core/EditorVR.PinnedToolButtons.cs | 8 +- Scripts/Core/EditorVR.Tools.cs | 8 +- Scripts/UI/Interfaces/IMenuIcon.cs | 4 +- Scripts/UI/Interfaces/IPinnedToolsMenu.cs | 2 +- 11 files changed, 181 insertions(+), 186 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index ec3933393..98a769167 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -175,7 +175,7 @@ void CreateFaceButtons(List types) if (buttonData == null) buttonData = new MainMenuUI.ButtonData(type.Name); - CreateFaceButton(buttonData, tooltip, () => + var mainMenuButton = CreateFaceButton(buttonData, tooltip, () => { if (targetRayOrigin) { @@ -183,6 +183,9 @@ void CreateFaceButtons(List types) UpdateToolButtons(); } }, selectedType); + + // Assign pinned tool button preview properties + mainMenuButton.toolType = selectedType; } if (isWorkspace) @@ -238,25 +241,22 @@ void CreateFaceButtons(List types) } } - void CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action buttonClickCallback, Type selectedType = null) + MainMenuButton CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action buttonClickCallback, Type selectedType = null) { var mainMenuButton = m_MainMenuUI.CreateFaceButton(buttonData); - mainMenuButton.button.onClick.RemoveAllListeners(); - mainMenuButton.button.onClick.AddListener(() => + var button = mainMenuButton.button; + button.onClick.RemoveAllListeners(); + button.onClick.AddListener(() => { if (visible) buttonClickCallback(); }); + mainMenuButton.hovered += OnButtonHovered; + mainMenuButton.clicked += OnButtonClicked; mainMenuButton.tooltip = tooltip; - if (selectedType != null) - { - // Assign pinned tool button preview properties - mainMenuButton.toolType = selectedType; - mainMenuButton.hovered += OnButtonHovered; - mainMenuButton.clicked += OnButtonClicked; - } + return mainMenuButton; } void UpdateToolButtons() diff --git a/Menus/MainMenu/Scripts/MainMenuButton.cs b/Menus/MainMenu/Scripts/MainMenuButton.cs index 671e9bf05..31790e49a 100644 --- a/Menus/MainMenu/Scripts/MainMenuButton.cs +++ b/Menus/MainMenu/Scripts/MainMenuButton.cs @@ -2,11 +2,12 @@ using System; using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; +using UnityEngine.EventSystems; using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExitHandler, IRayClickHandler + sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExitHandler, IPointerClickHandler { [SerializeField] Button m_Button; @@ -27,12 +28,6 @@ sealed class MainMenuButton : MonoBehaviour, ITooltip, IRayEnterHandler, IRayExi public Type toolType { get; set; } - public void OnRayClick(RayEventData eventData) - { - if (clicked != null) - clicked(eventData.rayOrigin); - } - public bool selected { set @@ -75,6 +70,12 @@ public void OnRayExit(RayEventData eventData) if (hovered != null) hovered(eventData.rayOrigin, null, null); } + + public void OnPointerClick(PointerEventData eventData) + { + if (clicked != null) + clicked(null); // Pass null to perform the selection haptic pulse on both nodes + } } } #endif diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs index 6969b8897..fbf7da976 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs @@ -7,11 +7,12 @@ using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using UnityEngine.Serialization; using UnityEngine.UI; namespace UnityEditor.Experimental.EditorVR.Menus { - public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor + sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor { static Color s_FrameOpaqueColor; @@ -21,6 +22,109 @@ public sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, IToolt const string k_MainMenuTipText = "Main Menu"; readonly Vector3 k_ToolButtonActivePosition = new Vector3(0f, 0f, -0.035f); + [SerializeField] + GradientButton m_GradientButton; + + [SerializeField] + Transform m_IconContainer; + + [SerializeField] + Transform m_PrimaryUIContentContainer; + + [SerializeField] + CanvasGroup m_IconContainerCanvasGroup; + + [SerializeField] + SkinnedMeshRenderer m_FrameRenderer; + + [SerializeField] + SkinnedMeshRenderer m_InsetMeshRenderer; + + [SerializeField] + Collider[] m_PrimaryButtonColliders; + + [SerializeField] + [FormerlySerializedAs("m_CloseButton")] + GradientButton m_CloseButton; + + [SerializeField] + [FormerlySerializedAs("m_CloseButtonContainerCanvasGroup")] + CanvasGroup m_CloseButtonContainerCanvasGroup; + + [SerializeField] + [FormerlySerializedAs("m_CloseInsetMeshRenderer")] + SkinnedMeshRenderer m_CloseInsetMeshRenderer; + + [SerializeField] + [FormerlySerializedAs("m_CloseInsetMaskMeshRenderer")] + SkinnedMeshRenderer m_CloseInsetMaskMeshRenderer; + + [SerializeField] + [FormerlySerializedAs("m_CloseButtonColliders")] + Collider[] m_CloseButtonColliders; // disable for the main menu button & solitary primary tool button + + [SerializeField] + Transform m_TooltipTarget; + + [SerializeField] + Transform m_TooltipSource; + + [SerializeField] + Vector3 m_AlternateLocalPosition; + + [SerializeField] + Image m_ButtonIcon; + + Coroutine m_PositionCoroutine; + Coroutine m_VisibilityCoroutine; + Coroutine m_HighlightCoroutine; + Coroutine m_ActivatorMoveCoroutine; + Coroutine m_HoverCheckCoroutine; + Coroutine m_SecondaryButtonVisibilityCoroutine; + + string m_TooltipText; + string m_PreviewToolDescription; + bool m_MoveToAlternatePosition; + int m_Order = -1; + Type m_PreviewToolType; + Type m_ToolType; + GradientPair m_GradientPair; + Material m_FrameMaterial; + Material m_InsetMaterial; + Vector3 m_OriginalLocalPosition; + Vector3 m_OriginalLocalScale; + Material m_IconMaterial; + Vector3 m_OriginalIconContainerLocalScale; + Sprite m_Icon; + Sprite m_PreviewIcon; + bool m_Highlighted; + bool m_ActiveTool; + + public Transform tooltipTarget { get { return m_TooltipTarget; } set { m_TooltipTarget = value; } } + public Transform tooltipSource { get { return m_TooltipSource; } } + public TextAlignment tooltipAlignment { get; private set; } + public Transform rayOrigin { get; set; } + public Node node { get; set; } + public ITooltip tooltip { private get; set; } // Overrides text + public GradientPair customToolTipHighlightColor { get; set; } + public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } + public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } + public int activeButtonCount { get; set; } + public int maxButtonCount { get; set; } + public Transform menuOrigin { get; set; } + public bool implementsSecondaryButton { get; set; } + + public Action openMenu { get; set; } + public Action selectTool { get; set; } + public Func closeButton { get; set; } + public Action highlightSingleButton { get; set; } + public Action selectHighlightedButton { get; set; } + public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu + public Func visibleButtonCount { get; set; } + public Action destroy { get { return DestroyButton; } } + public Action showAllButtons { private get; set; } + public Action hoverExit { get; set; } + public Type toolType { get @@ -70,7 +174,7 @@ public int order this.RestartCoroutine(ref m_PositionCoroutine, AnimatePosition(m_Order)); - if(m_Order == -1) + if (m_Order == -1) this.HideTooltip(this); } } @@ -159,104 +263,6 @@ public string tooltipText private set { m_TooltipText = value; } } - [SerializeField] - GradientButton m_GradientButton; - - [SerializeField] - Transform m_IconContainer; - - [SerializeField] - Transform m_PrimaryUIContentContainer; - - [SerializeField] - CanvasGroup m_IconContainerCanvasGroup; - - [SerializeField] - SkinnedMeshRenderer m_FrameRenderer; - - [SerializeField] - SkinnedMeshRenderer m_InsetMeshRenderer; - - [SerializeField] - Collider[] m_PrimaryButtonColliders; - - [SerializeField] - GradientButton m_SecondaryGradientButton; - - [SerializeField] - CanvasGroup m_SecondaryButtonContainerCanvasGroup; - - [SerializeField] - SkinnedMeshRenderer m_SecondaryInsetMeshRenderer; - - [SerializeField] - SkinnedMeshRenderer m_SecondaryInsetMaskMeshRenderer; - - [SerializeField] - Collider[] m_SecondaryButtonColliders; // disable for the main menu button & solitary primary tool button - - [SerializeField] - Transform m_TooltipTarget; - - [SerializeField] - Transform m_TooltipSource; - - [SerializeField] - Vector3 m_AlternateLocalPosition; - - [SerializeField] - Image m_ButtonIcon; - - Coroutine m_PositionCoroutine; - Coroutine m_VisibilityCoroutine; - Coroutine m_HighlightCoroutine; - Coroutine m_ActivatorMoveCoroutine; - Coroutine m_HoverCheckCoroutine; - Coroutine m_SecondaryButtonVisibilityCoroutine; - - string m_TooltipText; - string m_PreviewToolDescription; - bool m_MoveToAlternatePosition; - int m_Order = -1; - Type m_PreviewToolType; - Type m_ToolType; - GradientPair m_GradientPair; - Material m_FrameMaterial; - Material m_InsetMaterial; - Vector3 m_OriginalLocalPosition; - Vector3 m_OriginalLocalScale; - Material m_IconMaterial; - Vector3 m_OriginalIconContainerLocalScale; - Sprite m_Icon; - Sprite m_PreviewIcon; - bool m_Highlighted; - bool m_ActiveTool; - - public Transform tooltipTarget { get { return m_TooltipTarget; } set { m_TooltipTarget = value; } } - public Transform tooltipSource { get { return m_TooltipSource; } } - public TextAlignment tooltipAlignment { get; private set; } - public Transform rayOrigin { get; set; } - public Node node { get; set; } - public ITooltip tooltip { private get; set; } // Overrides text - public GradientPair customToolTipHighlightColor { get; set; } - public bool isSelectionTool { get { return m_ToolType != null && m_ToolType == typeof(Tools.SelectionTool); } } - public bool isMainMenu { get { return m_ToolType != null && m_ToolType == typeof(IMainMenu); } } - public int activeButtonCount { get; set; } - public int maxButtonCount { get; set; } - public Transform menuOrigin { get; set; } - public bool implementsSecondaryButton { get; set; } - - public Action OpenMenu { get; set; } - public Action selectTool { get; set; } - public Func closeButton { get; set; } - public Action highlightSingleButton { get; set; } - public Action selectHighlightedButton { get; set; } - public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu - public Func visibleButtonCount { get; set; } - public Action destroy { get { return DestroyButton; } } - public Action showAllButtons { private get; set; } - public Action hoverExit { get; set; } - public bool isActiveTool { private get { return m_ActiveTool; } @@ -299,7 +305,7 @@ public bool highlighted } } - public bool secondaryButtonHighlighted { get { return m_SecondaryGradientButton.highlighted; } } + public bool secondaryButtonHighlighted { get { return m_CloseButton.highlighted; } } public bool toolTipVisible { @@ -325,7 +331,7 @@ bool secondaryButtonCollidersEnabled { set { - foreach (var collider in m_SecondaryButtonColliders) + foreach (var collider in m_CloseButtonColliders) { collider.enabled = value; } @@ -406,13 +412,13 @@ void Start() m_GradientButton.containerContentsAnimationSpeedMultiplier = kIncreasedContainerContentsSpeedMultiplier; m_FrameRenderer.SetBlendShapeWeight(1, 0f); - m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, 100f); - m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, 100f); + m_CloseInsetMeshRenderer.SetBlendShapeWeight(0, 100f); + m_CloseInsetMaskMeshRenderer.SetBlendShapeWeight(0, 100f); - m_SecondaryGradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions - m_SecondaryGradientButton.hoverExit += OnActionButtonHoverExit; - m_SecondaryGradientButton.click += OnSecondaryButtonClicked; - m_SecondaryButtonContainerCanvasGroup.alpha = 0f; + m_CloseButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions + m_CloseButton.hoverExit += OnActionButtonHoverExit; + m_CloseButton.click += OnSecondaryButtonClicked; + m_CloseButtonContainerCanvasGroup.alpha = 0f; } void OnDestroy() @@ -483,7 +489,7 @@ void ActionButtonHoverExit() return; } - if (!m_SecondaryGradientButton.highlighted) + if (!m_CloseButton.highlighted) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); hoverExit(); @@ -659,7 +665,7 @@ void CorrectIconRotation() IEnumerator ShowSecondaryButton() { // Don't perform additional animated visuals if already in a fully revealed state - if (Mathf.Approximately(m_SecondaryButtonContainerCanvasGroup.alpha, 1f)) + if (Mathf.Approximately(m_CloseButtonContainerCanvasGroup.alpha, 1f)) { m_SecondaryButtonVisibilityCoroutine = null; yield break; @@ -691,17 +697,17 @@ IEnumerator ShowSecondaryButton() this.StopCoroutine(ref m_HighlightCoroutine); - var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); - var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; + var currentSecondaryButtonVisibilityAmount = m_CloseInsetMeshRenderer.GetBlendShapeWeight(0); + var currentSecondaryCanvasGroupAlpha = m_CloseButtonContainerCanvasGroup.alpha; currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); currentDuration = 0f; while (currentDuration < 1f) { var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(currentDuration += Time.unscaledDeltaTime * kDurationMultiplier); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, kFrameSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); - m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); - m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); - m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 1f, shapedAmount); + m_CloseInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); + m_CloseInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonVisibleBlendShapeWeight, shapedAmount)); + m_CloseButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 1f, shapedAmount); yield return null; } @@ -721,14 +727,14 @@ IEnumerator HideSecondaryButton() const float kSecondaryButtonHiddenBlendShapeWeight = 100f; const int kDurationMultiplier = 12; var currentVisibilityAmount = m_FrameRenderer.GetBlendShapeWeight(1); - var currentSecondaryButtonVisibilityAmount = m_SecondaryInsetMeshRenderer.GetBlendShapeWeight(0); - var currentSecondaryCanvasGroupAlpha = m_SecondaryButtonContainerCanvasGroup.alpha; + var currentSecondaryButtonVisibilityAmount = m_CloseInsetMeshRenderer.GetBlendShapeWeight(0); + var currentSecondaryCanvasGroupAlpha = m_CloseButtonContainerCanvasGroup.alpha; var amount = 0f; while (amount < 1f) { yield return null; - if (m_SecondaryGradientButton.highlighted) + if (m_CloseButton.highlighted) { m_SecondaryButtonVisibilityCoroutine = null; yield break; @@ -738,9 +744,9 @@ IEnumerator HideSecondaryButton() var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(amount += Time.unscaledDeltaTime * kDurationMultiplier); m_FrameRenderer.SetBlendShapeWeight(1, Mathf.Lerp(currentVisibilityAmount, 0f, shapedAmount)); - m_SecondaryInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); - m_SecondaryInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); - m_SecondaryButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 0f, shapedAmount); + m_CloseInsetMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); + m_CloseInsetMaskMeshRenderer.SetBlendShapeWeight(0, Mathf.Lerp(currentSecondaryButtonVisibilityAmount, kSecondaryButtonHiddenBlendShapeWeight, shapedAmount)); + m_CloseButtonContainerCanvasGroup.alpha = Mathf.Lerp(currentSecondaryCanvasGroupAlpha, 0f, shapedAmount); } m_SecondaryButtonVisibilityCoroutine = null; diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab index 938da5b1b..ec0b6085f 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab +++ b/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab @@ -870,7 +870,7 @@ MonoBehaviour: m_BeginHighlightDuration: 0.25 m_EndHighlightDuration: 0.3 m_DelayBeforeReveal: 0 - m_highlightZScaleMultiplier: 25 + m_HighlightZScaleMultiplier: 25 --- !u!114 &114000010635728284 MonoBehaviour: m_ObjectHideFlags: 1 @@ -916,7 +916,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_GradientButton: {fileID: 114000014181189902} - m_SmoothMotion: {fileID: 0} m_IconContainer: {fileID: 4000011872301252} m_PrimaryUIContentContainer: {fileID: 4181584002966386} m_IconContainerCanvasGroup: {fileID: 225000010727404378} @@ -927,19 +926,14 @@ MonoBehaviour: - {fileID: 65000012136550866} - {fileID: 65000010544999880} - {fileID: 65000012534630730} - m_SecondaryGradientButton: {fileID: 114000010373680160} - m_SecondaryButtonContainerCanvasGroup: {fileID: 225000012815828682} - m_SecondaryInsetMeshRenderer: {fileID: 137000012837336366} - m_SecondaryInsetMaskMeshRenderer: {fileID: 137000010072420284} - m_SecondaryButtonColliders: - - {fileID: 65000012409633396} - - {fileID: 65000010321053192} - - {fileID: 65000011573248474} + m_CloseButton: {fileID: 114000010373680160} + m_CloseButtonContainerCanvasGroup: {fileID: 225000012815828682} + m_CloseInsetMeshRenderer: {fileID: 137000012837336366} + m_CloseInsetMaskMeshRenderer: {fileID: 137000010072420284} + m_CloseButtonColliders: [] m_TooltipTarget: {fileID: 4000010683372396} m_TooltipSource: {fileID: 4000013378434912} m_AlternateLocalPosition: {x: 0, y: 0, z: 0} - m_Inset: {fileID: 0} - m_InsetMask: {fileID: 0} m_ButtonIcon: {fileID: 114000011650556854} --- !u!114 &114000011650556854 MonoBehaviour: @@ -1061,7 +1055,7 @@ MonoBehaviour: m_BeginHighlightDuration: 0.25 m_EndHighlightDuration: 0.167 m_DelayBeforeReveal: 0 - m_highlightZScaleMultiplier: 10 + m_HighlightZScaleMultiplier: 10 --- !u!137 &137000010072420284 SkinnedMeshRenderer: m_ObjectHideFlags: 1 diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/PinnedToolMenu/PinnedToolsMenu.cs index ab8060ecd..3a4664b69 100644 --- a/Menus/PinnedToolMenu/PinnedToolsMenu.cs +++ b/Menus/PinnedToolMenu/PinnedToolsMenu.cs @@ -14,7 +14,7 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac IControlHaptics, IUsesViewerScale, IControlSpatialScrolling, IControlSpatialHinting, ISetDefaultRayVisibility, IUsesRayOrigin { const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation - const int k_MaxButtonCount = 16; // + const int k_MaxButtonCount = 16; [SerializeField] Sprite m_MainMenuIcon; @@ -38,24 +38,23 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac HapticPulse m_HidingPulse; // The pulse performed when ending a spatial selection Transform m_RayOrigin; - Transform m_AlternateMenuOrigin; float m_AllowToolToggleBeforeThisTime; Vector3 m_SpatialScrollStartPosition; - IPinnedToolButton m_MainMenuButton; PinnedToolsMenuUI m_PinnedToolsMenuUI; public Transform menuOrigin { get; set; } List buttons { get { return m_PinnedToolsMenuUI.buttons; } } public bool alternateMenuVisible { set { m_PinnedToolsMenuUI.moveToAlternatePosition = value; } } - public Action HighlightSingleButton { get; set; } - public Action SelectHighlightedButton { get; set; } - public Action SetButtonForType { get; set; } + public Action highlightSingleButton { get; set; } + public Action selectHighlightedButton { get; set; } + public Action setButtonForType { get; set; } public Action deletePinnedToolButton { get; set; } public Node? node { get; set; } - public IPinnedToolButton previewToolButton { get { return m_MainMenuButton; } } - public Transform alternateMenuOrigin { get { return m_AlternateMenuOrigin; } set { m_AlternateMenuOrigin = value; } } + public IPinnedToolButton previewToolButton { get; private set; } + public Transform alternateMenuOrigin { get; set; } public SpatialScrollModule.SpatialScrollData spatialScrollData { get; set; } + public ActionMap actionMap { get { return m_MainMenuActionMap; } } public Transform rayOrigin { @@ -69,14 +68,9 @@ public Transform rayOrigin } } - public ActionMap actionMap - { - get { return m_MainMenuActionMap; } - } - void Awake() { - SetButtonForType = CreatePinnedToolButton; + setButtonForType = CreatePinnedToolButton; deletePinnedToolButton = DeletePinnedToolButton; } @@ -98,7 +92,7 @@ void CreatePinnedToolsUI() // Alternate menu origin isn't set when awake or start run var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; - pinnedToolsUITransform.SetParent(m_AlternateMenuOrigin); + pinnedToolsUITransform.SetParent(alternateMenuOrigin); pinnedToolsUITransform.localPosition = Vector3.zero; pinnedToolsUITransform.localRotation = Quaternion.identity; } @@ -106,7 +100,7 @@ void CreatePinnedToolsUI() void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) { // Select an existing ToolButton if the type is already present in a button - if (buttons.Any( (x) => x.toolType == toolType)) + if (buttons.Any( x => x.toolType == toolType)) { m_PinnedToolsMenuUI.SelectExistingToolType(toolType); return; @@ -122,12 +116,12 @@ void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) button.rayOrigin = rayOrigin; button.toolType = toolType; // Assign Tool Type before assigning order button.icon = toolType != typeof(IMainMenu) ? buttonIcon : m_MainMenuIcon; - button.highlightSingleButton = HighlightSingleButton; - button.selectHighlightedButton = SelectHighlightedButton; + button.highlightSingleButton = highlightSingleButton; + button.selectHighlightedButton = selectHighlightedButton; button.rayOrigin = rayOrigin; if (toolType == typeof(IMainMenu)) - m_MainMenuButton = button; + previewToolButton = button; m_PinnedToolsMenuUI.AddButton(button, buttonTransform); } @@ -151,7 +145,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { this.SetDefaultRayVisibility(rayOrigin, false); this.LockRay(rayOrigin, this); - m_SpatialScrollStartPosition = m_AlternateMenuOrigin.position; + m_SpatialScrollStartPosition = alternateMenuOrigin.position; m_AllowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; this.SetSpatialHintControlObject(rayOrigin); m_PinnedToolsMenuUI.spatiallyScrolling = true; // Triggers the display of the directional hint arrows @@ -175,7 +169,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, m_AlternateMenuOrigin.position, 0.325f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); + spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); var normalizedRepeatingPosition = spatialScrollData.normalizedLoopingPosition; if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/PinnedToolMenu/Scripts/HintIcon.cs index 34eee4625..84401e80c 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/PinnedToolMenu/Scripts/HintIcon.cs @@ -81,7 +81,7 @@ void Awake() IEnumerator AnimateShow() { var currentDuration = 0f; - var targetDuration = 0f; + float targetDuration; var currentLocalScale = m_IconTransform.localScale; if (currentLocalScale == k_HiddenScale) { diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/PinnedToolMenu/Scripts/HintLine.cs index c9f73fc2b..de8ba288a 100644 --- a/Menus/PinnedToolMenu/Scripts/HintLine.cs +++ b/Menus/PinnedToolMenu/Scripts/HintLine.cs @@ -32,7 +32,7 @@ public class HintLine : MonoBehaviour public float LineWidth { set { m_ScrollLineRenderer.SetWidth(value, value); } } /// - /// set the start & end positions for the line visuals + /// Set the start & end positions for the line visuals /// public Vector3[] Positions { set { m_ScrollLineRenderer.SetPositions(value) ; } } diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.PinnedToolButtons.cs index 6b9598031..6399f57fc 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.PinnedToolButtons.cs @@ -18,7 +18,7 @@ public PinnedToolButtons() IMainMenuMethods.clearPinnedToolButtonPreview = ClearPinnedToolButtonPreview; } - internal void PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, string toolDescription) + private static void PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, string toolDescription) { // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions if (!toolType.GetInterfaces().Contains(typeof(ITool))) @@ -35,7 +35,7 @@ internal void PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, }); } - internal void ClearPinnedToolButtonPreview() + private static void ClearPinnedToolButtonPreview() { Rays.ForEachProxyDevice((deviceData) => { @@ -43,7 +43,7 @@ internal void ClearPinnedToolButtonPreview() }); } - internal void OnToolButtonClicked(Transform rayOrigin, Type toolType) + private static void OnToolButtonClicked(Transform rayOrigin, Type toolType) { if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); @@ -51,7 +51,7 @@ internal void OnToolButtonClicked(Transform rayOrigin, Type toolType) Tools.SelectTool(rayOrigin, toolType); } - internal void OnMainMenuActivatorSelected(Transform rayOrigin) + private static void OnMainMenuActivatorSelected(Transform rayOrigin) { var targetToolRayOrigin = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin != rayOrigin).rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin == rayOrigin); diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 71a80857c..04f9b9e40 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -120,8 +120,8 @@ internal static void SpawnDefaultTools(IProxy proxy) var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); deviceData.pinnedToolsMenu = pinnedToolsMenu; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; - pinnedToolsMenu.SetButtonForType(typeof(IMainMenu), null); - pinnedToolsMenu.SetButtonForType(typeof(SelectionTool), selectionToolData != null ? selectionToolData.icon : null); + pinnedToolsMenu.setButtonForType(typeof(IMainMenu), null); + pinnedToolsMenu.setButtonForType(typeof(SelectionTool), selectionToolData != null ? selectionToolData.icon : null); } evr.GetModule().UpdatePlayerHandleMaps(); @@ -210,7 +210,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn else if (!currentToolIsSelect && setSelectAsCurrentTool) { // Set the selection tool as the active tool, if select is to be the new current tool - pinnedToolsMenu.SetButtonForType(typeof(SelectionTool), null); + pinnedToolsMenu.setButtonForType(typeof(SelectionTool), null); } spawnTool = false; @@ -243,7 +243,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn AddToolToStack(data, newTool); - pinnedToolsMenu.SetButtonForType(toolType, newTool.icon); + pinnedToolsMenu.setButtonForType(toolType, newTool.icon); } } diff --git a/Scripts/UI/Interfaces/IMenuIcon.cs b/Scripts/UI/Interfaces/IMenuIcon.cs index afbdf05a2..a190679fe 100644 --- a/Scripts/UI/Interfaces/IMenuIcon.cs +++ b/Scripts/UI/Interfaces/IMenuIcon.cs @@ -4,12 +4,12 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Declares a class as a menu UI element that can be represented via an icon/sprite + /// Provides an icon/sprite to display on a menu item which represents this class /// public interface IMenuIcon { /// - /// The icon representing this Action that can be displayed in menus + /// The icon representing this class that can be displayed in menus /// Sprite icon { get; } } diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs index 123c3becd..5e969241a 100644 --- a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs +++ b/Scripts/UI/Interfaces/IPinnedToolsMenu.cs @@ -25,7 +25,7 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod /// Function that assigns & sets up a tool button for a given tool type /// This method isn't hooked up in EVR, it should reside in the implementing class /// - Action SetButtonForType { get; } + Action setButtonForType { get; } /// /// Delete the tool button with corresponding type of the first parameter. From 412aebda6b55a9c85a00e07d73120681e93dea33 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 25 Aug 2017 18:02:58 -0700 Subject: [PATCH 788/870] Perform many PR changes --- Menus/MainMenu/MainMenu.cs | 4 +- Menus/{PinnedToolMenu.meta => ToolMenu.meta} | 0 .../HapticPulses.meta | 0 .../PinnedToolButtonClickPulse.asset | 0 .../PinnedToolButtonClickPulse.asset.meta | 0 .../PinnedToolButtonHoverPulse.asset | 0 .../PinnedToolButtonHoverPulse.asset.meta | 0 .../PinnedToolMenuHidingPulse.asset | 0 .../PinnedToolMenuHidingPulse.asset.meta | 0 .../PinnedToolsMenu.cs | 0 .../PinnedToolsMenu.cs.meta | 0 .../PinnedToolslMenuInput.asset | 0 .../PinnedToolslMenuInput.asset.meta | 0 .../PinnedToolslMenuInput.cs | 0 .../PinnedToolslMenuInput.cs.meta | 0 .../{PinnedToolMenu => ToolMenu}/Prefabs.meta | 0 .../Prefabs/PinnedToolsMenu.prefab | 0 .../Prefabs/PinnedToolsMenu.prefab.meta | 0 .../{PinnedToolMenu => ToolMenu}/Scripts.meta | 0 .../Scripts/HintIcon.cs | 52 ++++++------------- .../Scripts/HintIcon.cs.meta | 0 .../Scripts/HintLine.cs | 0 .../Scripts/HintLine.cs.meta | 0 .../Scripts/PinnedToolsMenuUI.cs | 0 .../Scripts/PinnedToolsMenuUI.cs.meta | 0 .../Textures.meta | 0 .../Textures/HintArrow.png | 0 .../Textures/HintArrow.png.meta | 0 .../Textures/SecondaryHintArrow.png | 0 .../Textures/SecondaryHintArrow.png.meta | 0 .../Textures/UnityIcon.png | 0 .../Textures/UnityIcon.png.meta | 0 .../ToolMenuButton.meta} | 0 .../ToolMenuButton}/Materials.meta | 0 .../Materials/PinnedToolButton.mat | 0 .../Materials/PinnedToolButton.mat.meta | 0 .../Materials/PinnedToolButtonBorder.mat | 0 .../Materials/PinnedToolButtonBorder.mat.meta | 0 .../Materials/PinnedToolButtonFaceMask.mat | 0 .../PinnedToolButtonFaceMask.mat.meta | 0 .../Materials/PinnedToolButtonUIContent.mat | 0 .../PinnedToolButtonUIContent.mat.meta | 0 .../ToolMenuButton}/PinnedToolButton.cs | 46 ++++------------ .../ToolMenuButton}/PinnedToolButton.cs.meta | 0 .../ToolMenuButton}/PinnedToolButton.prefab | 0 .../PinnedToolButton.prefab.meta | 0 Scripts/Core/EditorVR.Menus.cs | 2 +- ...nedToolButtons.cs => EditorVR.ToolMenu.cs} | 26 +++++----- ...tons.cs.meta => EditorVR.ToolMenu.cs.meta} | 0 Scripts/Core/EditorVR.Tools.cs | 10 ++-- Scripts/Core/EditorVR.cs | 4 +- Scripts/Interfaces/Entity/IMainMenu.cs | 28 +--------- .../IPreviewInToolMenuButton.cs | 40 ++++++++++++++ .../IPreviewInToolMenuButton.cs.meta | 12 +++++ 54 files changed, 102 insertions(+), 122 deletions(-) rename Menus/{PinnedToolMenu.meta => ToolMenu.meta} (100%) rename Menus/{PinnedToolMenu => ToolMenu}/HapticPulses.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/HapticPulses/PinnedToolButtonClickPulse.asset (100%) rename Menus/{PinnedToolMenu => ToolMenu}/HapticPulses/PinnedToolButtonClickPulse.asset.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/HapticPulses/PinnedToolButtonHoverPulse.asset (100%) rename Menus/{PinnedToolMenu => ToolMenu}/HapticPulses/PinnedToolButtonHoverPulse.asset.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/HapticPulses/PinnedToolMenuHidingPulse.asset (100%) rename Menus/{PinnedToolMenu => ToolMenu}/HapticPulses/PinnedToolMenuHidingPulse.asset.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/PinnedToolsMenu.cs (100%) rename Menus/{PinnedToolMenu => ToolMenu}/PinnedToolsMenu.cs.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/PinnedToolslMenuInput.asset (100%) rename Menus/{PinnedToolMenu => ToolMenu}/PinnedToolslMenuInput.asset.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/PinnedToolslMenuInput.cs (100%) rename Menus/{PinnedToolMenu => ToolMenu}/PinnedToolslMenuInput.cs.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Prefabs.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Prefabs/PinnedToolsMenu.prefab (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Prefabs/PinnedToolsMenu.prefab.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Scripts.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Scripts/HintIcon.cs (69%) rename Menus/{PinnedToolMenu => ToolMenu}/Scripts/HintIcon.cs.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Scripts/HintLine.cs (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Scripts/HintLine.cs.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Scripts/PinnedToolsMenuUI.cs (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Scripts/PinnedToolsMenuUI.cs.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Textures.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Textures/HintArrow.png (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Textures/HintArrow.png.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Textures/SecondaryHintArrow.png (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Textures/SecondaryHintArrow.png.meta (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Textures/UnityIcon.png (100%) rename Menus/{PinnedToolMenu => ToolMenu}/Textures/UnityIcon.png.meta (100%) rename Menus/{PinnedToolMenu/PinnedToolButton.meta => ToolMenu/ToolMenuButton.meta} (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials.meta (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials/PinnedToolButton.mat (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials/PinnedToolButton.mat.meta (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials/PinnedToolButtonBorder.mat (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials/PinnedToolButtonBorder.mat.meta (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials/PinnedToolButtonFaceMask.mat (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials/PinnedToolButtonFaceMask.mat.meta (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials/PinnedToolButtonUIContent.mat (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/Materials/PinnedToolButtonUIContent.mat.meta (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/PinnedToolButton.cs (93%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/PinnedToolButton.cs.meta (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/PinnedToolButton.prefab (100%) rename Menus/{PinnedToolMenu/PinnedToolButton => ToolMenu/ToolMenuButton}/PinnedToolButton.prefab.meta (100%) rename Scripts/Core/{EditorVR.PinnedToolButtons.cs => EditorVR.ToolMenu.cs} (63%) rename Scripts/Core/{EditorVR.PinnedToolButtons.cs.meta => EditorVR.ToolMenu.cs.meta} (100%) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs.meta diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 98a769167..29c146179 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -279,10 +279,10 @@ void OnButtonHovered(Transform rayOrigin, Type buttonType, string buttonDescript // Pass the pointer which is over us, so this information can supply context (e.g. selecting a tool for a different hand) // Enable preview-mode on a pinned tool button; Display on the opposite proxy device by evaluating the entering RayOrigin // Disable any existing previews being displayed in PinnedToolsMenus - this.ClearPinnedToolButtonPreview(); + this.ClearToolMenuButtonPreview(); if (buttonType != null && rayOrigin != null) - this.PreviewInPinnedToolButton(rayOrigin, buttonType, buttonDescription); + this.PreviewInToolMenuButton(rayOrigin, buttonType, buttonDescription); } void OnOpening() diff --git a/Menus/PinnedToolMenu.meta b/Menus/ToolMenu.meta similarity index 100% rename from Menus/PinnedToolMenu.meta rename to Menus/ToolMenu.meta diff --git a/Menus/PinnedToolMenu/HapticPulses.meta b/Menus/ToolMenu/HapticPulses.meta similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses.meta rename to Menus/ToolMenu/HapticPulses.meta diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset b/Menus/ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset rename to Menus/ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta b/Menus/ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta rename to Menus/ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset b/Menus/ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset rename to Menus/ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta b/Menus/ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta rename to Menus/ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset b/Menus/ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset rename to Menus/ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset diff --git a/Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta b/Menus/ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta similarity index 100% rename from Menus/PinnedToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta rename to Menus/ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs b/Menus/ToolMenu/PinnedToolsMenu.cs similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolsMenu.cs rename to Menus/ToolMenu/PinnedToolsMenu.cs diff --git a/Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta b/Menus/ToolMenu/PinnedToolsMenu.cs.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolsMenu.cs.meta rename to Menus/ToolMenu/PinnedToolsMenu.cs.meta diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset b/Menus/ToolMenu/PinnedToolslMenuInput.asset similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolslMenuInput.asset rename to Menus/ToolMenu/PinnedToolslMenuInput.asset diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.asset.meta b/Menus/ToolMenu/PinnedToolslMenuInput.asset.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolslMenuInput.asset.meta rename to Menus/ToolMenu/PinnedToolslMenuInput.asset.meta diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs b/Menus/ToolMenu/PinnedToolslMenuInput.cs similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolslMenuInput.cs rename to Menus/ToolMenu/PinnedToolslMenuInput.cs diff --git a/Menus/PinnedToolMenu/PinnedToolslMenuInput.cs.meta b/Menus/ToolMenu/PinnedToolslMenuInput.cs.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolslMenuInput.cs.meta rename to Menus/ToolMenu/PinnedToolslMenuInput.cs.meta diff --git a/Menus/PinnedToolMenu/Prefabs.meta b/Menus/ToolMenu/Prefabs.meta similarity index 100% rename from Menus/PinnedToolMenu/Prefabs.meta rename to Menus/ToolMenu/Prefabs.meta diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/ToolMenu/Prefabs/PinnedToolsMenu.prefab similarity index 100% rename from Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab rename to Menus/ToolMenu/Prefabs/PinnedToolsMenu.prefab diff --git a/Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab.meta b/Menus/ToolMenu/Prefabs/PinnedToolsMenu.prefab.meta similarity index 100% rename from Menus/PinnedToolMenu/Prefabs/PinnedToolsMenu.prefab.meta rename to Menus/ToolMenu/Prefabs/PinnedToolsMenu.prefab.meta diff --git a/Menus/PinnedToolMenu/Scripts.meta b/Menus/ToolMenu/Scripts.meta similarity index 100% rename from Menus/PinnedToolMenu/Scripts.meta rename to Menus/ToolMenu/Scripts.meta diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs b/Menus/ToolMenu/Scripts/HintIcon.cs similarity index 69% rename from Menus/PinnedToolMenu/Scripts/HintIcon.cs rename to Menus/ToolMenu/Scripts/HintIcon.cs index 84401e80c..d23323494 100644 --- a/Menus/PinnedToolMenu/Scripts/HintIcon.cs +++ b/Menus/ToolMenu/Scripts/HintIcon.cs @@ -45,16 +45,7 @@ public class HintIcon : MonoBehaviour /// /// Bool denoting the visibility state of this icon /// - public bool visible - { - set - { - if (value) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); - else - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); - } - } + public bool visible { set { this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateVisibility(value)); } } /// /// The color to be displayed by this icon when it is visible @@ -64,7 +55,7 @@ public Color visibleColor set { m_VisibleColor = value; - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + visible = true; } } @@ -78,12 +69,14 @@ void Awake() visible = false; } - IEnumerator AnimateShow() + IEnumerator AnimateVisibility(bool show = true) { var currentDuration = 0f; float targetDuration; var currentLocalScale = m_IconTransform.localScale; - if (currentLocalScale == k_HiddenScale) + var targetLocalScale = show ? m_VisibleLocalScale : k_HiddenScale; + // Only perform this wait if showing/revealing, not hiding + if (show && currentLocalScale == k_HiddenScale) { // Only perform delay if fully hidden; otherwise resume showing targetDuration = Random.Range(0.125f, 0.175f); // Set an initial random wait duration @@ -95,38 +88,23 @@ IEnumerator AnimateShow() } currentDuration = 0f; - targetDuration = m_ShowDuration; // Set animated reveal duration - var currentColor = m_Icon.color; - while (currentDuration < targetDuration) - { - var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / targetDuration); - shapedDuration = Mathf.Pow(shapedDuration, 4); - m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, m_VisibleLocalScale, shapedDuration); - m_Icon.color = Color.Lerp(currentColor, m_VisibleColor, shapedDuration); - currentDuration += Time.unscaledDeltaTime; - yield return null; - } - - m_IconTransform.localScale = m_VisibleLocalScale; - } - - IEnumerator AnimateHide() - { - var currentDuration = 0f; - var targetDuration = m_HideDuration + (m_SlightlyRandomizeHideDuration ? 0f : Random.Range(0.125f, 0.2f)); // Set an initial random wait duration - var currentLocalScale = m_IconTransform.localScale; + targetDuration = show ? m_ShowDuration : m_HideDuration + (m_SlightlyRandomizeHideDuration ? 0f : Random.Range(0.125f, 0.2f)); // Set an initial random wait duration + const int kAdditionalDurationShaping = 4; + const int kAdditionalHideSpeedScalar = 3; var currentColor = m_Icon.color; + var targetColor = show ? m_VisibleColor : m_HiddenColor; while (currentDuration < targetDuration) { var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / targetDuration); - shapedDuration = Mathf.Pow(shapedDuration, 4); - m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, k_HiddenScale, shapedDuration); - m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration * 3); + shapedDuration = Mathf.Pow(shapedDuration, kAdditionalDurationShaping); + var colorLerpAmount = show ? shapedDuration : currentDuration * kAdditionalHideSpeedScalar; + m_IconTransform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedDuration); + m_Icon.color = Color.Lerp(currentColor, targetColor, colorLerpAmount); currentDuration += Time.unscaledDeltaTime; yield return null; } - m_IconTransform.localScale = k_HiddenScale; + m_IconTransform.localScale = targetLocalScale; } /// diff --git a/Menus/PinnedToolMenu/Scripts/HintIcon.cs.meta b/Menus/ToolMenu/Scripts/HintIcon.cs.meta similarity index 100% rename from Menus/PinnedToolMenu/Scripts/HintIcon.cs.meta rename to Menus/ToolMenu/Scripts/HintIcon.cs.meta diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs b/Menus/ToolMenu/Scripts/HintLine.cs similarity index 100% rename from Menus/PinnedToolMenu/Scripts/HintLine.cs rename to Menus/ToolMenu/Scripts/HintLine.cs diff --git a/Menus/PinnedToolMenu/Scripts/HintLine.cs.meta b/Menus/ToolMenu/Scripts/HintLine.cs.meta similarity index 100% rename from Menus/PinnedToolMenu/Scripts/HintLine.cs.meta rename to Menus/ToolMenu/Scripts/HintLine.cs.meta diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs similarity index 100% rename from Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs rename to Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs diff --git a/Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs.meta b/Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs.meta similarity index 100% rename from Menus/PinnedToolMenu/Scripts/PinnedToolsMenuUI.cs.meta rename to Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs.meta diff --git a/Menus/PinnedToolMenu/Textures.meta b/Menus/ToolMenu/Textures.meta similarity index 100% rename from Menus/PinnedToolMenu/Textures.meta rename to Menus/ToolMenu/Textures.meta diff --git a/Menus/PinnedToolMenu/Textures/HintArrow.png b/Menus/ToolMenu/Textures/HintArrow.png similarity index 100% rename from Menus/PinnedToolMenu/Textures/HintArrow.png rename to Menus/ToolMenu/Textures/HintArrow.png diff --git a/Menus/PinnedToolMenu/Textures/HintArrow.png.meta b/Menus/ToolMenu/Textures/HintArrow.png.meta similarity index 100% rename from Menus/PinnedToolMenu/Textures/HintArrow.png.meta rename to Menus/ToolMenu/Textures/HintArrow.png.meta diff --git a/Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png b/Menus/ToolMenu/Textures/SecondaryHintArrow.png similarity index 100% rename from Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png rename to Menus/ToolMenu/Textures/SecondaryHintArrow.png diff --git a/Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png.meta b/Menus/ToolMenu/Textures/SecondaryHintArrow.png.meta similarity index 100% rename from Menus/PinnedToolMenu/Textures/SecondaryHintArrow.png.meta rename to Menus/ToolMenu/Textures/SecondaryHintArrow.png.meta diff --git a/Menus/PinnedToolMenu/Textures/UnityIcon.png b/Menus/ToolMenu/Textures/UnityIcon.png similarity index 100% rename from Menus/PinnedToolMenu/Textures/UnityIcon.png rename to Menus/ToolMenu/Textures/UnityIcon.png diff --git a/Menus/PinnedToolMenu/Textures/UnityIcon.png.meta b/Menus/ToolMenu/Textures/UnityIcon.png.meta similarity index 100% rename from Menus/PinnedToolMenu/Textures/UnityIcon.png.meta rename to Menus/ToolMenu/Textures/UnityIcon.png.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton.meta b/Menus/ToolMenu/ToolMenuButton.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton.meta rename to Menus/ToolMenu/ToolMenuButton.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials.meta b/Menus/ToolMenu/ToolMenuButton/Materials.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials.meta rename to Menus/ToolMenu/ToolMenuButton/Materials.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButton.mat b/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButton.mat rename to Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButton.mat.meta b/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButton.mat.meta rename to Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonBorder.mat b/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonBorder.mat rename to Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta b/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonBorder.mat.meta rename to Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat b/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat rename to Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta b/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonFaceMask.mat.meta rename to Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat b/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat rename to Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat diff --git a/Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta b/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/Materials/PinnedToolButtonUIContent.mat.meta rename to Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs similarity index 93% rename from Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs rename to Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs index fbf7da976..b026bb879 100644 --- a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs +++ b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs @@ -379,6 +379,8 @@ public bool moveToAlternatePosition } } + bool visible { set { this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateVisibility(value)); } } + public Vector3 primaryUIContentContainerLocalScale { get { return m_PrimaryUIContentContainer.localScale; } set { m_PrimaryUIContentContainer.localScale = value; } } public float iconHighlightedLocalZOffset { set { m_GradientButton.iconHighlightedLocalZOffset = value; } } @@ -537,51 +539,28 @@ IEnumerator AnimateHideAndDestroy() ObjectUtils.Destroy(gameObject, 0.1f); } - IEnumerator AnimateHide() + IEnumerator AnimateVisibility(bool show = true) { - const float kTimeScalar = 8f; - var targetPosition = Vector3.zero; + const float kSpeedScalar = 8f; + var targetPosition = show ? (moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition) : Vector3.zero; + var targetScale = show ? (moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_AlternateLocalScaleMultiplier) : Vector3.zero; var currentPosition = transform.localPosition; var currentIconScale = m_IconContainer.localScale; - var targetIconContainerScale = Vector3.zero; + var targetIconContainerScale = show ? m_OriginalIconContainerLocalScale : Vector3.zero; var transitionAmount = 0f; var currentScale = transform.localScale; while (transitionAmount < 1) { - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount += Time.unscaledDeltaTime * kTimeScalar); - m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); - transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); - transform.localScale = Vector3.Lerp(currentScale, Vector3.zero, shapedAmount); - yield return null; - } - - m_IconContainer.localScale = targetIconContainerScale; - transform.localPosition = targetPosition; - m_VisibilityCoroutine = null; - } - - IEnumerator AnimateShow() - { - const float kTimeScalar = 8f; - var targetScale = moveToAlternatePosition ? m_OriginalLocalScale : m_OriginalLocalScale * k_AlternateLocalScaleMultiplier; - var targetPosition = moveToAlternatePosition ? m_AlternateLocalPosition : m_OriginalLocalPosition; - var currentIconScale = m_IconContainer.localScale; - var targetIconContainerScale = m_OriginalIconContainerLocalScale; - var transitionAmount = 0f; - var currentScale = transform.localScale; - var currentPosition = transform.localPosition; - while (transitionAmount < 1) - { - var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount += Time.unscaledDeltaTime * kTimeScalar); + var shapedAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount += Time.unscaledDeltaTime * kSpeedScalar); m_IconContainer.localScale = Vector3.Lerp(currentIconScale, targetIconContainerScale, shapedAmount); transform.localPosition = Vector3.Lerp(currentPosition, targetPosition, shapedAmount); transform.localScale = Vector3.Lerp(currentScale, targetScale, shapedAmount); yield return null; } - transform.localPosition = targetPosition; - transform.localScale = targetScale; m_IconContainer.localScale = targetIconContainerScale; + transform.localScale = targetScale; + transform.localPosition = targetPosition; m_VisibilityCoroutine = null; } @@ -592,10 +571,7 @@ IEnumerator AnimatePosition(int orderPosition) this.RestartCoroutine(ref m_SecondaryButtonVisibilityCoroutine, HideSecondaryButton()); - if (orderPosition == -1) - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); - else - this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); + visible = orderPosition != -1; const float kTimeScalar = 6f; const float kCenterLocationAmount = 0.5f; diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.meta b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.cs.meta rename to Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs.meta diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab rename to Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab diff --git a/Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab.meta b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab.meta similarity index 100% rename from Menus/PinnedToolMenu/PinnedToolButton/PinnedToolButton.prefab.meta rename to Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab.meta diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index f1b4fbdb8..17687376d 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -177,7 +177,7 @@ static void UpdateAlternateMenuForDevice(DeviceData deviceData) alternateMenu.visible = deviceData.menuHideFlags[alternateMenu] == 0 && !(deviceData.currentTool is IExclusiveMode); // Move the pinned tool buttons to an alternate position if the alternate menu will be shown - var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenu = deviceData.ToolMenu; pinnedToolsMenu.alternateMenuVisible = alternateMenu.visible; } diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs b/Scripts/Core/EditorVR.ToolMenu.cs similarity index 63% rename from Scripts/Core/EditorVR.PinnedToolButtons.cs rename to Scripts/Core/EditorVR.ToolMenu.cs index 6399f57fc..c74242263 100644 --- a/Scripts/Core/EditorVR.PinnedToolButtons.cs +++ b/Scripts/Core/EditorVR.ToolMenu.cs @@ -7,20 +7,20 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - class PinnedToolButtons : Nested + class ToolMenu : Nested { - public PinnedToolButtons() + public ToolMenu() { IPinnedToolsMenuMethods.mainMenuActivatorSelected = OnMainMenuActivatorSelected; IPinnedToolsMenuMethods.selectTool = OnToolButtonClicked; - IMainMenuMethods.previewInPinnedToolButton = PreviewToolInPinnedToolButton; - IMainMenuMethods.clearPinnedToolButtonPreview = ClearPinnedToolButtonPreview; + IPreviewInToolMenuButtonMethods.previewInToolMenuButton = PreviewToolInToolMenuButton; + IPreviewInToolMenuButtonMethods.clearToolMenuButtonPreview = ClearToolMenuButtonPreview; } - private static void PreviewToolInPinnedToolButton (Transform rayOrigin, Type toolType, string toolDescription) + static void PreviewToolInToolMenuButton (Transform rayOrigin, Type toolType, string toolDescription) { - // Prevents menu buttons of types other than ITool from triggering any pinned tool button preview actions + // Prevents menu buttons of types other than ITool from triggering any ToolMenuButton preview actions if (!toolType.GetInterfaces().Contains(typeof(ITool))) return; @@ -28,22 +28,22 @@ private static void PreviewToolInPinnedToolButton (Transform rayOrigin, Type too { if (deviceData.rayOrigin == rayOrigin) // Enable pinned tool preview on the opposite (handed) device { - var previewPinnedToolButton = deviceData.pinnedToolsMenu.previewToolButton; - previewPinnedToolButton.previewToolType = toolType; - previewPinnedToolButton.previewToolDescription = toolDescription; + var previewToolMenuButton = deviceData.ToolMenu.previewToolButton; + previewToolMenuButton.previewToolType = toolType; + previewToolMenuButton.previewToolDescription = toolDescription; } }); } - private static void ClearPinnedToolButtonPreview() + static void ClearToolMenuButtonPreview() { Rays.ForEachProxyDevice((deviceData) => { - deviceData.pinnedToolsMenu.previewToolButton.previewToolType = null; + deviceData.ToolMenu.previewToolButton.previewToolType = null; }); } - private static void OnToolButtonClicked(Transform rayOrigin, Type toolType) + static void OnToolButtonClicked(Transform rayOrigin, Type toolType) { if (toolType == typeof(IMainMenu)) OnMainMenuActivatorSelected(rayOrigin); @@ -51,7 +51,7 @@ private static void OnToolButtonClicked(Transform rayOrigin, Type toolType) Tools.SelectTool(rayOrigin, toolType); } - private static void OnMainMenuActivatorSelected(Transform rayOrigin) + static void OnMainMenuActivatorSelected(Transform rayOrigin) { var targetToolRayOrigin = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin != rayOrigin).rayOrigin; var deviceData = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin == rayOrigin); diff --git a/Scripts/Core/EditorVR.PinnedToolButtons.cs.meta b/Scripts/Core/EditorVR.ToolMenu.cs.meta similarity index 100% rename from Scripts/Core/EditorVR.PinnedToolButtons.cs.meta rename to Scripts/Core/EditorVR.ToolMenu.cs.meta diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 04f9b9e40..d495915b7 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -118,7 +118,7 @@ internal static void SpawnDefaultTools(IProxy proxy) // Setup PinnedToolsMenu var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); - deviceData.pinnedToolsMenu = pinnedToolsMenu; + deviceData.ToolMenu = pinnedToolsMenu; pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; pinnedToolsMenu.setButtonForType(typeof(IMainMenu), null); pinnedToolsMenu.setButtonForType(typeof(SelectionTool), selectionToolData != null ? selectionToolData.icon : null); @@ -193,21 +193,21 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn var currentToolType = currentTool.GetType(); var currentToolIsSelect = currentToolType == typeof(SelectionTool); var setSelectAsCurrentTool = toolType == typeof(SelectionTool) && !currentToolIsSelect; - var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenu = deviceData.ToolMenu; // If this tool was on the current device already, remove it, if it is selected while already being the current tool var despawn = (!currentToolIsSelect && currentToolType == toolType && despawnOnReselect) || setSelectAsCurrentTool;// || setSelectAsCurrentTool || toolType == typeof(IMainMenu); if (currentTool != null && despawn) { DespawnTool(deviceData, currentTool); - if (!currentToolIsSelect && !setSelectAsCurrentTool) + if (!setSelectAsCurrentTool) { // Delete a button of the first type parameter // Then select a button the second type param (the new current tool) // Don't spawn a new tool, since we are only removing the old tool pinnedToolsMenu.deletePinnedToolButton(toolType, currentToolType); } - else if (!currentToolIsSelect && setSelectAsCurrentTool) + else if (setSelectAsCurrentTool) { // Set the selection tool as the active tool, if select is to be the new current tool pinnedToolsMenu.setButtonForType(typeof(SelectionTool), null); @@ -362,7 +362,7 @@ internal static void UpdatePlayerHandleMaps(List maps) maps.Add(alternateMenuInput); } - var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenu = deviceData.ToolMenu; var pinnedToolsMenuInput = deviceData.pinnedToolsMenuInput; if (pinnedToolsMenu != null && pinnedToolsMenuInput != null) { diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 3f3b3feb7..52efa78bb 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -78,7 +78,7 @@ class DeviceData public ActionMapInput alternateMenuInput; public ITool currentTool; public IMenu customMenu; - public IPinnedToolsMenu pinnedToolsMenu; + public IPinnedToolsMenu ToolMenu; public ActionMapInput pinnedToolsMenuInput; public readonly Dictionary menuHideFlags = new Dictionary(); public readonly Dictionary menuSizes = new Dictionary(); @@ -385,7 +385,7 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate if (altMenuInput != null && altMenu.visible) altMenuInput.ProcessInput(deviceData.alternateMenuInput, consumeControl); - var pinnedToolsMenu = deviceData.pinnedToolsMenu; + var pinnedToolsMenu = deviceData.ToolMenu; var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; if (pinnedToolsMenuInput != null) pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index f9d09bf3e..f5dd8f967 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR /// /// The main menu that can be shown on device proxies /// - public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool + public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool, IPreviewInToolMenuButton { /// /// The menu tools that will populate the menu @@ -35,31 +35,5 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Transform targetRayOrigin { set; } } - - public static class IMainMenuMethods - { - public static Action previewInPinnedToolButton { get; set; } - - /// - /// Highlights a pinned tool button when a menu button is highlighted - /// Transform: Ray origin to check - /// Type: MenuButton's tool type to preview - /// String: The tool description to display as a Tooltip - /// - public static void PreviewInPinnedToolButton (this IMainMenu obj, Transform rayOrigin, Type toolType, string toolDescription) - { - previewInPinnedToolButton(rayOrigin, toolType, toolDescription); - } - - public static Action clearPinnedToolButtonPreview { get; set; } - - /// - /// Clears any PinnedToolButton previews that are set - /// - public static void ClearPinnedToolButtonPreview (this IMainMenu obj) - { - clearPinnedToolButtonPreview(); - } - } } #endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs b/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs new file mode 100644 index 000000000..3c14c647c --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs @@ -0,0 +1,40 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Gives decorated class the ability to preview tools in a ToolButton + /// + public interface IPreviewInToolMenuButton + { + } + + public static class IPreviewInToolMenuButtonMethods + { + public static Action previewInToolMenuButton { get; set; } + + /// + /// Highlights a ToolMenuButton when a menu button is highlighted + /// Transform: Ray origin to check + /// Type: MenuButton's tool type to preview + /// String: The tool description to display as a Tooltip + /// + public static void PreviewInToolMenuButton (this IMainMenu obj, Transform rayOrigin, Type toolType, string toolDescription) + { + previewInToolMenuButton(rayOrigin, toolType, toolDescription); + } + + public static Action clearToolMenuButtonPreview { get; set; } + + /// + /// Clears any ToolMenuButton previews that are set + /// + public static void ClearToolMenuButtonPreview (this IMainMenu obj) + { + clearToolMenuButtonPreview(); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs.meta new file mode 100644 index 000000000..18029bb7d --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d036595a7f8413746b5378b0f2fe2898 +timeCreated: 1503708538 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 24dc6e955e1595a40c1102bc09b3472c59917a03 Mon Sep 17 00:00:00 2001 From: andrewm Date: Tue, 29 Aug 2017 10:39:00 -0700 Subject: [PATCH 789/870] Fixes #247 Size setter for list view controller base is now virtual, which lets the asset grid view invalidate its hidden item index when that value is set. --- Scripts/ListView/ListViewControllerBase.cs | 2 +- .../Scripts/AssetGridViewController.cs | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Scripts/ListView/ListViewControllerBase.cs b/Scripts/ListView/ListViewControllerBase.cs index 7fbef27b5..81de78243 100644 --- a/Scripts/ListView/ListViewControllerBase.cs +++ b/Scripts/ListView/ListViewControllerBase.cs @@ -68,7 +68,7 @@ public Vector3 itemSize protected abstract float listHeight { get; } - public Vector3 size + public virtual Vector3 size { set { diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs index 8fe29b0ed..8f64e1625 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs @@ -62,7 +62,16 @@ public override List data } } - protected override void Setup() + public override Vector3 size + { + set + { + base.size = value; + m_LastHiddenItemOffset = Mathf.Infinity; + } + } + + protected override void Setup() { base.Setup(); From d90e64449a6693fdca54ca8ec8f82bf2f6935bae Mon Sep 17 00:00:00 2001 From: andrewm Date: Tue, 29 Aug 2017 11:41:03 -0700 Subject: [PATCH 790/870] Only apply head height in the vrview for stationary tracking --- Scripts/Core/VRView.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Scripts/Core/VRView.cs b/Scripts/Core/VRView.cs index 94ed2552b..0c2326c39 100644 --- a/Scripts/Core/VRView.cs +++ b/Scripts/Core/VRView.cs @@ -132,9 +132,14 @@ public void OnEnable() m_Camera.nearClipPlane = 0.01f; m_Camera.farClipPlane = 1000f; - // Generally, we want to be at a standing height, so default to that Vector3 position = m_CameraRig.position; - position.y = HeadHeight; + + // For stationary tracking, we want to simulate being at a head height. Roomscale manages height automatically + if (VRDevice.GetTrackingSpaceType() == TrackingSpaceType.Stationary) + { + position.y = HeadHeight; + } + m_CameraRig.position = position; m_CameraRig.rotation = Quaternion.identity; From 897528c657613cd8757932f6474f7ae18735057a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 29 Aug 2017 11:59:45 -0700 Subject: [PATCH 791/870] Reconcile input changes made in menu-hide branch; require a hold of the grip, then a press of the trigger, in order to enable a spatial tool scroll --- Menus/ToolMenu/PinnedToolsMenu.cs | 22 ++++++++++++++-------- Scripts/Core/EditorVR.Tools.cs | 4 ---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Menus/ToolMenu/PinnedToolsMenu.cs b/Menus/ToolMenu/PinnedToolsMenu.cs index d6e17762c..ca6d4d8f9 100644 --- a/Menus/ToolMenu/PinnedToolsMenu.cs +++ b/Menus/ToolMenu/PinnedToolsMenu.cs @@ -141,17 +141,23 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon const float kAllowToggleDuration = 0.25f; var pinnedToolInput = (PinnedToolslMenuInput) input; - if (pinnedToolInput.show.wasJustPressed) + if (spatialScrollData == null && (pinnedToolInput.show.wasJustPressed || pinnedToolInput.show.isHeld) && pinnedToolInput.select.wasJustPressed) { m_SpatialScrollStartPosition = alternateMenuOrigin.position; m_AllowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; this.SetSpatialHintControlObject(rayOrigin); m_PinnedToolsMenuUI.spatiallyScrolling = true; // Triggers the display of the directional hint arrows + consumeControl(pinnedToolInput.show); + consumeControl(pinnedToolInput.select); + // Assign initial SpatialScrollData; begin scroll + spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); } - else if (pinnedToolInput.show.isHeld && !pinnedToolInput.select.isHeld && !pinnedToolInput.select.wasJustPressed) + else if (spatialScrollData != null && pinnedToolInput.show.isHeld) { - // Don't scroll if the trigger is held, allowing the user to setting on a single button to select with release - if (pinnedToolInput.select.wasJustReleased) + consumeControl(pinnedToolInput.show); + consumeControl(pinnedToolInput.select); + // Attempt to close a button, if a scroll has passed the trigger threshold + if (spatialScrollData != null && pinnedToolInput.select.wasJustPressed) { if (m_PinnedToolsMenuUI.DeleteHighlightedButton()) buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount @@ -183,16 +189,16 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon } m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); - consumeControl(pinnedToolInput.show); - consumeControl(pinnedToolInput.select); } } else if (pinnedToolInput.show.wasJustReleased) { - if (spatialScrollData.passedMinDragActivationThreshold) + consumeControl(pinnedToolInput.show); + consumeControl(pinnedToolInput.select); + + if (spatialScrollData != null && spatialScrollData.passedMinDragActivationThreshold) { m_PinnedToolsMenuUI.SelectHighlightedButton(); - consumeControl(pinnedToolInput.select); } else if (Time.realtimeSinceStartup < m_AllowToolToggleBeforeThisTime) { diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 9c668fcd9..21f9365b2 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -249,10 +249,6 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn deviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; } - else - { - deviceData.menuHideData[deviceData.mainMenu].hideFlags |= MenuHideFlags.Hidden; - } }); return result; From 098a8a36ce86584d856482fa73133fcd0f667986 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 29 Aug 2017 12:19:14 -0700 Subject: [PATCH 792/870] Add support for closing/cancelling a spatial scroll via action-2 button/input --- Menus/ToolMenu/PinnedToolsMenu.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Menus/ToolMenu/PinnedToolsMenu.cs b/Menus/ToolMenu/PinnedToolsMenu.cs index ca6d4d8f9..aeb00103a 100644 --- a/Menus/ToolMenu/PinnedToolsMenu.cs +++ b/Menus/ToolMenu/PinnedToolsMenu.cs @@ -141,6 +141,16 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon const float kAllowToggleDuration = 0.25f; var pinnedToolInput = (PinnedToolslMenuInput) input; + if (spatialScrollData != null && pinnedToolInput.cancel.wasJustPressed) + { + consumeControl(pinnedToolInput.cancel); + consumeControl(pinnedToolInput.show); + consumeControl(pinnedToolInput.select); + OnButtonClick(); + CloseMenu(); // Also ends spatial scroll + m_PinnedToolsMenuUI.allButtonsVisible = false; + } + if (spatialScrollData == null && (pinnedToolInput.show.wasJustPressed || pinnedToolInput.show.isHeld) && pinnedToolInput.select.wasJustPressed) { m_SpatialScrollStartPosition = alternateMenuOrigin.position; From a4e0d9cdf656ac59063f33b6b58fcbb634f9cebe Mon Sep 17 00:00:00 2001 From: andrewm Date: Tue, 29 Aug 2017 12:44:24 -0700 Subject: [PATCH 793/870] spaces->tabs --- .../Scripts/AssetGridViewController.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs b/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs index 8f64e1625..227d2658c 100644 --- a/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs +++ b/Workspaces/ProjectWorkspace/Scripts/AssetGridViewController.cs @@ -62,16 +62,16 @@ public override List data } } - public override Vector3 size - { - set - { - base.size = value; - m_LastHiddenItemOffset = Mathf.Infinity; - } - } - - protected override void Setup() + public override Vector3 size + { + set + { + base.size = value; + m_LastHiddenItemOffset = Mathf.Infinity; + } + } + + protected override void Setup() { base.Setup(); From 909f72c9db8a4ba6db6167985866fa86b42bedfa Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Tue, 15 Aug 2017 19:12:31 -0700 Subject: [PATCH 794/870] Remove unstable binormal calculation for brush direction --- Tools/AnnotationTool/AnnotationTool.cs | 60 +++++++++++--------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 7a986b063..0630a1749 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -34,7 +34,7 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr const int k_InitialListSize = 1024; // Pre-allocate lists to avoid GC List m_Points = new List(k_InitialListSize); - List m_Forwards = new List(k_InitialListSize); + List m_UpVectors = new List(k_InitialListSize); List m_Widths = new List(k_InitialListSize); float m_Length; @@ -44,7 +44,7 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr Matrix4x4 m_WorldToLocalMesh; ColorPickerUI m_ColorPicker; - BrushSizeUI m_BrushSizeUi; + BrushSizeUI m_BrushSizeUI; Transform m_AnnotationHolder; @@ -78,8 +78,8 @@ void OnDestroy() if (m_ColorPicker) ObjectUtils.Destroy(m_ColorPicker.gameObject); - if (m_BrushSizeUi) - ObjectUtils.Destroy(m_BrushSizeUi.gameObject); + if (m_BrushSizeUI) + ObjectUtils.Destroy(m_BrushSizeUI.gameObject); if (m_ColorPickerActivator) ObjectUtils.Destroy(m_ColorPickerActivator); @@ -93,7 +93,7 @@ void Start() this.LockRay(rayOrigin, this); m_AnnotationPointer = ObjectUtils.CreateGameObjectWithComponent(rayOrigin, false); - CheckBrushSizeUi(); + CheckBrushSizeUI(); if (m_ColorPickerActivator == null) { @@ -123,12 +123,12 @@ void Start() } } - void CheckBrushSizeUi() + void CheckBrushSizeUI() { - if (m_BrushSizeUi == null) + if (m_BrushSizeUI == null) { var brushSizeUi = this.InstantiateUI(m_BrushSizePrefab); - m_BrushSizeUi = brushSizeUi.GetComponent(); + m_BrushSizeUI = brushSizeUi.GetComponent(); var trans = brushSizeUi.transform; var scale = brushSizeUi.transform.localScale; @@ -137,12 +137,12 @@ void CheckBrushSizeUi() trans.localRotation = Quaternion.Euler(-90, 0, 0); trans.localScale = scale; - m_BrushSizeUi.onValueChanged = (val) => + m_BrushSizeUI.onValueChanged = (val) => { m_BrushSize = Mathf.Lerp(MinBrushSize, MaxBrushSize, val); m_AnnotationPointer.Resize(m_BrushSize); }; - onBrushSizeChanged = m_BrushSizeUi.ChangeSliderValue; + onBrushSizeChanged = m_BrushSizeUI.ChangeSliderValue; } } @@ -174,7 +174,7 @@ void OnColorPickerValueChanged(Color color) color.a = .75f; m_AnnotationPointer.SetColor(color); - m_BrushSizeUi.OnBrushColorChanged(color); + m_BrushSizeUI.OnBrushColorChanged(color); } void HandleBrushSize(float value) @@ -191,7 +191,7 @@ void HandleBrushSize(float value) m_BrushSize = Mathf.Clamp(m_BrushSize, MinBrushSize, MaxBrushSize); } - if (m_BrushSizeUi && onBrushSizeChanged != null) + if (m_BrushSizeUI && onBrushSizeChanged != null) { var ratio = Mathf.InverseLerp(MinBrushSize, MaxBrushSize, m_BrushSize); onBrushSizeChanged(ratio); @@ -206,7 +206,7 @@ void SetupAnnotation() SetupHolder(); m_Points.Clear(); - m_Forwards.Clear(); + m_UpVectors.Clear(); m_Widths.Clear(); m_Length = 0; @@ -277,9 +277,9 @@ GameObject GetNewSessionHolder(Transform mainHolderTrans) void UpdateAnnotation() { - var rayForward = rayOrigin.forward; + var upVector = rayOrigin.up; var viewerScale = this.GetViewerScale(); - var worldPoint = rayOrigin.position + rayForward * TipDistance * viewerScale; + var worldPoint = rayOrigin.position + rayOrigin.forward * TipDistance * viewerScale; var localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); if (m_Points.Count > 0) @@ -294,16 +294,16 @@ void UpdateAnnotation() } var brushSize = m_BrushSize * viewerScale; - InterpolatePointsIfNeeded(localPoint, rayForward, brushSize); + InterpolatePointsIfNeeded(localPoint, upVector, brushSize); m_Points.Add(localPoint); - m_Forwards.Add(rayForward); + m_UpVectors.Add(upVector); m_Widths.Add(brushSize); PointsToMesh(); } - void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, float brushSize) + void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 upVector, float brushSize) { if (m_Points.Count > 1) { @@ -315,8 +315,8 @@ void InterpolatePointsIfNeeded(Vector3 localPoint, Vector3 rayForward, float bru var halfPoint = (lastPoint + localPoint) / 2f; m_Points.Add(halfPoint); - var halfForward = (m_Forwards.Last() + rayForward) / 2f; - m_Forwards.Add(halfForward); + var halfUp = (m_UpVectors.Last() + upVector) / 2f; + m_UpVectors.Add(halfUp); var halfRadius = (m_Widths.Last() + brushSize) / 2f; m_Widths.Add(halfRadius); @@ -356,21 +356,10 @@ void LineToPlane(List newVertices) { var distance = 0f; var lastPoint = m_Points[0]; - var direction = (m_Points[1] - m_Points[0]).normalized; - var forward = -m_Forwards[0]; - Vector3.OrthoNormalize(ref direction, ref forward); - var lastBinormal = Vector3.Cross(forward, direction).normalized; for (var i = 1; i < m_Points.Count; i++) { var point = m_Points[i]; var segment = point - lastPoint; - direction = segment.normalized; - - forward = -m_Forwards[i]; - Vector3.OrthoNormalize(ref direction, ref forward); - var binormal = Vector3.Cross(forward, direction).normalized; - binormal = Vector3.Lerp(lastBinormal, binormal, 0.1f).normalized; - lastBinormal = binormal; var width = m_Widths[i]; @@ -378,11 +367,12 @@ void LineToPlane(List newVertices) var endDistance = m_Length - distance; width *= Math.Min(Mathf.Sqrt(endDistance / width), 1); - var left = point - binormal * width; - var right = point + binormal * width; + var upVector = m_UpVectors[i]; + var top = point - upVector * width; + var bottom = point + upVector * width; - newVertices.Add(left); - newVertices.Add(right); + newVertices.Add(top); + newVertices.Add(bottom); distance += segment.magnitude; lastPoint = point; From 5c471827fc6bcab011e29870f4202a35503f5a93 Mon Sep 17 00:00:00 2001 From: andrewm Date: Tue, 29 Aug 2017 13:25:27 -0700 Subject: [PATCH 795/870] Adjusted the camera origin to be calculated via a helper function and also made the locomotion tool aware of this --- Scripts/Core/VRView.cs | 19 +++++++++---------- Tools/LocomotionTool/LocomotionTool.cs | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Scripts/Core/VRView.cs b/Scripts/Core/VRView.cs index 0c2326c39..53ee70aaf 100644 --- a/Scripts/Core/VRView.cs +++ b/Scripts/Core/VRView.cs @@ -94,6 +94,14 @@ public static LayerMask cullingMask } } + public static Vector3 headCenteredOrigin + { + get + { + return VRDevice.GetTrackingSpaceType() == TrackingSpaceType.Stationary ? Vector3.up * HeadHeight : Vector3.zero; + } + } + public static event Action viewEnabled; public static event Action viewDisabled; public static event Action beforeOnGUI; @@ -131,16 +139,7 @@ public void OnEnable() m_Camera.transform.parent = m_CameraRig; m_Camera.nearClipPlane = 0.01f; m_Camera.farClipPlane = 1000f; - - Vector3 position = m_CameraRig.position; - - // For stationary tracking, we want to simulate being at a head height. Roomscale manages height automatically - if (VRDevice.GetTrackingSpaceType() == TrackingSpaceType.Stationary) - { - position.y = HeadHeight; - } - - m_CameraRig.position = position; + m_CameraRig.position = headCenteredOrigin; m_CameraRig.rotation = Quaternion.identity; m_ShowDeviceView = EditorPrefs.GetBool(k_ShowDeviceView, false); diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index dc58cf9f5..e6b87e240 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -486,7 +486,7 @@ bool DoTwoHandedScaling(ConsumeControlDelegate consumeControl) { m_AllowScaling = false; #if UNITY_EDITORVR - cameraRig.position = Vector3.up * VRView.HeadHeight; + cameraRig.position = VRView.headCenteredOrigin; #endif cameraRig.rotation = Quaternion.identity; From 6ffe1689414c63ddc699ac1ee9c0075682de5a68 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 29 Aug 2017 17:18:11 -0700 Subject: [PATCH 796/870] Remove ray visibility settings when ending a spatial scroll; add INodeToRay interface & functionality --- Scripts/Core/EditorVR.Rays.cs | 34 +++++++++++++++++++ Scripts/Core/Interfaces/INodeToRay.cs | 28 +++++++++++++++ Scripts/Core/Interfaces/INodeToRay.cs.meta | 12 +++++++ .../SpatialScrollModule.cs | 8 ++--- 4 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 Scripts/Core/Interfaces/INodeToRay.cs create mode 100644 Scripts/Core/Interfaces/INodeToRay.cs.meta diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 15d5be2e4..5068e7788 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -47,6 +47,7 @@ public Rays() IGetPreviewOriginMethods.getPreviewOriginForRayOrigin = GetPreviewOriginForRayOrigin; IUsesRaycastResultsMethods.getFirstGameObject = GetFirstGameObject; IRayToNodeMethods.requestNodeFromRayOrigin = RequestNodeFromRayOrigin; + INodeToRayMethods.requestRayOriginFromNode = RequestRayOriginFromNode; IGetRayVisibilityMethods.isRayVisible = IsRayActive; IGetRayVisibilityMethods.isConeVisible = IsConeActive; } @@ -480,6 +481,39 @@ internal void PreProcessRaycastSource(Transform rayOrigin) return null; } + static Transform RequestRayOriginFromNode(Node? node) + { + Transform rayOrigin = null; + if (node == null) + return rayOrigin; + + foreach (var deviceData in evr.m_DeviceData) + { + if (!deviceData.proxy.active) + continue; + + if (deviceData.node == node) + { + rayOrigin = deviceData.rayOrigin; + break; + } + } + + if (!rayOrigin) + { + foreach (var kvp in evr.GetNestedModule().rays) + { + if (kvp.Value.node == node) + { + rayOrigin = kvp.Value.originalRayOrigin; + break; + } + } + } + + return rayOrigin; + } + static void SetDefaultRayColor(Transform rayOrigin, Color color) { if (rayOrigin) diff --git a/Scripts/Core/Interfaces/INodeToRay.cs b/Scripts/Core/Interfaces/INodeToRay.cs new file mode 100644 index 000000000..4d26f32c6 --- /dev/null +++ b/Scripts/Core/Interfaces/INodeToRay.cs @@ -0,0 +1,28 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR.Core +{ + /// + /// Provide the ability to request a corresponding ray origin for a node + /// + interface INodeToRay + { + } + + static class INodeToRayMethods + { + internal static Func requestRayOriginFromNode { private get; set; } + + /// + /// Get the corresponding ray origin for a given node + /// + /// The node to request a ray origin for + internal static Transform RequestRayOriginFromNode(this INodeToRay obj, Node? node) + { + return requestRayOriginFromNode(node); + } + } +} +#endif diff --git a/Scripts/Core/Interfaces/INodeToRay.cs.meta b/Scripts/Core/Interfaces/INodeToRay.cs.meta new file mode 100644 index 000000000..b19e707be --- /dev/null +++ b/Scripts/Core/Interfaces/INodeToRay.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4f58906608a7e0c4ea1f84c991958952 +timeCreated: 1480994231 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index 9ed646e11..bad18aa5d 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -5,7 +5,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, IControlHaptics, IControlSpatialHinting + public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, IControlHaptics, IControlSpatialHinting, IRayVisibilitySettings, INodeToRay { [SerializeField] HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection @@ -162,14 +162,12 @@ internal void EndScroll(IControlSpatialScrolling caller) if (m_ScrollCallers.Count == 0) return; - this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); - //TODO: Remove ray visibility settings - //this.RemoveRayVisibilitySettings(caller) - foreach (var scroller in m_ScrollCallers) { if (scroller == caller) { + this.RemoveRayVisibilitySettings(this.RequestRayOriginFromNode(caller.spatialScrollData.node), this); + this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); caller.spatialScrollData = null; // clear reference to the previously used scrollData m_ScrollCallers.Remove(caller); return; From 14b30fd4bfdde91bf809a58b2750a9c51e0c982f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 29 Aug 2017 19:33:05 -0700 Subject: [PATCH 797/870] Add support for adding/removing ray visibility settings in SpatialScrollModule --- .../SpatialScrollModule/SpatialScrollModule.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index bad18aa5d..eb6b0789e 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -13,7 +13,7 @@ public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, ICont // Collection housing objects whose scroll data is being processed List m_ScrollCallers; - public class SpatialScrollData + public class SpatialScrollData : INodeToRay { public SpatialScrollData(IControlSpatialScrolling caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true) { @@ -26,6 +26,7 @@ public SpatialScrollData(IControlSpatialScrolling caller, Node? node, Vector3 st this.maxItemCount = maxItemCount; this.centerVisuals = centerVisuals; spatialDirection = null; + rayOrigin = this.RequestRayOriginFromNode(node); } // Below is Data assigned by calling object requesting spatial scroll processing @@ -40,6 +41,11 @@ public SpatialScrollData(IControlSpatialScrolling caller, Node? node, Vector3 st /// public Node? node { get; set; } + /// + /// The ray origin on which this spatial scroll is being processed + /// + public Transform rayOrigin { get; set; } + /// /// The origin/starting position of the scroll /// @@ -120,9 +126,9 @@ internal SpatialScrollData PerformScroll(IControlSpatialScrolling caller, Node? if (spatialScrollData == null) { - //TODO: Add ray visibility settings spatialScrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerScrollVisuals); m_ScrollCallers.Add(caller); + this.AddRayVisibilitySettings(spatialScrollData.rayOrigin, caller, false, false, 1); } return ProcessSpatialScrolling(spatialScrollData); @@ -166,7 +172,7 @@ internal void EndScroll(IControlSpatialScrolling caller) { if (scroller == caller) { - this.RemoveRayVisibilitySettings(this.RequestRayOriginFromNode(caller.spatialScrollData.node), this); + this.RemoveRayVisibilitySettings(caller.spatialScrollData.rayOrigin, caller); this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.Hidden); caller.spatialScrollData = null; // clear reference to the previously used scrollData m_ScrollCallers.Remove(caller); From 2d4279baf55a3118fcd7e87842d62d0addf743b8 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 29 Aug 2017 20:16:06 -0700 Subject: [PATCH 798/870] Remove delegates from IControlSpatialHinting & IControlSpatialScrolling --- .../IControlSpatialHinting.cs | 32 ++++++------------- .../IControlSpatialScrolling.cs | 6 ++-- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs index 30c2332f6..19fa842e4 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; @@ -13,8 +14,14 @@ public interface IControlSpatialHinting public static class IControlSpatialHintingMethods { - internal delegate void SetSpatialHintStateDelegate(SpatialHintModule.SpatialHintStateFlags state); - internal static SetSpatialHintStateDelegate setSpatialHintState { get; set; } + internal static Action setSpatialHintState { get; set; } + internal static Action setSpatialHintPosition { get; set; } + internal static Action setSpatialHintContainerRotation { get; set; } + internal static Action setSpatialHintShowHideRotationTarget { get; set; } + internal static Action setSpatialHintLookAtRotation { get; set; } + internal static Action pulseSpatialHintScrollArrows { get; set; } + internal static Action setSpatialHintDragThresholdTriggerPosition { get; set; } + internal static Action setSpatialHintControlObject { get; set; } /// /// Set the spatial hint state @@ -25,9 +32,6 @@ public static void SetSpatialHintState(this IControlSpatialHinting obj, SpatialH setSpatialHintState(state); } - internal delegate void SetSpatialHintPositionDelegate(Vector3 position); - internal static SetSpatialHintPositionDelegate setSpatialHintPosition { get; set; } - /// /// Set the position of the spatial hint visuals /// @@ -37,9 +41,6 @@ public static void SetSpatialHintPosition(this IControlSpatialHinting obj, Vecto setSpatialHintPosition(position); } - internal delegate void SetSpatialHintRotationDelegate(Quaternion rotation); - internal static SetSpatialHintRotationDelegate setSpatialHintContainerRotation { get; set; } - /// /// Set the rotation of the spatial hint visuals container game object /// @@ -49,9 +50,6 @@ public static void SetSpatialHintContainerRotation(this IControlSpatialHinting o setSpatialHintContainerRotation(rotation); } - internal delegate void SetSpatialHintRotationTargetDelegate(Vector3 target); - internal static SetSpatialHintRotationTargetDelegate setSpatialHintShowHideRotationTarget { get; set; } - /// /// Sets the target for the spatial hint visuals to look at while performing an animated show or hide /// @@ -61,9 +59,6 @@ public static void SetSpatialHintShowHideRotationTarget(this IControlSpatialHint setSpatialHintShowHideRotationTarget(target); } - internal delegate void SetSpatialHintLookATRotationDelegate(Vector3 position); - internal static SetSpatialHintLookATRotationDelegate setSpatialHintLookAtRotation { get; set; } - /// /// Set the LookAt target /// @@ -73,9 +68,6 @@ public static void SetSpatialHintLookAtRotation(this IControlSpatialHinting obj, setSpatialHintLookAtRotation(position); } - internal delegate void PulseSpatialHintScrollArrowsDelegate(); - internal static PulseSpatialHintScrollArrowsDelegate pulseSpatialHintScrollArrows { get; set; } - /// /// Visually pulse the spatial-scroll arrows; the arrows shown when performing a spatial scroll /// @@ -84,9 +76,6 @@ public static void PulseSpatialHintScrollArrows(this IControlSpatialHinting obj) pulseSpatialHintScrollArrows(); } - internal delegate void SetSpatialHintDragThresholdTriggerPositionDelegate(Vector3 position); - internal static SetSpatialHintDragThresholdTriggerPositionDelegate setSpatialHintDragThresholdTriggerPosition { get; set; } - /// /// Set the magnitude at which the user will trigger spatial scrolling /// @@ -96,9 +85,6 @@ public static void SetSpatialHintDragThresholdTriggerPosition(this IControlSpati setSpatialHintDragThresholdTriggerPosition(position); } - internal delegate void SetSpatialHintControlObjectDelegate(Transform controlObject); - internal static SetSpatialHintControlObjectDelegate setSpatialHintControlObject { get; set; } - /// /// Set reference to the object, RayOrigin, controlling the Spatial Hint visuals /// Each control-object has it's spatial scrolling processed independently diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs index c8f1b162e..7ec596b11 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs @@ -1,4 +1,5 @@ #if UNITY_EDITOR +using System; using UnityEditor.Experimental.EditorVR.Modules; using UnityEngine; @@ -19,7 +20,9 @@ public static class IControlSpatialScrollingMethods { internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDelegate (IControlSpatialScrolling caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true); + internal static PerformSpatialScrollDelegate performSpatialScroll { private get; set; } + internal static Action endSpatialScroll { private get; set; } /// /// Perform a spatial scroll action @@ -39,9 +42,6 @@ public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IC return performSpatialScroll(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerVisuals); } - internal delegate void EndSpatialScrollDelegate (IControlSpatialScrolling caller); - internal static EndSpatialScrollDelegate endSpatialScroll { private get; set; } - /// /// End a spatial scrolling action for a given caller /// From 9196714bc86d613bd2643d4bcb8f975976755eb0 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 29 Aug 2017 21:05:20 -0700 Subject: [PATCH 799/870] Perform various suggested SpatialHintModule PR changes; Add IRayClickHandler execution to ShouldActivateInput in MultipleRayInputModule --- .../MultipleRayInputModule.cs | 1 + .../SpatialHintModule/SpatialHintModule.cs | 47 ++++++++++--------- .../SpatialHintModule.cs.meta | 4 +- ...patialHintModuleUI.cs => SpatialHintUI.cs} | 19 ++------ ...ModuleUI.cs.meta => SpatialHintUI.cs.meta} | 0 5 files changed, 32 insertions(+), 39 deletions(-) rename Scripts/Modules/SpatialHintModule/{SpatialHintModuleUI.cs => SpatialHintUI.cs} (91%) rename Scripts/Modules/SpatialHintModule/{SpatialHintModuleUI.cs.meta => SpatialHintUI.cs.meta} (100%) diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index ea51e0477..a230988fa 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -222,6 +222,7 @@ static bool ShouldActivateInput(RayEventData eventData, GameObject currentObject || ExecuteEvents.GetEventHandler(currentObject) || ExecuteEvents.GetEventHandler(currentObject) || ExecuteEvents.GetEventHandler(currentObject) + || ExecuteEvents.GetEventHandler(currentObject) || hasScrollHandler; } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index 3f7e58e23..ac4926b15 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -18,7 +18,7 @@ public enum SpatialHintStateFlags } [SerializeField] - SpatialHintModuleUI m_SpatialHintModuleUI; + SpatialHintUI m_SpatialHintUI; SpatialHintStateFlags m_State; Transform m_ControllingRayOrigin; @@ -32,27 +32,28 @@ public SpatialHintStateFlags state switch (m_State) { case SpatialHintStateFlags.Hidden: - m_SpatialHintModuleUI.centeredScrolling = false; - m_SpatialHintModuleUI.preScrollArrowsVisible = false; - m_SpatialHintModuleUI.secondaryArrowsVisible = false; + m_SpatialHintUI.centeredScrolling = false; + m_SpatialHintUI.preScrollArrowsVisible = false; + m_SpatialHintUI.secondaryArrowsVisible = false; this.RemoveRayVisibilitySettings(m_ControllingRayOrigin, this); controllingRayOrigin = null; break; case SpatialHintStateFlags.PreDragReveal: - m_SpatialHintModuleUI.centeredScrolling = false; - m_SpatialHintModuleUI.preScrollArrowsVisible = true; - m_SpatialHintModuleUI.secondaryArrowsVisible = true; + m_SpatialHintUI.centeredScrolling = false; + m_SpatialHintUI.preScrollArrowsVisible = true; + m_SpatialHintUI.secondaryArrowsVisible = true; break; case SpatialHintStateFlags.Scrolling: - m_SpatialHintModuleUI.centeredScrolling = false; - m_SpatialHintModuleUI.preScrollArrowsVisible = false; - m_SpatialHintModuleUI.scrollVisualsVisible = true; + m_SpatialHintUI.centeredScrolling = false; + m_SpatialHintUI.preScrollArrowsVisible = false; + m_SpatialHintUI.scrollVisualsVisible = true; break; case SpatialHintStateFlags.CenteredScrolling: - m_SpatialHintModuleUI.centeredScrolling = true; - m_SpatialHintModuleUI.preScrollArrowsVisible = false; - m_SpatialHintModuleUI.scrollVisualsVisible = true; + m_SpatialHintUI.centeredScrolling = true; + m_SpatialHintUI.preScrollArrowsVisible = false; + m_SpatialHintUI.scrollVisualsVisible = true; break; + } } } @@ -67,30 +68,30 @@ Transform controllingRayOrigin m_ControllingRayOrigin = value; if (m_ControllingRayOrigin == null) { - m_SpatialHintModuleUI.controllingNode = null; + m_SpatialHintUI.controllingNode = null; } else { state = SpatialHintStateFlags.PreDragReveal; - m_SpatialHintModuleUI.controllingNode = this.RequestNodeFromRayOrigin(m_ControllingRayOrigin); + m_SpatialHintUI.controllingNode = this.RequestNodeFromRayOrigin(m_ControllingRayOrigin); } } } - Vector3 spatialHintScrollVisualsRotation { set { m_SpatialHintModuleUI.scrollVisualsRotation = value; } } + Vector3 spatialHintScrollVisualsRotation { set { m_SpatialHintUI.scrollVisualsRotation = value; } } - Transform spatialHintContentContainer { get { return m_SpatialHintModuleUI.contentContainer; } } + Transform spatialHintContentContainer { get { return m_SpatialHintUI.contentContainer; } } void Awake() { - m_SpatialHintModuleUI = this.InstantiateUI(m_SpatialHintModuleUI.gameObject).GetComponent(); - this.ConnectInterfaces(m_SpatialHintModuleUI); + m_SpatialHintUI = this.InstantiateUI(m_SpatialHintUI.gameObject).GetComponent(); + this.ConnectInterfaces(m_SpatialHintUI); } internal void PulseScrollArrows() { - m_SpatialHintModuleUI.PulseScrollArrows(); + m_SpatialHintUI.PulseScrollArrows(); } internal void SetState(SpatialHintStateFlags newState) @@ -105,7 +106,7 @@ internal void SetPosition(Vector3 newPosition) internal void SetContainerRotation(Quaternion newRotation) { - m_SpatialHintModuleUI.transform.rotation = newRotation; + m_SpatialHintUI.transform.rotation = newRotation; } internal void SetShowHideRotationTarget(Vector3 target) @@ -122,10 +123,10 @@ internal void LookAt(Vector3 position) internal void SetDragThresholdTriggerPosition (Vector3 position) { - if (state == SpatialHintStateFlags.Hidden || position == m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition) + if (state == SpatialHintStateFlags.Hidden || position == m_SpatialHintUI.scrollVisualsDragThresholdTriggerPosition) return; - m_SpatialHintModuleUI.scrollVisualsDragThresholdTriggerPosition = position; + m_SpatialHintUI.scrollVisualsDragThresholdTriggerPosition = position; } internal void SetSpatialHintControlObject(Transform controlObject) diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs.meta b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs.meta index 9aa0465d2..a183e82f9 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs.meta +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs.meta @@ -1,11 +1,11 @@ fileFormatVersion: 2 guid: 6a66c1a4c74c6454eb9140a886e8f9e8 -timeCreated: 1499980636 +timeCreated: 1504065308 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - - m_SpatialHintModuleUI: {fileID: 114885606894613528, guid: cdc0eb858b1c7ed488024c8ad974bd47, + - m_SpatialHintUI: {fileID: 114885606894613528, guid: cdc0eb858b1c7ed488024c8ad974bd47, type: 2} executionOrder: 0 icon: {instanceID: 0} diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintUI.cs similarity index 91% rename from Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs rename to Scripts/Modules/SpatialHintModule/SpatialHintUI.cs index 2d4343ac4..1b46e58b5 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHaptics, IRayToNode + public class SpatialHintUI : MonoBehaviour, IUsesViewerScale, IControlHaptics, IRayToNode { readonly Color k_PrimaryArrowColor = Color.white; @@ -36,7 +36,6 @@ public class SpatialHintModuleUI : MonoBehaviour, IUsesViewerScale, IControlHapt bool m_Visible; bool m_PreScrollArrowsVisible; - bool m_SecondaryArrowsVisible; Vector3 m_ScrollVisualsRotation; Transform m_ScrollVisualsTransform; Coroutine m_ScrollVisualsVisibilityCoroutine; @@ -99,7 +98,6 @@ public bool scrollVisualsVisible /// public bool preScrollArrowsVisible { - get { return m_PreScrollArrowsVisible; } set { m_PreScrollArrowsVisible = value; @@ -126,11 +124,8 @@ public bool preScrollArrowsVisible /// public bool secondaryArrowsVisible { - get { return m_SecondaryArrowsVisible; } set { - m_SecondaryArrowsVisible = value; - foreach (var arrow in m_SecondaryDirectionalHintArrows) { arrow.visible = value; @@ -150,14 +145,14 @@ bool scrollArrowsVisible /// /// If non-null, enable and set the world rotation of the scroll visuals /// - public Vector3 scrollVisualsRotation { get { return m_ScrollVisualsRotation ; } set { m_ScrollVisualsRotation = value; } } + public Vector3 scrollVisualsRotation { set { m_ScrollVisualsRotation = value; } } /// /// The node currently controlling the spatial hint visuals /// public Node? controllingNode { - get { return m_ControllingNode; } + private get { return m_ControllingNode; } set { m_ControllingNode = value; @@ -212,9 +207,6 @@ IEnumerator ShowScrollVisuals() var targetLocalScale = Vector3.one; var currentAlpha = m_ScrollVisualsCanvasGroup.alpha; var secondArrowCurrentPosition = m_ScrollVisualsDragTargetArrowTransform.position; - Vector3 scrollVisualsDragTargetArrowTransformOrigin; - Vector3 scrollVisualsDragTargetArrowTransformDestination; - while (currentDuration < kTargetDuration) { var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); @@ -229,8 +221,8 @@ IEnumerator ShowScrollVisuals() m_ScrollVisualsDragTargetArrowTransform.LookAt(m_ScrollVisualsTransform.position - m_ScrollVisualsDragTargetArrowTransform.position); m_ScrollVisualsTransform.localScale = Vector3.Lerp(currentLocalScale, targetLocalScale, shapedDuration); - scrollVisualsDragTargetArrowTransformOrigin = m_ScrollVisualsTransform.position; - scrollVisualsDragTargetArrowTransformDestination = m_ScrollVisualsDragTargetArrowTransform.position; + var scrollVisualsDragTargetArrowTransformOrigin = m_ScrollVisualsTransform.position; + var scrollVisualsDragTargetArrowTransformDestination = m_ScrollVisualsDragTargetArrowTransform.position; if (centeredScrolling) { Vector3 offset = (scrollVisualsDragTargetArrowTransformOrigin - scrollVisualsDragTargetArrowTransformDestination) * -1; @@ -269,7 +261,6 @@ IEnumerator HideScrollVisuals() var shapedDuration = MathUtilsExt.SmoothInOutLerpFloat(currentDuration / kTargetDuration); m_ScrollVisualsTransform.localScale = Vector3.Lerp(currentLocalScale, hiddenLocalScale, shapedDuration); m_ScrollVisualsCanvasGroup.alpha = Mathf.Lerp(currentAlpha, 0f, shapedDuration); - //m_Icon.color = Color.Lerp(currentColor, m_HiddenColor, currentDuration); currentDuration += Time.unscaledDeltaTime * 3.5f; m_ScrollHintLine.LineWidth = (1 - shapedDuration) * this.GetViewerScale(); yield return null; diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs.meta b/Scripts/Modules/SpatialHintModule/SpatialHintUI.cs.meta similarity index 100% rename from Scripts/Modules/SpatialHintModule/SpatialHintModuleUI.cs.meta rename to Scripts/Modules/SpatialHintModule/SpatialHintUI.cs.meta From c11569031535cc217d5310b5a8092b786cafa097 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 29 Aug 2017 21:30:26 -0700 Subject: [PATCH 800/870] Refactor the use of RayOrigin into Node throughout SpatialHint arch --- Menus/ToolMenu/PinnedToolsMenu.cs | 2 +- .../SpatialHintModuleConnector.cs | 2 +- .../IControlSpatialHinting.cs | 8 +++--- .../SpatialHintModule/SpatialHintModule.cs | 27 +++++++++---------- .../SpatialHintModule/SpatialHintUI.cs | 2 +- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Menus/ToolMenu/PinnedToolsMenu.cs b/Menus/ToolMenu/PinnedToolsMenu.cs index aeb00103a..9ea449427 100644 --- a/Menus/ToolMenu/PinnedToolsMenu.cs +++ b/Menus/ToolMenu/PinnedToolsMenu.cs @@ -155,7 +155,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { m_SpatialScrollStartPosition = alternateMenuOrigin.position; m_AllowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; - this.SetSpatialHintControlObject(rayOrigin); + this.SetSpatialHintControlNode(node); m_PinnedToolsMenuUI.spatiallyScrolling = true; // Triggers the display of the directional hint arrows consumeControl(pinnedToolInput.show); consumeControl(pinnedToolInput.select); diff --git a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs index ead1d8d2a..59b212f3c 100644 --- a/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs +++ b/Scripts/Core/InterfaceConnectors/SpatialHintModuleConnector.cs @@ -16,7 +16,7 @@ public void LateBindInterfaceMethods(SpatialHintModule provider) IControlSpatialHintingMethods.setSpatialHintLookAtRotation = provider.LookAt; IControlSpatialHintingMethods.setSpatialHintDragThresholdTriggerPosition = provider.SetDragThresholdTriggerPosition; IControlSpatialHintingMethods.pulseSpatialHintScrollArrows = provider.PulseScrollArrows; - IControlSpatialHintingMethods.setSpatialHintControlObject = provider.SetSpatialHintControlObject; + IControlSpatialHintingMethods.setSpatialHintControlNode = provider.SetSpatialHintControlNode; } } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs index 19fa842e4..e1c17eee3 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs @@ -21,7 +21,7 @@ public static class IControlSpatialHintingMethods internal static Action setSpatialHintLookAtRotation { get; set; } internal static Action pulseSpatialHintScrollArrows { get; set; } internal static Action setSpatialHintDragThresholdTriggerPosition { get; set; } - internal static Action setSpatialHintControlObject { get; set; } + internal static Action setSpatialHintControlNode { get; set; } /// /// Set the spatial hint state @@ -89,10 +89,10 @@ public static void SetSpatialHintDragThresholdTriggerPosition(this IControlSpati /// Set reference to the object, RayOrigin, controlling the Spatial Hint visuals /// Each control-object has it's spatial scrolling processed independently /// - /// Control-object whose spatial scrolling will be processed independently - public static void SetSpatialHintControlObject(this IControlSpatialHinting obj, Transform controlObject) + /// Node on which spatial scrolling will be processed independently + public static void SetSpatialHintControlNode(this IControlSpatialHinting obj, Node? controlNode) { - setSpatialHintControlObject(controlObject); + setSpatialHintControlNode(controlNode); } } } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index ac4926b15..155b25d62 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -6,7 +6,7 @@ namespace UnityEditor.Experimental.EditorVR.Modules { - public sealed class SpatialHintModule : MonoBehaviour, IConnectInterfaces, IInstantiateUI, IRayToNode, IRayVisibilitySettings + public sealed class SpatialHintModule : MonoBehaviour, IConnectInterfaces, IInstantiateUI, INodeToRay, IRayVisibilitySettings { [Flags] public enum SpatialHintStateFlags @@ -21,7 +21,7 @@ public enum SpatialHintStateFlags SpatialHintUI m_SpatialHintUI; SpatialHintStateFlags m_State; - Transform m_ControllingRayOrigin; + Node? m_ControllingNode; public SpatialHintStateFlags state { @@ -35,8 +35,8 @@ public SpatialHintStateFlags state m_SpatialHintUI.centeredScrolling = false; m_SpatialHintUI.preScrollArrowsVisible = false; m_SpatialHintUI.secondaryArrowsVisible = false; - this.RemoveRayVisibilitySettings(m_ControllingRayOrigin, this); - controllingRayOrigin = null; + this.RemoveRayVisibilitySettings(this.RequestRayOriginFromNode(m_ControllingNode), this); + controllingNode = null; break; case SpatialHintStateFlags.PreDragReveal: m_SpatialHintUI.centeredScrolling = false; @@ -53,28 +53,27 @@ public SpatialHintStateFlags state m_SpatialHintUI.preScrollArrowsVisible = false; m_SpatialHintUI.scrollVisualsVisible = true; break; - } } } - Transform controllingRayOrigin + private Node? controllingNode { set { - if (value == m_ControllingRayOrigin) + var controllingNode = m_SpatialHintUI.controllingNode; + if (value == controllingNode) return; - m_ControllingRayOrigin = value; - if (m_ControllingRayOrigin == null) + m_ControllingNode = value; + if (m_ControllingNode == null) { m_SpatialHintUI.controllingNode = null; - } else { state = SpatialHintStateFlags.PreDragReveal; - m_SpatialHintUI.controllingNode = this.RequestNodeFromRayOrigin(m_ControllingRayOrigin); + m_SpatialHintUI.controllingNode = value; } } } @@ -129,10 +128,10 @@ internal void SetDragThresholdTriggerPosition (Vector3 position) m_SpatialHintUI.scrollVisualsDragThresholdTriggerPosition = position; } - internal void SetSpatialHintControlObject(Transform controlObject) + internal void SetSpatialHintControlNode(Node? controlNode) { - controllingRayOrigin = controlObject; - this.AddRayVisibilitySettings(m_ControllingRayOrigin, this, false, false); + controllingNode = controlNode; + this.AddRayVisibilitySettings(this.RequestRayOriginFromNode(m_ControllingNode), this, false, false); } } } diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintUI.cs b/Scripts/Modules/SpatialHintModule/SpatialHintUI.cs index 1b46e58b5..e4889c2a5 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintUI.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintUI.cs @@ -152,7 +152,7 @@ bool scrollArrowsVisible /// public Node? controllingNode { - private get { return m_ControllingNode; } + get { return m_ControllingNode; } set { m_ControllingNode = value; From 580050a4dcdb2e22fd86a9814e25e6200feb6456 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 30 Aug 2017 08:05:00 -0700 Subject: [PATCH 801/870] Add #if UNITY_EDITOR to AnnotationTool classes; Use IIsHoveringOverUI to hide AnnotationPointer --- Tools/AnnotationTool/AnnotationTool.cs | 58 +++++++++++++---- .../Prefabs/AnnotationUI.prefab | 63 +++++++------------ .../UserInterface/AnnotationPointer.cs | 6 +- .../UserInterface/BrushSizeUI.cs | 17 ++++- .../UserInterface/ColorPickerActivator.cs | 2 + .../UserInterface/ColorPickerSquareUI.cs | 2 + .../UserInterface/ColorPickerUI.cs | 2 + 7 files changed, 96 insertions(+), 54 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 0630a1749..3eb467fa7 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -1,7 +1,10 @@ +#if UNITY_EDITOR using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -9,8 +12,9 @@ using UnityEngine.VR; [MainMenuItem("Annotation", "Create", "Draw in 3D")] -public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, ISetDefaultRayVisibility, IUsesRayOrigins, - IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale, IUsesSpatialHash +public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IRayVisibilitySettings, + IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale, IUsesSpatialHash, + IIsHoveringOverUI { public const float TipDistance = 0.05f; public const float MinBrushSize = 0.0025f; @@ -49,6 +53,9 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr Transform m_AnnotationHolder; AnnotationPointer m_AnnotationPointer; + Vector3 m_OriginalAnnotationPointerLocalScale; + Coroutine m_AnnotationPointerVisibilityCoroutine; + bool m_WasOverUI; GameObject m_ColorPickerActivator; @@ -71,10 +78,7 @@ public ActionMap actionMap void OnDestroy() { if (rayOrigin) - { - this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); - } + this.RemoveRayVisibilitySettings(rayOrigin, this); if (m_ColorPicker) ObjectUtils.Destroy(m_ColorPicker.gameObject); @@ -89,10 +93,10 @@ void OnDestroy() void Start() { - this.SetDefaultRayVisibility(rayOrigin, false); - this.LockRay(rayOrigin, this); + this.AddRayVisibilitySettings(rayOrigin, this, false, false); m_AnnotationPointer = ObjectUtils.CreateGameObjectWithComponent(rayOrigin, false); + m_OriginalAnnotationPointerLocalScale = m_AnnotationPointer.transform.localScale; CheckBrushSizeUI(); if (m_ColorPickerActivator == null) @@ -151,8 +155,6 @@ void ShowColorPicker(Transform otherRayOrigin) if (!m_ColorPicker.enabled) m_ColorPicker.Show(); - this.UnlockRay(rayOrigin, this); - this.SetDefaultRayVisibility(rayOrigin, true); m_AnnotationPointer.gameObject.SetActive(false); } @@ -161,8 +163,6 @@ void HideColorPicker() if (m_ColorPicker && m_ColorPicker.enabled) { m_ColorPicker.Hide(); - this.SetDefaultRayVisibility(rayOrigin, false); - this.LockRay(rayOrigin, this); m_AnnotationPointer.gameObject.SetActive(true); } } @@ -526,5 +526,39 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon FinalizeMesh(); consumeControl(annotationInput.draw); } + + var isOverUI = this.IsHoveringOverUI(rayOrigin); + if (isOverUI != m_WasOverUI) + { + this.RestartCoroutine(ref m_AnnotationPointerVisibilityCoroutine, SetAnnotationPointerVisibility(m_WasOverUI)); + if (m_WasOverUI) + this.AddRayVisibilitySettings(rayOrigin, this, false, false); + else + this.RemoveRayVisibilitySettings(rayOrigin, this); + + m_WasOverUI = isOverUI; + } + } + + IEnumerator SetAnnotationPointerVisibility(bool visible) + { + if (!m_AnnotationPointer) + yield break; + + const float transitionTime = 0.1875f; + var annotationPointerTransform = m_AnnotationPointer.transform; + var startTime = Time.time; + var timeDiff = 0f; + var currentScale = annotationPointerTransform.localScale; + var targetScale = visible ? m_OriginalAnnotationPointerLocalScale : Vector3.zero; + while (timeDiff < transitionTime) + { + annotationPointerTransform.localScale = Vector3.Lerp(currentScale, targetScale, timeDiff / transitionTime); + timeDiff = Time.time - startTime; + yield return null; + } + + annotationPointerTransform.localScale = targetScale; } } +#endif diff --git a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab index b761c8c3b..77df12681 100644 --- a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab +++ b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab @@ -285,7 +285,6 @@ GameObject: - component: {fileID: 4663617041298854} - component: {fileID: 33923684612379296} - component: {fileID: 23825123643262260} - - component: {fileID: 64638945432625296} m_Layer: 5 m_Name: Base m_TagString: Untagged @@ -321,7 +320,7 @@ GameObject: - component: {fileID: 33699724321051718} - component: {fileID: 23309274037775718} - component: {fileID: 114168715074745758} - - component: {fileID: 135185009107635084} + - component: {fileID: 65270067782407046} m_Layer: 5 m_Name: Base m_TagString: Untagged @@ -435,7 +434,7 @@ GameObject: - component: {fileID: 33095966663817246} - component: {fileID: 23375274514904506} - component: {fileID: 114257755424135964} - - component: {fileID: 135877582041375586} + - component: {fileID: 65378884854788314} m_Layer: 5 m_Name: Base m_TagString: Untagged @@ -1080,32 +1079,42 @@ MeshFilter: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1136647751248060} m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} ---- !u!64 &64638945432625296 -MeshCollider: +--- !u!65 &65000012153002324 +BoxCollider: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1136647751248060} + m_GameObject: {fileID: 1000010898514098} m_Material: {fileID: 0} m_IsTrigger: 0 - m_Enabled: 0 + m_Enabled: 1 serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 4300050, guid: 4f7e1c38dff4db9449be30d253d1bd8f, type: 3} ---- !u!65 &65000012153002324 + m_Size: {x: 945.4, y: 1268, z: 10} + m_Center: {x: 0, y: 0, z: 0} +--- !u!65 &65270067782407046 BoxCollider: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010898514098} + m_GameObject: {fileID: 1167948277449984} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 945.4, y: 1268, z: 10} - m_Center: {x: 0, y: 0, z: 0} + m_Size: {x: 0.1, y: 0.0028786354, z: 0.07} + m_Center: {x: 0, y: -0.00000005960467, z: 0.000000008381907} +--- !u!65 &65378884854788314 +BoxCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1365241548943880} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.1, y: 0.0028786354, z: 0.07} + m_Center: {x: 0, y: -0.00000005960467, z: 0.000000008381907} --- !u!114 &114000010240686482 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1630,30 +1639,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 2 ---- !u!135 &135185009107635084 -SphereCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1167948277449984} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.03 - m_Center: {x: 0, y: 0, z: 0} ---- !u!135 &135877582041375586 -SphereCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1365241548943880} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.03 - m_Center: {x: 0, y: 0, z: 0} --- !u!222 &222000010186370168 CanvasRenderer: m_ObjectHideFlags: 1 diff --git a/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs b/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs index ed8f91d72..394f8dbec 100644 --- a/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs +++ b/Tools/AnnotationTool/UserInterface/AnnotationPointer.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if UNITY_EDITOR +using System.Collections.Generic; using UnityEngine; public class AnnotationPointer : MonoBehaviour @@ -137,4 +138,5 @@ public void SetColor(Color color) { m_ConeMaterialInstance.SetColor("_EmissionColor", color); } -} \ No newline at end of file +} +#endif diff --git a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs index d29a4bba7..7fd5aaf29 100644 --- a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs +++ b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs @@ -1,4 +1,6 @@ +#if UNITY_EDITOR using System; +using UnityEditor; using UnityEngine; using UnityEngine.UI; @@ -17,6 +19,13 @@ public class BrushSizeUI : MonoBehaviour public Action onValueChanged { private get; set; } + void Awake() + { + // HACK: Can't modify UI object without pushing an Undo state for it. + // Without this, we will undo changes to the handle scale while undoing annotations + Undo.undoRedoPerformed += () => m_Slider.value = m_Slider.value; + } + void Start() { m_SliderHandleImage = m_SliderHandle.GetComponent(); @@ -24,12 +33,17 @@ void Start() public void OnSliderValueChanged(float value) { - m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(k_MinSize, k_MaxSize, value); + //ScalelHandle(value); if (onValueChanged != null) onValueChanged(value); } + void ScalelHandle(float value) + { + m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(k_MinSize, k_MaxSize, value); + } + public void ChangeSliderValue(float newValue) { m_Slider.value = newValue; @@ -40,3 +54,4 @@ public void OnBrushColorChanged(Color newColor) m_SliderHandleImage.color = newColor; } } +#endif diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index 26ab86356..6b40534f7 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using System; using System.Collections; using UnityEditor.Experimental.EditorVR.UI; @@ -103,3 +104,4 @@ IEnumerator Highlight(bool transitionIn = true) m_Icon.localScale = targetScale; } } +#endif diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs index 75246623d..58b3f9c43 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerSquareUI.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using System; using UnityEngine.EventSystems; using UnityEngine.UI; @@ -24,3 +25,4 @@ public void OnEndDrag(PointerEventData eventData) m_AllowDragEvents = false; } } +#endif diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index 8ac3ea7e1..ebab6aa4e 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR using UnityEngine; using System.Collections; using UnityEngine.UI; @@ -183,3 +184,4 @@ public void OnPointerExit(PointerEventData eventData) onHideCalled(); } } +#endif From 5f969ab122ae7f841eb25d0f21df9033b3762832 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 30 Aug 2017 11:26:49 -0700 Subject: [PATCH 802/870] Fix undo bug where BrushSizeUI would get stuff done to it by undo --- Tools/AnnotationTool/AnnotationTool.cs | 11 ++++---- .../UserInterface/BrushSizeUI.cs | 25 ++++++++++++------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 3eb467fa7..ab18d4043 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using UnityEditor; using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Menus; @@ -64,8 +65,8 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr public Transform rayOrigin { private get; set; } public List otherRayOrigins { private get; set; } - public Transform menuOrigin { set; private get; } - public Transform alternateMenuOrigin { set; private get; } + public Transform menuOrigin { private get; set; } + public Transform alternateMenuOrigin { private get; set; } public Func customMenuOrigin { private get; set; } public Func customAlternateMenuOrigin { private get; set; } @@ -120,10 +121,8 @@ void Start() activator.showColorPicker = ShowColorPicker; activator.hideColorPicker = HideColorPicker; -#if UNITY_EDITOR - activator.undoButtonClick += UnityEditor.Undo.PerformUndo; - activator.redoButtonClick += UnityEditor.Undo.PerformRedo; -#endif + activator.undoButtonClick += Undo.PerformUndo; + activator.redoButtonClick += Undo.PerformRedo; } } diff --git a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs index 7fd5aaf29..d4915d38d 100644 --- a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs +++ b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs @@ -1,5 +1,6 @@ #if UNITY_EDITOR using System; +using System.Collections.Generic; using UnityEditor; using UnityEngine; using UnityEngine.UI; @@ -21,9 +22,20 @@ public class BrushSizeUI : MonoBehaviour void Awake() { - // HACK: Can't modify UI object without pushing an Undo state for it. - // Without this, we will undo changes to the handle scale while undoing annotations - Undo.undoRedoPerformed += () => m_Slider.value = m_Slider.value; + // We record property modifications on creation and modification of these UI elements, which will look odd when undone + Undo.postprocessModifications += PostProcessModifications; + } + + UndoPropertyModification[] PostProcessModifications(UndoPropertyModification[] modifications) + { + var modificationList = new List(modifications); + foreach (var modification in modifications) + { + if (modification.currentValue.target == m_SliderHandle) + modificationList.Remove(modification); + } + + return modificationList.ToArray(); } void Start() @@ -33,17 +45,12 @@ void Start() public void OnSliderValueChanged(float value) { - //ScalelHandle(value); + m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(k_MinSize, k_MaxSize, value); if (onValueChanged != null) onValueChanged(value); } - void ScalelHandle(float value) - { - m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(k_MinSize, k_MaxSize, value); - } - public void ChangeSliderValue(float newValue) { m_Slider.value = newValue; From 80411ae15d664274da38c2099eb0a08d35dc0925 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 30 Aug 2017 16:48:10 -0700 Subject: [PATCH 803/870] Add support for multiple custom ToolTip highlight materials --- .../Modules/TooltipModule/TooltipModule.cs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index dbfc8cbf7..0204c7e38 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -33,6 +33,7 @@ class TooltipData { public float startTime; public TooltipUI tooltipUI; + public Material customHighlightMaterial; } readonly Dictionary m_Tooltips = new Dictionary(); @@ -40,7 +41,6 @@ class TooltipData Transform m_TooltipCanvas; Vector3 m_TooltipScale; Color m_OriginalBackgroundColor; - Material m_CustomHighlightMaterial; // Local method use only -- created here to reduce garbage collection readonly List m_TooltipsToHide = new List(); @@ -51,7 +51,6 @@ void Start() m_TooltipCanvas.SetParent(transform); m_TooltipScale = m_TooltipPrefab.transform.localScale; m_HighlightMaterial = Instantiate(m_HighlightMaterial); - m_CustomHighlightMaterial = Instantiate(m_HighlightMaterial); m_TooltipBackgroundMaterial = Instantiate(m_TooltipBackgroundMaterial); m_OriginalBackgroundColor = m_TooltipBackgroundMaterial.color; var sessionGradient = UnityBrandColorScheme.sessionGradient; @@ -133,14 +132,8 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa var viewerScale = this.GetViewerScale(); tooltipTransform.localScale = m_TooltipScale * lerp * viewerScale; - var customToolTipColor = tooltip as ISetCustomTooltipColor; - if (customToolTipColor != null) - { - var customToolTipHighlightColor = customToolTipColor.customToolTipHighlightColor; - tooltipUI.highlight.material= m_CustomHighlightMaterial; - m_CustomHighlightMaterial.SetColor(k_MaterialColorTopProperty, customToolTipHighlightColor.a); - m_CustomHighlightMaterial.SetColor(k_MaterialColorBottomProperty, customToolTipHighlightColor.b); - } + var highlightMaterial = m_Tooltips[tooltip].customHighlightMaterial ?? m_HighlightMaterial; + tooltipUI.highlight.material= highlightMaterial; m_TooltipBackgroundMaterial.SetColor("_Color", Color.Lerp(UnityBrandColorScheme.darker, m_OriginalBackgroundColor, lerp)); @@ -249,9 +242,20 @@ public void ShowTooltip(ITooltip tooltip) if (m_Tooltips.ContainsKey(tooltip)) return; + Material highlightMaterial = null; + var customToolTipColor = tooltip as ISetCustomTooltipColor; + if (customToolTipColor != null) + { + highlightMaterial = Instantiate(m_HighlightMaterial); + var customToolTipHighlightColor = customToolTipColor.customToolTipHighlightColor; + highlightMaterial.SetColor(k_MaterialColorTopProperty, customToolTipHighlightColor.a); + highlightMaterial.SetColor(k_MaterialColorBottomProperty, customToolTipHighlightColor.b); + } + m_Tooltips[tooltip] = new TooltipData { - startTime = Time.realtimeSinceStartup + startTime = Time.realtimeSinceStartup, + customHighlightMaterial = highlightMaterial }; } From 7069d5b945db9e1ca0f7515a472a39289214e653 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 30 Aug 2017 17:23:05 -0700 Subject: [PATCH 804/870] Perform suggested PR changes on SpatialScrollModule --- .../SpatialScrollModule.cs | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index eb6b0789e..3b035f0fb 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -11,7 +11,7 @@ public sealed class SpatialScrollModule : MonoBehaviour, IUsesViewerScale, ICont HapticPulse m_ActivationPulse; // The pulse performed when initial activating spatial selection // Collection housing objects whose scroll data is being processed - List m_ScrollCallers; + readonly List m_ScrollCallers = new List(); public class SpatialScrollData : INodeToRay { @@ -104,40 +104,29 @@ public void UpdateExistingScrollData(Vector3 newPosition) } } - void Awake() - { - m_ScrollCallers = new List(); - } - internal SpatialScrollData PerformScroll(IControlSpatialScrolling caller, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerScrollVisuals = true) { // Continue processing of spatial scrolling for a given caller, // Or create new instance of scroll data for new callers. (Initial structure for support of simultaneous callers) - SpatialScrollData spatialScrollData = null; + SpatialScrollData scrollData = null; foreach (var scroller in m_ScrollCallers) { if (scroller == caller) { - spatialScrollData = scroller.spatialScrollData; - spatialScrollData.UpdateExistingScrollData(currentPosition); + scrollData = scroller.spatialScrollData; + scrollData.UpdateExistingScrollData(currentPosition); break; } } - if (spatialScrollData == null) + if (scrollData == null) { - spatialScrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerScrollVisuals); + scrollData = new SpatialScrollData(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerScrollVisuals); m_ScrollCallers.Add(caller); - this.AddRayVisibilitySettings(spatialScrollData.rayOrigin, caller, false, false, 1); + this.AddRayVisibilitySettings(scrollData.rayOrigin, caller, false, false, 1); } - return ProcessSpatialScrolling(spatialScrollData); - } - - SpatialScrollData ProcessSpatialScrolling(SpatialScrollData scrollData) - { - var currentPosition = scrollData.currentPosition; - var directionVector = currentPosition - scrollData.startingPosition; + var directionVector = currentPosition - startingPosition; if (scrollData.spatialDirection == null) { var newDirectionVectorThreshold = 0.0175f; // Initial magnitude beyond which spatial scrolling will be evaluated @@ -146,18 +135,19 @@ SpatialScrollData ProcessSpatialScrolling(SpatialScrollData scrollData) var dragPercentage = dragMagnitude / newDirectionVectorThreshold; var repeatingPulseAmount = Mathf.Sin(Time.realtimeSinceStartup * 20) > 0.5f ? 1f : 0f; // Perform an on/off repeating pulse while waiting for the drag threshold to be crossed scrollData.dragDistance = dragMagnitude > 0 ? dragPercentage : 0f; // Set value representing how much of the pre-scroll drag amount has occurred - this.Pulse(scrollData.node, m_ActivationPulse, repeatingPulseAmount, repeatingPulseAmount); + this.Pulse(node, m_ActivationPulse, repeatingPulseAmount, repeatingPulseAmount); if (dragMagnitude > newDirectionVectorThreshold) scrollData.spatialDirection = directionVector; // Initialize vector defining the spatial scroll direction } else { - var scrollingAfterTriggerOirigin = Vector3.Dot(directionVector, scrollData.spatialDirection.Value) >= 0; // Detect that the user is scrolling forward from the trigger origin point - var projectionVector = scrollingAfterTriggerOirigin ? scrollData.spatialDirection.Value : scrollData.spatialDirection.Value + scrollData.spatialDirection.Value; + var spatialDirection = scrollData.spatialDirection.Value; + var scrollingAfterTriggerOirigin = Vector3.Dot(directionVector, spatialDirection) >= 0; // Detect that the user is scrolling forward from the trigger origin point + var projectionVector = scrollingAfterTriggerOirigin ? spatialDirection : spatialDirection + spatialDirection; var projectedAmount = Vector3.Project(directionVector, projectionVector).magnitude / this.GetViewerScale(); // Mandate that scrolling maintain the initial direction, regardless of the user scrolling before/after the trigger origin point; prevent direction flipping projectedAmount = scrollingAfterTriggerOirigin ? projectedAmount : 1 - projectedAmount; - scrollData.normalizedLoopingPosition = (Mathf.Abs(projectedAmount * (scrollData.maxItemCount / scrollData.scrollableItemCount)) % scrollData.repeatingScrollLengthRange) * (1 / scrollData.repeatingScrollLengthRange); + scrollData.normalizedLoopingPosition = (Mathf.Abs(projectedAmount * (maxItemCount / scrollableItemCount)) % repeatingScrollLengthRange) * (1 / repeatingScrollLengthRange); } return scrollData; From d13721eb7f983c7b4da1549734219390c9435f36 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 30 Aug 2017 17:33:58 -0700 Subject: [PATCH 805/870] Address suggested PR changes in GradientButton, SpatialHintModule, and PinnedToolButton --- .../ToolMenuButton/PinnedToolButton.cs | 2 - .../ToolMenuButton/PinnedToolButton.prefab | 2 + .../SpatialHintModule/SpatialHintModule.cs | 9 ++-- Scripts/UI/GradientButton.cs | 52 ++++--------------- 4 files changed, 17 insertions(+), 48 deletions(-) diff --git a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs index b026bb879..9d77dbec1 100644 --- a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs +++ b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs @@ -407,11 +407,9 @@ void Start() tooltipAlignment = TextAlignment.Center; - const float kIncreasedContainerContentsSpeedMultiplier = 2.5f; m_GradientButton.hoverEnter += OnBackgroundHoverEnter; // Display the foreground button actions m_GradientButton.hoverExit += OnActionButtonHoverExit; m_GradientButton.click += OnBackgroundButtonClick; - m_GradientButton.containerContentsAnimationSpeedMultiplier = kIncreasedContainerContentsSpeedMultiplier; m_FrameRenderer.SetBlendShapeWeight(1, 0f); m_CloseInsetMeshRenderer.SetBlendShapeWeight(0, 100f); diff --git a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab index ec0b6085f..9e377a73f 100644 --- a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab +++ b/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab @@ -871,6 +871,7 @@ MonoBehaviour: m_EndHighlightDuration: 0.3 m_DelayBeforeReveal: 0 m_HighlightZScaleMultiplier: 25 + m_ContainerContentsAnimationSpeedMultiplier: 1 --- !u!114 &114000010635728284 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1056,6 +1057,7 @@ MonoBehaviour: m_EndHighlightDuration: 0.167 m_DelayBeforeReveal: 0 m_HighlightZScaleMultiplier: 10 + m_ContainerContentsAnimationSpeedMultiplier: 2.5 --- !u!137 &137000010072420284 SkinnedMeshRenderer: m_ObjectHideFlags: 1 diff --git a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs index 155b25d62..a09b9fdd6 100644 --- a/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs +++ b/Scripts/Modules/SpatialHintModule/SpatialHintModule.cs @@ -8,13 +8,12 @@ namespace UnityEditor.Experimental.EditorVR.Modules { public sealed class SpatialHintModule : MonoBehaviour, IConnectInterfaces, IInstantiateUI, INodeToRay, IRayVisibilitySettings { - [Flags] public enum SpatialHintStateFlags { - Hidden = 1 << 0, - PreDragReveal = 1 << 1, - Scrolling = 1 << 2, - CenteredScrolling = 2 << 3, + Hidden, + PreDragReveal, + Scrolling, + CenteredScrolling, } [SerializeField] diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 001ac470f..304ee63ce 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -20,8 +20,6 @@ sealed class GradientButton : MonoBehaviour, IPointerEnterHandler, IPointerExitH public event Action click; public event Action hoverEnter; public event Action hoverExit; - public event Action highlightStart; - public event Action highlightEnd; public Sprite iconSprite { @@ -70,19 +68,9 @@ public bool highlighted return; if (m_Highlighted) - { - m_HighlightCoroutine = StartCoroutine(BeginHighlight()); - - if (highlightStart != null) - highlightStart(); - } + this.RestartCoroutine(ref m_HighlightCoroutine, BeginHighlight()); else - { - m_HighlightCoroutine = StartCoroutine(EndHighlight()); - - if (highlightEnd != null) - highlightEnd(); - } + this.RestartCoroutine(ref m_HighlightCoroutine, EndHighlight()); } } bool m_Highlighted; @@ -119,26 +107,6 @@ public bool visible } bool m_Visible; - Vector3 originalScale - { - get { return invertHighlightScale ? m_HighlightContentContainerLocalScale : m_OriginalContentContainerLocalScale; } - } - - Vector3 highlightScale - { - get { return invertHighlightScale ? m_OriginalContentContainerLocalScale : m_HighlightContentContainerLocalScale; } - } - - public Sprite icon - { - set - { - m_Icon.sprite = value; - m_OriginalIconSprite = value; - } - } - - public bool invertHighlightScale { private get; set; } public float containerContentsAnimationSpeedMultiplier { set { m_ContainerContentsAnimationSpeedMultiplier = value; }} public float iconHighlightedLocalZOffset @@ -212,9 +180,11 @@ public float iconHighlightedLocalZOffset float m_DelayBeforeReveal = 0.25f; [SerializeField] - [FormerlySerializedAs("m_highlightZScaleMultiplier")] float m_HighlightZScaleMultiplier = 2f; + [SerializeField] + float m_ContainerContentsAnimationSpeedMultiplier = 1f; + Material m_ButtonMaterial; Vector3 m_OriginalIconLocalPosition; Vector3 m_OriginalContentContainerLocalScale; @@ -223,11 +193,11 @@ public float iconHighlightedLocalZOffset Vector3 m_IconPressedLocalPosition; Sprite m_OriginalIconSprite; Vector3 m_OriginalLocalScale; - float m_ContainerContentsAnimationSpeedMultiplier = 1f; // The initial button reveal coroutines, before highlighting occurs Coroutine m_VisibilityCoroutine; Coroutine m_ContentVisibilityCoroutine; + Coroutine m_HighlighCoroutine; // The visibility & highlight coroutines Coroutine m_HighlightCoroutine; @@ -277,7 +247,7 @@ IEnumerator AnimateShow() { m_CanvasGroup.interactable = false; m_ButtonMaterial.SetFloat(k_MaterialAlphaProperty, 0f); - m_ContentContainer.localScale = originalScale; + m_ContentContainer.localScale = m_OriginalContentContainerLocalScale; SetMaterialColors(normalGradientPair); this.StopCoroutine(ref m_ContentVisibilityCoroutine); @@ -389,9 +359,9 @@ IEnumerator BeginHighlight() var currentGradientPair = GetMaterialColors(); var targetGradientPair = highlightGradientPair; var currentLocalScale = m_ContentContainer.localScale; - var highlightedLocalScale = highlightScale; - var highlightDuration = m_BeginHighlightDuration > 0f ? m_BeginHighlightDuration : 0.01f; // Add sane default if highlight duration is zero - while (transitionAmount < highlightDuration) + var highlightedLocalScale = m_HighlightContentContainerLocalScale; + var highlightDuration = m_BeginHighlightDuration; + while (transitionAmount < highlightDuration) // Skip while look if user has set the m_BeginHighlightDuration to a value at or below zero { var shapedTransitionAmount = MathUtilsExt.SmoothInOutLerpFloat(transitionAmount += Time.unscaledDeltaTime / highlightDuration); m_ContentContainer.localScale = Vector3.Lerp(currentLocalScale, highlightedLocalScale, shapedTransitionAmount); @@ -417,7 +387,7 @@ IEnumerator EndHighlight() var originalGradientPair = GetMaterialColors(); var targetGradientPair = normalGradientPair; var currentLocalScale = m_ContentContainer.localScale; - var targetScale = originalScale; + var targetScale = m_OriginalContentContainerLocalScale; var highlightDuration = m_EndHighlightDuration > 0f ? m_EndHighlightDuration : 0.01f; // Add sane default if highlight duration is zero while (transitionAmount < highlightDuration) { From 9c296376f92fbf542bce0a0ed3cd78bcac002de8 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 30 Aug 2017 17:44:03 -0700 Subject: [PATCH 806/870] Move IPinnedToolsMenu and IMenuIcon into Scripts/Interfaces/Entity --- Scripts/{UI/Interfaces => Interfaces/Entity}/IMenuIcon.cs | 0 Scripts/{UI/Interfaces => Interfaces/Entity}/IMenuIcon.cs.meta | 0 Scripts/{UI/Interfaces => Interfaces/Entity}/IPinnedToolsMenu.cs | 0 .../{UI/Interfaces => Interfaces/Entity}/IPinnedToolsMenu.cs.meta | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename Scripts/{UI/Interfaces => Interfaces/Entity}/IMenuIcon.cs (100%) rename Scripts/{UI/Interfaces => Interfaces/Entity}/IMenuIcon.cs.meta (100%) rename Scripts/{UI/Interfaces => Interfaces/Entity}/IPinnedToolsMenu.cs (100%) rename Scripts/{UI/Interfaces => Interfaces/Entity}/IPinnedToolsMenu.cs.meta (100%) diff --git a/Scripts/UI/Interfaces/IMenuIcon.cs b/Scripts/Interfaces/Entity/IMenuIcon.cs similarity index 100% rename from Scripts/UI/Interfaces/IMenuIcon.cs rename to Scripts/Interfaces/Entity/IMenuIcon.cs diff --git a/Scripts/UI/Interfaces/IMenuIcon.cs.meta b/Scripts/Interfaces/Entity/IMenuIcon.cs.meta similarity index 100% rename from Scripts/UI/Interfaces/IMenuIcon.cs.meta rename to Scripts/Interfaces/Entity/IMenuIcon.cs.meta diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs b/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs similarity index 100% rename from Scripts/UI/Interfaces/IPinnedToolsMenu.cs rename to Scripts/Interfaces/Entity/IPinnedToolsMenu.cs diff --git a/Scripts/UI/Interfaces/IPinnedToolsMenu.cs.meta b/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs.meta similarity index 100% rename from Scripts/UI/Interfaces/IPinnedToolsMenu.cs.meta rename to Scripts/Interfaces/Entity/IPinnedToolsMenu.cs.meta From 46c9b7361f0ae5ca1280b2f57a18ecab404b3a6c Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 30 Aug 2017 17:47:48 -0700 Subject: [PATCH 807/870] Add missing comments to IPinnedToolsMenu --- Scripts/Interfaces/Entity/IPinnedToolsMenu.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs b/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs index 5e969241a..2948d6e95 100644 --- a/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs +++ b/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs @@ -9,6 +9,10 @@ namespace UnityEditor.Experimental.EditorVR /// public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode, ISelectTool { + /// + /// Bool denoting that the alternate menu (radial menu, etc) is currently visible + /// Allows the ToolsMenu to adapt visibility state changes that occur in the AlternateMenu + /// bool alternateMenuVisible { set; } /// @@ -37,6 +41,7 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod public static class IPinnedToolsMenuMethods { public static Action mainMenuActivatorSelected { get; set; } + public static Action selectTool { get; set; } /// /// Called when selecting the main menu activator @@ -47,8 +52,6 @@ public static void MainMenuActivatorSelected(this IPinnedToolsMenu obj, Transfor mainMenuActivatorSelected(rayOrigin); } - public static Action selectTool { get; set; } - /// /// Selects a tool, based on type, from a pinned tool button /// From ff905dcc1452c7000d87a90b8043b4c158245da7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 30 Aug 2017 17:54:01 -0700 Subject: [PATCH 808/870] Convert various values in PerformScroll into consts --- Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs index 3b035f0fb..4cf5f9545 100644 --- a/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs +++ b/Scripts/Modules/SpatialScrollModule/SpatialScrollModule.cs @@ -133,7 +133,11 @@ internal SpatialScrollData PerformScroll(IControlSpatialScrolling caller, Node? newDirectionVectorThreshold *= this.GetViewerScale(); var dragMagnitude = Vector3.Magnitude(directionVector); var dragPercentage = dragMagnitude / newDirectionVectorThreshold; - var repeatingPulseAmount = Mathf.Sin(Time.realtimeSinceStartup * 20) > 0.5f ? 1f : 0f; // Perform an on/off repeating pulse while waiting for the drag threshold to be crossed + const int kPulseSpeedMultiplier = 20; + const float kPulseThreshold = 0.5f; + const float kPulseOnAmount = 1f; + const float kPulseOffAmount = 0f; + var repeatingPulseAmount = Mathf.Sin(Time.realtimeSinceStartup * kPulseSpeedMultiplier) > kPulseThreshold ? kPulseOnAmount : kPulseOffAmount; // Perform an on/off repeating pulse while waiting for the drag threshold to be crossed scrollData.dragDistance = dragMagnitude > 0 ? dragPercentage : 0f; // Set value representing how much of the pre-scroll drag amount has occurred this.Pulse(node, m_ActivationPulse, repeatingPulseAmount, repeatingPulseAmount); if (dragMagnitude > newDirectionVectorThreshold) From 05a085f319f322b9b2e53680aa0efe52f86405eb Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Wed, 30 Aug 2017 17:55:18 -0700 Subject: [PATCH 809/870] Move IPinnedToolButton into interfaces/entity --- .../{Core/Interfaces => Interfaces/Entity}/IPinnedToolButton.cs | 0 .../Interfaces => Interfaces/Entity}/IPinnedToolButton.cs.meta | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Scripts/{Core/Interfaces => Interfaces/Entity}/IPinnedToolButton.cs (100%) rename Scripts/{Core/Interfaces => Interfaces/Entity}/IPinnedToolButton.cs.meta (100%) diff --git a/Scripts/Core/Interfaces/IPinnedToolButton.cs b/Scripts/Interfaces/Entity/IPinnedToolButton.cs similarity index 100% rename from Scripts/Core/Interfaces/IPinnedToolButton.cs rename to Scripts/Interfaces/Entity/IPinnedToolButton.cs diff --git a/Scripts/Core/Interfaces/IPinnedToolButton.cs.meta b/Scripts/Interfaces/Entity/IPinnedToolButton.cs.meta similarity index 100% rename from Scripts/Core/Interfaces/IPinnedToolButton.cs.meta rename to Scripts/Interfaces/Entity/IPinnedToolButton.cs.meta From c10ebef70cee14ac04679613409dc1ef19fa522e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 30 Aug 2017 21:46:32 -0700 Subject: [PATCH 810/870] Refactor ignorelists to use Rendererrs, so we don't have to get gameobject references; Fix highlightColor for linear color space; Revert change to LocomotionTool --- Scripts/Core/EditorVR.Viewer.cs | 10 +++------- .../FunctionalityInjection/IGetVRPlayerObjects.cs | 4 ++-- Scripts/Interfaces/FunctionalityInjection/IRaycast.cs | 6 +++--- Scripts/Modules/HighlightModule/HighlightModule.cs | 2 +- .../Modules/IntersectionModule/IntersectionModule.cs | 7 +++---- Scripts/Modules/SnappingModule/SnappingModule.cs | 10 +++++----- Tools/LocomotionTool/LocomotionTool.cs | 3 +-- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 2 +- 8 files changed, 19 insertions(+), 25 deletions(-) diff --git a/Scripts/Core/EditorVR.Viewer.cs b/Scripts/Core/EditorVR.Viewer.cs index 20d1baf26..3a3dab5dd 100644 --- a/Scripts/Core/EditorVR.Viewer.cs +++ b/Scripts/Core/EditorVR.Viewer.cs @@ -40,7 +40,7 @@ class Preferences PlayerBody m_PlayerBody; float m_OriginalNearClipPlane; float m_OriginalFarClipPlane; - readonly List m_VRPlayerObjects = new List(); + readonly List m_VRPlayerObjects = new List(); readonly Preferences m_Preferences = new Preferences(); @@ -181,12 +181,8 @@ internal void AddPlayerModel() m_PlayerBody = ObjectUtils.Instantiate(evr.m_PlayerModelPrefab, CameraUtils.GetMainCamera().transform, false).GetComponent(); var renderer = m_PlayerBody.GetComponent(); evr.GetModule().spatialHash.AddObject(renderer, renderer.bounds); - var renderers = renderer.GetComponentsInChildren(true); - evr.GetModule().ignoreList = renderers; - foreach (var r in renderers) - { - m_VRPlayerObjects.Add(r.gameObject); - } + renderer.GetComponentsInChildren(true, m_VRPlayerObjects); + evr.GetModule().ignoreList = m_VRPlayerObjects; } internal bool IsOverShoulder(Transform rayOrigin) diff --git a/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs b/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs index d3d87497f..7bf95dacd 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IGetVRPlayerObjects.cs @@ -14,12 +14,12 @@ public interface IGetVRPlayerObjects public static class IGetVRPlayerObjectsMethods { - internal static Func> getVRPlayerObjects { get; set; } + internal static Func> getVRPlayerObjects { get; set; } /// /// Returns objects that are used to represent the VR player /// - public static List GetVRPlayerObjects(this IGetVRPlayerObjects obj) + public static List GetVRPlayerObjects(this IGetVRPlayerObjects obj) { return getVRPlayerObjects(); } diff --git a/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs index 92b091c5d..21e294a49 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs @@ -12,7 +12,7 @@ public interface IRaycast public static class IRaycastMethods { - public delegate bool RaycastDelegate(Ray ray, out RaycastHit hit, out GameObject go, float maxDistance = Mathf.Infinity, List ignoreList = null); + public delegate bool RaycastDelegate(Ray ray, out RaycastHit hit, out GameObject go, float maxDistance = Mathf.Infinity, List ignoreList = null); public static RaycastDelegate raycast { get; set; } @@ -23,9 +23,9 @@ public static class IRaycastMethods /// Hit information /// The gameobject which was hit, if any /// The maximum distance of the raycast - /// (optional) A list of GameObjects to ignore + /// (optional) A list of Renderers to ignore /// - public static bool Raycast(this IRaycast obj, Ray ray, out RaycastHit hit, out GameObject go, float maxDistance = Mathf.Infinity, List ignoreList = null) + public static bool Raycast(this IRaycast obj, Ray ray, out RaycastHit hit, out GameObject go, float maxDistance = Mathf.Infinity, List ignoreList = null) { return raycast(ray, out hit, out go, maxDistance, ignoreList); } diff --git a/Scripts/Modules/HighlightModule/HighlightModule.cs b/Scripts/Modules/HighlightModule/HighlightModule.cs index ed1bd4779..f65d0c1fb 100644 --- a/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -43,7 +43,7 @@ void Awake() { var selectionColor = MaterialUtils.PrefToColor(EditorPrefs.GetString(k_SelectionOutlinePrefsKey)); selectionColor.a = 1; - m_RayHighlightMaterial.color = selectionColor; + m_RayHighlightMaterial.color = PlayerSettings.colorSpace == ColorSpace.Gamma ? selectionColor : selectionColor.gamma; } } diff --git a/Scripts/Modules/IntersectionModule/IntersectionModule.cs b/Scripts/Modules/IntersectionModule/IntersectionModule.cs index e1d7bcd08..7a7c09670 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionModule.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionModule.cs @@ -206,7 +206,7 @@ internal void UpdateRaycast(Transform rayOrigin, float distance) m_RaycastGameObjects[rayOrigin] = new RayIntersection { go = go, distance = hit.distance }; } - internal bool Raycast(Ray ray, out RaycastHit hit, out GameObject obj, float maxDistance = Mathf.Infinity, List ignoreList = null) + internal bool Raycast(Ray ray, out RaycastHit hit, out GameObject obj, float maxDistance = Mathf.Infinity, List ignoreList = null) { obj = null; hit = new RaycastHit(); @@ -218,8 +218,7 @@ internal bool Raycast(Ray ray, out RaycastHit hit, out GameObject obj, float max for (int i = 0; i < m_Intersections.Count; i++) { var renderer = m_Intersections[i]; - var gameObject = renderer.gameObject; - if (ignoreList != null && ignoreList.Contains(gameObject)) + if (ignoreList != null && ignoreList.Contains(renderer)) continue; var transform = renderer.transform; @@ -238,7 +237,7 @@ internal bool Raycast(Ray ray, out RaycastHit hit, out GameObject obj, float max hit.distance = dist; hit.point = point; hit.normal = transform.TransformDirection(tmp.normal); - obj = gameObject; + obj = renderer.gameObject; } } } diff --git a/Scripts/Modules/SnappingModule/SnappingModule.cs b/Scripts/Modules/SnappingModule/SnappingModule.cs index a6f135130..1bb7fdda4 100644 --- a/Scripts/Modules/SnappingModule/SnappingModule.cs +++ b/Scripts/Modules/SnappingModule/SnappingModule.cs @@ -235,7 +235,7 @@ public bool directSnappingEnabled public bool widgetEnabled { get; set; } - public Renderer[] ignoreList { private get; set; } + public List ignoreList { private get; set; } public GameObject settingsMenuPrefab { get { return m_SettingsMenuPrefab; } } @@ -365,7 +365,7 @@ public bool directSnappingEnabled public Transform rayOrigin { get { return null; } } // Local method use only -- created here to reduce garbage collection - readonly List m_CombinedIgnoreList = new List(); + readonly List m_CombinedIgnoreList = new List(); Transform[] m_SingleTransformArray = new Transform[1]; void Awake() @@ -740,13 +740,13 @@ void AddToIgnoreList(Transform[] transforms) var renderers = transforms[i].GetComponentsInChildren(); for (var j = 0; j < renderers.Length; j++) { - m_CombinedIgnoreList.Add(renderers[j].gameObject); + m_CombinedIgnoreList.Add(renderers[j]); } } - for (var i = 0; i < ignoreList.Length; i++) + for (var i = 0; i < ignoreList.Count; i++) { - m_CombinedIgnoreList.Add(ignoreList[i].gameObject); + m_CombinedIgnoreList.Add(ignoreList[i]); } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index dfc3dcbed..5eb5e3d9f 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -127,8 +127,7 @@ public GameObject settingsMenuItemInstance if (locomotionTool != this) { locomotionTool.m_BlockValueChangedListener = true; - //locomotionTool.m_ToggleGroup.NotifyToggleOn( - // isOn ? locomotionTool.m_FlyToggle : locomotionTool.m_BlinkToggle); + //linkedObject.m_ToggleGroup.NotifyToggleOn(isOn ? m_FlyToggle : m_BlinkToggle); // HACK: Toggle Group claims these toggles are not a part of the group locomotionTool.m_FlyToggle.isOn = isOn; locomotionTool.m_BlinkToggle.isOn = !isOn; diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index 59bbff943..290761de9 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -62,7 +62,7 @@ public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast public float extraSpeed { private get; set; } - public List ignoreList { private get; set; } + public List ignoreList { private get; set; } public bool visible { From 74576b1504e0542b7b89e653f8d1574bda9caf43 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 30 Aug 2017 22:01:34 -0700 Subject: [PATCH 811/870] Cancel crawling when rotating --- Tools/LocomotionTool/LocomotionTool.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 5eb5e3d9f..69f9ea644 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -285,6 +285,9 @@ bool DoRotating(ConsumeControlDelegate consumeControl) m_LastRotationDiff = filteredRotation; m_BlinkVisuals.visible = false; + + m_StartCrawling = false; + m_Crawling = false; return true; } } From d6b45143fbd4b72c25285d7cacd1d02434c01a66 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 30 Aug 2017 22:21:20 -0700 Subject: [PATCH 812/870] Remove redundant namespace operator --- Tools/AnnotationTool/AnnotationTool.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index ab18d4043..52c1830e5 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -416,8 +416,8 @@ void FinalizeMesh() this.AddToSpatialHash(go); - UnityEditor.Undo.IncrementCurrentGroup(); - UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create Annotation"); + Undo.IncrementCurrentGroup(); + Undo.RegisterCreatedObjectUndo(go, "Create Annotation"); } void CenterMesh() @@ -514,7 +514,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon consumeControl(annotationInput.draw); } - if (annotationInput.draw.isHeld) + var isHeld = annotationInput.draw.isHeld; + if (isHeld) { UpdateAnnotation(); consumeControl(annotationInput.draw); @@ -526,6 +527,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon consumeControl(annotationInput.draw); } + if (isHeld) + return; + var isOverUI = this.IsHoveringOverUI(rayOrigin); if (isOverUI != m_WasOverUI) { From d271c56b459c672625a9a5aa5d2a9948dc3ffba7 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 30 Aug 2017 23:22:39 -0700 Subject: [PATCH 813/870] Add IMultiDeviceTool; Make AnnotationTool a MultiDeviceTool to allow undo/redo with alternate hand's thumbstick --- Scripts/Core/EditorVR.Tools.cs | 44 ++++-- Scripts/Interfaces/Entity/IMultiDeviceTool.cs | 15 ++ .../Entity/IMultiDeviceTool.cs.meta | 12 ++ Tools/AnnotationTool/AnnotationTool.cs | 138 ++++++++++++------ .../Input/AnnotationInput.asset | 30 ++++ Tools/AnnotationTool/Input/AnnotationInput.cs | 1 + 6 files changed, 184 insertions(+), 56 deletions(-) create mode 100644 Scripts/Interfaces/Entity/IMultiDeviceTool.cs create mode 100644 Scripts/Interfaces/Entity/IMultiDeviceTool.cs.meta diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 0159cbd5e..402b1a448 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -187,9 +187,10 @@ static bool SelectTool(Transform rayOrigin, Type toolType) var spawnTool = true; // If this tool was on the current device already, then simply remove it - if (deviceData.currentTool != null && deviceData.currentTool.GetType() == toolType) + var currentTool = deviceData.currentTool; + if (currentTool != null && currentTool.GetType() == toolType) { - DespawnTool(deviceData, deviceData.currentTool); + DespawnTool(deviceData, currentTool); // Don't spawn a new tool, since we are only removing the old tool spawnTool = false; @@ -197,15 +198,40 @@ static bool SelectTool(Transform rayOrigin, Type toolType) if (spawnTool) { + var evrDeviceData = evr.m_DeviceData; + // Spawn tool and collect all devices that this tool will need HashSet usedDevices; var device = deviceData.inputDevice; - var newTool = SpawnTool(toolType, out usedDevices, device); - - var evrDeviceData = evr.m_DeviceData; + var toolData = SpawnTool(toolType, out usedDevices, device); + var multiTool = toolData.tool as IMultiDeviceTool; + if (multiTool != null) + { + multiTool.primary = true; + Rays.ForEachProxyDevice(otherDeviceData => + { + if (otherDeviceData != deviceData) + { + HashSet otherUsedDevices; + var otherToolData = SpawnTool(toolType, out otherUsedDevices, otherDeviceData.inputDevice); + + foreach (var dd in evrDeviceData) + { + if (!otherUsedDevices.Contains(dd.inputDevice)) + continue; + + var otherCurrentTool = otherDeviceData.currentTool; + if (otherCurrentTool != null) // Remove the current tool on all devices this tool will be spawned on + DespawnTool(otherDeviceData, otherCurrentTool); + + AddToolToStack(dd, otherToolData); + } + } + }); + } // Exclusive mode tools always take over all tool stacks - if (newTool is IExclusiveMode) + if (toolData.tool is IExclusiveMode) { foreach (var dev in evrDeviceData) { @@ -218,10 +244,10 @@ static bool SelectTool(Transform rayOrigin, Type toolType) if (!usedDevices.Contains(dd.inputDevice)) continue; - if (deviceData.currentTool != null) // Remove the current tool on all devices this tool will be spawned on - DespawnTool(deviceData, deviceData.currentTool); + if (currentTool != null) // Remove the current tool on all devices this tool will be spawned on + DespawnTool(deviceData, currentTool); - AddToolToStack(dd, newTool); + AddToolToStack(dd, toolData); } } diff --git a/Scripts/Interfaces/Entity/IMultiDeviceTool.cs b/Scripts/Interfaces/Entity/IMultiDeviceTool.cs new file mode 100644 index 000000000..3a1a7b0f4 --- /dev/null +++ b/Scripts/Interfaces/Entity/IMultiDeviceTool.cs @@ -0,0 +1,15 @@ +#if UNITY_EDITOR +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Declares a tool as one that should be spawned on all devices at once + /// + public interface IMultiDeviceTool + { + /// + /// Whether this tool is on the device that selected the tool + /// + bool primary { set; } + } +} +#endif diff --git a/Scripts/Interfaces/Entity/IMultiDeviceTool.cs.meta b/Scripts/Interfaces/Entity/IMultiDeviceTool.cs.meta new file mode 100644 index 000000000..14edce3df --- /dev/null +++ b/Scripts/Interfaces/Entity/IMultiDeviceTool.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c6329db01a7f2bd4cb5b78174d1fa923 +timeCreated: 1466026110 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 52c1830e5..c92a99a11 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -7,6 +7,7 @@ using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Menus; +using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; @@ -15,7 +16,7 @@ [MainMenuItem("Annotation", "Create", "Draw in 3D")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IRayVisibilitySettings, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale, IUsesSpatialHash, - IIsHoveringOverUI + IIsHoveringOverUI, IMultiDeviceTool, IUsesProxyType { public const float TipDistance = 0.05f; public const float MinBrushSize = 0.0025f; @@ -57,11 +58,14 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr Vector3 m_OriginalAnnotationPointerLocalScale; Coroutine m_AnnotationPointerVisibilityCoroutine; bool m_WasOverUI; + bool m_WasDoingUndoRedo; GameObject m_ColorPickerActivator; float m_BrushSize = MinBrushSize; + public bool primary { private get; set; } + public Type proxyType { private get; set; } public Transform rayOrigin { private get; set; } public List otherRayOrigins { private get; set; } @@ -83,8 +87,10 @@ void OnDestroy() if (m_ColorPicker) ObjectUtils.Destroy(m_ColorPicker.gameObject); + if (m_BrushSizeUI) ObjectUtils.Destroy(m_BrushSizeUI.gameObject); + if (m_ColorPickerActivator) ObjectUtils.Destroy(m_ColorPickerActivator); @@ -96,33 +102,36 @@ void Start() { this.AddRayVisibilitySettings(rayOrigin, this, false, false); - m_AnnotationPointer = ObjectUtils.CreateGameObjectWithComponent(rayOrigin, false); - m_OriginalAnnotationPointerLocalScale = m_AnnotationPointer.transform.localScale; - CheckBrushSizeUI(); - - if (m_ColorPickerActivator == null) + if (primary) { - m_ColorPickerActivator = this.InstantiateUI(m_ColorPickerActivatorPrefab); - var otherAltMenu = customAlternateMenuOrigin(otherRayOrigins[0]); + m_AnnotationPointer = ObjectUtils.CreateGameObjectWithComponent(rayOrigin, false); + m_OriginalAnnotationPointerLocalScale = m_AnnotationPointer.transform.localScale; + CheckBrushSizeUI(); + + if (m_ColorPickerActivator == null) + { + m_ColorPickerActivator = this.InstantiateUI(m_ColorPickerActivatorPrefab); + var otherAltMenu = customAlternateMenuOrigin(otherRayOrigins[0]); - m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); - m_ColorPickerActivator.transform.localRotation = Quaternion.identity; - m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; - m_ColorPickerActivator.transform.localScale = Vector3.one; + m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); + m_ColorPickerActivator.transform.localRotation = Quaternion.identity; + m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; + m_ColorPickerActivator.transform.localScale = Vector3.one; - var activator = m_ColorPickerActivator.GetComponentInChildren(); + var activator = m_ColorPickerActivator.GetComponentInChildren(); - m_ColorPicker = activator.GetComponentInChildren(true); - m_ColorPicker.onHideCalled = HideColorPicker; - m_ColorPicker.toolRayOrigin = rayOrigin; - m_ColorPicker.onColorPicked = OnColorPickerValueChanged; + m_ColorPicker = activator.GetComponentInChildren(true); + m_ColorPicker.onHideCalled = HideColorPicker; + m_ColorPicker.toolRayOrigin = rayOrigin; + m_ColorPicker.onColorPicked = OnColorPickerValueChanged; - activator.rayOrigin = otherRayOrigins.First(); - activator.showColorPicker = ShowColorPicker; - activator.hideColorPicker = HideColorPicker; + activator.rayOrigin = otherRayOrigins.First(); + activator.showColorPicker = ShowColorPicker; + activator.hideColorPicker = HideColorPicker; - activator.undoButtonClick += Undo.PerformUndo; - activator.redoButtonClick += Undo.PerformRedo; + activator.undoButtonClick += Undo.PerformUndo; + activator.redoButtonClick += Undo.PerformRedo; + } } } @@ -501,30 +510,66 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { var annotationInput = (AnnotationInput)input; - if (!Mathf.Approximately(annotationInput.changeBrushSize.value, 0)) + var isHeld = annotationInput.draw.isHeld; + if (primary) { - HandleBrushSize(annotationInput.changeBrushSize.value); - consumeControl(annotationInput.changeBrushSize); - consumeControl(annotationInput.vertical); - } + if (!Mathf.Approximately(annotationInput.changeBrushSize.value, 0)) + { + HandleBrushSize(annotationInput.changeBrushSize.value); + consumeControl(annotationInput.changeBrushSize); + consumeControl(annotationInput.vertical); + } - if (annotationInput.draw.wasJustPressed) - { - SetupAnnotation(); - consumeControl(annotationInput.draw); - } + if (annotationInput.draw.wasJustPressed) + { + SetupAnnotation(); + consumeControl(annotationInput.draw); + } - var isHeld = annotationInput.draw.isHeld; - if (isHeld) - { - UpdateAnnotation(); - consumeControl(annotationInput.draw); - } + if (isHeld) + { + UpdateAnnotation(); + consumeControl(annotationInput.draw); + } - if (annotationInput.draw.wasJustReleased) + if (annotationInput.draw.wasJustReleased) + { + FinalizeMesh(); + consumeControl(annotationInput.draw); + } + } + else { - FinalizeMesh(); - consumeControl(annotationInput.draw); + // Secondary hand uses brush size input to do undo/redo + var value = annotationInput.changeBrushSize.value; + if (proxyType == typeof(ViveProxy)) + { + if (annotationInput.stickButton.wasJustPressed) + { + if (value > 0) + Undo.PerformRedo(); + else + Undo.PerformUndo(); + } + } + else + { + var doUndoRedo = Math.Abs(value) > 0.5f; + if (doUndoRedo != m_WasDoingUndoRedo) + { + m_WasDoingUndoRedo = doUndoRedo; + if (doUndoRedo) + { + if (value > 0) + Undo.PerformRedo(); + else + Undo.PerformUndo(); + } + } + + consumeControl(annotationInput.changeBrushSize); + consumeControl(annotationInput.vertical); + } } if (isHeld) @@ -533,13 +578,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var isOverUI = this.IsHoveringOverUI(rayOrigin); if (isOverUI != m_WasOverUI) { - this.RestartCoroutine(ref m_AnnotationPointerVisibilityCoroutine, SetAnnotationPointerVisibility(m_WasOverUI)); - if (m_WasOverUI) - this.AddRayVisibilitySettings(rayOrigin, this, false, false); - else - this.RemoveRayVisibilitySettings(rayOrigin, this); - m_WasOverUI = isOverUI; + this.RestartCoroutine(ref m_AnnotationPointerVisibilityCoroutine, SetAnnotationPointerVisibility(!isOverUI)); + if (isOverUI) + this.RemoveRayVisibilitySettings(rayOrigin, this); + else + this.AddRayVisibilitySettings(rayOrigin, this, false, false); } } diff --git a/Tools/AnnotationTool/Input/AnnotationInput.asset b/Tools/AnnotationTool/Input/AnnotationInput.asset index cbf95d5fa..617099662 100644 --- a/Tools/AnnotationTool/Input/AnnotationInput.asset +++ b/Tools/AnnotationTool/Input/AnnotationInput.asset @@ -15,6 +15,7 @@ MonoBehaviour: - {fileID: 114000013162093460} - {fileID: 114000010589948208} - {fileID: 114574627476091900} + - {fileID: 114831519838551112} m_ControlSchemes: - m_Name: AnnotationInput m_DeviceSlots: @@ -52,6 +53,15 @@ MonoBehaviour: sensitivity: 1000 snap: 1 primaryIsButtonAxis: 0 + - sources: + - controlIndex: 22 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 m_MapTypeName: AnnotationInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null m_CustomNamespace: @@ -115,3 +125,23 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null name: Vertical defaultValue: 0 +--- !u!114 &114831519838551112 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: StickButton + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 3 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: StickButton + defaultValue: 0 diff --git a/Tools/AnnotationTool/Input/AnnotationInput.cs b/Tools/AnnotationTool/Input/AnnotationInput.cs index b0473e2c0..6bfefcb38 100644 --- a/Tools/AnnotationTool/Input/AnnotationInput.cs +++ b/Tools/AnnotationTool/Input/AnnotationInput.cs @@ -10,5 +10,6 @@ public AnnotationInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @draw { get { return (ButtonInputControl)this[0]; } } public AxisInputControl @changeBrushSize { get { return (AxisInputControl)this[1]; } } public AxisInputControl @vertical { get { return (AxisInputControl)this[2]; } } + public ButtonInputControl @stickButton { get { return (ButtonInputControl)this[3]; } } } } From 996244d7dac38d26798918cd39bb3c0661248d76 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 31 Aug 2017 14:15:43 -0700 Subject: [PATCH 814/870] Refactor any reference of "PinnedToolsMenu" into "ToolsMenu" --- Menus/MainMenu/MainMenu.cs | 6 +- Menus/{ToolMenu.meta => ToolsMenu.meta} | 0 .../{ToolMenu => ToolsMenu}/HapticPulses.meta | 0 .../ToolsMenuButtonClickPulse.asset} | 0 .../ToolsMenuButtonClickPulse.asset.meta} | 0 .../ToolsMenuButtonHoverPulse.asset} | 0 .../ToolsMenuButtonHoverPulse.asset.meta} | 0 .../ToolsMenuMenuHidingPulse.asset} | 0 .../ToolsMenuMenuHidingPulse.asset.meta} | 0 Menus/{ToolMenu => ToolsMenu}/Prefabs.meta | 0 .../Prefabs/ToolsMenu.prefab} | 0 .../Prefabs/ToolsMenu.prefab.meta} | 0 Menus/{ToolMenu => ToolsMenu}/Scripts.meta | 0 .../Scripts/HintIcon.cs | 0 .../Scripts/HintIcon.cs.meta | 0 .../Scripts/HintLine.cs | 0 .../Scripts/HintLine.cs.meta | 0 .../Scripts/ToolsMenuUI.cs} | 34 ++--- .../Scripts/ToolsMenuUI.cs.meta} | 0 Menus/{ToolMenu => ToolsMenu}/Textures.meta | 0 .../Textures/HintArrow.png | 0 .../Textures/HintArrow.png.meta | 0 .../Textures/SecondaryHintArrow.png | 0 .../Textures/SecondaryHintArrow.png.meta | 0 .../Textures/UnityIcon.png | 0 .../Textures/UnityIcon.png.meta | 0 .../ToolsMenu.cs} | 124 +++++++++--------- .../ToolsMenu.cs.meta} | 8 +- .../ToolsMenuButton.meta} | 0 .../ToolsMenuButton}/Materials.meta | 0 .../Materials/ToolsMenuButtonBorder.mat} | 0 .../Materials/ToolsMenuButtonBorder.mat.meta} | 0 .../Materials/ToolsMenuButtonFaceMask.mat} | 0 .../ToolsMenuButtonFaceMask.mat.meta} | 0 .../Materials/ToolsMenuButtonUIContent.mat} | 0 .../ToolsMenuButtonUIContent.mat.meta} | 0 .../Materials/ToolsMenulButton.mat} | 0 .../Materials/ToolsMenulButton.mat.meta} | 0 .../ToolsMenuButton/ToolsMenuButton.cs} | 10 +- .../ToolsMenuButton/ToolsMenuButton.cs.meta} | 0 .../ToolsMenuButton/ToolsMenuButton.prefab} | 14 +- .../ToolsMenuButton.prefab.meta} | 0 .../ToolslMenuInput.asset} | 0 .../ToolslMenuInput.asset.meta} | 0 .../ToolslMenuInput.cs} | 4 +- .../ToolslMenuInput.cs.meta} | 4 +- ...ButtonMesh.fbx => ToolsMenuButtonMesh.fbx} | 0 ....fbx.meta => ToolsMenuButtonMesh.fbx.meta} | 8 +- ...ntent.mat => ToolsMenuButtonUIContent.mat} | 0 ...meta => ToolsMenuButtonUIContent.mat.meta} | 0 ...utton.mat => ToolsMenuSecondaryButton.mat} | 0 ...meta => ToolsMenuSecondaryButton.mat.meta} | 0 Scripts/Core/EditorVR.Menus.cs | 12 +- Scripts/Core/EditorVR.Tools.cs | 32 ++--- ...orVR.ToolMenu.cs => EditorVR.ToolsMenu.cs} | 14 +- ...enu.cs.meta => EditorVR.ToolsMenu.cs.meta} | 0 Scripts/Core/EditorVR.cs | 12 +- Scripts/Interfaces/Entity/IMainMenu.cs | 2 +- .../{IPinnedToolsMenu.cs => IToolsMenu.cs} | 18 +-- ...edToolsMenu.cs.meta => IToolsMenu.cs.meta} | 0 ...innedToolButton.cs => IToolsMenuButton.cs} | 12 +- ...utton.cs.meta => IToolsMenuButton.cs.meta} | 0 ...Button.cs => IPreviewInToolsMenuButton.cs} | 6 +- ...meta => IPreviewInToolsMenuButton.cs.meta} | 0 .../Modules/TooltipModule/TooltipModule.cs | 4 +- 65 files changed, 165 insertions(+), 159 deletions(-) rename Menus/{ToolMenu.meta => ToolsMenu.meta} (100%) rename Menus/{ToolMenu => ToolsMenu}/HapticPulses.meta (100%) rename Menus/{ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset => ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset} (100%) rename Menus/{ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta => ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset.meta} (100%) rename Menus/{ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset => ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset} (100%) rename Menus/{ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta => ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset.meta} (100%) rename Menus/{ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset => ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset} (100%) rename Menus/{ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta => ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset.meta} (100%) rename Menus/{ToolMenu => ToolsMenu}/Prefabs.meta (100%) rename Menus/{ToolMenu/Prefabs/PinnedToolsMenu.prefab => ToolsMenu/Prefabs/ToolsMenu.prefab} (100%) rename Menus/{ToolMenu/Prefabs/PinnedToolsMenu.prefab.meta => ToolsMenu/Prefabs/ToolsMenu.prefab.meta} (100%) rename Menus/{ToolMenu => ToolsMenu}/Scripts.meta (100%) rename Menus/{ToolMenu => ToolsMenu}/Scripts/HintIcon.cs (100%) rename Menus/{ToolMenu => ToolsMenu}/Scripts/HintIcon.cs.meta (100%) rename Menus/{ToolMenu => ToolsMenu}/Scripts/HintLine.cs (100%) rename Menus/{ToolMenu => ToolsMenu}/Scripts/HintLine.cs.meta (100%) rename Menus/{ToolMenu/Scripts/PinnedToolsMenuUI.cs => ToolsMenu/Scripts/ToolsMenuUI.cs} (93%) rename Menus/{ToolMenu/Scripts/PinnedToolsMenuUI.cs.meta => ToolsMenu/Scripts/ToolsMenuUI.cs.meta} (100%) rename Menus/{ToolMenu => ToolsMenu}/Textures.meta (100%) rename Menus/{ToolMenu => ToolsMenu}/Textures/HintArrow.png (100%) rename Menus/{ToolMenu => ToolsMenu}/Textures/HintArrow.png.meta (100%) rename Menus/{ToolMenu => ToolsMenu}/Textures/SecondaryHintArrow.png (100%) rename Menus/{ToolMenu => ToolsMenu}/Textures/SecondaryHintArrow.png.meta (100%) rename Menus/{ToolMenu => ToolsMenu}/Textures/UnityIcon.png (100%) rename Menus/{ToolMenu => ToolsMenu}/Textures/UnityIcon.png.meta (100%) rename Menus/{ToolMenu/PinnedToolsMenu.cs => ToolsMenu/ToolsMenu.cs} (56%) rename Menus/{ToolMenu/PinnedToolsMenu.cs.meta => ToolsMenu/ToolsMenu.cs.meta} (69%) rename Menus/{ToolMenu/ToolMenuButton.meta => ToolsMenu/ToolsMenuButton.meta} (100%) rename Menus/{ToolMenu/ToolMenuButton => ToolsMenu/ToolsMenuButton}/Materials.meta (100%) rename Menus/{ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat => ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat} (100%) rename Menus/{ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat.meta => ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat.meta} (100%) rename Menus/{ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat => ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat} (100%) rename Menus/{ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat.meta => ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat.meta} (100%) rename Menus/{ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat => ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat} (100%) rename Menus/{ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat.meta => ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat.meta} (100%) rename Menus/{ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat => ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat} (100%) rename Menus/{ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat.meta => ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat.meta} (100%) rename Menus/{ToolMenu/ToolMenuButton/PinnedToolButton.cs => ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs} (98%) rename Menus/{ToolMenu/ToolMenuButton/PinnedToolButton.cs.meta => ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs.meta} (100%) rename Menus/{ToolMenu/ToolMenuButton/PinnedToolButton.prefab => ToolsMenu/ToolsMenuButton/ToolsMenuButton.prefab} (99%) rename Menus/{ToolMenu/ToolMenuButton/PinnedToolButton.prefab.meta => ToolsMenu/ToolsMenuButton/ToolsMenuButton.prefab.meta} (100%) rename Menus/{ToolMenu/PinnedToolslMenuInput.asset => ToolsMenu/ToolslMenuInput.asset} (100%) rename Menus/{ToolMenu/PinnedToolslMenuInput.asset.meta => ToolsMenu/ToolslMenuInput.asset.meta} (100%) rename Menus/{ToolMenu/PinnedToolslMenuInput.cs => ToolsMenu/ToolslMenuInput.cs} (74%) rename Menus/{ToolMenu/PinnedToolslMenuInput.cs.meta => ToolsMenu/ToolslMenuInput.cs.meta} (75%) rename Models/{PinnedToolButtonMesh.fbx => ToolsMenuButtonMesh.fbx} (100%) rename Models/{PinnedToolButtonMesh.fbx.meta => ToolsMenuButtonMesh.fbx.meta} (95%) rename Prefabs/UI/Materials/{PinnedToolButtonUIContent.mat => ToolsMenuButtonUIContent.mat} (100%) rename Prefabs/UI/Materials/{PinnedToolButtonUIContent.mat.meta => ToolsMenuButtonUIContent.mat.meta} (100%) rename Prefabs/UI/Materials/{PinnedToolSecondaryButton.mat => ToolsMenuSecondaryButton.mat} (100%) rename Prefabs/UI/Materials/{PinnedToolSecondaryButton.mat.meta => ToolsMenuSecondaryButton.mat.meta} (100%) rename Scripts/Core/{EditorVR.ToolMenu.cs => EditorVR.ToolsMenu.cs} (81%) rename Scripts/Core/{EditorVR.ToolMenu.cs.meta => EditorVR.ToolsMenu.cs.meta} (100%) rename Scripts/Interfaces/Entity/{IPinnedToolsMenu.cs => IToolsMenu.cs} (71%) rename Scripts/Interfaces/Entity/{IPinnedToolsMenu.cs.meta => IToolsMenu.cs.meta} (100%) rename Scripts/Interfaces/Entity/{IPinnedToolButton.cs => IToolsMenuButton.cs} (89%) rename Scripts/Interfaces/Entity/{IPinnedToolButton.cs.meta => IToolsMenuButton.cs.meta} (100%) rename Scripts/Interfaces/FunctionalityInjection/{IPreviewInToolMenuButton.cs => IPreviewInToolsMenuButton.cs} (78%) rename Scripts/Interfaces/FunctionalityInjection/{IPreviewInToolMenuButton.cs.meta => IPreviewInToolsMenuButton.cs.meta} (100%) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index f4b64bcbd..287d6517b 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -190,7 +190,7 @@ void CreateFaceButtons(List types) } }); - // Assign pinned tool button preview properties + // Assign Tools Menu button preview properties mainMenuButton.toolType = selectedType; } @@ -283,8 +283,8 @@ void OnButtonHovered(Transform rayOrigin, Type buttonType, string buttonDescript this.Pulse(this.RequestNodeFromRayOrigin(rayOrigin), m_ButtonHoverPulse); // Pass the pointer which is over us, so this information can supply context (e.g. selecting a tool for a different hand) - // Enable preview-mode on a pinned tool button; Display on the opposite proxy device by evaluating the entering RayOrigin - // Disable any existing previews being displayed in PinnedToolsMenus + // Enable preview-mode on a Tools Menu button; Display on the opposite proxy device by evaluating the entering RayOrigin + // Disable any existing previews being displayed in ToolsMenus this.ClearToolMenuButtonPreview(); if (buttonType != null && rayOrigin != null) diff --git a/Menus/ToolMenu.meta b/Menus/ToolsMenu.meta similarity index 100% rename from Menus/ToolMenu.meta rename to Menus/ToolsMenu.meta diff --git a/Menus/ToolMenu/HapticPulses.meta b/Menus/ToolsMenu/HapticPulses.meta similarity index 100% rename from Menus/ToolMenu/HapticPulses.meta rename to Menus/ToolsMenu/HapticPulses.meta diff --git a/Menus/ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset b/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset similarity index 100% rename from Menus/ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset rename to Menus/ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset diff --git a/Menus/ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta b/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset.meta similarity index 100% rename from Menus/ToolMenu/HapticPulses/PinnedToolButtonClickPulse.asset.meta rename to Menus/ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset.meta diff --git a/Menus/ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset b/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset similarity index 100% rename from Menus/ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset rename to Menus/ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset diff --git a/Menus/ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta b/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset.meta similarity index 100% rename from Menus/ToolMenu/HapticPulses/PinnedToolButtonHoverPulse.asset.meta rename to Menus/ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset.meta diff --git a/Menus/ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset b/Menus/ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset similarity index 100% rename from Menus/ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset rename to Menus/ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset diff --git a/Menus/ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta b/Menus/ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset.meta similarity index 100% rename from Menus/ToolMenu/HapticPulses/PinnedToolMenuHidingPulse.asset.meta rename to Menus/ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset.meta diff --git a/Menus/ToolMenu/Prefabs.meta b/Menus/ToolsMenu/Prefabs.meta similarity index 100% rename from Menus/ToolMenu/Prefabs.meta rename to Menus/ToolsMenu/Prefabs.meta diff --git a/Menus/ToolMenu/Prefabs/PinnedToolsMenu.prefab b/Menus/ToolsMenu/Prefabs/ToolsMenu.prefab similarity index 100% rename from Menus/ToolMenu/Prefabs/PinnedToolsMenu.prefab rename to Menus/ToolsMenu/Prefabs/ToolsMenu.prefab diff --git a/Menus/ToolMenu/Prefabs/PinnedToolsMenu.prefab.meta b/Menus/ToolsMenu/Prefabs/ToolsMenu.prefab.meta similarity index 100% rename from Menus/ToolMenu/Prefabs/PinnedToolsMenu.prefab.meta rename to Menus/ToolsMenu/Prefabs/ToolsMenu.prefab.meta diff --git a/Menus/ToolMenu/Scripts.meta b/Menus/ToolsMenu/Scripts.meta similarity index 100% rename from Menus/ToolMenu/Scripts.meta rename to Menus/ToolsMenu/Scripts.meta diff --git a/Menus/ToolMenu/Scripts/HintIcon.cs b/Menus/ToolsMenu/Scripts/HintIcon.cs similarity index 100% rename from Menus/ToolMenu/Scripts/HintIcon.cs rename to Menus/ToolsMenu/Scripts/HintIcon.cs diff --git a/Menus/ToolMenu/Scripts/HintIcon.cs.meta b/Menus/ToolsMenu/Scripts/HintIcon.cs.meta similarity index 100% rename from Menus/ToolMenu/Scripts/HintIcon.cs.meta rename to Menus/ToolsMenu/Scripts/HintIcon.cs.meta diff --git a/Menus/ToolMenu/Scripts/HintLine.cs b/Menus/ToolsMenu/Scripts/HintLine.cs similarity index 100% rename from Menus/ToolMenu/Scripts/HintLine.cs rename to Menus/ToolsMenu/Scripts/HintLine.cs diff --git a/Menus/ToolMenu/Scripts/HintLine.cs.meta b/Menus/ToolsMenu/Scripts/HintLine.cs.meta similarity index 100% rename from Menus/ToolMenu/Scripts/HintLine.cs.meta rename to Menus/ToolsMenu/Scripts/HintLine.cs.meta diff --git a/Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs b/Menus/ToolsMenu/Scripts/ToolsMenuUI.cs similarity index 93% rename from Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs rename to Menus/ToolsMenu/Scripts/ToolsMenuUI.cs index 56875a311..bc729a919 100644 --- a/Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs +++ b/Menus/ToolsMenu/Scripts/ToolsMenuUI.cs @@ -11,7 +11,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IInstantiateUI, + sealed class ToolsMenuUI : MonoBehaviour, IUsesViewerScale, IInstantiateUI, IConnectInterfaces, IControlSpatialHinting, IUsesRayOrigin { const int k_MenuButtonOrderPosition = 0; // Menu button position used in this particular ToolButton implementation @@ -34,7 +34,7 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IInstantiateUI Transform m_ButtonTooltipTarget; bool m_AllButtonsVisible; - List m_OrderedButtons; + List m_OrderedButtons; Coroutine m_ShowHideAllButtonsCoroutine; Coroutine m_MoveCoroutine; Coroutine m_ButtonHoverExitDelayCoroutine; @@ -51,7 +51,7 @@ sealed class PinnedToolsMenuUI : MonoBehaviour, IUsesViewerScale, IInstantiateUI public Transform buttonContainer { get { return m_ButtonContainer; } } public Transform rayOrigin { get; set; } public Action mainMenuActivatorSelected { get; set; } - public List buttons { get { return m_OrderedButtons; } } + public List buttons { get { return m_OrderedButtons; } } public bool allButtonsVisible { @@ -137,7 +137,7 @@ public bool spatiallyScrolling void Awake() { m_OriginalLocalScale = transform.localScale; - m_OrderedButtons = new List(); + m_OrderedButtons = new List(); } void Update() @@ -171,7 +171,7 @@ void Update() } } - public void AddButton(IPinnedToolButton button, Transform buttonTransform) + public void AddButton(IToolsMenuButton button, Transform buttonTransform) { button.showAllButtons = ShowAllButtons; button.hoverExit = ButtonHoverExitPerformed; @@ -231,7 +231,7 @@ IEnumerator ShowThenHideAllButtons(float delayBeforeHiding = 1.25f, bool showMen m_ShowHideAllButtonsCoroutine = null; } - void Reinsert(IPinnedToolButton button, int newOrderPosition, bool updateButtonOrder = false) + void Reinsert(IToolsMenuButton button, int newOrderPosition, bool updateButtonOrder = false) { var removed = m_OrderedButtons.Remove(button); if (!removed) @@ -283,9 +283,9 @@ void ShowOnlyMenuAndActiveToolButtons() } } - void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton, bool selectAfterSettingButtonOrder = true) + void SetupButtonOrderThenSelectTool(IToolsMenuButton toolsMenuButton, bool selectAfterSettingButtonOrder = true) { - var mainMenu = IsMainMenuButton(pinnedToolButton); + var mainMenu = IsMainMenuButton(toolsMenuButton); if (mainMenu) { mainMenuActivatorSelected(rayOrigin); @@ -294,20 +294,20 @@ void SetupButtonOrderThenSelectTool(IPinnedToolButton pinnedToolButton, bool sel var showMenuButton = !aboveMinimumButtonCount; - Reinsert(pinnedToolButton, k_ActiveToolOrderPosition); + Reinsert(toolsMenuButton, k_ActiveToolOrderPosition); this.RestartCoroutine(ref m_ShowHideAllButtonsCoroutine, ShowThenHideAllButtons(1f, showMenuButton)); if (selectAfterSettingButtonOrder && buttonSelected != null) { - bool existingButton = m_OrderedButtons.Any((x) => x.toolType == pinnedToolButton.toolType); + bool existingButton = m_OrderedButtons.Any((x) => x.toolType == toolsMenuButton.toolType); if (existingButton) - buttonSelected(rayOrigin, pinnedToolButton.toolType); // Select the tool in the PinnedToolsMenu + buttonSelected(rayOrigin, toolsMenuButton.toolType); // Select the tool in the Tools Menu } } /// - /// Utilized by PinnedToolsMenu to select an existing button by type, without creating a new button + /// Utilized by Tools Menu to select an existing button by type, without creating a new button /// /// Button ToolType to compare against existing button types public void SelectExistingToolType(Type type) @@ -323,7 +323,7 @@ public void SelectExistingToolType(Type type) } /// - /// Utilized by PinnedToolsMenuButtons to select an existing button by type, without creating a new button + /// Utilized by ToolsMenuButtons to select an existing button by type, without creating a new button /// /// Button ToolType to compare against existing button types void SelectExistingToolTypeFromButton(Type type) @@ -400,7 +400,7 @@ public void SelectHighlightedButton() /// Bool denoting that a highlighted button other than the selection tool button was deleted public bool DeleteHighlightedButton() { - IPinnedToolButton button = null; + IToolsMenuButton button = null; for (int i = 0; i < m_OrderedButtons.Count; ++i) { button = m_OrderedButtons[i]; @@ -448,12 +448,12 @@ public bool DeleteButtonOfType(Type type) return buttonDeleted; } - static bool IsMainMenuButton(IPinnedToolButton button) + static bool IsMainMenuButton(IToolsMenuButton button) { return button.toolType == typeof(IMainMenu); } - static bool IsSelectionToolButton(IPinnedToolButton button) + static bool IsSelectionToolButton(IToolsMenuButton button) { return button.toolType == typeof(SelectionTool); } @@ -494,7 +494,7 @@ IEnumerator MoveToLocation(Vector3 targetPosition, Vector3 targetScale) m_MoveCoroutine = null; } - void ShowAllButtons(IPinnedToolButton button) + void ShowAllButtons(IToolsMenuButton button) { m_RayHovered = true; if (!allButtonsVisible && aboveMinimumButtonCount && !IsMainMenuButton(button) && m_ButtonHoverExitDelayCoroutine == null) diff --git a/Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs.meta b/Menus/ToolsMenu/Scripts/ToolsMenuUI.cs.meta similarity index 100% rename from Menus/ToolMenu/Scripts/PinnedToolsMenuUI.cs.meta rename to Menus/ToolsMenu/Scripts/ToolsMenuUI.cs.meta diff --git a/Menus/ToolMenu/Textures.meta b/Menus/ToolsMenu/Textures.meta similarity index 100% rename from Menus/ToolMenu/Textures.meta rename to Menus/ToolsMenu/Textures.meta diff --git a/Menus/ToolMenu/Textures/HintArrow.png b/Menus/ToolsMenu/Textures/HintArrow.png similarity index 100% rename from Menus/ToolMenu/Textures/HintArrow.png rename to Menus/ToolsMenu/Textures/HintArrow.png diff --git a/Menus/ToolMenu/Textures/HintArrow.png.meta b/Menus/ToolsMenu/Textures/HintArrow.png.meta similarity index 100% rename from Menus/ToolMenu/Textures/HintArrow.png.meta rename to Menus/ToolsMenu/Textures/HintArrow.png.meta diff --git a/Menus/ToolMenu/Textures/SecondaryHintArrow.png b/Menus/ToolsMenu/Textures/SecondaryHintArrow.png similarity index 100% rename from Menus/ToolMenu/Textures/SecondaryHintArrow.png rename to Menus/ToolsMenu/Textures/SecondaryHintArrow.png diff --git a/Menus/ToolMenu/Textures/SecondaryHintArrow.png.meta b/Menus/ToolsMenu/Textures/SecondaryHintArrow.png.meta similarity index 100% rename from Menus/ToolMenu/Textures/SecondaryHintArrow.png.meta rename to Menus/ToolsMenu/Textures/SecondaryHintArrow.png.meta diff --git a/Menus/ToolMenu/Textures/UnityIcon.png b/Menus/ToolsMenu/Textures/UnityIcon.png similarity index 100% rename from Menus/ToolMenu/Textures/UnityIcon.png rename to Menus/ToolsMenu/Textures/UnityIcon.png diff --git a/Menus/ToolMenu/Textures/UnityIcon.png.meta b/Menus/ToolsMenu/Textures/UnityIcon.png.meta similarity index 100% rename from Menus/ToolMenu/Textures/UnityIcon.png.meta rename to Menus/ToolsMenu/Textures/UnityIcon.png.meta diff --git a/Menus/ToolMenu/PinnedToolsMenu.cs b/Menus/ToolsMenu/ToolsMenu.cs similarity index 56% rename from Menus/ToolMenu/PinnedToolsMenu.cs rename to Menus/ToolsMenu/ToolsMenu.cs index 9ea449427..38d400f5a 100644 --- a/Menus/ToolMenu/PinnedToolsMenu.cs +++ b/Menus/ToolsMenu/ToolsMenu.cs @@ -10,7 +10,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfaces, IInstantiateUI, + sealed class ToolsMenu : MonoBehaviour, IToolsMenu, IConnectInterfaces, IInstantiateUI, IControlHaptics, IUsesViewerScale, IControlSpatialScrolling, IControlSpatialHinting, IRayVisibilitySettings, IUsesRayOrigin { const int k_ActiveToolOrderPosition = 1; // A active-tool button position used in this particular ToolButton implementation @@ -23,10 +23,10 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac ActionMap m_MainMenuActionMap; [SerializeField] - PinnedToolsMenuUI m_PinnedToolsMenuPrefab; + ToolsMenuUI m_ToolsMenuPrefab; [SerializeField] - PinnedToolButton m_PinnedToolButtonTemplate; + ToolsMenuButton _mToolsMenuButtonTemplate; [SerializeField] HapticPulse m_ButtonClickPulse; @@ -40,18 +40,18 @@ sealed class PinnedToolsMenu : MonoBehaviour, IPinnedToolsMenu, IConnectInterfac Transform m_RayOrigin; float m_AllowToolToggleBeforeThisTime; Vector3 m_SpatialScrollStartPosition; - PinnedToolsMenuUI m_PinnedToolsMenuUI; + ToolsMenuUI m_ToolsMenuUi; public Transform menuOrigin { get; set; } - List buttons { get { return m_PinnedToolsMenuUI.buttons; } } - public bool alternateMenuVisible { set { m_PinnedToolsMenuUI.moveToAlternatePosition = value; } } + List buttons { get { return m_ToolsMenuUi.buttons; } } + public bool alternateMenuVisible { set { m_ToolsMenuUi.moveToAlternatePosition = value; } } public Action highlightSingleButton { get; set; } public Action selectHighlightedButton { get; set; } public Action setButtonForType { get; set; } - public Action deletePinnedToolButton { get; set; } + public Action deleteToolsMenuButton { get; set; } public Node? node { get; set; } - public IPinnedToolButton previewToolButton { get; private set; } + public IToolsMenuButton PreviewToolsMenuButton { get; private set; } public Transform alternateMenuOrigin { get; set; } public SpatialScrollModule.SpatialScrollData spatialScrollData { get; set; } public ActionMap actionMap { get { return m_MainMenuActionMap; } } @@ -63,15 +63,15 @@ public Transform rayOrigin { m_RayOrigin = value; // UI is created after RayOrigin is set here - // Ray origin is then set in CreatePinnedToolsUI() - CreatePinnedToolsUI(); + // Ray origin is then set in CreateToolsMenuUI() + CreateToolsMenuUI(); } } void Awake() { - setButtonForType = CreatePinnedToolButton; - deletePinnedToolButton = DeletePinnedToolButton; + setButtonForType = CreateToolsMenuButton; + deleteToolsMenuButton = DeleteToolsMenuButton; } void OnDestroy() @@ -79,38 +79,38 @@ void OnDestroy() this.RemoveRayVisibilitySettings(rayOrigin, this); } - void CreatePinnedToolsUI() + void CreateToolsMenuUI() { - m_PinnedToolsMenuUI = m_PinnedToolsMenuUI ?? this.InstantiateUI(m_PinnedToolsMenuPrefab.gameObject).GetComponent(); - m_PinnedToolsMenuUI.maxButtonCount = k_MaxButtonCount; - m_PinnedToolsMenuUI.mainMenuActivatorSelected = this.MainMenuActivatorSelected; - m_PinnedToolsMenuUI.rayOrigin = rayOrigin; - m_PinnedToolsMenuUI.buttonHovered += OnButtonHover; - m_PinnedToolsMenuUI.buttonClicked += OnButtonClick; - m_PinnedToolsMenuUI.buttonSelected += OnButtonSelected; - m_PinnedToolsMenuUI.closeMenu += CloseMenu; + m_ToolsMenuUi = m_ToolsMenuUi ?? this.InstantiateUI(m_ToolsMenuPrefab.gameObject).GetComponent(); + m_ToolsMenuUi.maxButtonCount = k_MaxButtonCount; + m_ToolsMenuUi.mainMenuActivatorSelected = this.MainMenuActivatorSelected; + m_ToolsMenuUi.rayOrigin = rayOrigin; + m_ToolsMenuUi.buttonHovered += OnButtonHover; + m_ToolsMenuUi.buttonClicked += OnButtonClick; + m_ToolsMenuUi.buttonSelected += OnButtonSelected; + m_ToolsMenuUi.closeMenu += CloseMenu; // Alternate menu origin isn't set when awake or start run - var pinnedToolsUITransform = m_PinnedToolsMenuUI.transform; - pinnedToolsUITransform.SetParent(alternateMenuOrigin); - pinnedToolsUITransform.localPosition = Vector3.zero; - pinnedToolsUITransform.localRotation = Quaternion.identity; + var toolsMenuUITransform = m_ToolsMenuUi.transform; + toolsMenuUITransform.SetParent(alternateMenuOrigin); + toolsMenuUITransform.localPosition = Vector3.zero; + toolsMenuUITransform.localRotation = Quaternion.identity; } - void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) + void CreateToolsMenuButton(Type toolType, Sprite buttonIcon) { // Select an existing ToolButton if the type is already present in a button if (buttons.Any( x => x.toolType == toolType)) { - m_PinnedToolsMenuUI.SelectExistingToolType(toolType); + m_ToolsMenuUi.SelectExistingToolType(toolType); return; } - if (buttons.Count >= k_MaxButtonCount) // Return if tool type already occupies a pinned tool button + if (buttons.Count >= k_MaxButtonCount) // Return if tool type already occupies a tool button return; - var buttonTransform = ObjectUtils.Instantiate(m_PinnedToolButtonTemplate.gameObject, m_PinnedToolsMenuUI.buttonContainer, false).transform; - var button = buttonTransform.GetComponent(); + var buttonTransform = ObjectUtils.Instantiate(_mToolsMenuButtonTemplate.gameObject, m_ToolsMenuUi.buttonContainer, false).transform; + var button = buttonTransform.GetComponent(); this.ConnectInterfaces(button); button.rayOrigin = rayOrigin; @@ -121,15 +121,15 @@ void CreatePinnedToolButton(Type toolType, Sprite buttonIcon) button.rayOrigin = rayOrigin; if (toolType == typeof(IMainMenu)) - previewToolButton = button; + PreviewToolsMenuButton = button; - m_PinnedToolsMenuUI.AddButton(button, buttonTransform); + m_ToolsMenuUi.AddButton(button, buttonTransform); } - void DeletePinnedToolButton(Type toolTypeToDelete, Type toolTypeToSelectAfterDelete) + void DeleteToolsMenuButton(Type toolTypeToDelete, Type toolTypeToSelectAfterDelete) { - if (m_PinnedToolsMenuUI.DeleteButtonOfType(toolTypeToDelete)) - m_PinnedToolsMenuUI.SelectNextExistingToolButton(); + if (m_ToolsMenuUi.DeleteButtonOfType(toolTypeToDelete)) + m_ToolsMenuUi.SelectNextExistingToolButton(); } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -139,37 +139,37 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; const float kAllowToggleDuration = 0.25f; - var pinnedToolInput = (PinnedToolslMenuInput) input; + var toolslMenuInput = (ToolslMenuInput) input; - if (spatialScrollData != null && pinnedToolInput.cancel.wasJustPressed) + if (spatialScrollData != null && toolslMenuInput.cancel.wasJustPressed) { - consumeControl(pinnedToolInput.cancel); - consumeControl(pinnedToolInput.show); - consumeControl(pinnedToolInput.select); + consumeControl(toolslMenuInput.cancel); + consumeControl(toolslMenuInput.show); + consumeControl(toolslMenuInput.select); OnButtonClick(); CloseMenu(); // Also ends spatial scroll - m_PinnedToolsMenuUI.allButtonsVisible = false; + m_ToolsMenuUi.allButtonsVisible = false; } - if (spatialScrollData == null && (pinnedToolInput.show.wasJustPressed || pinnedToolInput.show.isHeld) && pinnedToolInput.select.wasJustPressed) + if (spatialScrollData == null && (toolslMenuInput.show.wasJustPressed || toolslMenuInput.show.isHeld) && toolslMenuInput.select.wasJustPressed) { m_SpatialScrollStartPosition = alternateMenuOrigin.position; m_AllowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; this.SetSpatialHintControlNode(node); - m_PinnedToolsMenuUI.spatiallyScrolling = true; // Triggers the display of the directional hint arrows - consumeControl(pinnedToolInput.show); - consumeControl(pinnedToolInput.select); + m_ToolsMenuUi.spatiallyScrolling = true; // Triggers the display of the directional hint arrows + consumeControl(toolslMenuInput.show); + consumeControl(toolslMenuInput.select); // Assign initial SpatialScrollData; begin scroll - spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); + spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUi.buttons.Count, m_ToolsMenuUi.maxButtonCount); } - else if (spatialScrollData != null && pinnedToolInput.show.isHeld) + else if (spatialScrollData != null && toolslMenuInput.show.isHeld) { - consumeControl(pinnedToolInput.show); - consumeControl(pinnedToolInput.select); + consumeControl(toolslMenuInput.show); + consumeControl(toolslMenuInput.select); // Attempt to close a button, if a scroll has passed the trigger threshold - if (spatialScrollData != null && pinnedToolInput.select.wasJustPressed) + if (spatialScrollData != null && toolslMenuInput.select.wasJustPressed) { - if (m_PinnedToolsMenuUI.DeleteHighlightedButton()) + if (m_ToolsMenuUi.DeleteHighlightedButton()) buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount if (buttonCount <= k_ActiveToolOrderPosition + 1) @@ -183,37 +183,37 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_PinnedToolsMenuUI.buttons.Count, m_PinnedToolsMenuUI.maxButtonCount); + spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUi.buttons.Count, m_ToolsMenuUi.maxButtonCount); var normalizedRepeatingPosition = spatialScrollData.normalizedLoopingPosition; if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { - if (!m_PinnedToolsMenuUI.allButtonsVisible) + if (!m_ToolsMenuUi.allButtonsVisible) { - m_PinnedToolsMenuUI.spatialDragDistance = spatialScrollData.dragDistance; + m_ToolsMenuUi.spatialDragDistance = spatialScrollData.dragDistance; this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.CenteredScrolling); - m_PinnedToolsMenuUI.allButtonsVisible = true; + m_ToolsMenuUi.allButtonsVisible = true; } else if (spatialScrollData.spatialDirection != null) { - m_PinnedToolsMenuUI.startingDragOrigin = spatialScrollData.spatialDirection; + m_ToolsMenuUi.startingDragOrigin = spatialScrollData.spatialDirection; } - m_PinnedToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); + m_ToolsMenuUi.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); } } - else if (pinnedToolInput.show.wasJustReleased) + else if (toolslMenuInput.show.wasJustReleased) { - consumeControl(pinnedToolInput.show); - consumeControl(pinnedToolInput.select); + consumeControl(toolslMenuInput.show); + consumeControl(toolslMenuInput.select); if (spatialScrollData != null && spatialScrollData.passedMinDragActivationThreshold) { - m_PinnedToolsMenuUI.SelectHighlightedButton(); + m_ToolsMenuUi.SelectHighlightedButton(); } else if (Time.realtimeSinceStartup < m_AllowToolToggleBeforeThisTime) { // Allow for single press+release to cycle through tools - m_PinnedToolsMenuUI.SelectNextExistingToolButton(); + m_ToolsMenuUi.SelectNextExistingToolButton(); OnButtonClick(); } diff --git a/Menus/ToolMenu/PinnedToolsMenu.cs.meta b/Menus/ToolsMenu/ToolsMenu.cs.meta similarity index 69% rename from Menus/ToolMenu/PinnedToolsMenu.cs.meta rename to Menus/ToolsMenu/ToolsMenu.cs.meta index bd86ef116..570d52f8c 100644 --- a/Menus/ToolMenu/PinnedToolsMenu.cs.meta +++ b/Menus/ToolsMenu/ToolsMenu.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 800ff7c94496eac41ab0b6df27863704 -timeCreated: 1502308659 +timeCreated: 1504210685 licenseType: Pro MonoImporter: serializedVersion: 2 @@ -8,16 +8,14 @@ MonoImporter: - m_MainMenuIcon: {fileID: 21300000, guid: 05f6f0555fbf99a429004b50ccd6ffa9, type: 3} - m_MainMenuActionMap: {fileID: 11400000, guid: 744d823602c92f94ebd746822bed646d, type: 2} - - m_PinnedToolsMenuPrefab: {fileID: 114000010527895234, guid: 9df94b11e4f4ed848aa8c4055b378c6a, + - m_ToolsMenuPrefab: {fileID: 114000010527895234, guid: 9df94b11e4f4ed848aa8c4055b378c6a, type: 2} - - m_PinnedToolButtonTemplate: {fileID: 114000011260412956, guid: 7221a75a049ac3949a505c7c2f06bd8e, + - _mToolsMenuButtonTemplate: {fileID: 114000011260412956, guid: 7221a75a049ac3949a505c7c2f06bd8e, type: 2} - m_ButtonClickPulse: {fileID: 11400000, guid: ddf15856c41896c42bfd9a7b61028844, type: 2} - m_ButtonHoverPulse: {fileID: 11400000, guid: 4b4b7c3ee967062409632272431dc428, type: 2} - - m_ActivationPulse: {fileID: 11400000, guid: c3a3fe0d1f5495c4db58b5282c37a962, - type: 2} - m_HidingPulse: {fileID: 11400000, guid: 2e01cf9fae741534eaf75d6f0910be3a, type: 2} executionOrder: 0 icon: {instanceID: 0} diff --git a/Menus/ToolMenu/ToolMenuButton.meta b/Menus/ToolsMenu/ToolsMenuButton.meta similarity index 100% rename from Menus/ToolMenu/ToolMenuButton.meta rename to Menus/ToolsMenu/ToolsMenuButton.meta diff --git a/Menus/ToolMenu/ToolMenuButton/Materials.meta b/Menus/ToolsMenu/ToolsMenuButton/Materials.meta similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials.meta rename to Menus/ToolsMenu/ToolsMenuButton/Materials.meta diff --git a/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat rename to Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat diff --git a/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat.meta b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat.meta similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonBorder.mat.meta rename to Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat.meta diff --git a/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat rename to Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat diff --git a/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat.meta b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat.meta similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonFaceMask.mat.meta rename to Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat.meta diff --git a/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat rename to Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat diff --git a/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat.meta b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat.meta similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButtonUIContent.mat.meta rename to Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat.meta diff --git a/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat rename to Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat diff --git a/Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat.meta b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat.meta similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/Materials/PinnedToolButton.mat.meta rename to Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat.meta diff --git a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs similarity index 98% rename from Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs rename to Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs index 9d77dbec1..a70268e53 100644 --- a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs +++ b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs @@ -12,7 +12,7 @@ namespace UnityEditor.Experimental.EditorVR.Menus { - sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor + sealed class ToolsMenuButton : MonoBehaviour, IToolsMenuButton, ITooltip, ITooltipPlacement, ISetTooltipVisibility, ISetCustomTooltipColor { static Color s_FrameOpaqueColor; @@ -122,7 +122,7 @@ sealed class PinnedToolButton : MonoBehaviour, IPinnedToolButton, ITooltip, ITo public Vector3 toolButtonActivePosition { get { return k_ToolButtonActivePosition; } } // Shared active button offset from the alternate menu public Func visibleButtonCount { get; set; } public Action destroy { get { return DestroyButton; } } - public Action showAllButtons { private get; set; } + public Action showAllButtons { private get; set; } public Action hoverExit { get; set; } public Type toolType @@ -168,7 +168,7 @@ public int order get { return m_Order; } set { - m_Order = value; // Position of this button in relation to other pinned tool buttons + m_Order = value; // Position of this button in relation to other tool buttons highlighted = false; @@ -458,7 +458,7 @@ static string GetTypeAbbreviation(Type type) void OnBackgroundHoverEnter () { - if (hovered != null) // Raised in order to trigger the haptic in the PinnedToolsMenu + if (hovered != null) // Raised in order to trigger the haptic in the Tools Menu hovered(); if (isMainMenu) @@ -575,7 +575,7 @@ IEnumerator AnimatePosition(int orderPosition) const float kCenterLocationAmount = 0.5f; const float kCircularRange = 360f; const int kDurationShapeAmount = 3; - var rotationSpacing = kCircularRange / maxButtonCount; // dividend should be the count of pinned tool buttons showing at this time + var rotationSpacing = kCircularRange / maxButtonCount; // dividend should be the count of tool buttons showing at this time // Center the MainMenu & Active tool buttons at the bottom of the RadialMenu var phaseOffset = orderPosition > -1 ? rotationSpacing * kCenterLocationAmount - (visibleButtonCount(m_ToolType) * kCenterLocationAmount) * rotationSpacing : 0; var targetRotation = orderPosition > -1 ? Quaternion.AngleAxis(phaseOffset + rotationSpacing * Mathf.Max(0f, orderPosition), Vector3.down) : Quaternion.identity; diff --git a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs.meta b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs.meta similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/PinnedToolButton.cs.meta rename to Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs.meta diff --git a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.prefab similarity index 99% rename from Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab rename to Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.prefab index 9e377a73f..8c53e3484 100644 --- a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab +++ b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.prefab @@ -53,7 +53,7 @@ GameObject: - component: {fileID: 4000012504767854} - component: {fileID: 114000011260412956} m_Layer: 5 - m_Name: PinnedToolButton + m_Name: ToolsMenuButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -69,7 +69,7 @@ GameObject: - component: {fileID: 4000012609671830} - component: {fileID: 137000012108747896} m_Layer: 0 - m_Name: PinnedToolButtonFrame + m_Name: ButtonFrame m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -140,7 +140,7 @@ GameObject: m_Component: - component: {fileID: 4000010261126032} m_Layer: 0 - m_Name: PinnedToolButtonMesh + m_Name: ButtonMesh m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -219,7 +219,7 @@ GameObject: - component: {fileID: 4000013243584372} - component: {fileID: 137000012837336366} m_Layer: 0 - m_Name: PinnedToolSecondaryButtonInset + m_Name: SecondaryButtonInset m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -235,7 +235,7 @@ GameObject: - component: {fileID: 4000011544681006} - component: {fileID: 137000013542685126} m_Layer: 0 - m_Name: PinnedToolButtonInset + m_Name: ButtonInset m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -267,7 +267,7 @@ GameObject: - component: {fileID: 4000011352500524} - component: {fileID: 137000011420067172} m_Layer: 0 - m_Name: PinnedToolButtonFaceMask + m_Name: ButtonFaceMask m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -300,7 +300,7 @@ GameObject: - component: {fileID: 4000012297013730} - component: {fileID: 137000010072420284} m_Layer: 0 - m_Name: PinnedToolSecondaryButtonFaceMask + m_Name: SecondaryButtonFaceMask m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab.meta b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.prefab.meta similarity index 100% rename from Menus/ToolMenu/ToolMenuButton/PinnedToolButton.prefab.meta rename to Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.prefab.meta diff --git a/Menus/ToolMenu/PinnedToolslMenuInput.asset b/Menus/ToolsMenu/ToolslMenuInput.asset similarity index 100% rename from Menus/ToolMenu/PinnedToolslMenuInput.asset rename to Menus/ToolsMenu/ToolslMenuInput.asset diff --git a/Menus/ToolMenu/PinnedToolslMenuInput.asset.meta b/Menus/ToolsMenu/ToolslMenuInput.asset.meta similarity index 100% rename from Menus/ToolMenu/PinnedToolslMenuInput.asset.meta rename to Menus/ToolsMenu/ToolslMenuInput.asset.meta diff --git a/Menus/ToolMenu/PinnedToolslMenuInput.cs b/Menus/ToolsMenu/ToolslMenuInput.cs similarity index 74% rename from Menus/ToolMenu/PinnedToolslMenuInput.cs rename to Menus/ToolsMenu/ToolslMenuInput.cs index 96fa19a16..fc8f00171 100644 --- a/Menus/ToolMenu/PinnedToolslMenuInput.cs +++ b/Menus/ToolsMenu/ToolslMenuInput.cs @@ -4,8 +4,8 @@ // GENERATED FILE - DO NOT EDIT MANUALLY namespace UnityEngine.InputNew { - public class PinnedToolslMenuInput : ActionMapInput { - public PinnedToolslMenuInput (ActionMap actionMap) : base (actionMap) { } + public class ToolslMenuInput : ActionMapInput { + public ToolslMenuInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @show { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @select { get { return (ButtonInputControl)this[1]; } } diff --git a/Menus/ToolMenu/PinnedToolslMenuInput.cs.meta b/Menus/ToolsMenu/ToolslMenuInput.cs.meta similarity index 75% rename from Menus/ToolMenu/PinnedToolslMenuInput.cs.meta rename to Menus/ToolsMenu/ToolslMenuInput.cs.meta index 0eec98803..398f5e75b 100644 --- a/Menus/ToolMenu/PinnedToolslMenuInput.cs.meta +++ b/Menus/ToolsMenu/ToolslMenuInput.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: f01045237dd19eb4181c1e45f673ad95 -timeCreated: 1493935062 +guid: b0cc1f53ec00c1047a37d91add7a8c67 +timeCreated: 1504205842 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Models/PinnedToolButtonMesh.fbx b/Models/ToolsMenuButtonMesh.fbx similarity index 100% rename from Models/PinnedToolButtonMesh.fbx rename to Models/ToolsMenuButtonMesh.fbx diff --git a/Models/PinnedToolButtonMesh.fbx.meta b/Models/ToolsMenuButtonMesh.fbx.meta similarity index 95% rename from Models/PinnedToolButtonMesh.fbx.meta rename to Models/ToolsMenuButtonMesh.fbx.meta index 331d96b84..f36958f46 100644 --- a/Models/PinnedToolButtonMesh.fbx.meta +++ b/Models/ToolsMenuButtonMesh.fbx.meta @@ -88,6 +88,8 @@ ModelImporter: resampleCurves: 1 optimizeGameObjects: 0 motionNodeName: + rigImportErrors: + rigImportWarnings: animationImportErrors: animationImportWarnings: animationRetargetingWarnings: @@ -120,10 +122,11 @@ ModelImporter: tangentSpace: normalSmoothAngle: 60 normalImportMode: 0 - tangentImportMode: 0 + tangentImportMode: 2 importAnimation: 1 copyAvatar: 0 humanDescription: + serializedVersion: 2 human: [] skeleton: [] armTwist: 0.5 @@ -134,7 +137,10 @@ ModelImporter: legStretch: 0.05 feetSpacing: 0 rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 0 lastHumanDescriptionAvatarSource: {instanceID: 0} animationType: 1 humanoidOversampling: 1 diff --git a/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat b/Prefabs/UI/Materials/ToolsMenuButtonUIContent.mat similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButtonUIContent.mat rename to Prefabs/UI/Materials/ToolsMenuButtonUIContent.mat diff --git a/Prefabs/UI/Materials/PinnedToolButtonUIContent.mat.meta b/Prefabs/UI/Materials/ToolsMenuButtonUIContent.mat.meta similarity index 100% rename from Prefabs/UI/Materials/PinnedToolButtonUIContent.mat.meta rename to Prefabs/UI/Materials/ToolsMenuButtonUIContent.mat.meta diff --git a/Prefabs/UI/Materials/PinnedToolSecondaryButton.mat b/Prefabs/UI/Materials/ToolsMenuSecondaryButton.mat similarity index 100% rename from Prefabs/UI/Materials/PinnedToolSecondaryButton.mat rename to Prefabs/UI/Materials/ToolsMenuSecondaryButton.mat diff --git a/Prefabs/UI/Materials/PinnedToolSecondaryButton.mat.meta b/Prefabs/UI/Materials/ToolsMenuSecondaryButton.mat.meta similarity index 100% rename from Prefabs/UI/Materials/PinnedToolSecondaryButton.mat.meta rename to Prefabs/UI/Materials/ToolsMenuSecondaryButton.mat.meta diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index cc333faad..39a77195e 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -85,9 +85,9 @@ static void UpdateAlternateMenuForDevice(DeviceData deviceData) var alternateMenu = deviceData.alternateMenu; alternateMenu.menuHideFlags = deviceData.currentTool is IExclusiveMode ? 0 : deviceData.menuHideData[alternateMenu].hideFlags; - // Move the pinned tool buttons to an alternate position if the alternate menu will be shown - var pinnedToolsMenu = deviceData.ToolMenu; - pinnedToolsMenu.alternateMenuVisible = alternateMenu.menuHideFlags == 0; + // Move the Tools Menu buttons to an alternate position if the alternate menu will be shown + var toolsMenu = deviceData.ToolsMenu; + toolsMenu.alternateMenuVisible = alternateMenu.menuHideFlags == 0; } internal void UpdateMenuVisibilities() @@ -411,14 +411,14 @@ internal static IAlternateMenu SpawnAlternateMenu(Type type, InputDevice device, return alternateMenu; } - internal static IPinnedToolsMenu SpawnPinnedToolsMenu(Type type, InputDevice device, out ActionMapInput input) + internal static IToolsMenu SpawnToolsMenu(Type type, InputDevice device, out ActionMapInput input) { input = null; - if (!typeof(IPinnedToolsMenu).IsAssignableFrom(type)) + if (!typeof(IToolsMenu).IsAssignableFrom(type)) return null; - var menu = (IPinnedToolsMenu)ObjectUtils.AddComponent(type, evr.gameObject); + var menu = (IToolsMenu)ObjectUtils.AddComponent(type, evr.gameObject); input = evr.GetModule().CreateActionMapInputForObject(menu, device); evr.m_Interfaces.ConnectInterfaces(menu, device); diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 21f9365b2..2dcffad5e 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -115,12 +115,12 @@ internal static void SpawnDefaultTools(IProxy proxy) menuHideData[alternateMenu] = new Menus.MenuHideData(); alternateMenu.itemWasSelected += Menus.UpdateAlternateMenuOnSelectionChanged; - // Setup PinnedToolsMenu - var pinnedToolsMenu = Menus.SpawnPinnedToolsMenu(typeof(PinnedToolsMenu), inputDevice, out deviceData.pinnedToolsMenuInput); - deviceData.ToolMenu = pinnedToolsMenu; - pinnedToolsMenu.rayOrigin = deviceData.rayOrigin; - pinnedToolsMenu.setButtonForType(typeof(IMainMenu), null); - pinnedToolsMenu.setButtonForType(typeof(SelectionTool), selectionToolData != null ? selectionToolData.icon : null); + // Setup ToolsMenu + var toolsMenu = Menus.SpawnToolsMenu(typeof(Experimental.EditorVR.Menus.ToolsMenu), inputDevice, out deviceData.toolsMenuInput); + deviceData.ToolsMenu = toolsMenu; + toolsMenu.rayOrigin = deviceData.rayOrigin; + toolsMenu.setButtonForType(typeof(IMainMenu), null); + toolsMenu.setButtonForType(typeof(SelectionTool), selectionToolData != null ? selectionToolData.icon : null); } evr.GetModule().UpdatePlayerHandleMaps(); @@ -192,7 +192,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn var currentToolType = currentTool.GetType(); var currentToolIsSelect = currentToolType == typeof(SelectionTool); var setSelectAsCurrentTool = toolType == typeof(SelectionTool) && !currentToolIsSelect; - var pinnedToolsMenu = deviceData.ToolMenu; + var toolsMenu = deviceData.ToolsMenu; // If this tool was on the current device already, remove it, if it is selected while already being the current tool var despawn = (!currentToolIsSelect && currentToolType == toolType && despawnOnReselect) || setSelectAsCurrentTool;// || setSelectAsCurrentTool || toolType == typeof(IMainMenu); if (currentTool != null && despawn) @@ -204,12 +204,12 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn // Delete a button of the first type parameter // Then select a button the second type param (the new current tool) // Don't spawn a new tool, since we are only removing the old tool - pinnedToolsMenu.deletePinnedToolButton(toolType, currentToolType); + toolsMenu.deleteToolsMenuButton(toolType, currentToolType); } else if (setSelectAsCurrentTool) { // Set the selection tool as the active tool, if select is to be the new current tool - pinnedToolsMenu.setButtonForType(typeof(SelectionTool), null); + toolsMenu.setButtonForType(typeof(SelectionTool), null); } spawnTool = false; @@ -242,7 +242,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn AddToolToStack(data, newTool); - pinnedToolsMenu.setButtonForType(toolType, newTool.icon); + toolsMenu.setButtonForType(toolType, newTool.icon); } } @@ -361,13 +361,13 @@ internal static void UpdatePlayerHandleMaps(List maps) maps.Add(alternateMenuInput); } - var pinnedToolsMenu = deviceData.ToolMenu; - var pinnedToolsMenuInput = deviceData.pinnedToolsMenuInput; - if (pinnedToolsMenu != null && pinnedToolsMenuInput != null) + var toolsMenu = deviceData.ToolsMenu; + var toolsMenuInput = deviceData.toolsMenuInput; + if (toolsMenu != null && toolsMenuInput != null) { - // PinnedToolsMenu visibility is handled internally, not via hide flags - if (!maps.Contains(pinnedToolsMenuInput)) - maps.Add(pinnedToolsMenuInput); + // Tools Menu visibility is handled internally, not via hide flags + if (!maps.Contains(toolsMenuInput)) + maps.Add(toolsMenuInput); } maps.Add(deviceData.uiInput); diff --git a/Scripts/Core/EditorVR.ToolMenu.cs b/Scripts/Core/EditorVR.ToolsMenu.cs similarity index 81% rename from Scripts/Core/EditorVR.ToolMenu.cs rename to Scripts/Core/EditorVR.ToolsMenu.cs index 47b1b2c72..3c57cdb83 100644 --- a/Scripts/Core/EditorVR.ToolMenu.cs +++ b/Scripts/Core/EditorVR.ToolsMenu.cs @@ -8,12 +8,12 @@ namespace UnityEditor.Experimental.EditorVR.Core { partial class EditorVR { - class ToolMenu : Nested + class ToolsMenu : Nested { - public ToolMenu() + public ToolsMenu() { - IPinnedToolsMenuMethods.mainMenuActivatorSelected = OnMainMenuActivatorSelected; - IPinnedToolsMenuMethods.selectTool = OnToolButtonClicked; + IToolsMenuMethods.mainMenuActivatorSelected = OnMainMenuActivatorSelected; + IToolsMenuMethods.selectTool = OnToolButtonClicked; IPreviewInToolMenuButtonMethods.previewInToolMenuButton = PreviewToolInToolMenuButton; IPreviewInToolMenuButtonMethods.clearToolMenuButtonPreview = ClearToolMenuButtonPreview; @@ -27,9 +27,9 @@ static void PreviewToolInToolMenuButton (Transform rayOrigin, Type toolType, str Rays.ForEachProxyDevice((deviceData) => { - if (deviceData.rayOrigin == rayOrigin) // Enable pinned tool preview on the opposite (handed) device + if (deviceData.rayOrigin == rayOrigin) // Enable Tools Menu preview on the opposite (handed) device { - var previewToolMenuButton = deviceData.ToolMenu.previewToolButton; + var previewToolMenuButton = deviceData.ToolsMenu.PreviewToolsMenuButton; previewToolMenuButton.previewToolType = toolType; previewToolMenuButton.previewToolDescription = toolDescription; } @@ -40,7 +40,7 @@ static void ClearToolMenuButtonPreview() { Rays.ForEachProxyDevice((deviceData) => { - deviceData.ToolMenu.previewToolButton.previewToolType = null; + deviceData.ToolsMenu.PreviewToolsMenuButton.previewToolType = null; }); } diff --git a/Scripts/Core/EditorVR.ToolMenu.cs.meta b/Scripts/Core/EditorVR.ToolsMenu.cs.meta similarity index 100% rename from Scripts/Core/EditorVR.ToolMenu.cs.meta rename to Scripts/Core/EditorVR.ToolsMenu.cs.meta diff --git a/Scripts/Core/EditorVR.cs b/Scripts/Core/EditorVR.cs index 63da3f2dd..f35c5ae93 100644 --- a/Scripts/Core/EditorVR.cs +++ b/Scripts/Core/EditorVR.cs @@ -76,8 +76,8 @@ class DeviceData public ActionMapInput alternateMenuInput; public ITool currentTool; public IMenu customMenu; - public IPinnedToolsMenu ToolMenu; - public ActionMapInput pinnedToolsMenuInput; + public IToolsMenu ToolsMenu; + public ActionMapInput toolsMenuInput; public readonly Dictionary menuHideData = new Dictionary(); } @@ -382,10 +382,10 @@ void ProcessInput(HashSet processedInputs, ConsumeControlDelegate if (altMenuInput != null && altMenu.menuHideFlags == 0) altMenuInput.ProcessInput(deviceData.alternateMenuInput, consumeControl); - var pinnedToolsMenu = deviceData.ToolMenu; - var pinnedToolsMenuInput = pinnedToolsMenu as IProcessInput; - if (pinnedToolsMenuInput != null) - pinnedToolsMenuInput.ProcessInput(deviceData.pinnedToolsMenuInput, consumeControl); + var toolsMenu = deviceData.ToolsMenu; + var toolsMenuInput = toolsMenu as IProcessInput; + if (toolsMenuInput != null) + toolsMenuInput.ProcessInput(deviceData.toolsMenuInput, consumeControl); foreach (var toolData in deviceData.toolData) { diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 252fb08df..d0691ec53 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -8,7 +8,7 @@ namespace UnityEditor.Experimental.EditorVR /// /// The main menu that can be shown on device proxies /// - public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool, IPreviewInToolMenuButton + public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool, IPreviewInToolsMenuButton { /// /// The menu tools that will populate the menu diff --git a/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs b/Scripts/Interfaces/Entity/IToolsMenu.cs similarity index 71% rename from Scripts/Interfaces/Entity/IPinnedToolsMenu.cs rename to Scripts/Interfaces/Entity/IToolsMenu.cs index 2948d6e95..60ef964b4 100644 --- a/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs +++ b/Scripts/Interfaces/Entity/IToolsMenu.cs @@ -5,9 +5,9 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Gives decorated class Pinned Tools Menu functionality + /// Gives decorated class Tools Menu functionality /// - public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode, ISelectTool + public interface IToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode, ISelectTool { /// /// Bool denoting that the alternate menu (radial menu, etc) is currently visible @@ -21,9 +21,9 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod Transform rayOrigin { get; set; } /// - /// The PinnedToolButton that the menu uses to display tool previews + /// The ToolsMenuButton that the menu uses to display tool previews /// - IPinnedToolButton previewToolButton { get; } + IToolsMenuButton PreviewToolsMenuButton { get; } /// /// Function that assigns & sets up a tool button for a given tool type @@ -35,10 +35,10 @@ public interface IPinnedToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNod /// Delete the tool button with corresponding type of the first parameter. /// Then, select the tool button with corresponds to the type of the second parameter. /// - Action deletePinnedToolButton { get; } + Action deleteToolsMenuButton { get; } } - public static class IPinnedToolsMenuMethods + public static class IToolsMenuMethods { public static Action mainMenuActivatorSelected { get; set; } public static Action selectTool { get; set; } @@ -47,17 +47,17 @@ public static class IPinnedToolsMenuMethods /// Called when selecting the main menu activator /// /// This menu's RayOrigin - public static void MainMenuActivatorSelected(this IPinnedToolsMenu obj, Transform rayOrigin) + public static void MainMenuActivatorSelected(this IToolsMenu obj, Transform rayOrigin) { mainMenuActivatorSelected(rayOrigin); } /// - /// Selects a tool, based on type, from a pinned tool button + /// Selects a tool, based on type, from a Tools Menu Button /// /// This menu's RayOrigin /// The type of the tool that is to be selected - public static void SelectTool(this IPinnedToolsMenu obj, Transform rayOrigin, Type type) + public static void SelectTool(this IToolsMenu obj, Transform rayOrigin, Type type) { selectTool(rayOrigin, type); } diff --git a/Scripts/Interfaces/Entity/IPinnedToolsMenu.cs.meta b/Scripts/Interfaces/Entity/IToolsMenu.cs.meta similarity index 100% rename from Scripts/Interfaces/Entity/IPinnedToolsMenu.cs.meta rename to Scripts/Interfaces/Entity/IToolsMenu.cs.meta diff --git a/Scripts/Interfaces/Entity/IPinnedToolButton.cs b/Scripts/Interfaces/Entity/IToolsMenuButton.cs similarity index 89% rename from Scripts/Interfaces/Entity/IPinnedToolButton.cs rename to Scripts/Interfaces/Entity/IToolsMenuButton.cs index d844d6aef..8349ab3f3 100644 --- a/Scripts/Interfaces/Entity/IPinnedToolButton.cs +++ b/Scripts/Interfaces/Entity/IToolsMenuButton.cs @@ -5,9 +5,9 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Provides an interface for handling Pinned Tool Button functionality + /// Provides an interface for handling Tools Menu Button functionality /// - public interface IPinnedToolButton + public interface IToolsMenuButton { /// /// The type to preview in the button temporarily @@ -26,7 +26,7 @@ public interface IPinnedToolButton int order { get; set; } /// - /// The maximum number of buttons that can be displayed by a given PinnedToolsMenu + /// The maximum number of buttons that can be displayed by a given ToolsMenu /// int maxButtonCount { set; } @@ -87,9 +87,9 @@ public interface IPinnedToolButton Action selectTool { set; } /// - /// Shows all tool buttons for a given PinnedToolsMenu + /// Shows all tool buttons for a given ToolsMenu /// - Action showAllButtons { set; } + Action showAllButtons { set; } /// /// Performed when a hover exit is detected on this button @@ -97,7 +97,7 @@ public interface IPinnedToolButton Action hoverExit { set; } /// - /// Returns the visible button count for a given PinnedToolsMenu + /// Returns the visible button count for a given ToolsMenu /// used by buttons to position themselves /// Func visibleButtonCount { set; } diff --git a/Scripts/Interfaces/Entity/IPinnedToolButton.cs.meta b/Scripts/Interfaces/Entity/IToolsMenuButton.cs.meta similarity index 100% rename from Scripts/Interfaces/Entity/IPinnedToolButton.cs.meta rename to Scripts/Interfaces/Entity/IToolsMenuButton.cs.meta diff --git a/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs b/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolsMenuButton.cs similarity index 78% rename from Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs rename to Scripts/Interfaces/FunctionalityInjection/IPreviewInToolsMenuButton.cs index 3c14c647c..71022e6a5 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolsMenuButton.cs @@ -7,7 +7,7 @@ namespace UnityEditor.Experimental.EditorVR /// /// Gives decorated class the ability to preview tools in a ToolButton /// - public interface IPreviewInToolMenuButton + public interface IPreviewInToolsMenuButton { } @@ -21,7 +21,7 @@ public static class IPreviewInToolMenuButtonMethods /// Type: MenuButton's tool type to preview /// String: The tool description to display as a Tooltip /// - public static void PreviewInToolMenuButton (this IMainMenu obj, Transform rayOrigin, Type toolType, string toolDescription) + public static void PreviewInToolMenuButton (this IPreviewInToolsMenuButton obj, Transform rayOrigin, Type toolType, string toolDescription) { previewInToolMenuButton(rayOrigin, toolType, toolDescription); } @@ -31,7 +31,7 @@ public static void PreviewInToolMenuButton (this IMainMenu obj, Transform rayOri /// /// Clears any ToolMenuButton previews that are set /// - public static void ClearToolMenuButtonPreview (this IMainMenu obj) + public static void ClearToolMenuButtonPreview (this IPreviewInToolsMenuButton obj) { clearToolMenuButtonPreview(); } diff --git a/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IPreviewInToolsMenuButton.cs.meta similarity index 100% rename from Scripts/Interfaces/FunctionalityInjection/IPreviewInToolMenuButton.cs.meta rename to Scripts/Interfaces/FunctionalityInjection/IPreviewInToolsMenuButton.cs.meta diff --git a/Scripts/Modules/TooltipModule/TooltipModule.cs b/Scripts/Modules/TooltipModule/TooltipModule.cs index 0204c7e38..8f1972f11 100644 --- a/Scripts/Modules/TooltipModule/TooltipModule.cs +++ b/Scripts/Modules/TooltipModule/TooltipModule.cs @@ -132,7 +132,9 @@ void UpdateVisuals(ITooltip tooltip, TooltipUI tooltipUI, Transform target, floa var viewerScale = this.GetViewerScale(); tooltipTransform.localScale = m_TooltipScale * lerp * viewerScale; - var highlightMaterial = m_Tooltips[tooltip].customHighlightMaterial ?? m_HighlightMaterial; + TooltipData toolTipData; + m_Tooltips.TryGetValue(tooltip, out toolTipData); + var highlightMaterial = toolTipData != null ? toolTipData.customHighlightMaterial : m_HighlightMaterial; tooltipUI.highlight.material= highlightMaterial; m_TooltipBackgroundMaterial.SetColor("_Color", Color.Lerp(UnityBrandColorScheme.darker, m_OriginalBackgroundColor, lerp)); From 26772dd2f84691aa53c80b8870c689c2461d3651 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 31 Aug 2017 15:26:37 -0700 Subject: [PATCH 815/870] Fix a bug where moving objects in/out of miniworlds would cause previously manipulated objects to move; Fix workspaces showing up in miniworld (UI layer and frame collider); Fix a bug where objects coming out of miniworlds would pop for a frame --- Scripts/Core/EditorVR.Menus.cs | 2 +- Scripts/Core/EditorVR.MiniWorlds.cs | 2 ++ Scripts/Core/EditorVR.UI.cs | 3 +-- Workspaces/Base/Workspace.cs | 5 ++--- Workspaces/Base/WorkspaceBase.prefab | 32 ++++++++++++++-------------- Workspaces/Base/WorkspaceUI.cs | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 1f4875be1..bb94539b8 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -42,7 +42,7 @@ internal class MenuHideData // Local method use only -- created here to reduce garbage collection readonly List m_ActiveDeviceData = new List(); - readonly List m_WorkspaceComponents = new List(); + readonly List m_WorkspaceComponents = new List(); readonly Collider[] m_WorkspaceOverlaps = new Collider[k_PossibleOverlaps]; public Menus() diff --git a/Scripts/Core/EditorVR.MiniWorlds.cs b/Scripts/Core/EditorVR.MiniWorlds.cs index b5e42f81d..172be524f 100644 --- a/Scripts/Core/EditorVR.MiniWorlds.cs +++ b/Scripts/Core/EditorVR.MiniWorlds.cs @@ -123,6 +123,7 @@ public void EnterPreviewMode(IUsesSpatialHash hash, float scaleFactor) { hash.RemoveFromSpatialHash(grabData.transform.gameObject); grabData.SetScale(scaleFactor); + grabData.Update(originalRayOrigin); } } @@ -156,6 +157,7 @@ public void DropPreviewObjects(IPlaceSceneObjects placer) if (hasPreview) placer.PlaceSceneObjects(transforms, targetPositionOffsets, targetRotations, targetScales); + m_GrabData.Clear(); hasPreview = false; } diff --git a/Scripts/Core/EditorVR.UI.cs b/Scripts/Core/EditorVR.UI.cs index 2db62cff0..558ddf390 100644 --- a/Scripts/Core/EditorVR.UI.cs +++ b/Scripts/Core/EditorVR.UI.cs @@ -100,8 +100,7 @@ internal void Initialize() internal GameObject InstantiateUI(GameObject prefab, Transform parent = null, bool worldPositionStays = true) { - var go = ObjectUtils.Instantiate(prefab); - go.transform.SetParent(parent ? parent : evr.transform, worldPositionStays); + var go = ObjectUtils.Instantiate(prefab, parent ? parent : evr.transform, worldPositionStays); foreach (var canvas in go.GetComponentsInChildren()) canvas.worldCamera = m_EventCamera; diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 8e7c08f89..662649af1 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -132,8 +132,7 @@ public float topPanelDividerOffset public virtual void Setup() { - var baseObject = this.InstantiateUI(m_BasePrefab); - baseObject.transform.SetParent(transform, false); + var baseObject = this.InstantiateUI(m_BasePrefab, transform, false); m_WorkspaceUI = baseObject.GetComponent(); this.ConnectInterfaces(m_WorkspaceUI); @@ -160,7 +159,7 @@ public virtual void Setup() m_WorkspaceUI.sceneContainer.transform.localPosition = Vector3.zero; - m_OuterCollider = m_WorkspaceUI.gameObject.AddComponent(); + m_OuterCollider = gameObject.AddComponent(); m_OuterCollider.isTrigger = true; var startingBounds = m_CustomStartingBounds ?? DefaultBounds; diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index 4650df42c..bdcdd3aea 100644 --- a/Workspaces/Base/WorkspaceBase.prefab +++ b/Workspaces/Base/WorkspaceBase.prefab @@ -152,7 +152,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000012074834286} - m_Layer: 0 + m_Layer: 5 m_Name: TooltipTarget m_TagString: Untagged m_Icon: {fileID: 0} @@ -223,7 +223,7 @@ GameObject: - component: {fileID: 114000014286123538} - component: {fileID: 114000013983468268} - component: {fileID: 65736115287711426} - m_Layer: 0 + m_Layer: 5 m_Name: WorkspaceBase m_TagString: Untagged m_Icon: {fileID: 0} @@ -311,7 +311,7 @@ GameObject: - component: {fileID: 4000014022192516} - component: {fileID: 33000014019345868} - component: {fileID: 23000013394386716} - m_Layer: 0 + m_Layer: 5 m_Name: TopFace m_TagString: Untagged m_Icon: {fileID: 0} @@ -328,7 +328,7 @@ GameObject: - component: {fileID: 4000012169316234} - component: {fileID: 33000013143236502} - component: {fileID: 23000013761711670} - m_Layer: 0 + m_Layer: 5 m_Name: SeparatorMask m_TagString: Untagged m_Icon: {fileID: 0} @@ -377,7 +377,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000014171123912} - m_Layer: 0 + m_Layer: 5 m_Name: TooltipSource m_TagString: Untagged m_Icon: {fileID: 0} @@ -411,7 +411,7 @@ GameObject: - component: {fileID: 4000013290412170} - component: {fileID: 33000010567856684} - component: {fileID: 23000013191296468} - m_Layer: 0 + m_Layer: 5 m_Name: ButtonMesh m_TagString: Untagged m_Icon: {fileID: 0} @@ -429,7 +429,7 @@ GameObject: - component: {fileID: 33000013418938564} - component: {fileID: 23000010475008990} - component: {fileID: 114000013312479136} - m_Layer: 0 + m_Layer: 5 m_Name: TopHighlight m_TagString: Untagged m_Icon: {fileID: 0} @@ -529,7 +529,7 @@ GameObject: - component: {fileID: 4000012134427690} - component: {fileID: 33000012282235858} - component: {fileID: 23000013313223260} - m_Layer: 0 + m_Layer: 5 m_Name: FrameFrontFace m_TagString: Untagged m_Icon: {fileID: 0} @@ -559,7 +559,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000012021209696} - m_Layer: 0 + m_Layer: 5 m_Name: TopFaceContainer m_TagString: Untagged m_Icon: {fileID: 0} @@ -574,7 +574,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000012708483634} - m_Layer: 0 + m_Layer: 5 m_Name: TooltipTarget m_TagString: Untagged m_Icon: {fileID: 0} @@ -589,7 +589,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000012913026432} - m_Layer: 0 + m_Layer: 5 m_Name: TooltipSource m_TagString: Untagged m_Icon: {fileID: 0} @@ -673,7 +673,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000011607955888} - m_Layer: 0 + m_Layer: 5 m_Name: TopDividerContainer m_TagString: Untagged m_Icon: {fileID: 0} @@ -768,7 +768,7 @@ GameObject: - component: {fileID: 4000012157338960} - component: {fileID: 33000011738463840} - component: {fileID: 23000014080278418} - m_Layer: 0 + m_Layer: 5 m_Name: ButtonMesh m_TagString: Untagged m_Icon: {fileID: 0} @@ -851,7 +851,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000012340493516} - m_Layer: 0 + m_Layer: 5 m_Name: TopHighlightContainer m_TagString: Untagged m_Icon: {fileID: 0} @@ -921,7 +921,7 @@ GameObject: - component: {fileID: 33000014175619198} - component: {fileID: 23000011122332112} - component: {fileID: 114000013793407110} - m_Layer: 0 + m_Layer: 5 m_Name: Highlight m_TagString: Untagged m_Icon: {fileID: 0} @@ -936,7 +936,7 @@ GameObject: serializedVersion: 5 m_Component: - component: {fileID: 4000011062655166} - m_Layer: 0 + m_Layer: 5 m_Name: FrameFrontFaceContainer m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Workspaces/Base/WorkspaceUI.cs b/Workspaces/Base/WorkspaceUI.cs index 63abfa437..4969b086f 100644 --- a/Workspaces/Base/WorkspaceUI.cs +++ b/Workspaces/Base/WorkspaceUI.cs @@ -134,9 +134,7 @@ sealed class WorkspaceUI : MonoBehaviour, IUsesStencilRef, IUsesViewerScale, IGe [SerializeField] WorkspaceButton m_ResizeButton; - [SerializeField] BoxCollider m_FrameCollider; - Bounds m_Bounds; float? m_TopPanelDividerOffset; @@ -446,6 +444,8 @@ void Awake() m_CloseButton.hovered += OnButtonHovered; m_ResizeButton.clicked += OnResetSizeClicked; m_ResizeButton.hovered += OnButtonHovered; + + m_FrameCollider = transform.parent.gameObject.AddComponent(); } IEnumerator Start() From df03759a931ff10eaddaba12c6f6dab310088f55 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 31 Aug 2017 16:11:33 -0700 Subject: [PATCH 816/870] Remove duplicate IControlSpatialScrolling parameters in PerformSpatialScroll & EndSpatialScroll --- Menus/ToolsMenu/ToolsMenu.cs | 8 ++++---- .../IControlSpatialScrolling.cs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Menus/ToolsMenu/ToolsMenu.cs b/Menus/ToolsMenu/ToolsMenu.cs index 38d400f5a..089d97e1d 100644 --- a/Menus/ToolsMenu/ToolsMenu.cs +++ b/Menus/ToolsMenu/ToolsMenu.cs @@ -160,7 +160,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon consumeControl(toolslMenuInput.show); consumeControl(toolslMenuInput.select); // Assign initial SpatialScrollData; begin scroll - spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUi.buttons.Count, m_ToolsMenuUi.maxButtonCount); + spatialScrollData = this.PerformSpatialScroll(node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUi.buttons.Count, m_ToolsMenuUi.maxButtonCount); } else if (spatialScrollData != null && toolslMenuInput.show.isHeld) { @@ -175,7 +175,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (buttonCount <= k_ActiveToolOrderPosition + 1) { if (spatialScrollData != null) - this.EndSpatialScroll(this); + this.EndSpatialScroll(); return; } @@ -183,7 +183,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - spatialScrollData = this.PerformSpatialScroll(this, node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUi.buttons.Count, m_ToolsMenuUi.maxButtonCount); + spatialScrollData = this.PerformSpatialScroll(node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUi.buttons.Count, m_ToolsMenuUi.maxButtonCount); var normalizedRepeatingPosition = spatialScrollData.normalizedLoopingPosition; if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { @@ -240,7 +240,7 @@ void OnButtonSelected(Transform rayOrigin, Type buttonType) void CloseMenu() { this.Pulse(node, m_HidingPulse); - this.EndSpatialScroll(this); // Free the spatial scroll data owned by this object + this.EndSpatialScroll(); // Free the spatial scroll data owned by this object } } } diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs index 7ec596b11..d30ed7cbb 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs @@ -27,7 +27,7 @@ internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDele /// /// Perform a spatial scroll action /// - /// The object requesting the performance of a spatial scroll action + /// "obj" : The object requesting the performance of a spatial scroll action /// The node on which to display & perform the spatial scroll /// The initial position of the spatial scroll /// The current/updated position of the spatial scroll @@ -36,19 +36,19 @@ internal delegate SpatialScrollModule.SpatialScrollData PerformSpatialScrollDele /// The maximum number of items that can be scrolled through for this action /// If true, expand the scroll line visuals outward in both directions from the scroll start position /// The spatial scroll data for a single scroll action, but an individual caller object - public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IControlSpatialScrolling obj, IControlSpatialScrolling caller, Node? node, + public static SpatialScrollModule.SpatialScrollData PerformSpatialScroll(this IControlSpatialScrolling obj, Node? node, Vector3 startingPosition, Vector3 currentPosition, float repeatingScrollLengthRange, int scrollableItemCount, int maxItemCount = -1, bool centerVisuals = true) { - return performSpatialScroll(caller, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerVisuals); + return performSpatialScroll(obj, node, startingPosition, currentPosition, repeatingScrollLengthRange, scrollableItemCount, maxItemCount, centerVisuals); } /// /// End a spatial scrolling action for a given caller /// - /// The caller whose spatial scroll action will be ended - public static void EndSpatialScroll(this IControlSpatialScrolling obj, IControlSpatialScrolling caller) + /// "obj" : The caller whose spatial scroll action will be ended + public static void EndSpatialScroll(this IControlSpatialScrolling obj) { - endSpatialScroll(caller); + endSpatialScroll(obj); } } } From f0f2f692d3da6f7b1795c63a70dfc2bdda07f2ba Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 31 Aug 2017 17:13:10 -0700 Subject: [PATCH 817/870] Add new summaries to IControlSpatialScrolling and IControlSpatialHinting, in order to better describe the functionality they provide. --- .../FunctionalityInjection/IControlSpatialHinting.cs | 6 +++++- .../FunctionalityInjection/IControlSpatialScrolling.cs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs index e1c17eee3..b6d689c30 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialHinting.cs @@ -6,7 +6,11 @@ namespace UnityEditor.Experimental.EditorVR { /// - /// Gives decorated class ability to control spatial-hinting visuals + /// Gives decorated class ability to control spatial-hinting visuals. + /// + /// Spatial-Hinting visuals are displayed when performing a spatial-input action, such as spatial-scrolling + /// These visual elements assist the user in seeing which spatial direction(s) will + /// reveal/allow additional spatial interaction(s). /// public interface IControlSpatialHinting { diff --git a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs index d30ed7cbb..d37f72a69 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IControlSpatialScrolling.cs @@ -7,6 +7,9 @@ namespace UnityEditor.Experimental.EditorVR { /// /// Gives decorated class ability to control/perform spatial-scrolling + /// + /// Spatially scrolling allows for directional input-device movement to drive changes/progression of UI + /// element selection, without the need for additional input beyond the movement of an input-device. /// public interface IControlSpatialScrolling { From 78e8b467bea1a0e265152eb6bcfc26d88624f707 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 31 Aug 2017 18:04:16 -0700 Subject: [PATCH 818/870] Refactor velocity math to maintain blink distance regardless of gravity magnitude --- .../Prefabs/BlinkVisuals.prefab | 9 ++++--- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 26 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab index 2534f3341..e6d8c8d20 100644 --- a/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab +++ b/Tools/LocomotionTool/Prefabs/BlinkVisuals.prefab @@ -422,12 +422,13 @@ MonoBehaviour: m_LineWidth: 1 m_ValidColor: {r: 0.12635165, g: 0.9044118, b: 0.26049998, a: 1} m_InvalidColor: {r: 0.85294116, g: 0.21950692, b: 0.21950692, a: 1} - m_ProjectileSpeed: 250 - m_MaxProjectileSpeed: 1000 - m_TimeStep: 0.002 - m_MaxProjectileSteps: 100 + m_BlinkDistance: 15 + m_MaxBlinkDistance: 50 + m_TimeStep: 0.75 + m_MaxProjectileSteps: 150 m_SphereCount: 25 m_Spherespeed: 2 m_InvalidThreshold: -0.95 + m_TransitionTime: 0.15 m_MotionIndicatorSphere: {fileID: 1896404931618214} m_ArcLocator: {fileID: 1858194495447818} diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index 290761de9..86ca987f6 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -19,25 +19,25 @@ public class BlinkVisuals : MonoBehaviour, IUsesViewerScale, IRaycast Color m_InvalidColor; [SerializeField] - float m_ProjectileSpeed = 250f; + float m_BlinkDistance = 15f; [SerializeField] - float m_MaxProjectileSpeed = 500f; + float m_MaxBlinkDistance = 50f; [SerializeField] - float m_TimeStep = 0.0075f; + float m_TimeStep = 0.75f; [SerializeField] - int m_MaxProjectileSteps = 200; + int m_MaxProjectileSteps = 150; [SerializeField] int m_SphereCount = 25; [SerializeField] - float m_Spherespeed = 1f; + float m_Spherespeed = 2f; [SerializeField] - float m_InvalidThreshold = -0.8f; + float m_InvalidThreshold = -0.95f; [SerializeField] float m_TransitionTime = 0.15f; @@ -139,15 +139,17 @@ IEnumerator VisibilityTransition(bool visible) void Update() { targetPosition = null; - var viewerScale = this.GetViewerScale(); - var timeStep = m_TimeStep * viewerScale; - var projectileSpeed = m_ProjectileSpeed + extraSpeed * (m_MaxProjectileSpeed - m_ProjectileSpeed); - projectileSpeed *= m_TransitionAmount; - var velocity = transform.forward * projectileSpeed * timeStep; + var blinkDistance = m_BlinkDistance + extraSpeed * extraSpeed * (m_MaxBlinkDistance - m_BlinkDistance); + blinkDistance *= viewerScale; + var gravity = Physics.gravity; + var timeStep = m_TimeStep * viewerScale / Mathf.Sqrt(blinkDistance * gravity.magnitude); + blinkDistance *= m_TransitionAmount; + var speed = Mathf.Sqrt(blinkDistance * gravity.magnitude); + var velocity = transform.forward * speed * timeStep; + gravity *= timeStep * timeStep; var lastPosition = transform.position; - var gravity = Physics.gravity * timeStep; m_SpherePosition = (m_SpherePosition + Time.deltaTime * m_Spherespeed) % 1; for (var i = 0; i < m_MaxProjectileSteps; i++) { From 28ffc8dab2053826faf8924a470c257e8219e060 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 31 Aug 2017 18:04:42 -0700 Subject: [PATCH 819/870] Add comment linking to a visual represenation of the SmoothInOutLerpFloat function in MathUtilsExt --- Scripts/Utilities/MathUtilsExt.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/Utilities/MathUtilsExt.cs b/Scripts/Utilities/MathUtilsExt.cs index 55d6e332f..53c0d0a13 100644 --- a/Scripts/Utilities/MathUtilsExt.cs +++ b/Scripts/Utilities/MathUtilsExt.cs @@ -212,6 +212,8 @@ public static void LerpTransform(Transform source, Vector3 targetPosition, Quate /// The 0-1 smoothed lerp value public static float SmoothInOutLerpFloat(float lerpAmount) { + // https://www.wolframalpha.com/input/?i=t%5E3+*+(t+*+(6+*+t+-+15)+%2B+10) + // t^3 * (t * (6 * t - 15) + 10) return Mathf.Pow(lerpAmount, 3) * (lerpAmount * (6f * lerpAmount - 15f) + 10f); } } From c00c15aa45e256e3cfc112ac84c22e4b826be92b Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Sat, 2 Sep 2017 05:44:46 -0700 Subject: [PATCH 820/870] Add support for a connect interfaces override rayOrigin in InstantiateUI --- Scripts/Core/EditorVR.UI.cs | 4 ++-- .../Interfaces/FunctionalityInjection/IInstantiateUI.cs | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Scripts/Core/EditorVR.UI.cs b/Scripts/Core/EditorVR.UI.cs index 2db62cff0..a01862db7 100644 --- a/Scripts/Core/EditorVR.UI.cs +++ b/Scripts/Core/EditorVR.UI.cs @@ -98,7 +98,7 @@ internal void Initialize() inputModule.preProcessRaycastSource = evr.GetNestedModule().PreProcessRaycastSource; } - internal GameObject InstantiateUI(GameObject prefab, Transform parent = null, bool worldPositionStays = true) + internal GameObject InstantiateUI(GameObject prefab, Transform parent = null, bool worldPositionStays = true, Transform connectInterfacesOverride = null) { var go = ObjectUtils.Instantiate(prefab); go.transform.SetParent(parent ? parent : evr.transform, worldPositionStays); @@ -115,7 +115,7 @@ internal GameObject InstantiateUI(GameObject prefab, Transform parent = null, bo } foreach (var mb in go.GetComponentsInChildren(true)) - evr.m_Interfaces.ConnectInterfaces(mb); + evr.m_Interfaces.ConnectInterfaces(mb, connectInterfacesOverride); return go; } diff --git a/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs b/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs index da94cf690..93471d1d0 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs @@ -12,7 +12,7 @@ public interface IInstantiateUI public static class IInstantiateUIMethods { - internal delegate GameObject InstantiateUIDelegate(GameObject prefab, Transform parent = null, bool worldPositionStays = true); + internal delegate GameObject InstantiateUIDelegate(GameObject prefab, Transform parent = null, bool worldPositionStays = true, Transform connectInterfacesOverride = null); internal static InstantiateUIDelegate instantiateUI { get; set; } @@ -21,12 +21,13 @@ public static class IInstantiateUIMethods /// /// The prefab to instantiate /// (Optional) A parent transform to instantiate under - /// (Optional) If true, the parent-relative position, scale and rotation are modified + /// (Optional) If true, the parent-relative position, scale and rotation are modified + /// (Optional) RayOrigin override that will be used when connecting interfaces on this object /// such that the object keeps the same world space position, rotation and scale as before. /// - public static GameObject InstantiateUI(this IInstantiateUI obj, GameObject prefab, Transform parent = null, bool worldPositionStays = true) + public static GameObject InstantiateUI(this IInstantiateUI obj, GameObject prefab, Transform parent = null, bool worldPositionStays = true, Transform connectInterfacesOverride = null) { - return instantiateUI(prefab, parent, worldPositionStays); + return instantiateUI(prefab, parent, worldPositionStays, connectInterfacesOverride); } } } From 0b08627f7842e602a12d2e7e7fcfe57dcf255bae Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Sat, 2 Sep 2017 05:47:07 -0700 Subject: [PATCH 821/870] Replace ToolsMenuInput ActionMap; fixes serialized naming issues with control scheme --- Menus/ToolsMenu/ToolsMenuInput.asset | 17 +++ ...t.asset.meta => ToolsMenuInput.asset.meta} | 5 +- .../{ToolslMenuInput.cs => ToolsMenuInput.cs} | 4 +- ...nuInput.cs.meta => ToolsMenuInput.cs.meta} | 4 +- Menus/ToolsMenu/ToolslMenuInput.asset | 117 ------------------ 5 files changed, 24 insertions(+), 123 deletions(-) create mode 100644 Menus/ToolsMenu/ToolsMenuInput.asset rename Menus/ToolsMenu/{ToolslMenuInput.asset.meta => ToolsMenuInput.asset.meta} (55%) rename Menus/ToolsMenu/{ToolslMenuInput.cs => ToolsMenuInput.cs} (76%) rename Menus/ToolsMenu/{ToolslMenuInput.cs.meta => ToolsMenuInput.cs.meta} (75%) delete mode 100644 Menus/ToolsMenu/ToolslMenuInput.asset diff --git a/Menus/ToolsMenu/ToolsMenuInput.asset b/Menus/ToolsMenu/ToolsMenuInput.asset new file mode 100644 index 000000000..65e1ca465 --- /dev/null +++ b/Menus/ToolsMenu/ToolsMenuInput.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} + m_Name: ToolsMenuInput + m_EditorClassIdentifier: + m_Actions: [] + m_ControlSchemes: [] + m_MapTypeName: + m_CustomNamespace: diff --git a/Menus/ToolsMenu/ToolslMenuInput.asset.meta b/Menus/ToolsMenu/ToolsMenuInput.asset.meta similarity index 55% rename from Menus/ToolsMenu/ToolslMenuInput.asset.meta rename to Menus/ToolsMenu/ToolsMenuInput.asset.meta index b5a09f9b8..787346f33 100644 --- a/Menus/ToolsMenu/ToolslMenuInput.asset.meta +++ b/Menus/ToolsMenu/ToolsMenuInput.asset.meta @@ -1,8 +1,9 @@ fileFormatVersion: 2 -guid: 744d823602c92f94ebd746822bed646d -timeCreated: 1493933312 +guid: c9a6ad3bee1a1274c884e678ee951c4b +timeCreated: 1504341042 licenseType: Pro NativeFormatImporter: + mainObjectFileID: 11400000 userData: assetBundleName: assetBundleVariant: diff --git a/Menus/ToolsMenu/ToolslMenuInput.cs b/Menus/ToolsMenu/ToolsMenuInput.cs similarity index 76% rename from Menus/ToolsMenu/ToolslMenuInput.cs rename to Menus/ToolsMenu/ToolsMenuInput.cs index fc8f00171..c655414f6 100644 --- a/Menus/ToolsMenu/ToolslMenuInput.cs +++ b/Menus/ToolsMenu/ToolsMenuInput.cs @@ -4,8 +4,8 @@ // GENERATED FILE - DO NOT EDIT MANUALLY namespace UnityEngine.InputNew { - public class ToolslMenuInput : ActionMapInput { - public ToolslMenuInput (ActionMap actionMap) : base (actionMap) { } + public class ToolsMenuInput : ActionMapInput { + public ToolsMenuInput (ActionMap actionMap) : base (actionMap) { } public ButtonInputControl @show { get { return (ButtonInputControl)this[0]; } } public ButtonInputControl @select { get { return (ButtonInputControl)this[1]; } } diff --git a/Menus/ToolsMenu/ToolslMenuInput.cs.meta b/Menus/ToolsMenu/ToolsMenuInput.cs.meta similarity index 75% rename from Menus/ToolsMenu/ToolslMenuInput.cs.meta rename to Menus/ToolsMenu/ToolsMenuInput.cs.meta index 398f5e75b..e91f21ec1 100644 --- a/Menus/ToolsMenu/ToolslMenuInput.cs.meta +++ b/Menus/ToolsMenu/ToolsMenuInput.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: b0cc1f53ec00c1047a37d91add7a8c67 -timeCreated: 1504205842 +guid: 61e2e933e1c8a2a4cb1cac1e63ca541c +timeCreated: 1504341086 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Menus/ToolsMenu/ToolslMenuInput.asset b/Menus/ToolsMenu/ToolslMenuInput.asset deleted file mode 100644 index 4fe628316..000000000 --- a/Menus/ToolsMenu/ToolslMenuInput.asset +++ /dev/null @@ -1,117 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} - m_Name: PinnedToolslMenuInput - m_EditorClassIdentifier: - m_Actions: - - {fileID: 114000014192420456} - - {fileID: 114000013122567660} - - {fileID: 114836735327238322} - m_ControlSchemes: - - m_Name: PinnedToolsMenu - m_DeviceSlots: - - m_Key: 1 - m_Type: - m_TypeName: UnityEngine.InputNew.VRInputDevice, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - m_TagIndex: -1 - m_ActionMap: {fileID: 11400000} - m_Bindings: - - sources: - - controlIndex: 3 - deviceKey: 1 - deadZone: 0.3 - buttonAxisSources: [] - gravity: 1000 - sensitivity: 1000 - snap: 1 - primaryIsButtonAxis: 0 - - sources: - - controlIndex: 2 - deviceKey: 1 - deadZone: 0.3 - buttonAxisSources: [] - gravity: 1000 - sensitivity: 1000 - snap: 1 - primaryIsButtonAxis: 0 - - sources: - - controlIndex: 18 - deviceKey: 1 - deadZone: 0.3 - buttonAxisSources: [] - gravity: 1000 - sensitivity: 1000 - snap: 1 - primaryIsButtonAxis: 0 - m_MapTypeName: PinnedToolslMenuInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, - PublicKeyToken=null - m_CustomNamespace: ---- !u!114 &114000013122567660 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Select - m_EditorClassIdentifier: - m_ActionMap: {fileID: 11400000} - m_ActionIndex: 1 - m_ControlData: - componentControlIndices: - controlType: - m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - name: Select - defaultValue: 0 ---- !u!114 &114000014192420456 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Show - m_EditorClassIdentifier: - m_ActionMap: {fileID: 11400000} - m_ActionIndex: 0 - m_ControlData: - componentControlIndices: - controlType: - m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - name: Show - defaultValue: 0 ---- !u!114 &114836735327238322 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} - m_Name: Cancel - m_EditorClassIdentifier: - m_ActionMap: {fileID: 11400000} - m_ActionIndex: 2 - m_ControlData: - componentControlIndices: - controlType: - m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - name: Cancel - defaultValue: 0 From 42ae85b5a32c5894ac4d338ef0b538b737988f7a Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Sat, 2 Sep 2017 05:50:56 -0700 Subject: [PATCH 822/870] Refactor instantiation of ToolsMenuUI out of the ToolsMenu rayOrigin property; remove manual setting of ToolsMenuUI's rayOrigin from ToolsMenu --- Menus/ToolsMenu/Scripts/ToolsMenuUI.cs | 2 +- Menus/ToolsMenu/ToolsMenu.cs | 26 ++++++++++---------------- Menus/ToolsMenu/ToolsMenu.cs.meta | 4 ++-- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Menus/ToolsMenu/Scripts/ToolsMenuUI.cs b/Menus/ToolsMenu/Scripts/ToolsMenuUI.cs index bc729a919..c751d44d3 100644 --- a/Menus/ToolsMenu/Scripts/ToolsMenuUI.cs +++ b/Menus/ToolsMenu/Scripts/ToolsMenuUI.cs @@ -49,7 +49,7 @@ sealed class ToolsMenuUI : MonoBehaviour, IUsesViewerScale, IInstantiateUI, public int maxButtonCount { get; set; } public Transform buttonContainer { get { return m_ButtonContainer; } } - public Transform rayOrigin { get; set; } + public Transform rayOrigin { private get; set; } public Action mainMenuActivatorSelected { get; set; } public List buttons { get { return m_OrderedButtons; } } diff --git a/Menus/ToolsMenu/ToolsMenu.cs b/Menus/ToolsMenu/ToolsMenu.cs index 089d97e1d..10bab5956 100644 --- a/Menus/ToolsMenu/ToolsMenu.cs +++ b/Menus/ToolsMenu/ToolsMenu.cs @@ -37,7 +37,6 @@ sealed class ToolsMenu : MonoBehaviour, IToolsMenu, IConnectInterfaces, IInstant [SerializeField] HapticPulse m_HidingPulse; // The pulse performed when ending a spatial selection - Transform m_RayOrigin; float m_AllowToolToggleBeforeThisTime; Vector3 m_SpatialScrollStartPosition; ToolsMenuUI m_ToolsMenuUi; @@ -55,18 +54,7 @@ sealed class ToolsMenu : MonoBehaviour, IToolsMenu, IConnectInterfaces, IInstant public Transform alternateMenuOrigin { get; set; } public SpatialScrollModule.SpatialScrollData spatialScrollData { get; set; } public ActionMap actionMap { get { return m_MainMenuActionMap; } } - - public Transform rayOrigin - { - get { return m_RayOrigin; } - set - { - m_RayOrigin = value; - // UI is created after RayOrigin is set here - // Ray origin is then set in CreateToolsMenuUI() - CreateToolsMenuUI(); - } - } + public Transform rayOrigin { get; set; } void Awake() { @@ -81,10 +69,9 @@ void OnDestroy() void CreateToolsMenuUI() { - m_ToolsMenuUi = m_ToolsMenuUi ?? this.InstantiateUI(m_ToolsMenuPrefab.gameObject).GetComponent(); + m_ToolsMenuUi = this.InstantiateUI(m_ToolsMenuPrefab.gameObject, rayOrigin, true, rayOrigin).GetComponent(); m_ToolsMenuUi.maxButtonCount = k_MaxButtonCount; m_ToolsMenuUi.mainMenuActivatorSelected = this.MainMenuActivatorSelected; - m_ToolsMenuUi.rayOrigin = rayOrigin; m_ToolsMenuUi.buttonHovered += OnButtonHover; m_ToolsMenuUi.buttonClicked += OnButtonClick; m_ToolsMenuUi.buttonSelected += OnButtonSelected; @@ -99,6 +86,12 @@ void CreateToolsMenuUI() void CreateToolsMenuButton(Type toolType, Sprite buttonIcon) { + // Verify first that the ToolsMenuUI exists + // This is called in EditorVR.Tools before the UI can be created herein in Awake + // The SelectionTool & MainMenu buttons are created immediately after instantiating the ToolsMenu + if (m_ToolsMenuUi == null) + CreateToolsMenuUI(); + // Select an existing ToolButton if the type is already present in a button if (buttons.Any( x => x.toolType == toolType)) { @@ -139,7 +132,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; const float kAllowToggleDuration = 0.25f; - var toolslMenuInput = (ToolslMenuInput) input; + + var toolslMenuInput = (ToolsMenuInput) input; if (spatialScrollData != null && toolslMenuInput.cancel.wasJustPressed) { diff --git a/Menus/ToolsMenu/ToolsMenu.cs.meta b/Menus/ToolsMenu/ToolsMenu.cs.meta index 570d52f8c..e21ce848b 100644 --- a/Menus/ToolsMenu/ToolsMenu.cs.meta +++ b/Menus/ToolsMenu/ToolsMenu.cs.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 guid: 800ff7c94496eac41ab0b6df27863704 -timeCreated: 1504210685 +timeCreated: 1504341756 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - m_MainMenuIcon: {fileID: 21300000, guid: 05f6f0555fbf99a429004b50ccd6ffa9, type: 3} - - m_MainMenuActionMap: {fileID: 11400000, guid: 744d823602c92f94ebd746822bed646d, + - m_MainMenuActionMap: {fileID: 11400000, guid: c9a6ad3bee1a1274c884e678ee951c4b, type: 2} - m_ToolsMenuPrefab: {fileID: 114000010527895234, guid: 9df94b11e4f4ed848aa8c4055b378c6a, type: 2} From 6f6365fc306927d8ecf94f98a78346c48ab3a140 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 5 Sep 2017 10:04:09 -0700 Subject: [PATCH 823/870] Add missing actions to ToolsMenuInput actionmap --- Menus/ToolsMenu/ToolsMenuInput.asset | 106 ++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 3 deletions(-) diff --git a/Menus/ToolsMenu/ToolsMenuInput.asset b/Menus/ToolsMenu/ToolsMenuInput.asset index 65e1ca465..8f1ca3071 100644 --- a/Menus/ToolsMenu/ToolsMenuInput.asset +++ b/Menus/ToolsMenu/ToolsMenuInput.asset @@ -11,7 +11,107 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 24e5bc088c9caeb44bc4283dc321b033, type: 3} m_Name: ToolsMenuInput m_EditorClassIdentifier: - m_Actions: [] - m_ControlSchemes: [] - m_MapTypeName: + m_Actions: + - {fileID: 114108446146354448} + - {fileID: 114568097036575830} + - {fileID: 114167252148599272} + m_ControlSchemes: + - m_Name: ToolsMenuInput + m_DeviceSlots: + - m_Key: 1 + m_Type: + m_TypeName: UnityEngine.InputNew.VRInputDevice, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_TagIndex: -1 + m_ActionMap: {fileID: 11400000} + m_Bindings: + - sources: + - controlIndex: 3 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 2 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + - sources: + - controlIndex: 18 + deviceKey: 1 + deadZone: 0.3 + buttonAxisSources: [] + gravity: 1000 + sensitivity: 1000 + snap: 1 + primaryIsButtonAxis: 0 + m_MapTypeName: ToolsMenuInput, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null m_CustomNamespace: +--- !u!114 &114108446146354448 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: show + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 0 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: show + defaultValue: 0 +--- !u!114 &114167252148599272 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: cancel + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 2 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: cancel + defaultValue: 0 +--- !u!114 &114568097036575830 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5eba7b4b2e3ea134991ccbff5f47c2c8, type: 3} + m_Name: select + m_EditorClassIdentifier: + m_ActionMap: {fileID: 11400000} + m_ActionIndex: 1 + m_ControlData: + componentControlIndices: + controlType: + m_TypeName: UnityEngine.InputNew.ButtonInputControl, Assembly-CSharp, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + name: select + defaultValue: 0 From 83d0d17989f4a964adaff46e468564b6b9f7b2f6 Mon Sep 17 00:00:00 2001 From: Amy DiGiovanni Date: Tue, 5 Sep 2017 17:22:55 -0700 Subject: [PATCH 824/870] Moved close and reset dimensions buttons to front panel of WorkspaceBase; moved front panel buttons to account for these additional buttons --- Workspaces/Base/WorkspaceBase.prefab | Bin 106548 -> 62988 bytes Workspaces/Common/Prefabs/FilterUI.prefab | Bin 48731 -> 40348 bytes Workspaces/Common/Prefabs/ZoomSlider.prefab | Bin 22456 -> 25068 bytes .../Prefabs/CreateEmptyUI.prefab | Bin 18429 -> 25420 bytes .../HierarchyWorkspace/Prefabs/FocusUI.prefab | Bin 18427 -> 25420 bytes .../InspectorWorkspace/Prefabs/LockUI.prefab | Bin 16553 -> 23236 bytes .../Prefabs/UnlockAllUI.prefab | Bin 15691 -> 23572 bytes .../MiniWorldWorkspace/MiniWorldWorkspace.cs | 2 +- .../MiniWorldWorkspace/Prefabs/ResetUI.prefab | Bin 15974 -> 22756 bytes 9 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index 4650df42cb51160d7b9714cd1bbf4e8fe8a7bca7..1e76cab94c93382130da19803210d0dd6ede58b6 100644 GIT binary patch literal 62988 zcmeHw37i$hwSHfA!Ch41f`g*C01lgivfNpK8D$ySLag>ojP^8y2f#?`_ys1+1GKLgB)i8ejKM?&(nHl&K_Evs7_W+7}KMokF#^vu3eGC zaO>li_-EIybB{XUdf)S1AP~<1>)uwPU>{WN#T)QxJ1fvBKYtA zmQL#Nh?8msDB?w?9On>3()0O9iuYSMzXzXVam}JJS9zwTvl$%w;+lMXUM-!T;6Dgh zJH*zALf^vq6YycUCjU0XQ@qzQ(hGbTiMRFeR)+tPc!s>mOZc>MCLn#GOTUjt-`bgj za?Zdt%h{f|iERSq>|o(`Ir)sxw|4T7XCWuyD2u<-qbB>EW#d?Q)cb+wF3+hew>BfzN}uCZEn8-Xg%~ z7z?-gWO#VQ=?gw9aZNs5JUqyU{axhKA|RjRJUrrzK%HK3ueNo|J@#(Q?Ba_96 z>4~CPbs|~r%$yp!99J1DubQ5$oLLa7jF(q~U|6Coo}Y_EL9DveB{FL7j*+J3RBq68gZvr@|3j6rd_7DjdbB6t%-s;RxQ!>57h*jceAIQE(XuT3;$0 z#qIi1;Rr4Yd<3p311cN_Dt0Qahad-*p9;rG8My_@Zxl|Hc(D9N;ouSCw&L;?j_@A` z8uF*YsgJ)=IMKTNeT5U`?<<^$vl{X#1Y6363Wp)wAAE%qY)4<=h!d=(kxFe)}{WW1_WDe|kbimDT{;->JB^ud1^c+UGh`i$GU zcIHpdYEv-p1e9@+Th?l{cVN63eD@RlztVW4BA(@rTWh=p#=k$_g6-{(w}|rr_;B2^ z&vU#vP6pbtg|h@bv_G!c57?({{0v+X=XkU6fw&^h@n++LaYbCl8~Gz&$Uh2?n~&zp@n++iFUOnU!oL7llMya^uE7aVVj(?C>x$MGh(7zC=U;1OeJmg1WA<-8IxF*qNDCwSH4 z86JJa^q-4x&GzbI@DzB7JTJ#J`5$ZWTGltvPh^7kag}G+5WULtco$D!UyMi=#mdGc ztHnB)?aXm5aW1BgAYPEHO1M^oxgHCQ6L?N(qO2J6HIls`B+&g^z}BK40c?H_+|?t43SRrNxV4{RagMbZhVkQDKTRS1Vm zLn?%#qsYTkc6VSL-n=JGy89_x`Gluz`C#*u0kF7#RI2a00MJ%7cMu<4I z7$W`La_@^@2Fizcj!C;J1P?0CDUy6dh4^@}i`!E+`RLSRR7h0lIW(^aJ%^^K5aPk1 zDJq0`aA=AO5qzjMG)09Fm!YZhF;liFTPtJhs(d(fwY_df`awjtA-k2}Et~}?=d-v* zcQRA9jjwZYf6A62{wLs+B~^&h(^S*)_*1s1d@T=Eh?a*c=OdR7RR{xzvdzaw&Ih@DZrjvB2@a(=~)=y11wi zpZ**d=Tskw3eI{>1y26mEI!09b#YFCn(q?e3tjxA5WdvKPqy$UfUQTQ98N)WOuj*R zQhvfe*e*RhTvYG-F8`huo&ouP37q}pRD+XO#33F5NIa8x)NyDIjfs~-u|c(^uUB(o zRn=olW5vmfxw;t>FN(vA@_~^_>eUHY7$qx7Fd|V>iq%hYT6}y}tV9+`)5~xhQ~`Ko ztU6wqh?P}2W2v)?vSZanrTOL4lVB1?rY9;R~GImsHc$g^mvx$(5gCab)t zG)ddgFVKW!Sq&Cqv*MMNiDH(_%mVr4hGJ%{!aN$UidW8xkDtK08uE90ZEq(m`? zB`b4EW0lpp@oK3J39#;~td5me56>sNIO`cN7V}m_&C)Tek%{ue%$k{o!`Q?ngtBU? zljA3hjLptXRDp+CPwoe|>G<;@;Ojeb=YYe}DU?H>h5RBBEEBz-g?no8}L@S3|BYs`!ScF=oeM*3$4G zAL;HKE=`%nluvjXQ$FcVW6CEyjVYh@C|8y#YsBe;-@%9+#$pLe`Kcz95AQ`x4AzTN zJ8|}1ta8wPX%9X#NckKa-1L1G2yM1}!--on|M#526K=VA>(&X|*V4-5bjRV&z&0Bt zNu-#6!)?ZLH`Hdw;$D4iMpf37Hd8*~Hd8+7wwdw?x0&*>+l+lSAF;kRQ$FD~Q$E^e zl-meMus+j+xSBRJJtAlu(sT7v=;j+|>dJxY}&dy1el|ef;v6B{*&Z$ZisY*B9)m884x%pM&Dib9o z#-KL3PmFU|-*A)xtu(niTMoG|@%(R`e*O2E^4fjZoHJAH}-Xuc+gH~J@BZ( z&p{u#5RrV@$pw!%wCU)=pd6??8Nzb#?dzZ%eET}WcP3`N!hufv+Ho=rpC!Q0#ueo+ z_O*|*9}}m24NJ|VAMN6uLpbVS=-CcJFYBbS=Gp-Vge=~RI7LX#L8RQe5Kj?r;VeXQ zDI#$yKfzl%E0BEA#gFswR)Kcx>fz#2Ro5)-YlaA%)Z{}slRxci;oru24as*9Dd%p8 z4Ek9L?cw3_ z4(D@Rw?gcR$iRHR!EY-(%zRHJm@@gAdU0LCdeOdSh+s;jL7?^OWiY|*diD13wx(WP zT>dmNgnzq0z50?qNeY|9iTecVb()9EJG5*Nv0l)ZCQ$xMkW+z+a~v=b=eR2b z&iW1@m?9o54_!C)mFG<2CI-txmyY0V&HDZ#T=04jqV!vle+nSWNkfZ){g&nVIdGO| z2*DKb;JdOYU@1@VU0D`!6I%u3lkMRV=NBMYhRAlzL1YN)fn0+LZnvWv$sBiV_qNcj zEdMYvK_Fg>@;?gxEXQzySw8-}i|1K5`Eb2RKKaBE$Y%-gcU=4|felXnAG&;~Z@28yw;05S(PPN^f8yBQnTuEuerVx21-!}$f~M}&zx2^XWX2MxXUuXyxJlkR+fy} z*YXa+BFIiA%dATlUKfNOQ>n|?ipoTFoOO{D5_nB$)}mQe6YU|#~ zn&~cx4Ov;TXvW2fD%P0SqhWw0%Ei)Z<*ev5;G(-HE}6OU_$jZf-luPeQwF|z(2XZu zS+mSJP8gbh~uvZF8Fb-(3a~#M@f%G!7Pj_*y6c`krgEZ-V zPrT6o+{HWNmqF?8LYnkkDKHSHh48RRJ5C0{EbOL9^Ci4YO>p^EdwXll43(^@EQ$wU zOfwVp9a}-HxL97rpH~-}R2Q0P+_2VDp=;SFGoFs?u_k9x11+3Ir?*{pNB34`ZK`+u z_mo+;UX}m)v}LnDU$gA?l?N_;s%+z3b5YyVT2c&qr!lm;*B$n%fjv_LT%d6=7FGjM zU>tT-0}NCHH1^L!q}rewU{FVeE)e|}aQ)jzeS!^XY1^x_sy`5I(YCT7+xL?F2*y zSB-JMo5Mws?=Wa#94$`*qoai?*+DIs?-IvJy@)IF5r=_~zvSX{7>MIU=zr(p#$jOb zdBw%Md-ReoofyoQ4uksgrNhAHuldqpVB?xE9R@b8`HI6J1NS6fm`)~NIt(1EoLXP@ zN1Ko4Ya9j^z2++p1M(L+Xujew@bmo)d|6*{82I#>FC7N;gE2KJNAz)nVFUmI*tq3;iD7$W=U5DyQImnd+MAO^=v zmWQ`+$Y+wvhYkaVa6iv6SY1B39xi+?bomS=6NE6IVFs(qXSjz)9KMXc9+8d^jtwV8 zdU22}aq)Z)4?0NbFo;A+A9Rq=VSq;sZaYdxc)0NYwacH5OUXCLe-!DXb@|hwSs(ub z4;TI~yZq_stdIW~(nss^r#V$0|8X8J{NHx@j|W~K{|Tgz*5!XLaT9|Mq=_Cb=GDg_ zA|3U;I$(AHfJ4ai!%4&u*j^aZo`djwg9&cy?a3Y>rE)L!K;6whL--LhLfa9}-^ilE&I&@2kn;3NHCOljmig?s%g@}5X!1CXUJnwb$ zok27uJR+{LQ}HaH!q{OW{q=KNn@d1jGEv~GDWCT?P|JhMGq9J&X# z6uLRUrT>fkj{(kdUP2r}_0=iBS)NM?ricgi$z`OC5)bOD%ZZy99FJGHc)H6PYz#T{;t;IzFR^We#q(|(vXM1q)rpF-gn8LI zELI%Pt*Ml%ieFLPkM@;YVb23;WgT!vB5&_nGk1Y3>~1mHxNmw{ulg{ltN%LK%E|}n z_(Wblpqcpy{IK!LSWz_v;Ch3HSH>zz6Ggr|*ae*In(FFgc}`iPXhy&zO(5i8{wKJh z)&2V~>wl(p!LTYkyUkg59=W8$9UUf(9+kD|sinOJ{q2H{bB{Rq*&eBFk8d8wMTsid zy>H(svAsUwNHhg0G<`8$i%E%#I4X0qn9dS;(l|oWOd3DIFGCAZVL{;e&iuu63$qPv z8fZAl$YMI0wr@*!_l=2TKOnS?t1YOwjE05>OI{Dz$jDd~Rd;p*UwWBw)6#i(S*vYd z|K-b!5s7ZsRPQ=wVTYEtul>!6yK)csk4_K&?cs@&x}t3Vg~+<@9XHa>Z2!GZsHTq_ zjt`C-_IERGOurJJFcAxN)2e^iNrA)2Jjp^}UVL zcqD!_VM8xY92$wlI}=9Ge6K~CIGs=o#998kktUvj$e{F(AWggrK?KEri!||L2_h)I z5ozMb5kyGW_?tO(e8M=GjjhKG&F<%%1&P`5vMRiA9$%g?b{szu83r4}*j^sln0OVo z5u0yGxQz|=UQuN{UXIu0MWrrFlRh_5TwOZ4GB56$fwDs`R_1aahF8JUVns9L>D&VD zAI`-$t}x%kq;jD-<*}KGqF~vK=4s>XJp8+R9{TFzHIMD{@?j;noc>sH#lf?GdTIab zJ{mP>!t#?2`<{}a=^a7bt9hj7?A1Ie^oOQv9xfxPdAMvdnkPkh2KVDp^T@I-$e)^r zeUSOuZYG(riANl2FS@(9{1(kaJm@Z=<`F)@w`|lrf(swIZOF&hJV8Dg9(|Bc7Y`Rr zMfZcPdD7P~h>9ZIG>X2R!?dZK6+b^8?JT z06CHLB8~w50sm-kfq@76Z66Eo2OjiKvz&b2#i0H|_HXu|eg+fVt}iDWmP^Z-iwj<# zj;Q5i|DWjM{VjY6@=O3H{{h4i(w`Xkd6(z%g2k6pQ&pXu=^;TMVAw5}#czko@mU2= zIB@-LLc>pk^vgc_zr^EZqwX}66Dyw;t1@0L(pi@-LHvjh}7iRIir#)$y6Sh0}7{AvvdtHa8N*3E4L)F2r~- z7wNGw@Xd{v#pYzkamow!pBT&-!|j~bf8Jc{q+ZIuz2lIrUkrGDW7eU=`<^nd%iBd; zhHSrg)OShh9_kym^WM49@B4d~;Xxgf&fG|S440JAk^V9~I2RdX*z~vHT%^XZ898a3 zgHrzhAD67~hLa9_u@d)j4w@8sy7z{)qlWf=@5%B@Cd|L0k&tENu-8g#ZYza3tt#OZv$!JvB80XJ@`yor}m> zeovQ$>5eo^S~Kzec&T@U2o_@I{ad+(2#M}t#DwIMc!-SGz?A8JoM0xZ_Rdoyi@x5n zb^B+Ve0_9Bjp5l)3HkF|&kl!uErhH!cOO^Yp^+i+jY z<1gZZ+(4bzYO8>a1mD@A1>nT^6ZBTmWShm zAEUo$fZz<54-GJyVLtw*#bCSBi;G7Qh0lX7pFA=_2=mD|nBca2 zsB@GL(`#KmG#?nkd`1|oE}xMe9x>yTUs1B%xoMFh%!f`a$v0T90uL8H|K;+bbBiI& zXNmPZ$%ln?dB_b#7tWP%XpGu~iz`AqO|;j@1WsTUn(3}HSK4OW-Wc^)o&j&b=+ zA`^r#pYsh?mk-T1k(==8=kl3CCJ13Z7Z|KAAI>v2pAjyfLf{NxJ~4yU|+#X;4rbW?X&%1n*hD%*O6%FvY$iwA5^ak*u*>B8Ub5HQCE?xzU zf&G68%>Hj(yjoxnZ`)G%)P(S(Tzr;=(^+>aaLWB+;#tCfIIs&4Io@XzM+nPjj===C z<#UOLM;!7gbNO6KCJ13Zml>=spUXWQ&S&sg=<>OOOc26+<{GRnpOlNIyPT#a&Q!?0<7H!$AUh+++{7%NsAJz6pU-ySXX&0V)s?(2 zRf?Dk&;UXa27qjAA_xGU?CYX++41T6S=Pzf7M@*dX^KEMV#&SE5xyhs2li%nt4dP1 zxF@5Dz$y9=Ohh+SNDe|U60cJ6dAnvS{l;aMD_bboep$sA!r^XSsmk#1x{2??&M8Y) z#pTlD=U&P)))`4&Pl4lJ4o$iiqZG@DA)8t}f5bEW*RFfN@Xmp!oUwq$#^X?Q_}>H= zsVOcx%teZWz2Wn@I)bR7ql>smpt6Nd0S8}c(8z9w$a{kC{^%m*)5fEh$xHdP^>8`b zv7yt2mCrt)hYm*GK|bw0T+Y=Bc%Kcu_~K|xv)okN43rO*{8=Vl_h?WxO7=I@KD|zs z2ZV4{$_EmU3OyHti*U(yIfys{${$z^9xO2Mpx5{i3*X(*pemn34R7+7#h}XhFb_w4 zkzS6-Har|r+m}a!zJP1?B`)f1{0}bv6Azc8LEpnQWl5i#(rd>RJOl0cEpYaeQw`2%VC(^J z2atFs@u=YB!>^54PA=*hRGwXcgO$TYJ%i$>yEyxc6BT?Eu=5aEufD_)!tLuX>Vx$< z&Cm)Tj>kgq;dq3;bjukWkN%=QI3BsEXL&hJ?NhY&i@kxtET>BUW$k)*@>U!mq;!CM)lI+7F;1!Zu}SSN;?PXqAP!gM(! z4y$dR&t7Ft-lLMzS33+>td|T^AJ21f8Kyo?>x=Z1mCXl3%-|fRg3Bq^qi{vuGE99w zny;*qeO&XEVd~?WuMAV-!v6x7zYJ5KUir%~^>O8IhN&e7<2p|D<6NA zEY`j9$?)h!J{7>|7;qxf2$>$^w50>-f5UzYq@o?eu46eziyN3t)P=0nf zl}}F(7e24!ntV9z+4Nek%n+`8WR*-g2%mRAM?SJjt}7q2O19*td}NiJ;RHRU>DoN* zUpVqMDg875@)1Ak=bzQUU$cPHchj-iUOHavZG^&{fawGKb*p(yY(Zic{xrw?6y&a5 zJKNm3VD=4{Eqd+U%FCTr!=_Nb=oC*1>V1(pE>i4+4V!1|?+xjFjsuR9u-<1sVmt9( z#KhfuN0m<-k6y;7@<~_kE1$65S3d2*Kg%soL+05MNQC``WoO+PD4!9))myQjz#e|K zp;5i>(@%DBqxYj~bjukC>G!^@vWikRao|V>_ao{m_jq6$BJ#&ny` z)dHL2V#}w$)Q(t23m==E_fbbf2P~#^Z$Ek%v3BS&*J>Ugc0YpHVqiD9Sf{7H=t?XT ztq^yy;!c^}3>~m}E|z!dmfplNP(v+Cs|iJYh}Bxyow5#o_PtC$<5Y z%HWKB6N8E6p~q=ij=EuK7O^eBR4!XT%^gmx5WW0XmtS?wr18Xd08@U?wCp*RSOt2d zKKs_bcTXes1u(70#1CF5A~qX6RIyFjZKe~WRiZK&)BQGsl>$?`r>=X(U|#@J8SLA7 z-i0P#^x&)A@_o~DMH#Ujz_ffj-<(xp=+L88L44}`{&Hg5fN7a;E5GRqVx_Qb^x1v; zExd}@7GV19cZcqO4Y7&n@%rrKcUBv06EN*Vxlc^Li*$L=Oj@@Q*WPdsvE>%_;T==& zCD!R6pRW6DJsu>M0(O&Iw<{mW`n92hWu*B=H{bd=vBkiYuH!eYR}jmDrKI_`AJA^4 zp#!Gn>;3M@25Se)Ddy&J)Rm_^OS%eRDuZ$B4qQcSn?*O>sWe!@p?-TTzba!j={5k< zXXpQQ{0qeLU~Or;WxQVg60vo_w0!$c`s#PYGGTowHth5suMt}eOzZYm#v2C9gf(`% zTjn=<&;0}GHUOLHVr4_yzegDUu{FT7Uv0^M?mvm;!CJf4eYW$8><@`; z0(P~FwXg2*39&+0Z<@#BEB^R3u?@hK-<6ML?jSZ1)||@Vl0Sd<*?0Z+cQydK4E&%f zoPkSkJ^p)O1xGthg^R6TdD#iX)&NtwBYswP60s<(J;k;>`Rb{L4wyc>{Jign5zB=2 zr*z9ZJbN~=<-pduc`QHZ^pV77XZX+F-Qm0fV%sdN@Q8b+5}Vk?=U0B-AEy!91WfZi z`QZzu6U)P_q*%ewRVBn$0$b$fdtKYAQep+i`E={QyT6jy8em%Hbv>TCm{_!{PuKh4 z+vXEnZecgCy7~rU8OQr{NB#ZJHxs+j!cxcoZV@qBn_9kO58YNvtir;sTRik3Vq1V| znG3eBTup2?EK)7s?6W?3k=PDk%I|0Au3AT|^h6)~YWzd5659l<)|J6eANkL>48N0n zx^4x2A6tk`gaxa4Y_94xxag^KoOQrhK4?s5!yjKRCRTWgk8OOi(-vYo zfH7avO+I=%K_4VeKlvhpWE2dHf*s zZdkf~!5>qVbJm&vxRqFc3tRctxxXYD7tgz&*cJ=x-uu!gh;_>J z^Jr0Z&ojgdEG*-qHqQ~8Z(-|SeSQP6H5Rt?kjvgCw!^~KRo}RYSY|IjkHW!O-x4de zu@P@T;E?I}nz;$|ZNv;uDDFS=c2*&ODV^%ED&9wkDU@ zN(;Mf>USfEePLm1qcf%uI}xh@&13y@ediG?w6H7kuD*`gVhcOVd3*t}4Hj1TkC%F! z{Mm<2J1{FiJGMrg*y8g7ViPTFefMQm#2&D)=(P*4CAP!D-kUUk0kOP(KEKD;9q=n+ zi!E&Fm&=|aw#~xsF8RxI#QLA+KYQ1Oq`_7K(|o_${PqW=TQ|_ByZJxgYFP>_bC6HhrqiRX zh(!lWeQCIF{__V0yAfC(u36^Ji|*|}x=j`~Y1!z*iDe8C9Rah*sXb^!Ct^1O)3OX) z+qoOD+9)i0(7-HmuDt4~?&jGnzrG#&{aUab|Jhd4{@jCfnYli;`M^t0BNiR%W0`~Q zJ(F0$Fu%;(PS_G9w%Eef9DQI8u`L#M_li-u#7-RU^V`4U^9Jh=0cbtOe6?#h>GJY@ ztar|n`NSrkt-Z_a_g@u(L_{jytRsz#} zs~60hMr_?kzb$J=zdwgq<|t`5%r4HBdC%QMjDIh04X&AQo5j6vCKes-=liqe3vMGe z9~j3QpZ)aJzb+xR30NVn4?wJ_?zfCse-KsUn(el4o9~wsTMkUickq`VKS6BGIgayl z7#0VDZc*-$N4&D~!$`q6T%bQ6gr62ay(9XkCpxw)7%vAO9}KMbacgsk&9<_aoQ(e&U@qcN48uJ>^@v~MBGsIv)`P*>RDnNENtI*u31g2^n9Og{vRIyEiq@ZkG1&ithK}z1Jm+7 zdjIOziAAUQ`7Zi$^_#@L0H$RwEZ%=3vH2JH&tCD1^WG(vIn}2-apI|eC$`SQR<+(} zu);$B*-xh4`yJ`p#T;jcE0^ETyrR{c!0>l`yz;f$)U`da2P|xH_PBkC6%_e&WtHa| zY=?ynoA~M>q^m9V%QyY(VI7I}kNfq#pvUr~h;0L=a#?u8h;GDgobEr{b>W;GVkegP z*ljmdo<(d8u#Ij#{_R(dBA2SBnCJUpE#&C2VT{-CuI+U3%SacIKi{P)f-8Dwjr_bmxi)jpL zXUm+&m^8MWrdwG!=WNB>SZU53inp`Uosf2>CVzMQ(eaI=uN(04do7kefh7yWR}1Fe zcK>6E=mU3Lb>&;pdtMeawR*`l&wsot|L$8pKlSn(UyTadWy#a|qu&2G_r4(u3m=?+ z_)tOrcHOD-uiO5~=%@bsspq?W_S#ZGox#6&_Q8&q4Zmabn}0jz^o<#U9^ESY*ux*H z&A;ns{cd@0#)nr3+IG@2_x}1fcaFMc>C_JwzBu|pLEpc6T6 zg25lX?)Q^33J)k9zVyotk@?*dn+5IM^~D2AoCorjH{a$Ug_P}XMHFIpM1xc_iWqep}cEPdh%CC z-=7#J=$!ICyAHc&{IDB-e_gKu2j6*wpsP=va7NyX`{m!CwI<_$Bma7U6y~+u>+?IW zaiXj49dJv@*tWkF+RwW8c=GOo{yBFoiDr~+ee5uy-EnZ_!~Oa_J?!CLV^YcY2Q3%c z{L0$e|9G=F@0V{soBaOc=f4+p`=Qr#oqu%i>{VBd{=>a1YIu$^!jM~fz4N;-KN^1h zsO@LxpLXx@Ld(9IPEa3|((AANtorIy)T-l1qc%DFH1#PrW^*UGY|!Q2i+DBr@_3vb zfxiU`Em1cx&)wxKHF6x)%jBT*57TN3u?(Dx!~31n$)9|}AzW`=pOa4KZ05;mc8udU z-MrGNudZjo)=@i&Y1LoMmpTetqT|)>X65F{U)x#dTIQ+i9p-sBVz8b4jp5Cazsg3} zll`UYd|A=`E;gP^4IaFwhQxA9|`m1_^b0#jHueQ^C!=6 z&~~65!l3pt(`t(|t!r7Pbxq8)u5FmsH4@Xh{%4x~#{c{R9~R*{ow2;TexveIJC^yV z|A_M9x`BN~hHBGv)$Z~oZwB@MF|EEarqu_-wE6^?R-Xo+XaBL(NLsQWkKL6^`>(e? z0llsX`KZsm0@@Jt6bD?%RJR5$F%yAm{z|7)9SC$as}s@AKp(?F6!51 zp6ZKZT79fca||$ld_MGp<)QhiPo4bLSID&bahc}$7#pvM;q-pIZ|Aww%~x+-6Eh$6 zFEFisBg&m)#hXj~ues8a0eS7NU#J{({YrZEEikQqBrS*Om!S{R($N*pK(Xt^RtZ^&JG$)JI}Unw`+i z((Y>4=zACDqkeIw^<4?m>Z@a#HXp{I_mO2fve35W^BQzs(|JPu7`(6kR&4{zmi8u! zADXYqUwuu?SAAeitB;mtpse_9Z8~}K+1=Gw^HrY;>D7nGwEEzguV>RXam?>7f0eiA zb3#7qCslb{-(5Dlywxwrx~gB3Y4uJ2v*fMsSeci;V`5t0>oLuFH~5wD57#%^7V5iW z{b(oG^VM;)jBCwL-#sHMs6UeQ&_DzRzG;*ndM`kf+tBv@OX`gX(AU zWzhW%OzV4UruDrf)B0|TX?=gk=Z!yvHbXP6%eBnv*JeKKf5Agho3H=r-VkJA>@kcd z_bdT#NHr>JKFgqGmn->K<*oPhJ%J}b?<4-IM)Oe~`n$V)bZ-pv$v_P1KX01%Dw$57 zPA6Y|f8f`z$n74@Q$L+&b>9$Wpzjx%)^`hKL*pf7lrA6hFz&;)Awtv>z?+jrZs5&wOqQ7jrVm=4AZ**glT<; z&a}RZ=kt80UB_nyES)h9vfY+X%dY#=NKc=ry>{?hDZM zY(uPDSE~T&)OmOLtNozwUYWn{17KSB$1tsXBv>xKYjj@|G>hD|9J&XP`RSf7rgd)- z)4G3y<=~zN-;R-qIvtsiPdakZy_%%geN{~B{yV01UkB6NKjh6mNT*Yl-IYV{>HbjW zL7#1KzVkc856w^8LEnipKi%8GwC*2bTKDh#Gx~#$3*E=S{B++P^P`W$xHm$M*dJPd zW~2L?kxcn9HRO|9AIAwdAdDucO{CZQ+gN_OzZvu?KU(<#e0}};RpI*DYg7CE2FL@UvHW%4dEg-< zTOa8-?gEYms zbJwmD!uiQ{sDHWpsPT-W?~m1PBBr6S{Pmj`(5L(utgoHFzQa-5m-*Q1bbGF}*Bk0P zAib^&nAUf(Oxy2;cx{Kq>Y?9BeATKS$3}|LO*@lsc;UG=^9~)vHk&wLg*9&d{KK+q zEI<9;!Y-r8$wzK@;p>6(5#PS|3op-r4)aMH?I-#T3G3xYX{YvY--}(R{NFTN3pf-G%fB2eD+xdOxep^GPehl`@iw13t zetJ%SSNDPn!JZohk$)S@PrpwAb;^&y{N6e(Bg)A7X@Ai*0-kZ~_t>_t$KG#2Iy*F0 zF8!uT`!b)^bar9<*~5Qx&eO?*uR{B$hG;(^jXm}pXGJzKhQ{*KZ)iZ8@}tN>`Jb_3 zozcJiRerV)Ui+EO+u-8`rS||N>~`1haP0f68?XEH>GK?ZQXI#9`aEIAv(l*^3G)wM zlitoxzr#{K@+Nw3HuHLplw3rx)f;qbKk++mQB%J9f?W>=@M(P0dfgO+;Q+2##Bk zXK=o@_aIphHY!j3{t(Zk{20uyK0Tp6KIUcno9%anwx5S|c4$oQ`kku%495-ZRE`-p zu$&T=pURyC_WLV+LVuNBulZ|_qvh_muJ(P&3&;PZF>Zs;HQulFo6mn>zTdU$`4u~N z&3*hcnfsm6n?8G1_~k+GG5YOe+b2!Yi~45ZsqkF2?!ucrL}L^Tev^L)`hft~_kp4f1$F^K2|X?|WT0FUd1C$l2UKKb?e@|rr6W8K!9w(rt@wz2wY|57^say_5X zA;V^qMq0{9d%^7!kj3NZll2G9&%SGqGhGiV-M>n?R4;0|*uL}`s=WCAMALTNcArjP zcABrv&z76olS;>5?gRK|mWgH2{Fv5YmrKX3(*3KHOYKg(T=aqOiM+_8x%$7_=~}LT zwSK1SP`<}}x0|+jT`OYMpK{D^EI0KoSse6)aP^@G*zBzFE=$mJnGDq)4BBpu z=>cum=HjP%thxBryZ$ki+Oztq-fOP%>HN}M{8W!L7e5{E&Bagke{=EE@7ZjAk@`BV zOHkh}dtTFXhm?-L`aP)T!98}qy~XijN1?hDKjZl!;?Q#Z$%=T-@%cTuyE`_`{Ndw@ z(nQfIIW=WvW2#!?iqNlx~4Kds61X% zT^TFuo>5RU4S#(3?D(8<$rhrwTVCSP}2q_(Z^}AiAS0Axnr~CWO z*EK`F-7$N}Kfaw~+We0jHVo3pKJd!Ayuq)pA7LV|ZTi!%orlvQjBdqmb=LjGdTr+x#*V>FyT^^5b|Frf4fI0$aZmoq z&~xbDven=e`7wVEyqWtn3lc6rF}wZ4{k5Tf){x&;^Jpv|)w4?1P(BU$Gt=1sJQ|XFL+|s_mAjs|r}_NY<*xIrEe|~#fih*#dwO<)p#H!1I90n$pJ}dn zWl#CkS3f=D!LI>RI@jmrVuv=O1esITWMii?;<_xYm)_^EU4K1CQt9~nV;GpKq4cpOs$|r0W?kS)8=7F#t@C0HKY7dyTohP^d*X#da8RaV6&P28S zYOo;STadHnyN2l#DabLas*`+Rruu=|$!OZZD%pZj+iFS_4H z>&1QWVLO)hf^rbuL3wDfzopXipLkDgG^Xu6j=JZcyftr|mh=do-%l>(Uwgc(e^z$87PeXQ?WRIUyAKN{NiPFe9;ecqOx-4FCVn9|W78Sck? zR?l)!x`z1a_ZmvKr{lstyF$OSH05y5y=B_o)2H7?F<;GF{iCFHL!;v&EcZPf7y7C>?*p08F!TxT`-otNyKV#R|uA^P|A5vd?kF5Qj zkNw?_e&@(Nm%1Mx-v?k%{?`L_EZN_x+viN$=e8*=<)FbHpZa~0((#wyJo@WjeX6lv znWs6A$r{wbyS3f#!{qt6TdloH+|PLN>SI=~jJ9z1RC7OVx*_%4h8M2EbL;SoMt`ob zx!Cm&`$rn03%^fph%RjBG(;DEFVPTPSbsJ|7hdl+L>FH7G(;C(FE&IM_O~@e7k>ZM z5M9`x-Vj~bkJAuccwN&FovoK?69fbLlRH50Cv5^j$Bhlz{Y&>f;eN`Gfpr3KUQ1Md z_8ENkxxL^~PtfP<+yY;RQHviSu*<3a0t6{PlCK>!A0M~ZE;i-l8?py8o-}#%5Jvl+ zn>JpO4X&VE^;65TSuSV^Ux!!7&ok6 zKM3FTVJ&Ow)~Fq+{YA?qzrI}jYmu4uDgFL{_w6}e=$rDd@Wm5p$x+7(=u>|5%R6rT zhVI%2T^WEZXoDNT{inIwSM`U@+sJlMXBZa$5+uj*Zw z-u?0O7l79q1<`V8dk3F)wBHUvxy&~sez^?qM$4u12Kc5J`3;JGhvMg@WimVstmTsT zn@VZETl8e*%B(kK#<9>8dFeh|mdTHP{u2lE#oU}4g1?VzqPCm8uR?91U>UWn{Pp?q z3g4ovqHTmEqr<Gnd#jA`j2n~>e>MHZuh}p8y*G$FnKmXrwI`HwL-OMsQs4X${7#JWW6(0C zhPd;`z^0C4wXevGu_NZS!qB|Nc5SF!dQJeIMc}-qvXWo7U9EB%!baOw_alQk)`|lFiXXn}H zFWYDD+ULRAXPw*U;_Cb^9130bfQ~x_rA*0Ly@rcm-=z+`%+IEQTh7& zL+x*0)t^vz+!-D$AHxvrfrQRx&^^{(9U8SK^?MCI>_?W%3n}sq&je&zSQxZ#z(zGrQ@>fe*aGbum% zJb@7gKaGOuSv2+V*Sz%?=OM8_de0lYp63GXt^OLxP0sWP%@6gKOYJ6oPJY!+HdoA_ z;c?pVw3C~%Zq&c=YnR1N3u~<_Z4wFgK4*Jxy}duy_7m81u<9q_wEH=!SG(@6&NtLv z8#E?w^*`aMlpk3SJNWfdRQ(5G{>?S+)&HaU$**6oZngWMzx(BC_@*II0M3rk??$KzduxcpmhYFQ1JQbji#=zg73{S Tf4B`BZeQ}Z^+@o&qCEG1Kt=w7 literal 106548 zcmeHQTXWk+mVWoI;5#efHN67eDm=^6;15GP`~8FdHww`NQ); zF@5eiuKVKI+1VLgbsfj;eMf&f^z-c9JRfEK7teaV>F2lof8~SakKUYhx0o7md{`G_$z zQ0_J#iqEeHgd$bAPe1>ZeSMQJ?&KFZV&%;exHI^EI9?WWiEw=3dT}vWj=$pD8=&L* zf#>;2?3^ZaoHX`bC&e4kkvBuf^E?3_&-G&0@%_|mU+cOIbr5+RBu<)0d}{#Z`|<7F z@_oJlEfbKA3PsQL!_;#&p)tk@J7`Q&Sd_#;8bzKUn`Rige#|fo0|Iy)w8Q1q9F%rk zXoMiDIB|p1qA7-kAGuNN$4R^il|+#ngEdA%8Z<)=yk9`hkAfhMgP?;sf|&B<<->A$ zY-)<)FbUlFL?srE+mD^^)@slt~oDSVU(t+cHO(k9& zcPM!g^D#F}LpqVDgSwO!0p$wHpqIK`(h3yyIv+`m@VL;%tHo)OoFrL!1ZY3>*)nOC zMGD%n7pHOT1s#YXq3uPk7kLq|sGXN8XajvhsFwlr-FCtzXkQg`Fj2MwjtX;VQf?AN zr%B-+6u|_#RwAv@ian$Zu41wr-+##Fw@0?L;y6xHFO5!2E7W#ykU%elJ>0<}wWXDU z11DI$36F%bApIx|)5s0N4wj|>NlI|w zr_!U*%v3e|3mu|F$7$CkguMSLy~) z2XPg!x2A^1d3>i->113FAe-D7iozUn2STp0Rn<&2aJsQW14gk6*G<|%jf%ot=pk_w z;?MQU2vpC=O%gBNfCUrTx*l|=4W0|uhbJcRfUKzHxdQx#8u`I)5P>>WG-0+)4DE9`w29;p!IbZSm& zHba3|5Q-6)Lp#+f!^FpHMsQGfELCPGAPyTe-Na1?{_mxJ8ZpG1X;$$VGHm0}3z=^; zs$+IotFGs{kpm0hMAa~G93Oy*qYd-}j(S!)Wc)r|r)Sa&AmvV17ZXj|3f({0* zS*-*86F0hR+#B{ds@xb_eh@{$iBY10q?=N*2JDm$T2zokR3=IQ^i4D*5-bjAx5H0Q z9!HDvJKO}j#VdLz21#WAf%kcUWR-GE?)RY(UizEjVSZ%kg}6VZm~4_sL+N}f6U~}z zH9rnh((^hvnxYvvK^@Ab=?a4>?g!-&*-*5&)v6FKM5~Afo@+!FoD(w;rETG*4uq52 z6_Hk6gAkT|2zPcDpJZ>N?}7>uf~xt0O;Y6i8_F&`suq$uu@|Mtr(Ev>wuufU@F25d z-$&BxT9*&P#gJP7U&m6ZMS@t7f&gQA1H;fqdQ1?fu3z;6n1F_{_ajmmCzQr`Tu=va zMp8`ev_P%Y6eLfD0RsPj`+*wd!hdX9=`NO4e^*tB4Hh2SOGI z1-FM8kIoY2PiX$y3|2wAs|)=S%4T)2Xj=eN*`$pP-!?U)#zjv z1r~xq9^2OpWh$oB1=l+*04mxe)zO2Gj_FAsw#n{3UK5u?0iPYr4h0+ma*9sV5rqJp zi%grScHA|ih>+Tn!%mTu0@d}zG;hhCux}*iMyz*h+^!zBCAqnj|Kum66rL6zktYo^ z-|>*ASyh@EPWt%%RSzjj$h?eBGp-9&301+!m+#P(lv9pEz+vce0cmq|PzL-_gB8NL z8g-=$YOM;1cM#7|*GL1?RAowx(hqA(k%8}|D1w38lIsS@%Df1(ox3ki@ z1Tl99_yK`?TIa2C8#Ukv79o|eRaYppK#y8yOzsBYH4?8*>!c-SQ;QfF@*O;+>N3$` zwx2}pZV#jxKL2Azsu5I23O7#SR0To^BMcb?8?>^5 z#e+m~6j!v%jA0Yb) zbSQ(OTDvuME<4hFd^oSLRb)7xrVIkNgCie_ckMjP9y5ZtxPzRd4ZJaoDRwjqQ}P~d zHqg5R?b+I0U^jz&miO#nOCj37pvvo1o2sBm3OXHx9lS=x7=siq3TIZwQsp*5avc2C zD3fkyc1n{#FRKtS8>IAauok6cBm+2KM6)~7IZBD$7I;lU$^t{Z^@*`NY3~5YC}@Ej zyd5M8DM*Pxz_2TeRe8aYLlHZO&vkg{6jDIUI{}16*JIUM519=xaU8GRJh-g4Ksc(B z2`?plmGCK^mMD~Zj1PFHzN~!HBxq_JX5OhCEE)-d;4mkfCI|N`G(04WucyZVy=;jX zn4fF#R5)av7%YL2?;~!A^3~I#3azvtLl_0XC`M@KnL30NC$KW1plu``5&VVnyh-~I z(VQoO6IML88TdzUzDfCi=(v`grYjJoWg#kX5N&D)vkEhz>n%0Z>Pp{|q7iD9=;X3V zJ1v-dK%WqVLOW;#av31DKodecnGlfy|HR@)QWK(*43~N=tpzu{TnH(qZWp0Ss~yF1 z9-27dulA=Z?FN|ukhrL?tJ1V7Z?(7im|6|A0))Dg_%wSWyNFJpYnsb_jx|x4r(E^$ zTOl(8FMyKlpsDF;%1lUnBQ+t@(3E?J|Ish39eB#11e_gYkJWl$m1p(^ z3y5XLN-Gd6OyzlRU(P8Y7MHIz5|!aui1IT!>3xZh!L|+O zG~0+Za84=wDwB^Yfb{oNS@e_b0wiTi^Q5W`0ZCx}{h+5PteR7HRw|new`w8T>g7rh zWaTp2mKvF`#%1;G)v~~*1(nQBV}VqeYZGQ#nSQlVbp`+SRhf0Aj9vIw)*rRvpK~6= zp@y~*4YrTIX58Im1Cg*!HHU|6HP##Yvy=lY5fXf1X*jKy2FgXm3+xAkRdf%mJPRptSY`Y z<@&HtC6yTuHVACR?BNe;5QC^);h{mLh3hU7d{4ExoNZ$lENS*4PYg1Sd|&b-uzdR0GzHG90p<4%GnBpX+?kgk1EX5{&;lfmPuxI!4OkdW$K;*hpK4Yjqh%x z<{-leKc=7*%8vY)cchinCfY=oE~9JZE-DXCvftTLSZ2>y23MVv)C$)M#%|=XAm9YZ z6_UhgJlRltu!h`M(m<4p#fLR`u92+>uvTWy8nSg?9Z0u%u?uE2;gg%^7$;k$#ob`` zSZZoL&Uru(B`S&EE)XHHUzSE35JUiKyA=V-Vf#H*s;aU&&UZ27t3$W85^)vWYmjhy zn5|tPL#G-!BDfu7d%4fFe6+xSwy!kPs;*ryESp`m!cap&3a51fjWkK|gC0ikL2;0h z1f0|!jW05Un=5aViYEW&vhC=c3qM=BrP5hidi<3J6WtS+xWMR*-E=fTl%gJk%hz($a@AS^l!I*FV}j$gtc-#yKK${38P4Y6kzE+8ofjgezCcQ(M*M81-f zvbk@pZ8Gya$#?qex@ z;)52x;9X(Ls)Z9L%}Y{ zB2yQsrGj0f( z)si=_A?-8&JfdRg5E+6@=B2@^vIi5&9yGqt(5I#G>T+U;`i-?TW!Tm^!5Vg5+AI8( z23+?vUQr${N03_vRXy03fEYN1!HD_HJJE^N)+{7Ij1F38M)X zV*Tp1H`y|ukF&|5RzZXYp7is)cl$7=-Q{6Iqn7j0FvFO8P{m+?&f9}1%!X+{96j$X zzun^tWeLj-l|l_Jv*qCKdNwNP*}dLqJjcsD^a&)qwO((*zg`s&R8Yj*HEt$4HtLn6 zp&;JkVm7!d%wi^GMd&m5R7@VG`P;Agd=6l*K1Q&l>zO#TX?Cwb07O{i^RM~GPx@T1 zZ)e3k|EZWyaZs;{`PE%EU%t$je5h*Q*VFrAzRYIJAFkC$H#r@AKKy<-2AmiV>GiN1 zPBDBlo{gsuQ}Mu?@o)G%5ZHL}uq-})dXxS7a=gGJ2e{yzbE%%bBucSf^paHEpz2w>4V1MJ;?d$AYKEHmcH)(uY`%IS;Nt@E3v9i?KIvT?~JXsmfyzz;~ zh~%DV3`BccG*-?WwT{M+$5`>io(PSl8A_Mj%y*)Zlc4#nmw6*+h*5vZ0OPsxVMUG^ z#$`<$<}L;h4A77kx?z%`fl!tP{WQqX3OMNZM@UD15{G{-afk-Da`=~Zq*~8uJrPnJ z4n~9iV32!W-Vgjykb|(?AqY4hx$!7|qA~cH{%kacL8ai@XmDknSr?*-Ek>lNq0vt? z_M~#2q*;enffR6#(D}$Z8mr}bp9+onkYqtR975yFqAUn9bY4oFeh_78(s#2zs;d9PC-AJ=5J#w2 z6X%#oj}>v`;p}#Jb9QnfI--{@xpr0uZ9CPIv9jm>WxNelBZ4| z@$59gRNj7;4P7`XqX;?s9M5jliZH!TjxVze3+h$UwKF&%9q3tI)}4TwmiEYW03|y_ z9U{t@EIR?mgMEYq4K>u|(Qp96ZGD9QLX4QF@32TKs)bD+?*yQHVf0cMS!W^EYL;pz zP~(MZoJYPt8b$6X4e>IgBp+mni)<&)?WY;?)H`?~8oXhu4D3nUjVx{4{^8c zFjqV#Cvcb%4ZV%f-^8}VTnR~8eV8=X(Zw9W7}=kJ7uj~0VC5Lqh?btRJHVpd${ciGo*@nDDbg8|tTB=V${k5Q7k_5>llS&M`!+x!_J?eKo9nXVx3jB<$wXA| zqFi@&i=u7pkY42-nSYBVc7ByjxRRPL@UPsvfEIp0jWoaa$Ju!K?fcp7c$S}kygq-E zExu44_z&~!{%$<@Tm759|B8n{?^W-5F226klh)_o(K~_ud)~v{%ZGXX_gVh1oM)5g zy>}1&$$0Qz`L_?nmwfj38Qw!2?#=ytOtr|mP8jMEAuyi7FzpY5V2D_6?&3tz*Lu+R zv()!f8W0sb?m(TbgekqBsvuTn)EA3;lt8Ob;TD}JVq)r~Pu}Fqy8>0_T>DI)Tuiwl zyj*iNDF$DD887e!<%e%!o{wkraGAJPBSXkDs4V1^wv7zyl6FTj1k0`fEEx5ZQ5>aF zHbUSAW1};`D?#7Np%aYKs1C3ViIB_K;o*=S6TFt=jxg-g3o%RAy5p`})(1LnC&`h) zA19-Jnj?G`NZPJGG8 z|DhUXy~~C}RQW5C`)AAN|I_mMKSW=I`a_yNM5_U?rH|BHgSSki*-VIN=!)=23a_|z zgqUDhc7$2kQnA<-GblGO2>k@jiyl)R{sc|pmgfvh>GP(b<`&dWf>4Y}_3i8<`dMhU zE-=Kr`m*>1T(kZ9>wIJi`<45}py>JoAm8TMOieXry#an->Q5p!#~n1pXSf*>7`7KJsDZIW7V(^e8MR%s)4N7Y{Rj zHy=k*YEgewbx%m67Ei$6=ACHFAv(8Ic2T{v^=+JU^sXdTgWgCy;0;9f_EVvibnmQ3Okl^lY#sa46+~RX3?l8HlPhbT~8I7?UtO zN%c_fpdo!xh`L6j6WgNZb3l2iBi3n&LCA`Yma_CA?U+fH;mn_0%x}@FX10_^D%N2k z_bO5sjrWj1ZC-Z)l%Dn{-zXZV0TBlJpUQvqWZZ=Yl8%3Clph4otl=y0$ z2&+v4*j0qpbjhPCH(rv281m8R!* zV+JDNF*1Yf;~D7RsG+ zGNcZzJWjZb+pWCM(GCJ`E$RP2Cs+=dTv7}LMmoCybbDL%F-4)+1JaV(NWP29F`N{= z0KiJ47^Sm~4qreN#c`NXXQ9Zg=Y{PG(VDe<%*YF>Q9VQ+P@rw09IF+m{}GNGp>Kr0 z@u!8yeIS07CQcBdk21x`MF;T5;a4BWBCx~`Q4Sfr&qrw1j+WQ&#=qv11zfQd_Es!R zEPn-WF9q?LtLYow=L@v_ratHJlp^~YX{n+GKAN<0T>oY;&+{2l3I=!PH;NB_9uJpy zZ|6Ve6kJfTvv+sj7UMxS;T>?x?pJVF_Ornke%Q-*X!f1*)Q^|>D1#rL-RG4H-)7l# zJgB`8-1$wOMxqxVTB(hmMkhx9gcO}}_wy$`DWy+Jsr5=}>QU`v9NK6brkKDG$Easw zzIGs)>U!v7jW*VK;O1!_pi|+<&ynPnW=RsmTew>`!v}^`hFD1p+jP{K&N#Ctm5Gn#_1We}@D!{}LIrldDzkL4CCzBFl#)S6?7{ zJflz>iH|1!>p9?ZNQSi08VM-J0M(4D+t03me@a$(N>^ zBRqPt0@CUz#XXkn{wY~OrX+~mk20;`DOo}0pL>{05g_!K*yw(NZwM_@l08M(lL_%; zLfCFXcn;b!qSC^~G7y*#L5c(bSGq=a)FhwC@QDnqCqtdIUVG=e*sDUgz zITbnyS{3C(-|4HftyE*N)0#{a8fvMkvDkC|NYz-)wXhni-c5Z+X;@Fg zIc7`{T?r!;JtWkP%eI8&dd>bH;*i0L2Sney zr_KX^dH74E^MI#4_V$S<^yo!6AwX->CzDeY3q!U&H2@h;^6Qr`di4e%Y2d|9=45f^ z4>9s07^d+Mb9kfS2n`SV!;$4CXXsG2fI~f*ZL@)>FpMU4v`maWfj&H|T4JT_euFan zCmoWrUhHa{<3$(&ONeP<=97bcfhA#7(_X@B#Zi-IaIPgumgISskAeuTqoV$(AA7^R zKk)R7*6n&%T|6uc-ReMPt6n`Umc>+mY}i=aQjcs_bwMKuXXq_=Jt$^vtsA&xo*G`i zOF=sY}9OkXs8LhLw!pB8nYQa``SW?!?#5A))|>?MNnGSqPh=64Vvh7=?c67=mx zg96=XL2E(`Fj{t1%$6BCUm=56=WKbhtBnig1Op{})tG@dZY3LEs*z14Y`J6ku1i^$=m`XA5w)yHc@H9FY`(E z?J^$~b9C*I7tWirdoe^Wbl?}a(Lk#=Ec_$5<=`WNkVSdEeHuW$r|uu&xJlWH(6_-t zx14{NMo&*}IjcJuTI!ZdkqZJ#%CoRysNTW263)NHOd1pvt!6Rp;9ekks>s@JaL zI#Be`GZF8k=et%McYX{76w}<$P1-t-fsa{pNbE#A&x3*^c(Q${Rdec6S(_T3+HL!w z_y#E$AYAD}ZL@uJ;?ZWdkB7lgVSw(sl5MrxK8~aMX&%D%sqOOdY#%@NsHhZj&_d#> z&9OO<6g*~(98A^^9JF({@wic19HL*Re^@`xF-41ujxFdXgTGot3tk!g1zAw`VSl~5 z{(-Q62%i!n(q8QL5kp9k3>YOL+J|HEdKBe(yql!InHI(J?tQV8ol!aG;DcxiJ2O6J zj}5O@y^fU^POdgS=G9H@Je!IH1Ba}4R54f>S%53ePm=V|KGNTzIut$L7kOD7x=BfB zj7s^$j}#y2E(wL)26_4r^(;3xEeXY3Q#6Z3&sYmd*T={Mj|!EavMN@Sl%D1}{E_B4 zP%IbZize%T8VQQvdzfM9hTD%}Fy}B1ylfOgb|(H{6r?)_rfvrLEbofKAW9L(9*PJh zqkJ_-$mU%(%MtQe3E5!iahOIfj2GsrKW4MxByS6~pna1T9Cz$j4>!J-~q4F^+B6>528 zDW+N$ly#vk3(AIwEepz$ww47@>1EH`mIY;do0bJ-3L`B*({aK*8c4u+WgsATg@94X!P8JZdCZ)ffXchM2XRmN#f$m~mbz+FAM>)w_#X zOq#G=94Uo(F^d7si_vsL?)}vq>%`V+J594mcsr<3K}}QWM*3{c`}EE_9^kre>Y*x1 zT8B6Q!F*nhztRxljvHZ8VrVzqcl>4_uZhbce%s0HP(Z8T+U}v_ROby<(lyAY^R6mA%e&UUPL;}ecWYm%O8N4Y)}Nft zXx7A_F{lZuk|N;wKo$XTkndtzTQ^e2M@<2xC@WpMJi2vvdJY=Kq;M>2QUTuSeKsIO z>6|fWkax-BqcO=#_8TMqCrGb$+2wH{d`Yz}J9khNVF(ny=M5U_h&frfY+Pi{Rr|h| z+^md9{9^boWUHuVImC>Gh1TkqEWPLaQha``%gaO~;|!1x!;`{GMFX8Ls>2CO2a6wL z>fQ>wdUk^@m$Q6W$#)U&&7Cie@pkMyKzZCK>+?J#USfbuf|S>YVIwn2{V3Tb*a7iN zx$XxryOn2%1!5d6{GX2U8`s<{SC~0>bC(T^Uvz6u;9Wlcn%6#kQ&5w;PZ$tI!*wwI zj6n06Na@|Y=;t37*{z<#hVFP1EX4ZNYihV&U0175*vldI(9SbShETsfngW-Mg3-Xw zfP@<9%A4QA&0`$1 z1_R#kVm7!FQ~Xp4le}1-!6$SA1RT%@bq zVJaTTM92g1C~xfJr#IQJ7;}S14hWV=Cn6y0OBb_Sns$?^1-lsji2&t zZm>V}etn&N%jcBpD>rF;TKnwn9I}=_Yv~6&{ruk#*#wge)tw*jhe$;G`7WQm9gP;E z+oC#IMUqXZ%SfR&90;QoaX{I55*|a>Plxfq8^w8yfrNRG=luYq9(_Lx>+!H0S$KX8=3aP_z^ zE-o+CI3YFhkeX6*OG^6E$P1tMetRJ{5MlB++A#=yhv5AEucWo$skj5YL$t9Je`7uV zW`6l{JYRkj--C@yFD2Sd^uD9%p7=reCt~1e@ep{=IH08iqXKJ=%M8s96wRAY1K)QL z$hUCwaP{jcs*Rh6b%>ZEY#|FbZ)QR@ZXV_o8cw0(pM{$@`{FllK1FX{vd$w5H*Y#? zn>G)#2kCPz3|b2}Z`QRoZr(#ba468|hHD?UF{_>$HxCyU1{Pb2^G4-l)8=9Q6Vkvh zX5q;rxk5MmYTP^~36q}z{f_NJ8*@xjCOA3m~p8EQvPCixX__bZk{wnHSY0P)@f%FK!XLqMhvTz z+)mvSZ*c_^WR6j(TAx>z+XMlG(xibJE0&9{=;-o3g0ZCR2x;~%#BfI_^RlggwC1EG zqZTV8ujxT@>E*-VOTJ_q4qo=5ba{yHzreI)GLN$fS=l++ckmrd7BuS`1(9;*s$nLr z7*B?wqy~cGHSbXqLR-}E4+#G3o`P~NhuA%A_MvgKWKK@oJSkbL(N3&~=u08DK7`-e$B7dG|c$FVZJ_$_(g@@{rKz;NeX%N6`e z@>+%i5@s8}k$Ej2HXaNwA)G`Z(UK@f+lh*F#$Samgg!rq)kuhS9%?rj(8|CqgdBXN z6nl<+xMgZ#!e@0*+>(bS0JTtG612O*;NKII+~H+3f6{r zU-|E5?u7yD;>W|(07h_L_pan*3bEVx7^zAKo%)`I$XA=PBS2D>krm|ILO`~m8l%|8 z^3jbFvcw}UfibcPlnSzv;!)>-aw7)%vA(t$`pLTwi+vRYt;tKqCdnfWEL$%xqXbb6 zBoSE1)Em-wC za<6>^BHM-ga3n(r8PZazUyWDmGLhm(EaWy7g-SH8h(vkpZK^#2Iw^i=lCgFAnCaR+ zZKPr^#y&`8fUyCo8n4!oN<<|OgjEI>H#sAa;ROvpiX#iL%8d53U{zHBI_EJ;o}36u zxKQ)uZ%kV>_6KK&s1JfU7wQ9fQo5o7?12Ks9dch8n~DIiGvV5 zyA`rHve!*b%|hHfXj@r{1l!ufUXaEu@6I^_CT zRkb8EU||_Hr1WuV8xn?HgGP_NOQ#}Zd#g`lCC#mLiEV?E+pG8zb$EM>$}8yD!SjT{ zNdge%E)oeHSDLxoX#8c5A^Q*z4hj!#n2;rAu&je2U<-#6JV5F&gn;-bu#Z3GZLC8* z?Q^8%4Y=w1$O}gvpGsX>!A+UA=_1w7Ptr(k^uQ*A;W=%R%cf_wyuJ;FiWD8VJ9LW9 zR%nUzax}hjLK__(2nbL%cn4pUYK=f0Q0gPP+n9~uPhycZ{M<(%bEs!Cfqd5DUu$4- zS{^rCTS2bFxz`Levr+5w6Bh-nAzIQ{XGfi5}2761*E~b zTvZ3P!sC?dtwa9qZ+kQ#Sq%ZZ)j=UxNz%%n2od%anQRP+6>U(NzQ9`{nAL37tr%aB zL`b2aMg`WPqM1X{Vu1Yaj8DP_I*_3w9x~3r_b7Q3&>YO+{=`n2Qy68$mB*< zuWD&X8H^?kafG0T)Eru6aJ|Ozu$G2t#7dV<)umj)$vW?oSkl7qoQi}u_}kh@R~cEh z5WP@ygn$wHy04;_;o75!vcL)axwV^be_Ydw9LjWIuZKL*q`~Z^Chr^tqPJ>T zPQ~zWEg5M6ibU(7Vo7_IkTciD$V{tsmQ^ZI zo?*)0(&FkAc~7NvUg{LvSns4=1Y*}MdaX&oTag$vWfUJEXB~aj%SQSug(Cy&Z1DNODjB6%aD4_dFhNlRK86` z+0YDg69w30gEgEJ2AVMWOJ}@frdwg2CP@1*4~=F}Muxs;?K;WhVcrJ3Poa>fg%06z zgO)*D55YaZRZpq6@L9puwGw`t)I>=VbpdZ8+pbEp5bS8eh$ME|0;CCTwSJ8;Tq(k9vlCHD%cBab3Q&Ozc^7+FFWHU~W-0wul*;bC=VD0o=K=Gg|{K)9N0Ii#7!{Hj~=L)}2rLVifD z5(m9W+O@>P^TWM_t)okU7!n2#I{+>nl!rmF%{G{8^l^*dy3Ed9!8E2o;XZH52P*lseR#$b zt0Sbh@>?~C%0mT*TGY8N_SK@EX_qSPxk-Q1x=G6dWM|0?t+oX^k-B9;J;>RjB35e! zD}kGJba0fwO-m}suC_~=n`$5Cn?09WIILx|x=gMnq^uy*A!PNb8OEh&)js5^k05Vi zt4vfJm))Y$fdrSz!4Qw#(C<=ZmD1~6X(w%PQhB-7EP92>DT|~d_P2l9WtT-Fg$L6^ zv!v(S({mr??p}m~Tq%cYT4d#0wy{S_Nnj%yVnS~mN6KU0fQI| z!wRY3SE`JfY{kA(zgppozent(qJ`G=%nDjHqa4E0@(kCaT}ZuXg!j@I5-$5(@icKE z7>?V0bj=|7i^=^R8u75i5J5+J6VD2L=UKLl2 X4p7F)AWkDk2-(8U+<8h){4O55g?a?eGkSg`<*d2-e8P5*qCNqj2Sm-{HW0@r#7T==}cYiscmD; zyLaX8DsKzWDl}P z856^Qw-lTF-7%Bz2Po!8ri?iRk@S2%mgoH<^HcCS4*8EGvQ&Ad*t`Iarz1~30k2{+ z3j8Ml8;IB+QRs`zbHJw|PyQvu^SoCa8v{O!#0U6zKg<79c!s>mOZfCNbx42Sqd&l> z?{7LF=Q89e=Yhm+ED6c^F$Z_$E*6h-Brlls4Nw(%dFfG-bte%2IO(NH16Ye8fa80)*Gr0~IHMvBl zF_|-M-aS5QmM5CqlP107^U3;LZE|T6{Ogn8Tbpc2FHbg9rCZw4ttc~V%VOywFiFzs z-1J0Ca*ll%Ky_B`c~Y`9Fci*Rc;o~3T)OVOdv^YA)UW?|T7n(13Xv0iBN}9X70z=| zMC=HwaB!u|x<-{+xnBeSCb}*Gepm1bhJmT@89NKX%AFFWeJ?T*8V-=3YV^%?p zK$-)dWmF1%XyQ}h2rddx6%-YY;#7({;Hhu~?`KLe@FpYA`Z5YG6G7`sg`>DzUn(5I zMS;&mo^3#d!$8GO#dQbTf$~$~n7nPbko;ERR1go#Zxs$6A?_-!K;a1g`Jf?xDx5<6 zt-`73&OcB%Vg7-_iJ1q{K8wMYZ9|2_5FHPJ!U^|dpm3yp8u2XKCr~(o|CeX@sBny_ z0Dqat%aMyAs=}$M$z{$I%R6;tF4>yJR4&7;=ss2bNoD+0O(K;s^*Y(`)XYRjGK1^< zMB}_%Ce_-=`BiU~!|cTJS;=gZQdDOv>vO5)Nh>^BddSbtocrRbW9Ps0NXwVbDydm@ zB4k|W$(lodhvu8b_io@nO7o41c)2%ko%t4;|G|6<_jfSgV&-??!+Faw&-rFd9DP}2 zx-dc~AjfgQG3DZCAV-|@&Bf0|jyUI=iw@%P5ILyTZkOzGv`|+BHAsaFF4->59hu)oYw@io1G^^G)!Wbu^ohXMJf`Vm5~DLDayj9*_Ik9dGbHb;+?E-Xqzc z1o4`5HsyH@Ha`y-4R}>ks<{F78p&xe^j4YBV$aDm*t8{{+TNVZRJJxYC$lqBa4c+J z@7c4yW%${t{96kTy!-Y`ckJGi9RraE7fJIXX+kO_PrPRp!s*hJ3SrZ+$)hHFBrr~I z-jgofyUA8QQIoBFT$8;w6{38iDn$9XDrBa?RDdd?e8CzaW;!uN#(8po99IUm5AiCS z_EZQSRGcP~d_;u=c!P(#CYyZJ^jH;AA@rP@Uk5#>rl=6&;i)Mqgm`#riV6{Ysxvi3 zg%FpisqJG;ww0})^>wvUGq7!lY==`2jV(9ao@_tiAMTe^eOy%Uiyr?` z4jxDQ{{=Y5$)_z&UNJ*F29Wq@;uXfw9jZ;XLa{-$^~f|;qtCaiwaOOgw+iAGr@Ep5haP=(-GiCi+1N;GH9JnHQF$%$Nj zQ+4aoG?+w@rKt>rXkWrAn5lW6CFL z#+1*2kgL+l8Z%>YEkooq7Ef5@r#= zToLl`sSnlbjP{{=i|k)%gT1>V$|u@~%BQz|sC=S*sC?W$?1V}TxgwR6RmSq!Xd}uV z^kK|2!4$p*oEZC%K~0#J%ef-;l|I*U>56DOM0XEjdCMoX8lWpe6&-asdb@it7IM<1 zp(_&0=P751zjZ|_h=*Mo)&q}Pd@jcF=MgElxFW>GB@+|q?H+jTRtH+H0_k4S6)`3b zYVrE#AjkF;S0unuhQ-Ad3GjIyF0M#`FYs`>A~0%*F>?;mNksO`P(+4kzpx)z5902s zDDLAi^97{WB9hNAM20Azz!eGeIo{HeK4vx`{X<0ZDMe(6@)1|0yFAtvvGg(Xued&g zNIrB$7@~Z%AENaVS48A_9?!joNIoYcGDP{%6)Ds{BYiw(-a>jHh{%Vo2t$;QxFUkP z?d-ZDoOcI<56hz~LZ!-fqbpttkmGg?aRl%WjoZ@%1|A-_)W;0O$AJgOE#*`@rLMTn z({YxT^x}%^JRR@jGR~)f7yjqc&6kt%pX=cq?<#*6%1i<0IG;!yq4!=D4gCzbO3iea zpxvw5v$=GOk5r|b;k;x_qgi4S!nSl?TPBrD(iBwEinPM9;9i%&9u19z`go+A+@8y& zTV2#6tV*;lPh_WO((P@ebFv;mbql;V-m?2?wqm9J4!h!2>DF8#)v6|~REi4<#^du= zB-+R#JEyg(IaR+5kYCH{T(Skb@Z1tCot{awHKpqLERr2rF3^!^NXb@yCEO=exS=+= zJeg<)(UfF!qGNIr`~67|v$nCHS@)R%H-CF%zvhzMoKe)VP5+n3zDa@W?Iue)#X z`g@z7z2Q>y(|8y#_H&%@3W0z9n%}zNPSFQM7_hEJ_gm16-ZMzh;0;nI`Zcs zQdiM7GN^7-T@@_T<(04Ms$iL3WXNYJBKZW%bdg{A&^B_6lfSE*UE4@L?TF+PM`Vb~ zGt6S$`M9=`e7=N8KD3PtQ9iVdh2#lrqbzgRfsXA)+sMH2*@f#y#2JXg5gFLdb8l#4ZoEmv$~z(>pFcy#$_xg4V|uH}kt4ESid<9&K5 z_jRvaYa0u+Gi{^GU(2O!ba5@0YZMpPa{s}{#g}{sdG;4~h8fuJ?B9c8f=?0{c+3n1 zb~0iqurePnG82GJL*)1@_wn$2sQ?ZV#PEEn^l{;HzQ<=WaE9nOud-NoK2v;L_ND;JFaUdU9EaxRSA)d_ck7k(@e(_3SA!4v)4mD+0U$TP6pC*&Mr4QAsjr0}74+z!kLgF?a5ULm5UBTt3)QjNHdSwwA*#2E8 zX_trR1hzQ$BzP8$?M(Y$NS@{7Q9(Xoc~%g&F)YtYA0J>};|wkqx(?tn{-yno1x`6H zB95T?>J;FVhwE~YC#+AtNZJb0hxOIP#BB`gt4ln*w`(#S7)Ukh(V|cW$AgmIDn+(< z6HA)y(nxZ1S{HEZSTj@7EBHE5von)RxxUkEt+(E@ODTCJY1ev_o6~k}WHa1*mR;xY zI?!1<@z4>Mh}`W?X0t&So5>WIa!tk zi%x&lmTd5roPODUUJLgCS+rr}e|{#_*ocj5lwJsvx_U&Qaf%8+ubu&*g#}1;E7rw{ z`Wzde`?7MrJ=o=~GmR`&?UEEb_RD3JscY04$cjyQfK`d+X1hveONUS_Ttj&fkXYBV za^8!}St%EZS;<^ex?wgp@l9o>5w9Z1zP`!63-I!6A$d|Mx&f8w?Up6Y9rHWdl9m^i z=&d=2d|Gol;pXLJj6*Ovoo;rrlv)RX&(toai_FeLHl()v(2SdKz``dtd}Z#W`~Gy! z&Cf4edi>d^jqd!V+3_Zge=!sZCt%-Vn(ffHn2uHC(F*TvG0jB;jqQ<$3{mIklNJ-) zHMU$#ixG&~MPU{4T%2(+ZA{$q>4I6Ib4%kRi|GL8I3|7!qAW_n8`(o6IGs|`%VL^* zq~F!~jN_gBc5j&MdnH**CP@?4p+g8%@2@#*u#(a@vyU2>f>Q&?F8Zo zbk@j6oi)3d&J!;&T(~}u$aWr%$PjhbxR{pq91z+(ILXJwS$he2%6~GhB7fLfJB9QW z5E-I+V2Z^A zcl(ixX*`N3n@Lz~!XHry>(8-8Pg*Z^eQxsWYkHlO?1@b(1z!CRJD8N z9cK?(8$-TMJESNEC2G` zIVD@SJ$ul=q^t7bhFduqa#P`o*n4eskqqi`x zy`?3Q>0lPQDamYoCe_9xnHCXqhohaj&>Mc)BAJPe5Zz3{)mZ(n(7t++FvZ*Dh=2WgjFhE|Ld3kH5`%)%(N_E7I`?$G=tJ#h&1VGrWq7pg*0(B)4f$kdYD?~HD(tM zM4yvtz;A19az@hI7pFSG`Rrta-t+;VWLk4_WePjIN}+j=z)sYG=G`OS{>~k5yt?(S z10FrR@tdEyEB%8ZE5G!G32S~ods5w|lMa7}_WmMUvA&(lO4|;76ZO4LRPKmyqH;&X z`qOz%nD9|XPE^?u2`d6lRN8ea2zN(>6IJk--96$?1^uC5qK5sLz@HBL4VxKPGN5!Cn7&n2*cON+a@A1oWpFdanrP|g7vhNAqU`Mi7AL;jVnOC-2!?4tSATe0lW1s=-{+s#9Xh`|bgunv zmh)63FJI4Cz+ba@n!(!r5;LNt{*dAS{neSpukBoQ*j0zD7*Rg8?)=xwN=gRSPHTI9 z_fgch+zn>c`_w?68aRw&p(2m*5Vp&FW3;cI#=L;(OI5(>8>j)XkK9)vt`2%{rx#8? zq%*0Dc(A^CT8gXnI((uAAHA_TJIG_^iC<5@a`iVy96D;@HKXTl|G{IQ>$-l;Wl!9A zUH{dK{^i!=D{3gzX2iZhZdDuFq0iR6*FlbRVs?;oQ!*Ij;(VS4%pK(FOiuLhU==F# zFf*1uScM8s=azh2TgS;&v6ne7JaY>6K4u1Xn)tT3+~2&UK(8{}U}e=cyu&JD6~OE9__IIW_SeJkLLFMdgB=I`^*m!sUM~gM^HVZ<2E=r6#n&(E)~_Yc@TU! z&gro*DE@?p&k)$+o$wg&B?Y9tgF}@8{ck+_;NXyWLj2VT`BUF8D1Urk&*C!$_WADt zj{gnykQ_8BvZwD4_G~Nn{S~L@aWru9pF|yFfq1!?87K1ML*IJ8OY+ zyR(*P-qME-$Z=Pr&~_(Z^;6#HcIN^Q@2$rpyAXN^if`~VZG95=*VFiDP2Yhi?|eD^ zxEw!}s7J5>^yWDDG^|IbBytIm`$_2nX4(9_dKd5eHbmy-I_!7WCMUBwS9{8*F zVGMqb*lm}tpSj@rvp)N^X?4SAZRyweF`#^x#xco&v|a5;j(E>syEzC%J$)&K9zW+< zF`|rj*_P+=ihAR20=K#=G+GoP@9O&WlHeEj<(CbaX zop>CrJ84IJ#4qkx`1tIOqSTug{ObF(YA+(PrVMOdY7NQly>&kUqMll}6!!|XE)TWr zPwOh5XzMDU-nOptiMFot(bnZ?;#W0k)#+t&^cfQeD%zIThV`PQa&cM};)4h~^t2wt z*;X!2D?ywiRB-u9Bdq~>vuu}M%RM-PYq>)rxR!f}j|>0LAy58?`gpir+-!5pRsOWX zF0TBK@NxNG$TH+Pez*@&iHLR!SsiY+2_9ZWa34bPy?s@)6m)Didig>x-wV-x4ndo$deDf{6c(Aj^N7Y z6dxBp{|9;U8R_HU`m+68{>o>Rj|-pe$deB}L6=_ZH9CSTpD{ize4a<1e7Mh5h|kyv zu6*RsTHJ(RhxFFB@xEF5f8|@I{6QW+ln1j6Q|hG?EB$n`LEp^)qPfO*SF9UQlUk0C z?Y+nb*t6%|lIy>=a_tw_J^8E5#irl1h14$>B693AQ145dBatw<#QnTS910;{0lD?hz9<#fT?n&|0;eohHLk>}U5o-fS} zLis$Ryos|X^|FR;yfK}P|J~mv@JFVCF>fyZ-N#pbz1VKltOCw%D!FCoU}9U5R&2+i zCmum;1_+WK-CHB>Jet@hU^=W`dZFudVk3&=>@fMg8J{zb*tNhe_MV;clP4w+I}&5& zs~%SK@Db+{yA4>2hmHE(V-`CS{qSWE8~W=#pCw(VgOz?MQ%`IJYS`h?y>iBoM#~SF z$~WbL^IC|-F~$^o{Oe{Vv1@^;ENeQ;EH(mTPU}1S$ct8!?kZqf#w`P$`3AAU80YO? zxetBok#7=P4NU2t`ps`GHV|V{`Awei(A}hK1E%f#$ig!oAhz3~D{UCJo!DZGTYYv! z%|Aa+>~RO%apN0*etX;}%;=BFN7K>VX7tlz4t@vNtI(ryW_`= zMOVk30=5mj`Xi2%i!)+M^=wc9=mUuZG%=oVAD?%G%ro*fK7NXuBfv}F*n_$LE?XMSTzoY-ji zIXOH>wNo}PJAv43z?zUpx0nr27nfOn*xgk5CjVgkG|TU3LzQDy(EMdv=MrlJru>fE zan>4QuK?3$*G%}&D~RoeU$hd>qN~gw1|GK7J`0~{G}?eF>aDka^KD|C@Q1b{&-VM} zLw~rQ*y1=gWjwk^@2J^G?6zS+8S~G`+(qoZY1N@s(9du##{^8Fl@{}UVhaz#5x`9zMn6?huDPS#%%KFDqdLo z2(edy>9d>e|HI?NxH5g*qucP?MgKu;#z_I)RR=!wM`Al2?C2Aowb;s&gEF>#=e%8{ z8*xhT?73r4-c4*PFqNhAgybpz2CQvlK=;t!K0cM$z*7UPq_%Yiu})z6Y~3BduOU`5 zDxll6;`1iec;JY+7aUu>6&U9)rkz=R z+ylFb?RKzlpMS?H(^=q7C3bzCj5CI{mj!LTzsJMO|?(N}-H?eNREyrAy7^S<++ z(e%szGYPFHG}{Nro)>9`PCBMR@nfoK#wo=5CJ+M~L6ILI4(9;9gPy5pMu6d~Bz>5b7+R-|8&*9%$ zFm3Hm*NmAsyFP}DR)&1XoY)I_# zmjs=d%x=CV{pYi9efP4ix*NuA7rtvIZYrBJ;pRCTzEJhef!nA5O3>Fwo_fzsH500C z=&Fb}zI4~&f)1{~<~J{o%1`~ri`J&T_rw0%gzxSlv6lypyMNloF}3;hi<349YAYyx z>?QYlQGbGCf)bK9fdu8PlpynN~ge_mD$nRQRqPQS719(uSI`I^Fg$Sw!iwAELZ&-mP=h8 zv_bF28F@s5_P5qw?HcLS*I`?Xw^Fd~fOVQ=lN<4@N>q}MeF)9T|et-e2H zpw12dYOVKkVQ=#2J@rGiEb3Rk!BKW^+FW^o+z;B%+TOZuB!RBcnAWu(({|4LUpMYu z*?g`y<*TnwdR;>>t!o?BpKCj>tv|4O>$;j{={l5YUH3Bm_o%nFiTdo?zu})^^sbGS z7iHC;{j1|z*ATp~>nx^qz00(&r76n??Ki26x;E1Ke$eAt%h5HCmh(aTMOu!oJ0s@ z2NCV^#lJl8#5=jolk%H3KRM_x-P%QUDhty7V_L@y)2#r=E`gYk0b^aSLXIay-90yH+bzMf*d?yEfA zV+CoRaqC0Sd;k1fH#4tM`MEYn>#O&`#}9=tx4t?*l#ad&^;i63 zam#~tL(>-M)gNgu&ZT}r5Bcv#n{^Lbu6xIoPsgd!ebnUB@uKqaO26Xo*=B4jEstpp zZo8>m+?U;XL#2}J^EqvA+U@;$PRG&yKBwbf>%*(=N2$=no_^}7Ng8D?=v}$GzLx86 zs?SR*S9iI49vo8)>Mt>^YXqh}*~*+WlYR)byZ7Em>qFkU2d59HjnRB>uW$afz5H*x zSC+r^w+^chv^{ubn>_LOjI!<9X4=TSOTQ|ghx}HL*m~@%OzHsn&Z(@=oNt_3Uy@&z z!e?CVSl2I`YMr$mHLrUQ+ykAL%yF?9EW3fREH@mB%z{>Y+hS@fzBrW}CExHE8Fw(3 z-1ZO4N=KesP(4bPS*OUw{d#JM+o%QABjY%i#edy*(wI@B`QOMmzC@O5&mOVfHbBbwKH>nSZ*OO+)FAlnZ?>^mm z&pChZf0^>Xe5Ke%(E-7J1o^ppMY=yk+}*cx_tV_9{l4m_@1&KEZKCfXSO$aK%Wr{f z-J(7xl=9bYze4ltqo8j;^VLbVVVi~Z9tIu<{C z{nBlK0AQV5{X!b8C(|0-`4RQ6_6fT|&)x^ z_P3r3QXU-t`mUF}H4tY|I?2gjw|#Xzu5|k|ehTfIC?CD{RIZ+(Qo2I(nB!LaRqR^W zcOvf(yI(&jKcP^+>id7U4c)Z19k0iJd0E-ohyH5k6={fRWZn&K|LZv}<;8x`^9A~h z+YeFSL!bMw`+;X}u<2$+*0IkF<%{NncFC7>{alwyu88Ab9pKtl>w}~p-1dsj7t%-d z9Xk97W{@SHN?eRhQ>C#TF-j{t3>LEt9D{Q_Wqxn^NV`;W;+lD=q zeTVnsr|bC^?c2Y%pU&E_tdHWpNL0_bE$_~wsDIZJUDQtXL>JwE=!q^mUVEa8u0MOC zi>^z0qKo=HJ<;hoXWY*RG1wpBb8jpfQ1*k%x9K{RkblNm$Djq}59R^qg2YE3xOF4^ zg&*Mr=VXb37kDn@_iI0ZPdwU&-Two18qSHBIBXW9$< z*N!?4@NhneJ~d7n;vo*e!a)MMk&ZWyXF@yiEeVe(eIuyc;7OK5hV8hzUGha_wL!V zW$fmL*lF|sW7%j|E-6Z7%9m?9>N{TEkM5bsGX?)rCWi7$rgd8X=IAGqd_SbV&OYaf z+AZ+N2a)ng828%T`-3(NaGfXI&yIv}J9_iv+te!F@t9BQ>^Fa*CmokHPlzgye ziuO~*xECfdo;$IjoKfkWtCc(Y9Phh&Mc3(o^Ni8?`}Xbsw8d>N?O%7?xn~K~&J-#a z{8@y`D!=+P`MU)-7BBRiE3f|kii{Ye@)FydzA3=pwiBMS*JCSlcfJ=tLj69LA4I>d zfcP(&GcQr)aL<Q<`@?hZM z@-kl(>9qJg&%We~Wl_!#23(CkDYIfyjMJ68hAVQ0Pm6TEoRo{%hjfw8R|kWCPl{=N z{N`Z5{-cMukKq;n^S}D~$9z^^=h;y?yDaB;*4&$&(Oi0=jTvWWAIoy}E}iAHc;}7k z13mmL{6KhtFBdR7J6_U6W`UmF7_}>MUxWywIF5L@=gg}fZrva(Q0*bjxV8-S;bzS7 ze3dWe>9oE~ItsbImdy^-o9(v9o!%edSZSA>i8%M=iF!QtL*Mt}IF>VR8q3vK5wVyB zK9AHY+sAqy&C7h|2Qdo+zIk3V*7Fmd_}KW6cKv;NlP?Yi^esQ*vPx9r3o|37Nrz?Qr_{XeRl?x5KbmMq= zI9?UkcwgH=CoGOc$e!szd$CAZAfl+_Kscv^<^fJRVqVfQ)*PPi1#u{1#6_=;w)nc4KDN=>Z3nf&tXS&xO zAUckHPf@ORifE8Z$Ww_T5qFF=NF{Zo6k^^yQe(5idEizbVObI#rV7=4ile6 z;Wo@HOrkIjL!yVRDD}3Of?0n)e%d4P{Fp^i65oC#Qdl!`##758Br$j(Ti_%f>tG~8 zC_%)7te|ACE}=yaWx%^Q3<5RO9vwlXmMzlpZ|95hYMx0+;b{*r5?&O0@iQZbTI5T@ zD2fArD*^{>f{4iIST+$(95Rks1UyUxg4B#bY`vKSRpXgp6Z zRC+-Yi`YxpGm|y+fk#ps@FCFMF5`3V`BA`GxS6B9ws`oYI2f`d;eO(6frEYIYXX0Q z7&x#6wg`~hI0?dJ3myo0H~`La-XXqlP8jQR5ikx_TC345SV*|{zF4ll-(j;g?cEC% zy-1!L$28izz|k?E^DYcD@+XUU5+pt-=@!^3SnNSIinkaG(klc95N*cnqiMO!dq8br zsDWG!dHs3GNA|Q6KjK~zcpa#1PdoGj2(2Jxx1Y9%V-bRHlWD-pNUr_mO}-p2ic4v| z`+oSkZiInGB!!G%8{NE*#F;_t@gbv=rK?-)VN97}U|qSzDz-c-VFxSb`Qk~BCJ8|N zxi6lpeGEn{Puj6Mc%eZq4)p_~4CK<=k&D5WmVoFQlX43${JyIEIv3=g5K8fQW^_^O zjbR`{?nCj|;xJ&WWRO>*j)OBoj0nIj1HkhZ6x55Q>wv`_Jn-~tHcJ;h&^d70FcBos zGM^_GgcZ#fF^6!nkuFMv>IG5cz6br4!}{>N_FC(AF<=EovMw3ISY(0-9|;Ri7h;h` z1}a39K$##fl9e`U78&L3d1`A64ZMm=y80atvNpr}y~)-FHvpcr)UKdw>yxc3AhKnYU5t_CWt`Bw7?S)i)XsmpuG@@WysBK zd;Mh0!XNytDVOZo=)I0`z+HNnXJ<};T@~l0!r{D1+S7Yjj??MKQU-ddsIYGbgMIdD za6|w6PXByGoR>5FL%A%f;WQe5W3b{D;No)9Q~ZYjv43MmJ`524=SOPZ>IWXs(;i(E z(+r`F6ozL*(~Oi*CusZCH<8Mc z@oJhc4(I37eECzM!ZGoUjcw3zp%pw>7hu2Op>nJ`2mBy-*k?mX2pN5AFe*ilYzJ`(f!GwNz1KiMI*5f2*XKQC}p{M2v zterYVf877ntzn>Fr(T&`oI`l%spF93#*0vskD)p$gf2wPN8~D?L6H-48Cw%4;RYy( zhCzs6TXBDqQ8RwEP=q=&X&KPu>}%kop{!_!O*}OOf8WYKG*Pda2s-FM-RZQ;qpV0#-;UA*!tLrPT{Z|#z&4TjfKE~VgJaaf zvnA)0ztD12`a~@=rDe-xh25}e&th}G4yy7zZF^ABkOv64_49o%el_Tp;D%tRFaW}9 zu6eGe+~A8IXJEuN!VRYg3?cpo%6(_-v@DXoY>mtsF5Q8h_v6xB4F0xe@7t5c^pE)* zG9RQqWtV;Q^praZ>_5)a(KOE}i)eOslrC4N7im_0MP?5%oR9f9M{Y*r>Paa@_Akgp zDi?O>`{Mj!^gEzJ)ILKihx7V0xrY#`G4l|8%;FUB<7wiL5`1sR>V!g$5F=t{+~l%Fka;(r<4NaF));xWR^GowK);=5sKJ6ZM4o48%qw z0ST~y)!Wn5dvl8QArDD;^i|fHdeXgW7fvHBG1qF8i>lTu)<0CWPD~u>2-nR-98{hQ-yCxha{>yRU))fqN2$ik=pZ= zJ=|iBpQrHzY$1*FJk2M5IPxapXfld;mXF3fb)ZHjGEyd=lE3MVN7HnU}KS86JO0C9dC`VVzRXMYlkIJc1grsw12y{>2agJg9MZJOA?@{A-YTZ7EG8J?V zwM51to?b2rsi0UAp_K=U2asT6)$(eL(ci67KtOhs&aczuJLD=ty|NRw2dtua1>Wuq zv%u5{NUjA-I^&Ijq8V>V3wH+EiEAYvptXKYFXiORU*<>CV*Hy?hU`usuku+_-!_xg zgUlQ|wjIz&T6nieZIft#d)m?3`)Fc{asE&D*i9?&n|>3lyUFADZjd)y>|b7K3Ow#xX*ti z{I@8iaZd_B{zvR{BZDD|sS@LQ${>sM+O3 zF>WEZbqa}kOq$A?<;eO=%M}RWQ932FCLKxb=RRIeFKT%MtCc;FPs_EQ%QH&D?&ueU3?Q4dgk6#URjjbQNAzV^J_DZkj2#9#K$bXpU zSF1%jeKq)SH39?vXMXdk{4JmVFu$5kH}E+V#@IhTSB0rQh|ldup-cgS6aI1eobe|# z!CBKvT!wrJ{SRyde}h2dZ;)rrh(4w_V|YLeW|GJP1joTCFoJ=5j=EQdczx)`^{Q;z zMxZ-Mm%mBkqsh%bnr~_cKn-tAFdS?JfD$h@k!iV3BQ6>T!r}4~R!4Ic7J=yzkV1;~ zv_0|)(I#W{msbvFWbPkcz-OuRF8|1Q zp#$m~ctJASp8+qRWh>{kAzDeEBx#mqNJ2%ehYaK_8Kp@yMmZ|vH*(jgBJqsyiF{;D zd~z^j_xQxy`HU4TdWcVr5|BHxXN2QC6648a1Z#ry_U5ranFJ$LKU0aL*2H}`ZA#}^ zeagSN>W)>B8;M#@691+r8cH<@AyUM1_?R&a)GLk5&S)^eOO^<&%o7x#i%J^^o%9e& zXF*uT$VXxnrqVn*@*|jekb<3t!8i#-HYRCiRk_n4y{qbs_t981{m?>pZ3e{fMjk3V zDqak)Fw$caK|I;{WmG3A%XJxHnpykR4!(oi+}##!+pE`LF}oRaU z0uo_;w7KdGZar=# z)-uEgs{Oc^wX9K5^~G9NS;k(hW%sg{Rb|Wj$K-b86?(Cjt(%r%qJ6QJby>@*Vo3eN zi${u9KpF5fK~!k&dwG(hY(P2@IrO09>)}Mw_%>)pqUQfj1LDcVy0CaX#|W zD4vXxd@{koCnA~T6P}^iTRN7xC1kj`qd7+v0b(g>{!0b%SMv-RX_LP;uB*XRHvF^9DWOgR8{xxN6YU{<>_+#0 zLPpt0Es}o%ii{f`#N_G0S z0I#FNgl`kQg7l?!Z$?#fzK2K9NNU~@`|GE?Q!kfsyS&q^p0TaGQ*~$Q-+`k(lJ2PU zAe`$DKg;ql&v-D((Y-20wUsf_FVQ&yMZY*4O_CHik^Im zW`ze~iqsggx{GJ8d5LbvO!RRm@K0H`WH`yc>Pef$ChB|k3sv_!i# z)ROy?aW<@LB^#rX+o?N2#2+w5=q*ImH|Z)hL4fkNW7I)s&sxL~>QKW!J;}m6=M2Tt zd7MTQR4PKIJ@3-@MC9q}ne~q|My;Sd1?yRK-kJ3F)#D!DL#>5+M3jMpj?H^Byt5mVgjM z(6oR5QsiF;h|b;H`+KWx3+?)JqpJSVh-Ss29SQd@saLYMT%%NScQ8)9McKyGt4eVo zqJC@YRionR#%P^-t=fmCUNu~$kC|CjwVvrAdf9eCFD&?l1vm323`6`rEZDHPJF#HH zMN#*LSg>!d^oj=`PNzzTUk=L2pj2JumjiT!A6&~$jnll9FIR1+`$srXA4Inbe-PpL zGudEBCi??Q>1!D-%}9P^xyzXSJVP7oWEA@2R5pxZF@mD=44#~tTy7%yB_31qr!1}Y zgqbnE?dbl8MZ=dsPk@>m=t;P$46Tjy+1rh;5^SB+S?7T@HQz*5QZBXmW#aG+{5O-I zWi%!t_@%u=nvtrXYMSb&JC8}lt*xdSdh0|;6HsL$RQ-0jFg4Lu5uOTu_A9=VBu_F4^*0+D?XXZhRX2-4mauN2x<}f-E!3j0_G#;2;7YKaPh8Q)w+1w z-KmF*chipA7B8^z3}$)stLq=Nal^@57oVU?R20Ej-p9o|ArW@*sP1IqDXTEqy?W?n z56FDg+la&()w1J39W9WYC><l)ZlWamYn?qHJ7i+z1}UT$)*Xi!HqzX zF%~(%tRjo`){3FQ+pfNU;EHdTjbsAbg?7E;SB=!&)+~bdsEaJpA>;3D8?@L)H*)8l5{B&^b~bj1 z@RAr!n9=so6bHI@Tad>ip?a$c#2V1}Ad2ZB)YOXs#$o?Juo-K)TZ*YqTTSW`Nd>6w zP`I(bj3tH*hw_ezp@-6kiVk`SLBbjZtSF_HBWOgE>~(=t?cQCOZ^a4v2TJe?pm0P2 zicTB%T|i0m7HCaqK&ekoGHJt-wjH-cHq8KmhCCdKsJGT6 z1x<+Y$MZtefe~P=3I!a(X=cEJQ6wH@LGRWY>D2v{Hp`y7VEwz1JvFaJOZ7O?j9Ryn z^JF_gF51OV&R}(pg)CzSj0=+?M}7pI&z*3>Zgu}~!nIZGULbuG@>=W8SL?JUW9YO@ zy-lCZ$K%u_hy$f#^sCgOw%&^--}e1s2u~zM;)c3s{GFgH=F%{LR>=K>E`~3Q8F0*W zI9`_@8y#cs(t3=jX_qv~hFYsOfzH*>7Wr}`XV;Xj(F@Sw>wN<}#=;1Zsa%7V1V>G` zn&9^kMZ0RP+ds&w`mld*UT;86vUGw?rIc^Q)+<3=4sT(~XoVXh*&VSAG~Xtsyctw` z!<1_x=8nMFXOjnHIqeW*{VI zhZ~JIMzUnuta&G%Ypn(S12I?v(ANhxzRf(>n66k1lSi14DbQYI5uR4vbipHI2*5BG z2GVK^jP33PdOJhj-n?Vfkb3LRHj>!rz`aHiwcxc|nAMux29tQ(-8J+^afdI${{UKUU<+TWeh#md@2lRGd* zb%52|o{KIb)m@?mr0UW)-Gwez;z|EN&GilM9@HL1)7@-H+=W{Y4RuvJD1`BmJ<V~`%dv)y|X-f*lorFifVf#!*k`_>>seXG2^>eGe|(;Xr=+j ztY#ocrDKnCY%Uw$q*Ye*zXQ!2kdN diff --git a/Workspaces/Common/Prefabs/ZoomSlider.prefab b/Workspaces/Common/Prefabs/ZoomSlider.prefab index 8792cf4db813cdffddb2e21f37ce8d15054dcebe..fc3ca48155d80ad123bac280f51cfd4c884608f6 100644 GIT binary patch literal 25068 zcmeHP33MFAnXZw9ZOmcrBLQcO4dyVyU<~H4t+8y`GO{h75W?ZH)RG2|X2i@$SR7#p zM~n#&UYreQ)-omu;c~bWLSVxYSaU52%dtF;ybuD9GfP-0lR2bYgoyf4s~5GxR0sW9aujVU8bFOs-2CV~Hc zP-)7yCrr5tP$G!DGG=E)$}@kW%=;DQDe&xr^tOmBRq|AtSHO5U(&P!bDor)`Cj%RX zxD}$vSD5F3*C9>*A;inPSD82zJdDJL26&a_|1$EBn_R+EWtQOjG+%z}Kz=LJ4Lz45 zO+AMbw{b{B&utvs)suNdek(HzWfqX8K5S~yb4Wzb?TObg&(MgTBZ%8L)XayD)RXBQ z0$ljdMVkER>VElmB3{#%pZ(Jx|1JS8?QkK|tkbRm9&Lx+9NcY(-2+_u>$^x(&piS> z+FyGHc(lL16g76+|_6A08f~Uz;h$g1A{B&6$==Q@WJN=S=&l zvE-scI#+DT7up-s1us{EKwT#5)lbJoW4hF4FWf9eu;x3wLaEzDO(|Vy^-8A0zsIbm zE1m81On%vEUQ=m-*W!V{$ph~KuRY)8HP`0bJMuY{S+r%bbWxZh`Fv?+y4{;+GXtnE z$~|98wg!g62`BGy-(Baf{_0(?y;1#N?;VzAN1TVqiGDL0WOEJ9b1+2g2y1ZgOM^qh z!U4*OUuiMH*`e%U8iUZ_$iR5m=b;|jaW0QFIQE`&sPb5YWATJFQ2XPW1D<81L_RX{ zX>bG=1E>ay21jukMIG=oID%K1F&KE$kY;@u1(%7S^`*g4+^sJSj^JXz8<1uj(BLr8 zu+wnegm$3*G&rVg+byEMH8?fIqxxHegDk{d!xb7F;a>z9^3&k-$8QZzO<(@d;6(XD zgOf17K>I8OE!&0$hao;5LW2|S$I#$N`?Ml2+b1+Qg8#R_@X_EHQv-gP$X!S!5Y^x` zHkJy<%E~)qMajz*F_ouaR`i{!!K5<5Rbx6+FikqykgFlx?G^C5DBZfSRLJC7Ilr2$ zahRL#n&TDQRHD9^YAR*AJgYofdZ(w4o&Wm56BhmU;r0t=4{1DaKj^sH*R_QHj?6cU zZ+wCOBF#4%;x2#QI`b_u|HJtf?eB2DCCnS(;k@OT=X^6JiN35bJs6>rkm5Mtm~!!> zks{9d=Hka9MV#}^#it-eT;?13Q7+oQ1{k^ReCwxN&Nr7w%jJA?aV?kgO>p6FM2h@& zzV*Y;`R4K{Kj)i^D?jI(^3x$Z87aci4@daM(cruVr*zt2Z((JEM7B7QK+VdQw$-j@q z*RZ~kaUu(Rh--U}iOFkw?(5@&w-*ihrgU~ez9ink3e#=QG-uF85O2&EGrreg(+h!d z0k3V#WSg;G~Wd$Urru= z`;F(m{7G-|P^i2^g)}cNO~izhi4SZ-I9&!ZA#6G}d3?zp2aMC3_oPcVzGN#;e92ZG zcgfzE2~nQ72~i%`gftjT1(+i07w!=fW(}suL|^Z1@yo#WAzo{*eG`I=igSr1kC>1U zZ}xF_$tI63J=TQOh&-p}rI6>;6ca)`IyJ?F5RXnxF(HD_aHgi15aKd5wSDZ8ZFQ@% zzOJ?pr>^$bRk*$pk$uQvC3uCo1bW_wG=`I1vR(W!9}kyonc~j@XIs*Qs61UY)hArC z#pJ6#G$E=FP0pJ>4^0RIr?SiAnh=^C;?XWywoR&$PnilWii2B9x)-r6V`<6 z0Oi;|tOtgY#T!tseSqVCGbVU z%Y6KR7{1oW4|MQ5fIWf8b~p&p*m9%o$@UZeXuljB;9`1T_xYcb;EgA9(M6huYKo%Pp^96S(?`wh!|Bia2Y$?zvd5z z*FZ;IH1Pv1V=Ru-tkQCjM}|A6%jPU&$`fD4lxMKZnDWGzG36N!y;4@!gqeWfDTtiL z;t7lXG!x3hdkGt(_2SY_oMRWe9Q5CyC!d|9%*PJ5W4{0*gx7XnmwDhGGjY<^CvRBy z&H0n>{owc;UR>TX`nbc!uX(||{P7&fRATP4+@Y{7o8yX*f1o~8uQT3<>MgQ=r42Uj ziYQOK50z)IeW*O~K2#pJ57)pXMqH5;b(OJv9NLJwhkckZZCDE522PB9$e>G@mdm*! z^_4!?a_Nd_JH$^95@pL1*$vPYp^1*W9D_YQm;gQL($E!2l*`mJ!f#!X8sbrxhV?*J zi_gbcJ`It2iz`ArVYvKpx5sw)drl9QfV&nPbjRq57?T9M>=KScitR71NQiSB6Q?VJ zMJwA7VD(@@cfW!UwOgUnkzjfC8~ zGYO_b`~e@I<>2I@YfYYd;t1sF0sf+o&lcF?m6IUG3v?M zRoeGzv0&Hcvv5EQrqwJnX`~mVyPM!kFOugAwVm0lbq?VY=33!2cF8k~dAax<(+HOj zE+X#NrnA|Zg?y)VRU;@KW<=5~AHsln;5tU0K2Slwc={8iwtVwkxRgNg1jI9`LM!}Z zmeSN_9aKL}S6B#Cq7RTN7QOam+3rQ%9iC5FpDQ`yb=iE{P0MkuBQPzW&pJseufB6Y zDs@@dQOJ}$)}fA9gftiQJI{Wpdm@J`#rKR*BcJCFMM+g!;w z8!&*jcv`j{WF~L%v_7Aw#TAJb_VapLn`gNeX0Z`2a4Mac&$mlTMt+5vU%maxy}rAD z+b2)7{AiyK3frFf&83U3KJ%InzjsB~g`@ZA+V2u*c}wM%kv|;mkV4coY|F_1d?TMe z9sRfX$gcs$HJ-nZAAA*&Glj>U47#^bUnD&4lvihTZx$YR3Qr62k|#Xw6#bQF zq~#WV*Qb#^MyOAx&y&P2LtLLx7VFEyJqA|~t=9#(raq$)8R9%+EY_EYdkog!m&q&OL_gwJNRe z^(!B@dklx?aUUNS$V<5!kY>5uWAs-p_ZTj}mdibci)*>uW4O4MD|?J2?n$}u`)s+~ zV;DzItuM!;%cJGmJ%%H%<;os|{L&6uE-kw7NV)GK&HBn7Bb3*2xyR_QT<$SkT+6k4 z3`ZX=SN0g>mp%5U$j^S{9)m&g5edQV9>d}ZGZNT=h#YHED2zb)Nx+k!{X8T zQe!d7N9SECz=h{TpND%4hWI$IwOC)C=>aZ0r};cHNP-aO;T{7bee{_b;0eQ{{!0C4YE zkpB1^16=qY_4#==(jWf<%GdPe*E18=3weXHp+%IpQTU(t`4;fcf%*k9bssonmX#RPZl_DKPrFuQ|eoX>MINf6>Z zr&z2n_}JV*LGOMx@QdD0f^%d;%N#codrPZh8xLANL%54feV% zz}aqG-?ZI&&_12Me5)gW4zP<6IsV&-mqpL3f!*rknE>^)!4(@9dc@{uzd zZuDgQN6*5F#BGe8g_Qza&SGkiu0rJc&p`eEiZZvZl=kc*ShnTbdhH6F_VWzl2=TM9 z6&4fRtygz|%h}U@KL42{DO>qSz0RV14e{t%*xAHwjGjH66X0?dHWU1;*Vhpl^ek+# zkDn{B#d-GR`TCTJ;}7Z;(dRtC{ps@!;x z{4);wC^5Y(E9V?GH7~cA=RWe3ab9kE{tUjhqR9rYg$Ey+T)@Y$NZXfU<<%E^9yN`p z9l&jZ2Rrg~Gk#Vz3)!=z;LEK%#*#CZVwl83OR5*#wqkQSv!zT&HY3L_>1JTq)c8Kd z$t|%j9^-s2y+SXKZ_8)Bxt;CHq@DuH);&B!w5Wfw7&{sKKR7?sbGt9>!J*Czv};{9 z-CC40j!N^{?tlB&n?8E$!P~Zebhp;;9C=&*&Yf0VaMq+%Z_b^(Wc>lVeL5QRn)a3U zV9Rq#C_1cEhf0@TZ{~F;h}F%9-eV9#Cehy>&r7Lz-5i3kIA)pA4G=1u8~-` z@HhZV$s%t>$v2@9^QpJf_FIiWd||$`VBe$h@29Ya<@iWLCVZ9o^A&%qzIoRBe_QhY zweS7+w;jHE`F;zIhLY!?rMFCY>tmrEwoLfXJK@*(6P{zq zPWTkZRl**&O#;S4AWnE=l0fBcKxPXq@y-_(hC~e9lGvWvDit>q-}`6HPfM=?m1itoZ+&k`yj7*f!F1wvjC=h*>v|b z4QGJH{ zxOBA+l0gsI*N`2pJNf10{?FfZ@?&$mD>5IS^wKSyS+66yt;-orX$IDQpw`_U_XlcS zTGIYnmzHRAT331Et*bnPZC&Mwx32PN>$1N5;Ea}qD?W_`o0g&fZ-Pu$Z`o+R=lY?Lj;xwvMzqbyd&J!#KNkS4!)8f#cz`}k4& zOFWGb*Y;%j@M!~iZBJSO!4u|XtXyl69)`FdqA|%pUirn-2yx}#KadxmTahLYJ&pc& z4vgW-b5MW_&(Dx1&$s}O)|c()@+(hufD6x)NRx-2hAXf2vYv)hU*!=`gY^}j7m=Gh z;%S8KpgiJfgt+pEr;#*~6R|-XQ~z_m|Ci7FxOVaz5`4O0*HL?&UJ+b-&CXYa{H6md zYl$!VHD?@#B14?0$%!HI31Vw-t&e7& zxxacOu_OdCzT5?eoj#h_w}Ey0*tX|X9YTy>qbhdMy+fv2IbiL+T%qYRi*e9g=VQOT z;+FF%hd!~7w5ZF!?^eH(*dFKz)o;w4c^in8fpz+M_j_m9bHqLYruq%3z4@q5CvI=r zQ0tYDL-A%(cDtp-J^?{Ge^u=DX*cXMnAN9LM(fp^vOzJh{_! zU?A$)xcghHUTv-TZsJG4_^LT*&Fs3JhqM8^7lXeMX^!XShwt8l*f0#r@lb?gdEBcX z9YAc-HW*Y$bFNhHKJr+b7uX9(a}1xj{1-nU_H7JAEu-T8r*9*+X1fqO;nd7}V(T#g zRc_KjpIPid3_iuGZ@S|2=kD00@|hjvl^f27pD){eC9zK&?6gs1zeg+y2V{T9P_DeX z@p@vj9PE?}$L;fJVZlz^VC-&)1N6a|yBW zaA=e-_l>7Nn19k&Djx&JzT_Nd-*L>{dhdzP(x2gYd9C|4{FVOKYYedfXCB2_M{{ca zSNrbm{bt^(qaJ;^V(lFmk_$&a?XZ^Ci6?Rdyu zCp>igGC@c6{Iq`V>u*h8H}$fmH?G`$hM>P&b;!z9@4Y?m?ho&NVC=ga)(U###66E* zI-+gn+CM&%SUE0(e;i5F%?zn^R`hMf2+G~4ilC8hJZ8wo!e*NPooW1Szc^4dh->DsE-+rFRHhwfLeadBT z%)DX8!=Bl7#Lc%0YK!C_w%uTY+5?r>UpKGXD!r$3lrk9d#y@5CPhDm1EXKwb&)}L} z9=#@yaw*1NEk~=OW0d!FT=QDz5&N5VJlGG*_Sw$ezo&fFO~*OQ!PGJGgf3|xvL#am zFAa=#VpC;7WKi|hc}jV;0lZe5Lp^AN;E8k=?Xki?wtThGEK}_(uhstYnsz5V6d8Q^ z%o`8d-!jb6$G-icoZ4;HnPoaJCJ(C3wGYXqLCfPBz@YYt*J_7(t@hmF{u;n*wNt#- z^+NTVmTp?!icd0f81aJ{6C2Y{$G_T2mZ$cg*SfZ_Y?jrSmErLBma97Hy3Dei`R#u) z@{g;Zt}QG_*D_w~I?npBuVmg0u3YAi2kmzqXS!BVPJIC_%YXTOP<_b!+Gf1gpye^G zK3G-VJ=hA>j73c!xbxO`Z&z9V{^UEyr=I%RUNyKkRdsaxz_qtJW>rpkHl>I9ZYnRo z<*E2BU;fKK{hYrnKa3*b+5|!5@21LAUl!73#`8-TUqkNHi|eb0KR^2CbN}$*zWC&H z>PNlj`eh2QmKW!brzzcEJF6VqhhrzXO%i{_$J1*I4C;?ey3D<s%qqyx=Fi+daAyzpxcgde}(<5KA)RM=k=!ebg!avw7qdYwZ|_1 zrmlrA+7}=HsdK7E&V|Pxn-#=(`ni z?V7&Hq;*z%OCC44_E~V54?CS-Gez_2Ivro5T^?S41<@Tz@*!blbj7n++u9b(hjA+= z`XJ|Brw9#(_U9a=>}Rc)tBgDTbg!&(9KZ4L!l$$JSCY%RlhX@ugYj>1B=N6GC3PXg z{r>DbIh7ZeLD*RNT({!oljA?0d1kUkj;(;qzi@pz*ROHMg8IL1UUKVvaAnm;rL6iV zVZL%OUP3HtzxDh=>(AeRMmxuOkgS}c)v(oNVsq`Bjx$SuKmE0b-sA6x5hJE*WPhsy zUnIM)I(?q@(DNvlPSpP&4~hwJXS`l>yrFzUTcwVUcc&_3pn#s7B9#`MxP!_hC$$?EX%lSi544fkB} z?zK~oc=D`4>!tpn!;8!KdZ*()w2ST@Fq+p*Ssv&qzsJ1#{x5j9H{7#m9X7dc>o`I7 zGNbN?aBV~Gjoq$cIWt=>iu7xLYp~|&?|1m~*YlAGgVk+Q{i@Fr2I^O#>f3&VEW z);P%#{Tt+8PyD*_5AMgFlX?!i{nSrKo;wiB63Od^pqya+Q{5=#o-et%*zQOp%I{8p z?za8B>aq)_Jo!We{qI5RsdnhmN!uKb{Vn$S<*Bb+S0Rrt~_1l9q1ym4sq4?m2I5pr*8oTxn<&@Pn= hKit^-?}uO8)c(RQ-T&Ft@=rI{E@^uUKjt?s{ui<&F%JL$ literal 22456 zcmeHPTW{RB6@K@xP#?N4wFe?a-3;u5<6PEgyb0nYMOzdGN8;FOG?JmwIO{F?-}~_< zQ5ubJN#Svu0oGZG6iM-%^PMa8$G;w(zV*nA?EUfM(Hrj%>pyrczc^f1MSBzEv#eh3 zQ=gE-y@P`T*-Ct$ct6R%zWnXIZ^VMn5BEH8dH!zxPm#616uEd^@{84>M{s*3nu3?b z?;`&!npII(haOeEPwTu`6d7;jJ=~Ead~A5NTGY+*J#R$S9(w;;6s0(MdFc87HeKAu zFvZ{hVeWqr%lca6$My26uJEjFTb}E&%tA*aF3&&Ib^C@dg zXkxQNHFLKua;FbGkX7%JGZ2&XBtaadksk)3nfEQf5e>Fqjq)q@>CpRF*JWE=oz?3m z6YBm)esR_|MRjrLeX77d7a~{pPcljFAq|)3zw+x-vAP_LeAa>wvR8T0){S8vJ>|*j zC~J#rOgpvHEKMm1Q~!DGG^Kj4vDFj| zp6F!I)mj?pq~du>;`Qdl-C(CzzZ=GZ6+S{jk`h91BcBy00@8(P#M13*=x=qsRH)cI zEm2ayL_qDUC5O z?6F&rmeNq$G6D7*SgVot_B9YWe*(Z5O15juyx`fFi>6*z+UR^DW0VH4U8`>IU6ef2NP)PSZ7=wW`0tgq~jsow?r`M`5mLrJKvm>9@s??_m3*fj7 zrNq^L#%ue?n+wrCCE5mI06zsb=rcuI5<*hou*A18e`kNjDVRS^lUw>)1odMYAb5~y zySB4oT%`L&`4LY_Jb-o>k$~KTc)Mu7(1`df4ddV*1R+rZ^O8Wcwz|%ASdHYXr>)kJ)1To#1d{%R zxk)f%aR5m+lQNd1KEV|xBzoZE%c9H?h13zVE{HV+xCi~)>*jG3?KN*NWf-j+#cJK5 z>87KR@0wip)lt&7a^bJmrD%?-i&Ct9DO6ZgZr|`NO?ZhqcmfgowRy%qRr7R7+pEhC=dot?qK~xZH2)0t+|Mg73gTVP!#pk8Sb;4$O ze#}?x*(J~GuSlY34*wuBfhhdw?rAMS_cM|{b<=fyE5pj~n|dxjt@s7-){d|!(GmSO z+fF&s8psl@Mp#RAW@F#GSQl7b%EKTfJn*B1pF}aEoG$#F_(_t%_Y(QO*WO%VLK9l* z!FD)|APA6WK>G-)hbN5il+9DdBR^pC`63w%vpmEgOEtlwdi=x3Et>==m z`VEnM(U-^YM3K4DZ|yuRQNz&y2By?z997w6?WzZhVck}KuFExYRM(>6-<;T6 zXF}3XC*;&3GRud?mMs&1Tu9s@SGbH>DJ*Ms-t=sz3=TrXM%VLEgGc@=!ZPs>8 zO1T|+NvfW(uYr^pGEU$PtiGeB*_$)04;d$w+fWHY^`v{ZTe$AoA-2(!0Yr5p(x^oB zbx~r@T@+N!ZrxTe75#(;)bfD<77K|Wxj)bHIcJD|^401jN5UD&Y-zTsHVbGD+m5g- z7a7fII2Wmp@K(Sw0GrQz8AU@vJ%Vm?undq~mkJ;-0h*9!#oxL5%kkHkCHy7>a%&GC zchySXRmbbHRB{TztdN=200u`ursG#FR({M&4ZS)EuP^(|`bU7Oe(z7RD&SRhQB-2~ z>11}wS6`&!c+>E!%Od;Jc&1m^7+H+dVucC%o9~(eTOkLx#SyMJ_2KW`6Q@26@lE1{ zY=Cm$tT4rl&yk9mr!uddacI^&71HHK5-tc+ZkhUF!qg`T9GY9ua-H-^Ds)c#?ok1e zArnmbzElt_%`>)u8kh&coGmyZ3z`wQ*;yRY=y6m))kbkKDAqwG4#Yv~eu<3QJa|`q zg7GnwOtkw624*T+_?Yrt4v@O{-m4*KBW~ z9VK8=f$*%AM6v2XD_x@q9saa1H4g4dEd!rwf|YfQchqLXMZ?(h^897d4DEK<;GcQ9 z?(`t6ZgZ_^`IpPO6u+*Qb7fO&E6F}EBT1rO@SPsxVfKRBI$6a8X;e9eiCySbq69qs zTb^tEt1XNk>)j3tXyjt;BS*~z+#y-y*WHwq(O$J}bQWN6#6CXkcLXV2&dZx=J4g2& zSTTb+!43U{{Tk(RUY9lB+NcZW`bP(YzCejx-_(yPeRE^YY0i_=Os^aEnT}5XN&ho# zjBS`heEEmg<7 zy5_4lDARE5!|93;sMulQ@HQ|J9G7P5g*&`$V@Y56l^kmYZy7G< z7rVXP#-6ldISx)vFUm;;*$xt2`ohAg4x(d@fn1LjRqQM?l4SHd4lQ(rMJ5)rM0`OUT1&!5%=x<@EwTz_63i-Cog@G z>JPQ0#Op^Ir8f)5YReDVBJoKiLXm_bW+CFpu%aIpCPJl_s3-t`G57vG(l*ullSmciuWyGr&QT)bNyGPU@iJ3PIEi+7blw|JE0 z*dUhQop;@nS)tvk@*agjRJr7+n0KnmTNaOgb7?o3$wR=pQe5lNaiyp~(*Z{4CKQ?4 zD^qED?^01qh+As4wYz!mVo?dSy5LSgZ;8E-cAelu`jM$ec|HeJ=YQmU4nuD@~A+r+5GEx~@j#-#$ zDR~IL_Gg!Ok6*_HSyTL~UtR$x;1fq;wx5bXyWA+7MV=dP> zk{dk1THkP%!{xLC$S6xl!l*n1avR%06-QJa7KcPn@ZZ)`8yzc-zPa-F6FCzsXI@FK zf2@XGHqvclb{jmt!D&7Y$4JrCqd$bl`ef$r@ff})W4__zQ2icu;CENI&h+kSKP}gj zyf%$><3g*AlVKev4!*rGIKZdtiN8tVy1X*tM1$WhmyS8{Af2Ju5NZ==scz#+X(}cJ zm5oZd`o>Us5N~#>VfT1*TxC0nf7VH%Y2w2b)8I}nqt8(avmXACt5Bz4(&0~u+Um<}`l5#C7eo$VeAx?!y?Di|WDegr4ka1d=^ z7faI^U(q2XGKU-$KiVh!z{l=}k?UWKoI<_t-`5)K!xED1Cd|e02SvK_lc__s6VH#o zj@LckLGQ>2*eW5zL;nMeeu(2v5~H;Z68EmVAH_Ik6dPJ7BnV&_03j z!?+U=KO*`IDI1L~Aj0Boq&-2eap diff --git a/Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab b/Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab index 09daef54b7c1cfe0efe67cce1f82374cecd8a293..f6b934bee787d122f8bd9598bc4cc7e67fde87dd 100644 GIT binary patch literal 25420 zcmeHP33Oc5dA=jb3nmyt2z!i-1qNdrHnRoWBgvaUwuNkqB{+C2JxhZ}Gh${WTP$Tr zX-gnLnwSO(A+`f)AOyEbSW-gZgoMB`P6>eq5{@yPgcMprLIVXFP`~f~_kZucC&`kV zHYYvxh3k3ud;k0H{x5HlF)b$=)81^1*~gfc7W|r7Gf$p*-1_+)*>a)S)_QEuiROcW zfq~RsIQ42Z{uvlJ=g_^Uf3WcG-)?K&`@~}_A760<(4Qe!A#blTl~atV;F19pab!#i z|9z#}RKAfil^Q^)F!RWm46-!H^v9R31j_UR)b9v_GOJ=`CM143Np>qeB> z&I3a{K3@lgcznJN_HfP%$ARrRB*e$W=H*Zi_uKQ)5Ko!E1kar)lV@^>SH*Y^^KhT1 zHpElrB=9_dGI^$ic$|mpUBlCsSF~8BMamEj)(2giSv1^!m;OMLY2oV9E+!{f;tMvT=1-; zUgTpNp9)8CQGlwTsBjdgQq%=cg(G;4sl&o+K$-nz7F;%h_LmAralgM*ID(4;Z$_D8 zK!w9Z#ZJZbHH-t>PlaPDcHCm^w+bgsJl=k*aBvB6UvWhWNBEaRhWu1GL-AXMlOD_; zDV#Weq;OK^yBMEUpyk+5;V>oFL!@xx^B5@{8J|vE%kha6j^O|93?CJaF=_D2M(#r? zg{%svrKMavLoDz7_2nR6!d9MxT`_p8hMUTSM=hCb(X{Jk!&S|h{-B88<(bZ9DzgbI^i-6% z4!EX#{B)FvbHDlc87L9we)I7;C=r+aMt;tkZalZ+kvW{jK%Iq)gO3LQAJxCgO)#J6He9Eq$i&5r$O|f_dTr!@Q zqfGw8ExwWcjjaxrL6NB zY$Mu*X(-es3-)*5^BOL1|GIj)k4;fq~84)6U9P z-dj208+Tsu!aD<{dLNAWw&LNkT;8o^YwDUofv7D^Q_VLFZ9+_;};?Dx-SW<;La1_-CsH923%rGE*`8WtrXS9Z+tvCe!?H0mt#X*RPRfUf2N1mV*K9(&UNxJ zi<2v5h^GJ&KaP0X7`j8PK^}??s%`XowJ}pFFYC&56xK1iX${%~xKR9hY$9F2eg+-l-pWw3 zb*yS}HlOY8?Y0cdvX>C5?=2Trv@Oo8pO-Cx!v>TgX3dSvk~R+kBjQL5T8R$xV3aLD zYv2W2r`N{2J`kN3>ox`J0*dgNFTS|-%9~F3^tW&Qw};=q`MIa5UgslYRoO%{c9J{h z50}?)x4Nj}hcjcWj@zu-a*#)sJGaZOm@(x^nla@Wtr=6Eq#0A5320ZnZEMP$h~GKL z+{WSwOZ%xNl!xb1Hplx#(@vag7f}x8Z`7O5Zc<*y3Aby%2qL6+|N8ec?_TuA@7vzE z_18byF>T_iQ}6lDzd88y*>}CV<)jU3k8GuPbvY_!z2l%;cEuGT|8R4tUT1O+)m!BJ z${6h26;Yn#94gOf=TLc)bErK29Bzb4jJYE9Y^$v0voJ<%do+hB(*;xb8gOEqLnbw0 zS}*sC^jGFw>!mBADacGo zp2!u6^Gvm}luw!4aeO~AdFqgvl04#y3~rBgMXY?v`~bgCBa?@&2vd?r=ONiIaYdv( z&*Qq+kjXP0nJLLbS7fO1nGxbC^B#`JLx?*-f3Cy1-nIRkP-hl6*ZFD0kw))T(a{LuZg_7zW$&lij@5;C*cERqisJ`b6?inftSb(`v{C`^|}zN)LD zFulrvI!+??zsPJPnzN8wh-Z=jf%BKhO zGd38Cza_+l|1rnUm|-aXR?4Rb^D~whihp^C3;$0Y{|ewk@k6%^$DE@OpTByY-l_aT%JZ{^YMGpUD zh*z8Qfn^F(&34De)QVQ=PkcYlD>s?K-LVT>b82A;)>{mN+Bz=WP z`_*AF!To*(AwJfw+pEDte%d$T9~Wz9C*{-R8ERn5;BJE_qwji@#IpRoKulB3kVuJhq%7^$k+pk9)e}N4V z?O8|M=6HM7hxj=A7-v$o$n^u4^)KUp7;v`p65>dzuZ{uE_AoA&_QdtcWt2@*KCZ7W zCvJ0GU;UZGM;nvjg@J6RzFHJ3;Ps%uMJaNNH?ultLnA3I&9C6CV=c@ptmETEEj9;h z7~g5J)x~=@l#)l1Hr8v%6>Mx|3%vI%cb(&Lpcgvvr6Y!jyxSd=N>LFvli9rRv=v+2 zn=5B~a#;jwe9+ku%D#;P zvjA7-2+5TyF$k!~Yv^nBS9Uyv(g{Ia|m;|Vkr3OTRHR_g)?No_El zGCMwed-mb`&8$=RSh@A~zdC#N1HU=vj_22|nR?a<$8CJhyzn-Se>D^dH{kAIn&YrL zm`#`ZvDrlfOpki`V|jV*&|F#;(Y6gHyF;EchvF}0Rw6U+*oTN)n; zrX!r|nD|GLB`AsC$ex_Q>6B7lf@$)|ysPtBi*xGqwd0URkj8Ba@e1pxGS}m9GcxhR z@hf<>`4$czb@z7TriFie%vn2$@@ZZZca9{O z794A&!tp2X$&|NQoV5lN*e?mDc}|?Q7Kd{mFcD{aRsm;!Pa{|%9&e8grqjgZ?U7(w zaKAkarnNmA!GAFdEZbnZp2sr&6@YA~A5617p8?MH*kHOs`M9%|#x*iNac2$GwjMfh zetQ~1JY~KB?mLhty z9Ps-ueeHLzKC)$x$M*01{3%-s-`aQmRhOQ6&99csZu|SA_kVvXq!==BRqgh)qMf$; zvBj=?TGZgQ@YLYe)2eVhh~E${A$ndOtS`HuGWHx) zPiO3BL!tPxLT}N&(&f(A<4JFxA)jpcDzoLsXB@nI>yCxl&RK;AyY4=%@3wOa+vcu% z@951>ZoTcwY0tNzk>^#hW4kweJ;p#y>+TI7-;i`|M|y{cn|*g^wL7#D1-(18!gj!( z`TrSOZNwsA*la_q3dfyh_ZD{3ihFo~p6m_}Ks$SZ|Q0YY{AB9%J!{=(`x1p8Ck1r4{uAvqCMg9Tc_}}mr zkAz}^@8fJMpHnK%dJhFo{-wl`)ZsYZ;e1ZXM0^wE=Q$kVtWC62bg){1)4^&bTCwu6 zTL|`6QJQ#MpD%|v+e_RJk@=jG_-GxM-65m9r~b#eVZH#b!p+N+GYszZP^N%IM(q4` zKkf?vBFoDC_Di&epj2Lvr2sw^aOd%DfPO0wdXIej51wR0|H7bvuK|kvxS}=N-euiW zJUS^9vzLH2ljC;|YjOpC0@sF*-0|7G4>jYhy=6U_cKK%3UW~=h75n5Bo10hMa^@$l zUC=gd@xwKpdjjQcDy}^y9NXYQO2mi%9$;?>4fifNZ&h-iRU^xKmv?M=t8ctJC-~0a zC0CxY!|;p?arrE1xG!UsXAj8N+iT+Onc#4FRZ?HF9QAhGfy*(vvtOt^>Ze~@`S_Cl zs_fer{Os$zVfYd!uHtZKIm5pU{77hFC{>_eITos68aS**D7$O9DH zPWzxid1^y>3E!_kne|Swcm-TCp4XyG{=+T4k^Qw+S?7zl&G2X@#C1GbzmMy9QVR&4 zGB3c2Z$^1M@{!2K)P_9DKP`bP|4|_>JolhX9zH-Bif4KPSDs@+TzLKwW%A4j@pykZ zem=kQ%nWhi*@iNC=n4Ar+An#467^Skjt}L9hYym-!v`os@z@6_-nc0bAD~bk-xHR@ z+bN?~rtYimKg!qMd}V>362dIQl)B^0`tUgD@IEf5xyGC6)(vRM_Th8Hm)OsNfe*&s za_#yXF59s6XT{4+&4QKGFBc=Hcp8a%U&b7T3i08sD%bmPdY}7%`y^>qxsEtbJjXi8 z&p-S#+~0Rmp0T04SVQF*t=?Cjq~2Ga3E;1H?b(R^Hq_mnO&Afb7q*>!XJY%Cf$M{; zy#x;Nv#gBj{Yd@-hg-d$Midl%2eAvQuRhn)MNcpG!U?{%;2r*wd;Ai8Kq`Of$39Le zSw*$6^FPM8_J*IVn1imGc;$7~_BKu68oBwUdk!VG5#{R~_Q(&uK8qN?a#p#0zxTPb zh}{IN-^qPzx%mvS1FPf@3E`A^?7pTiTRvdDPVUI#=iF`Ouws;N!l#~jj#$ORUi;lG z+ll=PFkQIkcO3aEVyiGSiZv{LV#E8hCYtAfU4}YPmAPx+p@)c_J4XJ<3b7q?#=S`F zH^6$F+*h_g^$M|7Sapis^ybW~+V4BtJOykcSP{>`BOg*6e%f^Dh%ykCo5A%)rGwZ{h>BUBIr!%Hz{wF60k==h-e|H|;6)a-)2| z>b|RqjmL^pxtRyP^*Le(VznKGYq_W|JN=>Sp8e*2)oFMbN1@CGU3KxnTZwgf*rM<3 z*hcKL9=7WJcRv60j}EDR0N8hM9jZ5<`t+A>BDNkY^md1BAHV2MVztm3H#zJpuQzV7 z*Lv7v3*Y!Lv6g+JYp-9oHS-f-?*P+l+y1p?V(SHmReu&<3&)R}>bc1u>`m-(591he z-R$V!f`4T$?|I<-r|DpD4qy4t+176Hc-uIMbU8mN&+#$8xaMP5U-RqNmfrW<`yQV5 z`qs@9Fy_L-50Ch0@XXR{PJ8Tys?FcTB4V1d>Dx_9UV3%j?Q^eRb?4Ow%op^|SqGiI zYVWRvo8NpYb@hxa{{9}*Dtbhx9l(Ir1meo_{z-6 z{7+qSL-wxw$2=(vwo3lP@fc0geWmjH>tCySK+oxV;J8zv@w=($6Dv{RD-he^UAhjR zM~}&)T#E5m>%o?^N%trVx^H-_Yk zvFay|JN1QRj~uisfabR1N7P+s*Ck5#|1Zt6hZ7T_A>@ksLwkwHoOuWeHOr0ct} z7~q?}`Q1I`{uNEQdNlPYmtR@397F5 zeEyzO+osa~ugd$FjyEy&ad23PGV6-cKc8HiW@a07tW>8`%3l}0&hhnO#3n~0wM%^^ zNLQjP?YiN6Z_%t14#!2xkx!K5PnId~kAwPuB#pAvH{qvKN32iRF0Qp{r22H+RgTx! zAlL3$Yp>^8(_;&a>K|z@=ZIWL7@u!6$YK0nt=C8W@zC~BSMIpAJ`@}2I$h5y$6xhZ zl!VxipL%MxW|>DlE5E+&@a?DWMN0W=P<1`IbuN5a)xpAU|Fvse+v(x4b)o*g%8^@r zGQCFkgqBD9`}SMCbKiYu{oME7?YHY#$AiBdlP4ZuG-unB%{H^_%b)V;E9baz!|%w6 z^C;f~h(GLo3t;H0yUzfut#oc-S70lVk z&peL*&8Wp2d*$9@FgqXgmW!F(jM|po)%bM&te}5+VQr9~oyU87JGB#R-B9a6eRrN8 zoZ>o4$A+KdB>J{EQ(DVUEZnCQ#|-&~;r~=W2e(tkT=Yg|uC`NueR*F`B=v{u951~*q9tl+>goer%w>+PJjGGKk~XirSVt&!M^+B&%TW`9(wOV z<#>(8k2tjH|H63Kn6~9n+g^JU$+ew7UqE*DEHNIkP8)Gv`%igI{yNolGm>0#e=8S% zeZJ(l4=1PhpK!hst^0AfHe?IhyfW8brhOlEt`H|YG u`xc^=C|h0>HL3;Nc*wwT}MXhPuyP0b^irb(`@bl literal 18429 zcmeHPTW{Mq7JkpK&^*k%Ok#-C-M~CJPA|qbZIDZW#bOcA66I(sOMxV(%?#$h?;#IK zU94Q1rW1E|3rrG|6iJ=ScdnkF|2aE;XORin`}utK#`!_t&>dRa=lM& zLZ*8M2M1!7*fz0#5kGD5Z||hyDO*nWENgxFVfh~(H*d3qzs}jJo>~NkYhGn6&wl60 zM_$!gSxhY|S09&2mS!<)#2Ac-9nLFO)M;6*Pguo^W@`PBW;tIRO)dLRwWRwP9PzJz ztMOC5E^l};FW1*)0nh5W^(F45E;`t8eR*1z%^SAnc=^tW@&$ksk!EyVu!QK0HbwxS*sV?znXg`Qm!bqG)(ku)KdwWQDlj2(dkR zvLTD0^nnFzMJjbRqSO@}h5OrH6uEY&PJYL3c{R0gpZ7qiskMm9VqO*v%L-n}{m+5Nr+!1SyNU@d~jk>&*CP#fn!H# z?c2onsPEDri`GbK8WD&1fge)AyK$}%qPXHlksS~>l5#k{mQqi0(1}Pu;jb`!cwfh+ zzGnvku3cY_aQi*~{4uMuWtIab9B!JXEMAi5#HOH>Td+T6GmXI?o&R^Xb;%v+b(?s^PIo| z&H<~X0F7F|IBWQ;^>uT5v3OBh z2VO`W4@Br;T8r34yWKDCnxhNo0*wQgQ1YPbaL%d~Z(fwrq34l^(&!OR+Ad19?S!sP zg5W-jV%+Tz)Fba`hz+KPT)m^1SGo0uhWhJaUBn$A)nmi zL}?AYVBnl=;z{;vHTxmcVv;4Fa z5xormzf7$Id*8anU%%t8&k)demYnJwVKPWa!hTe+zI@G^E0NwX%Z&foLjcSZeW((#76I#>xXG(c&Z}9m z%6a`ZlL;%h6TYgsw#u9tF1A2k1Vt{eYa!*KvsE5&npWD_QZCcs?V709nslw z)$VW!ow+A#Y@4*%EiSdGu;=FzLh2Jx_vu{1y1>_Ri8|IVbeNpk6X};zUI1PLVoOi> zyC>i8HIYMbeO0h!&J&T;7O*&Hb#r#blJYauEzrK4@|Z)~doX%j3M2Uu>MUhtmcGkY zSItRPF8M{xR$v+R4rvYxVg2^pF+^mdFjEh#B;;1bzkO@9$>4So6aEu(Y(IqnJ#Z@~>Je+TVr~mpU;x)R2=4S?CfLxy#69kX&(>%QWn5v%bVy zz#(hmt3{EP;)<4)W);wAvlN`gH-vfzew>#ZVSDkdI}Zy4=$LjT%#s+hBEBlSc3(@n zA?3$1-#}UDhF29-w6?dAMr=_?+OOHQ<|IVtP=&eS7at9K7OSGH_qH~QWSD9Ka}E1EY8J#@we|9FB`5fo?fdT<*@ip_CWWb4gZZg>VYwyEXH@!6&+ zFFqc#FGpDoTgEV9PcR@cQ_^dhT45xg(60fZE|hpcHsJP#n~FAPa6c&V$dsq7$;l_X zqvqnc(%4Al0y&_nTPatms;{#g&fG;sMR7Bva3#_h{eWa5}8xRnah|%BQNxM zl!TCG;99VqKTVyGfFr154%<|9_KwSzXx z2>9_`L~%I_QyKyaaL#z@`b(1f%XAsggfC;tIusMYh$RszXn5j0XLY?upu!8)W8sY( zfqx6Cn+x^TsyN@&O}RG1^D>tjFFg1Ol#n9dhEy;h-Qe?b@R^y&VkU&N0R0nz;MsMR z2~9Mjp|qq;{~P<$uGunFXt?LBxMB61s@wpMm<>&Wp;ym?8g##?s)cD7z=~xiZN`Vdo&@Q?!?Hs3bceRsZH`7r5DkIGKpg@L{$>VqJVlXP*9>+6!PfbXE65FwH==5uOPe5^YBBMe zCH!bpsXP>*K1C-8u^U|}wX{Q(ab)kj>)i|VD~+#MUm|9KM}A&q&?Ez1mO382Lp3_J z@Z&UUdU_J!d(F8OW2~#{)PV4;ncE`dxx3bii6^KnR^EjUwteK1&&tWmy<7k1uVS z`l1L*_T}N?9IG3c;K2Iwm^W8tf-c2}0s_rXX!E+H5^G_lL|FQF7(AC1wcUN-}cSugY3a|oXBIv1kh?p3jZj;aZ+-G@#pGuAs3xTQBjtA~e3 zfzL~J=OlJ$wU72TJ%p~4cB=d4f?+D^(0Vm~?~BC*>G>=ElJ*v&mm45k?` zL9|*xf1pOblly_9?eM%)=#E+aNg$WPs$W5bdMAwwppyQf7+Q}KK=DdDzJ^F%k3zJY&p|0f_=4mSBZy8qgcl>TH6}LNHS-)m>vJYN*mm#(*pdvK5qnfG z+77?n(~IvEV?vFbMUY?OF5wY(U6-W}2gQk47zV_1pB7`PzC6)1GPSU$!IDi4Qo!{r z6Q%c#;$W=R=K0Z8?e+L=uO5^o)an^Tw}r4lg85@XLTi$DkJWA2c@QL^m;2as!V5y+ zAT^rsm?qR)^2qj}P121aPinh14SWhM@jgIe)22orKu%S;93UrB2K=f4p8d^{6H}Xi zDRRu;b=Xciu;PJs>Wy&go2f4M{Pe{B-3J~+bP?1#LDZ(;Kt%K`!wfOh+=^gP zfRq?I z)?{_z!aDxzq``4VKri@O)N}L=-dk1d8dc>G^e*2vM(^O|yJ^GG%bRB3UA(;Mx;B*^ zXh{)bGfb}UK_R!=9px0^sls*!HE~zJlue6JC?Rdm4) zqkZe%9>d<+&W@e#G;rbtAs^jc*#Ab~h=gfb9d^xkdX@eMWXve)?#Wo!C>dS<-q?7b znBCbmv*J5FtqDHlI;rw%{v_h(EyDGc-Fl<8kU*glr7G$QO2-<8s2lbqR5=n9xGhlv zKLYGs=s<>CZ3*s%552)*M3oQ@%;b|Lti|r#ld$&NWF3R{lJEr%Q>VwH#VqY*;5E1U zu5~Hl$&J<{;-)33he<}%MrTLFOo|)wB~JvQ>VE`bzL};XXzVcCg~Y|cl^?VW&GPFj(J3Nt tI@X+UDC%If%9lf{s#+-WDB#I&+q99U!CJ6+h0YZTIQ&<_2OENNQ;1DyY|`E)mB%n!oKhM?sxCGHwnac zf4a}Z(UZC7o$tQqJ3rrdzH{y!jA=T@nAS#P%u&WPHR01t95-p)_|>!8(#2f9rFm@E zIcD#^eftt0##gVF`vpePZ#cK!1T;hWyJiQ##L>5^mXt zBCd={;JDygyOm_hsfM;5h~548VNG+;xK4?!0BGV>JhdX&jOgm{VHl_$;y4>R$~0I#t8C*mG*lS_CiObf0r_vH@_ zp5Xyr7U4PB z!CjuJ08f~6!Sf)>F2V@d>$F#3Dbx+J?59I`I&^>=DiiE<#Tgw=@seL zR56{)n$F8&#YOp4wy+|X?`%rty=)Nz_34b)FcTL|sbYt{aBnGqHP_|ki@h#tim80N zS2SJzcf8f~q%z%}$t}O!Yb`c=D?ISGdf;vLI&(c~}Jt%3~dl#S_*+osMfx zc-B!P@)5(Q!x3B@pgJfz9L4Drb;8r(2wq{TG4X0qW_y_h7emnY(%~rXwwDe^aB<*` zD6A1d$exUwzIHqL#Euz15I7#AB{jI~nEyP{N6*?T@Uj!NQ)8X{TZyipu zFMsH8qWq!5Nto}Wf0lukeM5)C6rT^F!-Uj@Jl_m%t_cc@@g! zKgHsk+1|)Jkp(`)wLhz4^4g!L`uO1eMPsftm1)iuB|2Dbdd(WMiavsPQ?8KqqXt`E z2#gDOT}L|8hV>ek^;qbwGvSIoKi_7rt?;bwjF+#;wr9M;oHPOpJJ$R5ZS5R&VY>A0 z(!;jjvG)15_Z7~D%EQW}dvR$ZE~G?!U>8Dj8OVjO>)7S-C3_4onm50bA>IFytvvB1 zTY20idw(uOdEzcad0ZFLXkZF(Mbt0cBP7gbn8-w5?+@XViTy*o&R+X21UD+qC6YYi zLPEUF$K55HJi7E)7m^ftn&x$or)i1{As#hNaUsN`rYSB&@L7&&iVGnwrm6j7mu#zB zg^hK!e`vZoUYl@z2QtTy(@O9%b1n3I2xUwsyJWlg4j&JfY%%etfU_^@LR6lin(7lS z+2Zn5AG#3Lhc4$=J`Y_86HVFWaa{;qj`D;qMD_x2;$G@gh0GM^8DTNOT^?~E#1qzq z41;p)AGQNi$>NP@*D1j9zp0Ml<9%FQNGQL+$GOxel7h2cmjNgLD2Ipml|IfTQ0v_S z{CXchBZhDF@zD-`FR)$6?1wXvjjcD@pX@*3kB-aO02kN$qR&6h!K={!Zvf{!Im_bY zN*Lk^fW*fWPa4B;sM*WHvB9+s-mliB3dMyTskYoI?rxgBRu5rR2+YmVueM-gl*?0~ zG2PyQ-A``0x44jMmrc@&48Dd`1fH8JdiiuJQ!oqZvs-IZ#nz67?1~&n;>e109!hjC zXA?|8KI?Mbc9ZAG(sSc(TTM;2wIj#aFjS}|m+8hvtjEje({0qut^y5NE76(ivbTB# zFW=)WZed#*+OxU5HxFA%s9B%O*L9@w#hG4FT0;Ts`|`z9wm7?ibROI3wMlp@T}|y+ z)!cM8-Pzq~85XA35US}e<`%ciO|71pE`Y;sC#+2tU=v8BNO_+1=IUSj1 zERnG2PdA}F{4Qa0v|U`O^~Gyp7|NQk2ji%TdH z;tPFTLXi+(?BfhYu&5y?%tg5NkU1{Hk(uJ-!f{|bh`YO@ssK-zD{;L6nLHzqnc_TQ zC=%rvX=N#&Ft_6R0c7%2BQwQ$BoyhZj}1kve8T()pHCo@hoJ~loJYqY-YyA6M4xAI z->;F$Ga8vG&cjfozy28$;0g0Cu7^U1JPbvc;yeZ`Auy#817rnP+QjN{&??XE%QI3HXa*$*=J z53Y?-A2XP>k!w4BGJP0N`b>%a8TDayo1P>d<(IWlaChwux9JH(|1=w!zKv@mQ``s3 z+9Ump zqmMWg{aT*C;ZR@17v{S2c5mdDYv3}oo%9OU;LFUOkKCGm_yIF<@}Wz2-ui_F(;obf zi*9>%<%*FPP8h%W8T0&GbD?B8Ho^xD-mYDCLU2(#Xz)>k9E`!!*ck-SkgUPuGj2%M z;C-BO$j@L{c!rprxO^6w{Tv3v@=gfHsRB6+hASgMei#f7v5#(Ff-L!MFkE82 zl@UE{Fq|Yl)Sh#yo?~zy`-!;gpcxDcF7JN4hBEbGFwB%NL(E(Ftbh>fWiTx5se?2mj+UY&urydLd)K2NQANKJ%4$kr7IWu`0 zh$E3_3-D)s`~rak{#Se+`WxjZ&s)BHqc1<$1zzHKJ=SF)uh+PYZfJ0hoa$}G!SW(m z?CZKS8GBNS^U-WOPEdO!>c^fT_Kj)6`6tdx@qJw?ld&5Z&__}1DI!v=AHurTkXLc2 zpkF-?*NPpvws|;T1&Y^!JX4cz$6+yRY3;D5wSJlB!a|@DeSn%m!RuU}>0Q*@<@uBi z*`gy}pUI`%vb?+C2-G6F#h-=8wOrlUbQo#L+w*$t%Sa2iS{_C` z-$#LwlZ~_-{4pQ5k(Q4$0>k4md%umeYC@hDeEBfak|+JI`nZj>9DcksY3tQUi|r!+ zKH&J@aK|TpL-3>gwRN6@Q~#5IQ~&wIku(xL+sB&(w)hsv&-8Kb5SbV$GGcB9&WO30 zV9D}CB6z!VOcIa!^F7_)KEHXakr~l!< zv_NEGvDdylSL+pu^=S&=?FRpQyw0GnHw5Q&d|-hyyV~B_UJfrXPbGo&|9t7fX zKrWwN1KL!EuV$>sckTlp031C0F%JzhfhFeq95j(atSimDV_i_ssGef^-nU-HF8$TZ6F?W&dgTO=JW?;_sI8YL zfc@3W`RMX!d+iCJ(=KhVoB)zv`a$cR6!1vBzd@PpmAEvN*M8;+V1M=U1klB`UV8%Q z=%e+@2_X69MEiZ*&vE1lAd})pCIq)9fEG`f;lM^CbFNLNFcRe_1FJ{o{In;47MHk1 z?Jj9C%17<4CcuT~QlF<5I8%I{*IBGD&&&W9p38k6#-&Vgo-i(r>NDHQQXa3Zfa5x3 z#%VS#EfJR!&n-UQKyr&mPdpiyCX$qoo_I1Y#jO^1kr`g`5)zYPE3&w* z)n+ll-FA5aE>CE#0T21Pz6pQy2~9iYljMn>8*~u2Ir@Yq9pLhW0JoY7WVFL3>VG5Z z{9C`?l|)OTC)>3RneECDN78z=U7Z#a+-+Ajz~u?e4}AU{NlI2evY+are3E$d3C$J6 zZH_(>VYn-}oEy9dezvQC%*6iRf|_3Q@uI*M=l+gAKW9I4{qIko9&#kf6V+!Gahs$1 ztPXH_LNlyf zD_-_x2l*9}eHv2Bvv$bY0v{{Li{|ksCBfTL{GBo13X>E5LRiH6<5VyB+KSEX=DQY| zv>f`U+Ps!&+>JG|Uxev&DT6oug5uO~h<0%Z(?GKZ- z`a+O#stQ3q$v|Bppp}IP9;|rzRBMqP(DzL;dA{SnT4v4E835AYm~d_1d6E+GfqxHhB!mWf zm;6+GN2dTE;2X2NW6L0VsQ;Z9`TpM}SDqmQ@Kgr4{48mpU&boWp^&e!_eAwM%*W+b zNqxz3&}UnFa65W;+VfSX|NNUvcg*W8OTV?`7k4uhe-YX3UAja{GwrW;kHGf>^=>u3 z>#ujYb@?E@t32`ERi452uJXitS9!E|*zW^oT>?;>(uJt+G}%u zT+Xv^yqRv#)SJ>h_&MT>Z0Ejxdxw1e+SMCAwQ=V!@>iLP`la+Q8s<}itE%)l3MJ0L zfmc<|_ksLA?SOU?UsXAeI8OX7Ve|f1Rpl8H$jfS|JcIT7$`kkd%5xa_YkYk+!`}LP zRbmTzg!6^Ev+YdmpGM$3B4T^Q?}zw>J}!Pg#C1z;{eBXU6vN*^e1O?klj-WCs5ZC%=ONI~CNTtK9vphph;`SM+qX-(KVze&&)7MZ z*tc-K&c|+V8N0yBLEt(c+j`1BcM;nGjC(KMJNdh}-%N~W13J;lnvS@W826=~FL(cv z)9xmAI%bSw$2{|eM~U6wV0(|a?>S;`15>`Ik1hP3SQkcyXA-RU(h0BaeQ)9s=5b&f zQASnfhSo1#{64S_w7Sd3@+)uu9I(~Fw%f$W- z7~jO?ME-}nFL{&L+nA-N1EZnrx%bn>$mRv@)JKfvHU?`x8gojWu9D;xtrKB z%uvN{-!SY6Vnc^PS6}X>QBVAi*bZP{^RX`vtu6l#ESrhNOe^~BzGu;rUR|D6R( zPA1cN_l780j^~;hqOCeS*OTuV4AYG`oiJdUvHf zLS~-qP;e*eRxezS8c1+b29`EJ9!7hj!u>x}D{-EqzFvjn{?_v2GP z?manw{rQhRU$*sLOf9B6CY~^5*^wQyx4!Xs;+ipO{QG-M!>b<|)^2W}v!&tdw+^X$ zXoH}u<{Ufx!#lrs!JQ*7>A2;(npcG3H)F=$cT3acx|_BntJ+`McAUr#YyIjAuZ%0r z`plXQ={p}dWS7WJerMB!)^|rI*ZOeb^ z&9vxqART!BVDwO*KzX%iUhCZCwc0fGU~oOpTh)>-q?e~N>0+<1)SucfIv(oFSg-mV zUaL>yHSJxhwLj3d<1?84;Jxvr^FgPa`U1+S&9dDvdB4s=@C&@bw3$5n8wdSP{Waye zuttBGGq^EVE^=tn_UU)(@AW}ElIYKTZjL-I3xs3kRdR^4*57m!r(Vm-X z0SNA3=$1&A-Q01ea>_g4rI>cu` zi?dj}XJzqA18>~ohH-OKg_S(d_s{LmjQQx<9xUnx;prGIo#9XSI>C&onAZF)PDKNx%b$PIn#IVYP6YUSN^;&uA5E__2Tou ziGD{OV#&VEd4OftVE@^bU4!+pmG+I=J<^%Od+>f}tZokFtXdpT5-viaF`&F06w+9DOUlsbr{lzrljn=Mw z|8HiTc-B%IublLlM_Yt#8rmK60sBYKwI~}V%O4hlbtcr)jWso1c5cv1)k8mhdCJe zVTKfv#yp(sZd$UTb~^JJOXkmDE}ePxl;m^6r#LcJ=L5}Co%gt}6y~^IENhk;RIfOH za^f$iF<*Rs+YDxrj{F^zUTSBdPSkJkdPQnPA>Lo{?@=C2o8^4(vdd6;<_yFpTS1M^@zabj$o7(N0l77K$dQEhG1lA%^R@eJnQx5y$X zs#|t0Pu$+w0I@ByR4TFVLqGp>|KyEFCv@lMi~U#LPphB2j?bs7y6o=!e3CVbT}CLK z?(FUD$z4ha^?s2*iTt;7+KPhDraPXuxOzAHkI1^$WiE~?K3`5f3d>8;mb@x|7x{b9 zF3YB#dQ3r|GUZkihIHG7LI#H9&c!??IQYntvAUkD`Ld7^qj8Zbs9%0j{<0gJ2SB_c8e zQhPA!ROGotN#GMd41yg8uey2kfPg@ChKO;44E5p$=D6-eTk~p2CbB}(H*(mada^wh zdD43xuoX|qLBv=fIZA0t0}|0V4J5|U+jKBY7cg6Mu&3g{GGk|b#wCrrQ58-6F+ zsfYBv1rAKT3-PHt&YD`0e8K1EU0c@ksdrg}OwL8F)+K;Lw#N3B-=2u&wMI%5PiEKkLd{c;X2Ak|c>)z>?^BvX9Z&Cm|!DI+)L}FDAYpM^X4C?2F@+ zrGz98;5Do!2}{E?_L;)FxEf*g!K&+?meDjwm>-6Ilsqp+qc*W9Or?!UlwBHUvt|uuQ}8Zv^Z*}yAB}ASZYxaaL!b;nNt*a1jS`wjj$1CGr9``ojFa~DDJ?ULqc9|C z`X!DPsoyTgO28ndNf9f%^5%lKbJ0EJN&Avi!ifJYy_O%yfI5m&9Ze6yH5~)uNuM{X zHWN>J(m@EGjS~9Ie1(nU{UDB6#Dbw+cTI>4rMJR<_z8(Z5(2r;%P*U=2CoZ(orJzR z>+xueG0d6#n8XmI2hjttCURp0aw{5u+Z*`ibsj#Yn)C_s=UKOvUYR9n6fz$prBP3N z)MTsWptv=ch|CzVIMP=pkbZqU7JftRD(D2tzNDw z(eBstN-STOs^A6hw{`@&@@8d$rY2n3GFh-epu^lpkcB-mA^t=1K$RfC&k+g00^#E7 z9xnBIg*3}*pyrY+UV=IJRxb4k`gU=tFMB)|mn46nWJYL|go+anD(^$gf)n3Rw{;F} zFw$uCFui(Ah3hqbyI9%h0*}Q?v^nl?Fxr&fv;6K=6kR47 zU~a+SDnCtuclR*4*2B#WyQLn9@G}2SPhc-*o zTF^J;{JJ}Bo0+&=@;Nw3gQ2JZ5a2iWPB=6Ypf9srcahjj*!AYC5~xdg=%pE!v7ZqdM^Jj>NkDlT%+i2I#1Ce( zA{n4rTw&e*fOpyTaa}Z$M9(YA7S3ojlbppjgmwpB9yTlKI`OTYo24;#{IV8ibr}0~ zcHOv6+eo@S%J)sRg09f5Xj^D#ZK6@}$Z@UCe!*`HC!yp7O_*D8`QEbUcwRTHcne)E zIPasTJ-p^^_d;~Y8$0VidO(e@WcsA6%f)J;5S~Me zZR!PTeSg(8m+w#brx)cCP-d_}CYUtXEfsW3y(Cq4nAd=S5jrs-8$i9~raqfD{>i$@`Au6&O|+t+wWP0=TmRF;Y&a@(+=slr<;z!XvjRI}5t>@?uq6X6Xn48< zW`t?IRxl{;IPfN38fHO@DGY-^9SbnBfpWzm+$Jss?0u^^R_2_+=<1yV=>5v zR65a~0g%qcZ4EA$+zQzd$JH02;&%rEW(b7c(56oj zd%CKYF4y#9d-?Q>D32rIQ&xa#2jMKEqDXlGJ#LW~R-<(R)4ucP@Pe1iXp)C{7G^0a zz*2zpL7SP*W}Fwq#cL)l2A0CM+Wt0{f-(pbAW9Gc6{!elQJjS=r(qQ2pdd-=M_HCL!ni-nZHx%6^eY^L ziE|y^Xglq=14w7U3BXS<{qPeEzJ@vDcNs+H*!3}H4y@j)s#F{XfmaP6>}QoOAZSLu#>g?AP@ty}SkF zyD$&q-n9z{BLC_6s^91Y^0x_CG`PE4wc@v0th$z0yWZ()1_t{d;_jmPAnM<0cn@`$ z_xUnOr!lN1u-#wYKu~H{A#ke>fhOsRv0x%sPDFRzK>C2us9f1!V2s|w99B*C;bSR{ zaliPkE#W96@-ZXWyM`^)3p@4oU3w8iB?YE;q;>njYO$8G&#E&MtL#vOq46RW2QfWp`9+MU@MX zEaF`T0`fzHMrxphaa@zsUAuH}_ewO77q(EyH@Baa*|i+lL;aPYubZ~~U5+DEGHouZ z1`7QK8jKUn;*IUR0o!+e!!tGMho%709*r9T8;x$E5qKQu2s2772%wpm{$j1H~QMls2v44g+n@xMP?^SIs-4~KV zq-~7KE94c{QyjZPCMu%~pjDt!x-ykeF6&MD@yJ)bI`!~!lQaw9kgK6I zA1s8v*1Lu@a}|hJQLFa}Bv3Y#yexFb1#FVnfcuQK5p8eGkYc z){_pC6O$Omu@fJ15MvM$KP}Rf`F_L;&Im-yF%QLzuma{n(}0?oP%5(HsO6=6O$^X5 z1btUS$^8Rn|L##~NM#XFjBsVYokL+%4%lnbaT)9DX45$)t?&{`K6(hZ4;r(WRd?eN zF~Sbw-N7?~Tm1vk)0oE`RSmy)6X(kNTL(xFAgAlM+&7nDysp0*y&9(*B6&Q|U-6f! zJU|_HGeb~vO# zlI@fql65i@aKfk-G!^x{7Pa5F>|mYN)^$NqjXiS;;nFnxu=$(*V;iL{k8Zy_zv724* zdq=jQC;;f-=g5c-=!??_u;(|JmLD15(RqS1v4cM3iw6j#nqnUqQey~MVDbvdgkCA0 zi{9n1bMLOm*XGwIL{GsW4w+&@Qv%8X3I~MiEP(GgQYdK30|sb>J1uWjw_47BO*95c z$Ea-Cv)Mk`>c7(1KG_d=h}M;_ zk+Hr#xP3C_+tK`cW$f{%PC-?PoI^ydRe#D6Rkey_d}i!)eMsC^JdDX(|8#Q$VEAe7 zh)qNRUmuzKd&#Z+e0lri){WMr%8&Tn$Cq0aSsb9%%`+>g_YUhBk?gI&h6()2aXrVx z8E*?^D5%dVeWEGiU-P(Rk{Fkq=q>_6Y?wh%LojyNYhvhbMZ>(N9hlo=>~%HMxOtkY*4Fx!Hv#d?mgHbk;t-CWD| xh@y0?B7aap#d@jx$uOy^A=R8Me)6PVRZZa9{K+|)exh#MPUbUHmydcf{{=suS3Up$ diff --git a/Workspaces/InspectorWorkspace/Prefabs/LockUI.prefab b/Workspaces/InspectorWorkspace/Prefabs/LockUI.prefab index 20018a99568a81912b05053e46e08d1e3a48efd4..20c19021cd23f607de4d7e30d120b53504b0acd2 100644 GIT binary patch literal 23236 zcmeHPYm`*gl|I$ocJqjW#%D;dkXBFu@qyx_p^E0!*g(@jYluXO?n`$;byZtc-Ow6C zvEn2~gHG09;wu>-I7>~Uj){iENpzx<=t7;u#3UNWpev6hlV~2JqekudzO(PX_uNYZ zt;x*f2L}#y&v*Cz&OVR5&pxMaVNBCzV^%z3j5*wxrhD*drcF6}%G3>WI!>p)SI%F4BG6}%tB{|sGL>_Tso;?T z6mext0)PIg+EngMm`V+xM38x9%=?ik&*u{r-mfxGg69O3--pav<(X>pJQ&YHnLHs^ zwV49`24KUG4?!0BD)Th(xhRvrmUxBtsuQP!hnaX?fY(_5F?fdDoEc;W^&H zU7losC(K#k*@-fF#szqkhx1+fxhgWB#|L=AG^0(A`Q>_kri^JRdTTPP7Zy6QYqIT` za<-5+-IvCS%ZizNX-%Qn-I6JK`7#9NW^-QCY+STt%3b!teWV1|LXTH0_q(VmXNsL( z+4T7L_^9d2TkW1+jJkVl;*TNi5=g(*@fl;>r- zy~Xxn08J&i=WEH{z*M++<*^Ukw{gpd@7w*WDL;Stj0^{26EY3`E9j7S>u{ciBjP|< zhl5W#96Aqv`y#PI2G1Q!RW4vG#(aXLkv@N_tW*O+=tyjdu-z087(A!vK)a1?jjONS%4IPhka z*#~quOmysYTwg{%P=7icQ?dOP(ce0p6!ED3*5Tk0;;!Qg9ggrXgADoUa0cVI4kxuY zf9P9FaHM}a@htl%bU1?l$zS;BaEwWTUkteq zr3A7%oR*ey@d8_4=(=y-?rmN35p5ABw7p7v%;5@T6qwqb@&M~U-* zbIQffLy0);&BZT3i8$@e#b=;ITp^^hS3jN%US2ovy^%|FRvCvy*!WDaQvBO?l;W@oIub9qv=DgDUECLHV)&m3EyC+Dp*M&42m;zi8^$Yh139}U@GR@cfefVTz{}6Aq*S-tEgNk#BB#*d| z5byADcgZG?ErT_qoye?gm~06#f1ny$1zQDA;iTrwSVlAZFQ@$ zv99(HO;^Y3CS2cv%rWG&61>V>3q2n|8Pmxw*)IO5kB3XPnE2Dc*_U)7D$h_&^$C}3 zarvqbU5M&Km-8E+hc1MPrtI>#E`%;ec|sQ=dx2N+EcHnuGsStvSxj)3M_dT;gmodK zp&a{%?Z8yBcr)5{0&x5_^)Y;^kBbWl<(K$4m-<9XaJK7G;N+j+@DRVk$GHS*z1x6a z=i?{G@a;Z+ii3X**yG6Thf|S_tvA}A>_6d;j?3f#7uWlO&p*Y%lj#3H0_QwA&En)r z7~%)yu=N!L<$DuQp~%<)vMjj>3BGZd$!|4`EaYEG*EkwqavbC{my~ z+u4QPPhqvUyp-vbP12eiZbK>pFU*v^Vm6a2nWgmE?XxoF_O7P6K z!fZa<-P>&$mS!&}lpW}erxnBek(i@+BYsy#Vzw%bwE4RM< zqumn@TQ&WzKY#86=QZ5<(%olmS$9$^qpK@XDeJ9+Z+SPN2>JIlh8lIo$55k1j<58= z{zDPviI1W340Q~ZCq9PCA{)MlOYX5kwm3JJtO=!6iE?}hBRyk z9<}%q%;mMn)LTLk;u4a{66l{E`2E%fS?&TEUNICgCJAYY`WK_b{*+K8#8HREB@_wq zr9Lj9NQf`@afTvT)Q}VAB3ygO9G9`kO!0ByIItbW-Ca>Kz!T;QTwjk&o^i-bah@;~ ziSmrMvXoDl9k~7mGI{Eenc_SWitMeA4MnVc!u%UPpF$=NLlLGpkB&pUT@s3jKF{E} zJ;>xa1(_+%!%$?f{+Sfu3G*hdhe3!u3`LmYJQ9is?)I}AiqP&32M_CGC_<;oeq$(J z50LZrbmBIRr07(`i~-T5 zo=1Z9^NN|Cu53G>#btkq8+2TBWaTJ7jqnK#?r8P;yi5*4v%OrVf0l>ye$U73+L$oM zj&JH~J#6)+lTJJSKiB_h&C=O7>>54hrpl~=&pva)o+EZQ(?&mq%yB-rHnJaN?jKwm zqdsORYa{(JeG7dLPx_eRJ~G^{>x`>`OVonhsW)DME&q;WW{Y2c|K`~+$TwV})1?3uKM$AkJ zQ)^zsXAOi{FC%7YSDkGa4?Wo~8!_Wk>(zEKV%B=y$eR(f;B~fL<9vP_F;^^4q+N`d z6Di`uBkc+!=HZcco$c^H4~=JmpY5^{v%Obm4{cj~+(yhk&YkcoUmqJWSN7KDJj$l_ z*5`c7A-LPm7X)~n{qo>4@Z+y(K$dwc{a^9*nL!+h^OpL2#@A;i!3y!{i#RF3qEGZi zoHTKpYa;zKE5H-x^ANZVnd8`q%oJZmXIo5gcO2&gxE%i0;WUE%JQtZs?es42Q;&HB z(;@z#kI#2-ju#K3$)9`(eZ9tI zbk~E!=1hM(PM?>_8##@=xtu*t#UX0G6UVH5vNgcQB6i2L;E)uDs<_{n$>r=W2lP=C z8;^(->xZ!JN927SD(F|w6S#6$p<@vaVS(bEAI0CZ@g`88Q@_O1FkVql(3>Wb;t{AN)@+dU^A{q}fBU5<|mh``f0-fsWqJ*!Ld; z@uh{{qWx~lzn{jDRh~{y48GcIIj8QnnUc)oj>7gHNLmbm=~L;1V@RhPDU#GJ?j=P?lk9{JkX17-M85*&;xA+*-N%XuYzvqP*0LaM#w$t(9@~)OtA|T^_C1Zmk@7tyi{Ip*~tK z7aQS`dVhy9+bdhEP+sfh)@rbNxwUd}t=Dd?9DTH2*;3czh0nvS6;qt2(PDe^ z%noqjS?lx6Aqi5Phg&O%SlrcTUV!6ELkMg}X23z)Fcr$nR&tw@LUJuIOO8L~@{CZTx zcDY;gWt6vB_@-uK6O#h1mTmtBqAVfL(d)=zO4ggzcI}cY7N8)(F zrh}hCe8ggcyW@UIfG5l`;5Y@DA|W%?e;yAHOufqeow>0z7*3 zl_8GAqc8HTMQyBiHNgt;T5}ojjmWgGcH&6-n<=%g4vPuyw#y4}Ir_R9Jmly4Cj8N( zuTILR$P+#K>LPA)^yn)a;BxeWM@}Rh3gXz;pjud&K`m85zb5x%V0WL>hqpL-(AGmw;bv$tDc{y<; z^;f3?r#@E@tPqd-laEn0MLg=St|V@A)ZRbt<3rt$;1?R%PW>%cq+rih{G$u|PF-eo z&VCmyZ`du)FXy{@T9{o}&-b^r*zB$0d4?8S{V&+BR9C)Ex|yw)#SlajFVI9uc9g5YWm(1SeKrG1FdV2l!h` z=X-oPIP(D`-^|%}03v61_N9R6QQZH+ft?Z4(wg zSkpNYC<8zm922hXiHDSk@B3}cQ4reKn|vqY9-RVwfN#uldch!in14@6ceNx~RV@``RVX zewCs43&?Ko(j`)wX@9+Y81C<@ck6L)u-@g?<=ynI^2B>rd4}4%$`kKh<8443Wl&~Ye043t=D;IA@i8yDd;PNY?MJSP*b-VIf z@8L0A>pdcdYrXFeaN%c&M*brMJld|KVz}}%^l;$(tXptdg6kp2e&f-E;tYXw96uD`@{?j*oZRg9cS?hxTHU?MVb63SbQtnYeOI%ukkTl`;+w}Xb zuI(rfLp}-Fm}DTY{1alh@=pwK;kgTC@|+ytQ9VzI;mUJrfD6yJP$ti$0FUx;99%t> zXG(wz&l4z<=d=Ki@=T54%5!>v3(qqslP5fyi1P4gVlaJpG(jA{<|qeez(aPX{%`93 zPkw91_=P{@!0#t)EMu=T8-i=E!})0+e^`O{0?QfPZprrH#~?4TodW~!)ZTLKhU-7J zW!JOCD^1PZmGmzf=2L>Js`NPu70$tZud1By`||s=1KLS^RpmV5IPqS>=KZg#%2ON2 z%W9}RL-qU06ZiYdGXnf+U!Se8x5192x1mQkU#L6V&cyy{2F@cQwnzMah+pXA;`c*b zx760}r|_+K_!jEBn0@J7PZx(c5`E%bS4Q+D|2yOG=R5NMEZC5;qH@Oe);{8 zTi%{_nCSx6gJ(f&F7H0=7GggG#vL57JCD2TSz;HX)mwaQ#QA&vgV^tZ>9aTQ8S~xt z`6G=fw3 z*1un~^Xac0Sv?W+Z6eB?zKg!oaMDkJwK&){|GMgyr=A>By#d$`$biDEo$%S=KLVD- zoV?M;^2=UYKy0UjowxqC%ZRmLj^5+TO*#L`3Ngkd%6Ih%`L8aynG|4c*tf=O=Z|d^UG^ayZV}!_bk5u z5BEPf;di^XQyA}rZ5;WfsyW|Uu;rrbTHYA*SN{zddIZm&RaFAYu@%h{vdJnq%8htBc`$S50CCNx6j|! zbjyy~#s{t!bp8CJ#vZ!s+Y9a-|KYALZchJN7=FIuhp(*qrcj<3U8 zhu{38^zHLM-*wJ+Q?0LmL(tz%ntb0ETc$VOx-FILeDUt1h1XUY{=>c+N>ck$dHr;s zRXc|%*rc|>g3e)H>sazy=O@RF;o~B2eOtDaU7gKk%l)#4wR3hk-h9UvyMxcf6Ls02 zKGGfGoaFO5w|T90Lmj9)Uv#CN9H>r+45?oA2b2%&8`o<8#5wPzx%P)=Luxah+h4o& zp874e4<>4&-#m*?7)o1NpPO{Nbz%i}3nBGStdqW}8H>g8ruSYK>y6i^euwwe7qC9K z1HUgzjrxm;zs7j#yjDNPdetBDT74+5)yHc4{i*y{9amjbV&m$+K`^ww);U6*HEBQV zJ@wIA5A7r9SUfb8zEv)*gP&RtuXRnwWhKm&nYcFBfA`gY;U{jPtXUAXtvG+YOlh}1 zjXy{l=E}^+KX>o9QTCJ8Rhg-LS|0`6`KM3lr^;)YpKkpc*8r}BS=x)TO+Pt1nPO&} z)raX=P(baP*E$z??fPAo-E<(mG#0`$l`xB5BYryGj>Aak!%V%DTl+(H^Vu)k54YX%^`7Gr*Pjn5H+?{|dXBA< zv7=s7#$EeWC*qpidUX$=avVdA*;JluWjH5v9_pt^@mrSVdBhNN@_1R&o3gxV%EC-( z9Z$~v6Y^8zud&(}Tqh-?Pfbd;@wL@LzTxyKQ~76763>-;i(W(C>n#^Exk<^E-qko& zztHPnR#@ld8}fKP*2d4;2W$h|!z}Yr{0aM1+lk8{x&0BJM|?g$4#xxI`kKW5sFQ5U z+gD5r#bmjVly7CAz2zRvUugaM87P4ZR}bAcsoY@W;yx>LIUEyx?*DsSqB=^6y1C;* zRP_}J`S(Emq5BDahJEy2(rd5w&V1wb4Kv?-qu=`2AO7G64Vu}nk3Bkn#uJY>+sv{n zf6k{j&5*tiUJ%)@3iPk?^_1+}oUf(~eV+fVlwITX3n}dzwS6sX%*Qx>ah@|$q8{Z? zIaP@B*0nZyg*#$_Dr!IZJaYlreGaxQ6`d*{?w4K>Hh6*eYR_@qsgOG#;(m+wHMw$e zJ5m{bx^jAU;okSh)q&K$!uZ5p``vild5D*oSCQ=BeiUmYb8zo~cA)LXGnFt?FE_EQ zS#WpFawRXhe%1`;lP_63li9uJUt8S|G#=W|c%~BOq3adrPfdHif%)QdJ7zNby0{-h z(knPu+K*nXO*zH@pe+korf9+_z(LZ`|d~O z+h1%Pa#3a6&|P`MXQO&X*Gbre|G2lN7Jc_uuphc#+7?*F;%1;99A{}^;w11AU@#aMC9))QLXieVIdM1o-{;iE zO_Y+@=~$UD5IJI9)^fKxck$2vJUM&qkO?{X`SRqI^V9k#r{;^}b&=KgUOGw2ahBI_Xa5mN{d<;*mpNaojva!>D^X=U&;AhU zdr_^jvN(3AqCP9rY@Q{&me24+&Tv`rVl^+TwmIdCmW6Ntjm)YoG#^v>SS=O)kQs~WhR#XQhgam=>2h39&SYA(8 zdLp|)(lADGMe+swif9mr?4UERI`SxkutCK`J>$kU%(|LpTGXN{c;4Tp7KLQc2(x{) za>EwM=_3bX)m-XK#H2ilhwb~+i{ePmH%>{2rUiWzM9d55c3Mh(H7})s=f^=1sq^ff z*CUY^xlv5i9+uay`Ms!)9et8FkkzsCMtppqt+H8`Lr$)t|IWPI*qOP)HaqL_b zP~?S3)$?g06|b*N%j-A%?o6z1%>1sRyr`j($%{0r%gU&+9+<99k~+J?;$t%RSm1|Y zKz}TmQ>rCNX&A+>>qo&ZNm4CI;uGRgkL;ke8bUzkLzJ$f9hIb%%#(^Pj0p(?=;n_l zIxRTnMt&H(gzhjw&(m^aq3=g5W^9Ly4QUWX1hWprrtLr*ptd<_Jx?mUC=9|Vh-vgA z3Xj6%LKaeQyLDWaWnO2um%Lht`YAcx-h-d#wAPdTxYewOV>FDtn7Zr>yp|i1FpfM} zn6#8pul2f2K3q+oR3LD{k>>{P7x=Ax6o?B*MLi!_X@@&9;K7UIfW>j>D=#-H5bcjv zrzLLvtPs_ciYAIemlBWtU}9(cEgE2e4b+c;s6S7O zEqF2WnYPy*B7aIjQ{qZS0W5#sDau%Azo0&oFg~CxRDfWV#pe3CDA!dYo|MxOG$)Kh z;{I5iZcNH&9tr(8-p*?YgrCxVG3OT(3^cIhpozzK1o+=lsh8KCkhu-lbSUmNV9#93 zWy16GQpRg4xchYM9JzzT8I2yxyo8{OFePDLkBO|`(93bfq#hg{=}?A zO^Q#Dn8{9WvOGnK!XzM;*DrZ}BZJf?#2mxtI@|EJN+qRs2mlg1f3eO*by6&HvHCqz zX%DQbH-}HXF_V93q|^rLdnTnO{n26jqoj1?P9SnzBH|vyq>4s5O+W3 z+87?*i5uFW&AK%{%^8_QG-mx+U1%=l{nCXN>U>*WkjAY&>o(^*k=Y9*Cbbi8zl~^w z&IUik8S9kv*IF?3oL}fLWpW^sBIlxjlZTsEpy_YV`|iFs2WI@D;Imw$_69oTtNP-G zr{zba%(eEOi$oyPIe2ZJ6L#MvK#eydDwQU+f z81)htDL!PYdBg~h*(_!}a6LAg&76v<85g$h>l8&gS@?va$P~q8d=uyr^GI?V}4JER7mOHS$brYwI@zf+8tY4{?6zxkgs9q6<58I4(VRx`0zz;xXTgljgV}r* z(p1b6$~zpB$V4Z)m7?htPjkLnO;Z#XQMi;4zESw!VY<0AUu%k|>s4JYo5!bRt}Gt! z$la*Vnfl~-L*J+;QVk1Om<$9jZmUe%S|fa82W{HDxnWwGjjKpce9DVEzIs)aYj}!g z!tuf!3Y=KILuS=wSjp){s~!4r7`D9D8}AU>iTg<*IN*=`R!+WpTb$-u^1*Vn;pMaz z%i+~wCmZhaRmJaDGLXZ6(o9v9wXU4Nd4bjGxwsRuoT{Hb7dgLwCQyJD%>aCtEq(XQ zr^ylTpZT=8daVH8$b4We;mq|o3dD@V;V>j*MdbSNd`3i)G&d<6&R3X^%%o433OY2p zxlNpkwy&Q^v-Z5=Eag5)=K_hXIrBqY_gt`q@g$nfyhO|gHhxv)a{b+N&i!OgfE&D& zFbN@$>rdeBq?<%_h#t>waQ}5j>8$i%Ty#ZrT$FBD0?H|On^0A=2Fz~(a{nh zCh5S-<#oq{V+bA`pYY)LY(4lnzfS1ejTp#;trD^q7$O~ z)*-A@{+M>0-^c_Z*aX)S-mce`_^lA@y5jkv^KLzZ2mXh+zbrq9;eN!S*(7;nZIaz8ru5)YZEot8$vlSL- zAHJy`p~lH+e;O z)GM|){eRXj2pU8f^U?hH_kt6&9cGJO-z%D0%?&7#vv!Jai>q$DrnI6v`n>$u4b(Qq zUyFG+7~U8^*YRotx~KNIBsoPB%E@-!HZYzLm#C>gu4d|dSCe(VThJw^lg6nNh|IA?R$^P?^0o6z01b zwHs@O?E{P>>macmPiiR+i_|oZHrTdvzi*2UZNk8AXE(f7RI(n3uJa+@uq*T%!K6gx zUN!90fc$MCagC1ny5}{N%B;06=qD%D0-0Ueoo?3Gk9C2-4tCCJ1TU%N(tWxUsQq%5 z-;c)!nzo1jduxK_?Sj(M?GLmzFZtF%-Cy0l+I#aE`W4%u?#X3PV-m>LIL7ylxJL8y zSN%(6fslwEjb%2X7_*x%ie(J=r<9_MLxK@6+kETD9`f!Iv_eh_}J## zW~@Ejd>6bnn@2+0W(?c<`T^=s^|@#(q~hyZ7HUE8S+ZwkVmdS?zCM;2=NQ{DF4D2S z90N#XaS4gp8W*=}#*r05a2mxzy~MlhPLzbT5y)=*Sw^=s5gE7Jp1scn+oKUM0wT4|*}v?}Qv zRvqC>`s7Bv61oOdDG-S)tx@*-HpPmGb!7N6w4N{fKFZZJG3}pn(WVtwGw-`77ZTL2 zY|>QH)BlzCta_@q(R5_?Z%6B^TF)=ZJJ+WrXzf|gw{d}fwxLr;%a2o3t93nyG zT%Rp=*gv%#7ClGQ()jxC57DfSwGelUj+uMt;q8PY-p}5V<0>^ey5Zv{u2D?A?*Sx3 zDugn`9x;k_+Ca@(pM_?=g#W`o5H_)kZdg#^)f4y6?e0c7$!~9DQc3M}ERXRlM~Yx& o(%I;3GL)(_OaIZgI;!f~YCvm;GwokL?Hgx?VbP$`;G1&hzjU%Nk^lez diff --git a/Workspaces/LockedObjectsWorkspace/Prefabs/UnlockAllUI.prefab b/Workspaces/LockedObjectsWorkspace/Prefabs/UnlockAllUI.prefab index 1509d54b82f29e5dac7362edc79dc4085395935c..d0f15600917ca65902b91f174f6542160202e1f9 100644 GIT binary patch literal 23572 zcmeHP3v^voncg=EO#y|XpdwgrAy9#~lt*hp+TNS=6`ImCZNjS^dYhakm)_hP?!8Hy zD)x4KAq;lL1tW~WYCA9kh@c`+2Nl-f16HYn2q?;EVMaz>qYOGQh)U-B_P_sg_Bl!0 zu;%5g)eSr6?CmJ>>MgkR^LqRl8M*NIBTs!}@m(+P={WMN>9r4Zo&@xV$aTm+t~0gw8&ktA zBPim`m=yl|n|f3GQp(gC0HwmrGh^P4%=)}PRpa$K^BwST z+uUeYKt{^R@}v+K{w*kzA5%Rh|J#UXM)Pxi#^UF)QTaIzA48daIwr*9mGz}^e|xSR6sxGPC|?L#7vQ8lSM9SW{w)=-mIi`yb=XHu zHCOHps%F4l^WR~QUTY2D>PceNu}AAr9*0B=XoUm6N}T1x!`r6Ss_*tXcZ2+S&_ zQgv~zKUi*W2GClOYfegz2A0A_Yu@$XeOs=(_`bbAo$;ezotfiAY(?fqzY7EMW);rU zP(+*vt8j3n!l7c}0_Dc9x0v9ZP);zFL8NeGVSK~!P!63qpT{a3drc-(d91>*c*-iM z_u-rio^52Mer)4Y;Rr4YP!$vvj^b2`y5OmB1aB}+Sa{7Sv%k!O%SO=tQsF4>_m>Js za8clGD02*`aG0prsklCeaiIKEIHqRDEhfKJI2qz``K`jiEyR7r6)7CyUxhm4r@|SF z-zuEUX#Pmy#Q7tIlQLh&_^bsj$A$`rDY+gZg%h90Na4u%^x|HQPo!`J|BW+zR5-?D zz%Ltl2&ELVDxCKAYWX~|ybCu~gJK0+c^-Df=&c%VDifZy=kjIKt(y&ZwdIC`GLEZq zy(_Ebe6g4NtJ^Av3vxrtf=Zv(Xsu+stNEe83XhR~+drJQ;`!-kt$N`b{U1GlLi^T} zA>(yU)+**Zw%;tie*^!=wBM+RhupsP_FHWKNBb>4-_d?cnV*7(`<82-`^}g%=CaQ0 zzzUs%64wFOl#ic_5^?S~A3qNz;@odOJ`W}0vfs#$b}{}LVC1&@ZH#ug-+Ufzm;24f zwO#Hv!G*saCGy+-HU>ZUo6n>C+;2Xv{M>KKPls#`O5D%fZ&_rFTTEYYzX=}K7u;`( z(?L{y$NeU_I0UNKxZf1_^&0n^;3?~9_My!F(ypXzj@yHzfmc1A4(q4v`ndvS&es%+ z*T5y?c_qr^Kf&VL+27bY5d$CLI-X65`Z}H`Ieh&3qOH`OD|D2q;vH-B|>-V6Sny2!`G&6I$%$!@hLKmgim@shk0kC)LUD;?%@cNR9ZuRS37szElW@jzgX_+0%e=d-Ix1 z>HbZ&@+3{R^7tlue=0z0HbtBI2K;|5BSqWZeu7R8nqKxHaO}39e>hQ>9%NBncILDGI zMC;R4Q+XnjEh=B-p$buXsB-?r@lb^@aVz^gz6znrQJzSJ$g{vJxR>&zk(rV_Q!FO9 z&m$^?c*?4fNf3_X!+u~XS-cJXIsrKTH%$qAro%;rMD%bbc>TKWr(K$5}!#tV+`G)j-Uv|2Gurxz1otiR9E)pdP*Dlbkh-Z2XLbzU|ETJ zwF?hMr7|nD<$L?^^ix_FbXIb`@{qK?fXk>AgO}y1K{=l*RLn~1?C$1VwY#sixV{9E zB(gqVh7g16*acIOV@qk!KID0Iskw2tZ6;gn?kmwZj0EZ`6$bGjHWZZ0`5sDUtw3wh z*67a-*js~2P#y|8yV#f3-eRd7T!2SPh`Fd#Zt2UFs|$jv^oAAi+*hvViq*xfqzl;3 zphw(W8EQ($rk3T4`ToIv%dj%PnNW7HTI%dtmfN%-Ujc`GpbRlwF6!IM<43z4y^ zY@!)E+nw{k<+ZO+7ghYe%ov;FHmkQBKnDQjenDUI*j44mjj497ykSl9t zO_{TBoQKS9ES|8)Pc@-Dyq2;#-Y=SV;#|9U%EA1Nd-K^%%KJFscI}rzg!J3L`2CE# zmb~=)u9t55)%W&JJ!0*gyMOnW?>=|#oj=Z;|sWW3Yc$M0t{Ps66AHL*+@%q4M~1xE(4n=89w~tE}av7$eFa&0)&)!4&=i zI5Ey4lbSGXmwQF}D|4>x(iPEhNJbA*HOmuw8lWpe6`gcB#v4623v$w>p(~QA)hK6- z-?}0h;&GRT{lKjjUxBrJIWpxISA@8@WMTqc^uUc<7wYmUknR;-5o6M*Enfd}lsKN^ zibOctu(-G)5x&yl;)+Cgr^D%rz^Eao%!N1)kU1}tk(rY7!g*jni2F}P=@3tu58`|q zGI^#TGbMQo~I)=!yl;`k&odFYBTC3$on zlKm1_MC5rE_x%EyJf|WvC3)zIj5R*fLOf+&$N5B5A`e{=rX-KJB7*zl?7Je|cSnJT z?a>vXQsubO6>kE_b$bSJB=E=9?U@1tkFQ(mVGZCW`{&Q}APf-J2_5sn38T>`s0G!p9Lv1apNwOT6rsH@nLD-Pu< zi_4|K0oL=1u0m@+yf;cuT2R&E<<~(wd~XsA1f`a$|0Q6qV)0mO{RJ z1E8>%t<|6(QFw*~n--UI1AX~!-iy=W3LnsM(vz1^eirT%I^5F{3fsl2 zo)6kaj)ScIgSIiQW5#0}sgJ1>sCyXcV@m4C=rKKRL!!s@6komCum^1^ZKE-1%R?Qr z6ea4Iq;2FnCLY4m;5Yy#NAuexb^bHSfBU1|Ry2wLaPJY@(;hA7|j^ceH?>lbZfDntCxSid6McxbF&vps%3=QM+#{j#>vUTd`BnRbU;+vsrmylb62);88g z%fn}svE=!Hr96KIoZ~;AV2ybE zm3s!T$P<6%o+WN`Lu`DSLp)_Zg9^7Ha~@lenUZ>7fyD&(=W$_(OPHq-&mEM15i*nR z)4Rb>ITjPlM)*SxU*h4MFNU4S(@GqPJUf6t>+tgh4*6enJk&SJPo7s@{We#BygrVY zb&c}SuIo8Y@XhB!twMjvG>k8R^7gw{@3Z?E18}k+RnC0c=d~d!8zZ9v?-1FV@ z-o0w~-o^ReS)~X2?mB1amJ3UJ=C6JIl%0?7zGdswXS-1A;yPKi2R*H5#~$>w4tiRu zVY{(M4tiP#JuMhnSYq*Lo1Miy=xIqbGU;h;$N12Tww_jv<5p+zeU^CunI0HDEhdc` zsV5zITJkZiMuF&Q;a1B-kLT+s&~vh$mWMy)aO-I~oY5gf%kBNv)5=CXKXLUVPfK3> z{oLW!)AIQ74V7(IJuUW&{3F2ezu^;~=ncV-a<=sX52yUc1E>7Ui6f~edWOT>1-AGO z)L-CmJ|QyEQ>4e-0h}Il2f>=Xetb@4+*gOZ=b*`A6wNED4)k`6Q71-R7+pz505ia-hmS>Oq8_GAxfq#tiV;92)t_po z`%(BpZ`;nTwU((Z1Q*)Ai1W3?-9$40kH-({?J z83FWhZC4_IRrz!o8MecA}1#pC-WV=>l``-j;O7oJNTPcv|)&GLW^hJa?pU-|$-|O@KYXA`8wd?Q_;z*n?+8x!~ms(74U;nQT@sxQd zI8H_8yssfiP3q&rU9-gDe-h&L<`Q6ehhG-r@i#PULp=V5CPy5JZ)nJKIa*`8>j>6} zPcT;i--68j)lD2ppJ%mSJr)z(?^h7w@`mOr@Q|POP59$)XnI*cL!NltppUrC@i#R2 z5SKRuxYaZuqaQX={_D}^U%PfU5Uq)v?AJZW>{o#}lD4b;>bIESe!q$#E^lZacKjuh z)NK9O^V9(AXNbq&&|E>>=J*>Ly1Rl)+~9fevtJctCXW9OwDgk0s{&h`&v*PaD#w}j ze=K>1$dMsWT%L`@ZH~*cDa7Rs&7^v%Hw;|Xzl{HTfm6=S#F12Aod%rpe2`#`cwC=+ zh;=i>?;5lVYeT7=GGPL#}V?$=kj7FKOWV> zg3?C*pg@al!FoQ|XtBe6@nJuvkRK)3w;|1pwWFRb@U?<`cba@t5`H|vpB?fe5sC0u zq9Q&grFh|GTW#53p_(5kj@SNmZhumqCnp#_$Alj@Us)I>Db!^v>leUaR=l#!N+tfr=zrk7lD^ORqkW+Si^T2t_?De*ou57b(rXrVOT%W zG2z_)NK8t^_x*YBk*Kt@+D!W!-6L>)U!&WEYh#TrA6?$e=qgWgbd_hkqpLj0(N!KDUG|qhL!1pc`RKvb zXG|KXJQ~nNX1{2jeVnc^@wXE8>YtAiagLRbx1mIwD^zg#S=$9Dk(+J%^|jrj61cYe zwgj&2zCFZ+pDr5tj}Gy8zm7@Z%1_tBmq+>E8RGJRC0!Y=ABHBf$QZYn%W-Uo$3wUb zO-TKE`}4ueP4w>!2reeL3H3N`3{5Cb7f9#vJs~c?QKC!1{!T_t*(|QF^7x?%pC=vG zmk_}gl-ceSi`T#<<9Q9r zCnFn^4(lub)C8{l?+bC^xf^BjoD$-3IZsXC%5z$X3(w!7OrB{W9_Qga_;M=Gj1U)| zJt&js^bn8p%uL|Qb4G{@&$B3#Ckjo(c^H})OCE+Mh~wu))$l9RaVt~zBhUYpAAiz+ z;V+92wxJ`G-HOOIeZF?e^aPI0ORPBs;;FT@!Db zvh~_}`*|rJ(AcYa^LI}t_63}8b=d7)(^uGfsGtu*J5Tt>0b;v=@!^a2&iTsiH`{u3 z(Mmh|2cP(s+I&$-S@9BuL0YRI$Vioeqr_-opT4x4d}Jb8KY#Hn#J+$f$6tDKQQhM*lztMZ+)At@-f5YJtEaoblbm{#!6MNXh&b#{LW1a!_GY`9Z=g6m@{LXRp zld$A&#eH0u&t`mshNQZ~f1JajYPcxwC7}kn;x0eYi?h%qxG}5PH1^>o1hz) z95eZ?yT5k+ohM%0cgwZe7lq-M)282dOZ%Lbn|5T8zzV1Js>-u8b)Qp`) zYO-vh;Dq?Ej)S(ZI)rViPT;xf44!kJNwf9`kaj-C(|_KZOgjIv=%W40db-cpXIf)v zvl9NoWjuW*&;G_;uc?k;TeMVMTVX>ekEbo=LiI3d|8#s+pRj`JG@h$&Wcyr`<6Yal zcdVrCs!XaY$xnS1uAk1PH)X*(>djl*dz%C-48_tL|eXJ)4}s4`#qbnIEl zU;o}s_EhWpxZl3oU0kn4xi){>-@o#;=pM==S^4}mul6IVADwCa2!Z|d`~>a4*5jJy zyr&OO+gmuVdTxPn{gLq_5AR2U{9kI8)A(O)*GI>ak85D>P1&&8f$r0B)p|UtO;ZwL z-+khVxte8+^{O0w9isY-S9I<3++Pc-d&#Z(!LO?}f%my&*P6nYZWh zHk(=Y>%ae#Tjvo&TR0v#aZV-5FE+u8@EeY$3+`L{pmBX&BmO=tp>BLd&k$36njHLi z{(tA%S6Td?`tzjEO?rK-eg6MpU90>&>bhdz{e8~99cVm~`<#55{BcX_N3Fx7Ur)#P zK<(;tfY0OBsRu(1~rOYD;Kg8v{bbkFg9j!N? z(~hib#`it_=N_2}Sq%bS&7*CAz(a$J6BpKO$+DfJDw*8Q}4Tk|~T zQ&umZ&s;n0qvvLRH2GYwj+I&G%fn;qS=T+T*P@)1i)GEiq;e(sGqZj?m-(V|dge1r x?bzRO$))=&l8N$-U#?h-C?v-#c^&0($))>6`i=eI1|T^O%Tb-UyRp9*4(@4C@EKm zj8Hm0I669#S1BRX`BAXG%eAO7o@c*_ z^pmLStSrV3Q`F~Wn$5F>H*yUtlEYQSi+WyGtB<@AMKgAOpJ%z4o{k;zM@!Pb4IlB( zf3@ouVpZOWbW*Nv%L4bBYpWa0s}*#>admT1md#tf5?c7)C#nae9%D41%qL6=u)3Mn znvoHZ+Ko}WBKIYTJeRn>=N$A~dcYLwELdL*D>>`9If(K1aNxRlb+^MZ$IDcC8#B#PoVj9B|b z@ADMuH;RcHD%RWq`ok%kCP_5!zb=gUlc_l^H>zTPW3Swy2NM1R~z#c^@YTB!yxd# zMSWoyvzU5(b}6>;Kwq?L@F-r zRkz5QjYAkEdyP6IZX6?9 zgux?vaa|oeBcvfeqK}a>O-ka(C2LpdD_g_3UKp}~d7D1a zuQg;Du^)RKk-#TD#C=^c%*)*ZwCDV&%bhM&9@rl7k*3r1OV80$ zt!{d4T-QG8_OL5JS|cqJo?n!*@lajLuVd$k96I;<*KhjQ7xW!H@{eVmb>x~FuOK#- zFPUEAKN^xz&2nVDnR_{7{_<{8fDQ1kdgzfFvpIAY>kQJx+;?NjT@uVm6oek*Y)(=N#3W&HAksspxxd8+wvB@I zSCnY-$FLDd#BM@p7@#HMkw!S#Pw#gd9=Z1b))f-6W%1tX)!OQh>kPQD(umE zCN-;{5U`SdJ1N)F&-GLHZk7;QFNm~JOKrw+ku1x8gfSt_Zsn&kUju!+6IBJ^aGQ;a zd(%Sg{fgfjO`;V5*mWnaKUwum7e!f#Uw|HBzt75QvgB2BDjKaDBli@@SJm*Mc{?>r zmqO}Kq#7yG<}4o%(zwc|&$A+1tyhZSC7{f)tQf-Rc{atDa>! zK64)(RhygL3LvO`!w$m;9f_bRnI-9rdz_>7@}oe+X+*t17{hk|uy8Cz(lMnZK+P5a zIXEwi@*msZjVn&pbyKeF@}$g_ z$IEJAgcdRmNEo4H0gk)zel~c|Z3aA+Mq0rCWRG@vTV>J{t!cDg(qR}j|8z84iArb7 z2`}z={kAICh$EJv>CuPK*8pfX#x(3pHX6wdwmM}Gi!LpAkI*ot8we}H^A~5bQ+lt@Uvc|+8X{LrR+SHB_`=E>TLfi>C zdC;q;BIoxf0<#)nFCg@pDba@aSu}Y6ybqhuqW#)J{!8yW0+fX|-lIsdI-}41c@QQ( zOQ|1t>D=Q{>;_4aGQzk!OKmDf#QF~ZGv!3jdRlkrc^#@r_!?f}VR(gKwKNy}K0yI= z#jAy|-V5Ve=ebIE$ZrLvEV>Rr3nk}ubpunF@LX3gdP=9?cB8i|)FwKBT+6ZHn_>a{ zYIHpvo%8y$tiNDVx63T~Y4}NR?!f#ICtP-WN($$XbzbRM{eeqo20Px6b9L?MPzzW0~A z#h@}yMZ!|%&qPf82wii6YMXcj5H!R5I)Iz>3T*TVT@Ks!rnXNTc#{r`|AXFi20;3h zH{65;`Mwu_D2p~qHB4lJFrKG@5R61VkU<{K0W)zP&U}(2W~Wu)QyvC>x~P`t0_;k2 zFX0Zkt8(c?)XiDe`l(z%Nv>})6sW@W0`;W>N}6MoDaA^qGU>W@>E!;cC{cY^fMv|> z7g@5D<7e%@lJs3!Wxq)F$zDz>R=0Z}itBz6s8VGA>S_69 z>zG0R`g<|&yTR7|7rI2YRc4!m6?)miebSoRSfk1~`A)a5z4${$s(|)fmDTYsL^#C` zs`5Dw11}^fu1)bQS=jneo`!i^EiT!~Oj!?EZOR0oONoQueL>I_EA(YUip@J8d>S%h zz6}wI!8y`@cAKka#CZ4_PsQoFYSC5+x#{j(R{*+)Z?)drmEHA0?^z!vFpspG0wG5g z%YcHekop(0y>CBW>$P1SJNoUmXqKQSZcEkb!BVvE+p9(}d)X}DI!-Ogl7=UZREH^0 zbQ#!|X8nNPp4ZvzAaJ^??Lv$=Pp%GiBlMI0r8*oyFgq*4ty)mY;Cx#}xU2N)o^Ai4 zt!w9jgVIZfi*E%4Ua%$kf9<9FpFg{k(ct7?+Q~3eykMe>c|beXrS=%$freNtB%`9w z%Z>!P^OzPK+!Wp(g4;*od!<(!$To!U2I_k#d_R&|;Q`Cq8I>JBA7Bd8?A2hm8|~{T ztVW)j6G1={vVqW(+C%55Q(ZKgV29VQjsoreZ5%)XRxups8r%o-89O78<-j-3ZzZuF z;h^6_jerTS787F*y)W%mjw=sd73pBaJtDr|JIzD(ZNL-JVk#ae{g{WNaWOzLxxt{; zbRV-jHE5D^=26Q*%CXb7?B493ZFL9V_RqFDqYd0XU1yWpW`=(LqgNF6DzmgUTiQ-k7~$I?J!cJwA4f53)A2BE z_rvV>gwf7Z_t40C_4i+AWZK4dR)SBlFbzjP(ZYb~BUTekbhM$F_Yc`yOpO6W__I&7 zWpjN4dM@MY^2GibSHC}c^~R;qsV5rOvxTo`GbLZPtNN=^-FGg`N-a%SIl<}0VGo^@yb E1Gzjfh5!Hn diff --git a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs index f4fcdf560..4d11d1e01 100644 --- a/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs +++ b/Workspaces/MiniWorldWorkspace/MiniWorldWorkspace.cs @@ -30,7 +30,7 @@ public string tooltipText static readonly float k_InitReferenceYOffset = DefaultBounds.y / 2.05f; // Show more space above ground than below - static readonly Vector3 k_LocatePlayerOffset = new Vector3(0.075f, 0.035f, -0.05f); + static readonly Vector3 k_LocatePlayerOffset = new Vector3(0.1385f, 0.035f, -0.05f); static readonly float k_LocatePlayerArrowOffset = 0.05f; const float k_InitReferenceScale = 15f; // We want to see a big region by default diff --git a/Workspaces/MiniWorldWorkspace/Prefabs/ResetUI.prefab b/Workspaces/MiniWorldWorkspace/Prefabs/ResetUI.prefab index 4ea3b0175a6249f9601de73e45f51c18f7d33c35..9c1285982450d98bc94070ea808b8d850770cb2b 100644 GIT binary patch literal 22756 zcmeHPdvsk@ncp`FNeeqVfk2PDU8m5h(hM~+u!-l+2`cZ zTbDEAAKhi=oc%lB`R(WT?eBc&T#Q-vK4Y%B|#hsZ_zR=!w zZr_FGt>NL}#L>8Ppc;RMhu?GRq#185{lae_Ynyc8x#i2&odNV&Crr5pP$I}YGv*!0l;{14GOt&e$H8+t%5Otvt#VJbc^-@xp-i5T ztJ=&0|9oH*kdHtX`6}}i@Fggdzm|BJ*QyiegNK=TU4YkE{!?%dxydCwHKrZsn|%3+ zf&39>2<_aAGTV71ahq!+?L5lC-FEUGkw3yLL!AYb*&YtHw6iwS&SQwDcu!rVos)>$ zTxV9Jjcg~&lLK7%x1vmbO!cVz#}ZGC+jj9|6zZD3fPOfLBF$ zPIGXVCmG-ga}jtRMwvWQ13b#Z^)BOF6I0z6?_(5FZJay^eJV_FMdS9;@$d}pRB z(~&M^@;TFcb*#9ykj@pm@`c{kbivD&Ah0Bp^_myqq%~dYu_x{=MX=`kyh3TnMNKJP z==Msc&%ef7%|JTa@0t9@O0F3L5(l^hK$g)7#d^vwsiZh!BC`+qU(KVH5d&578COhx|!2INo;&QmZ% zoCs@haHPSZVc`O$;#XTta84*En8qM9II=Ll>+`T3I&m(KH8}Q~OsMi$gJbc8HBe{a zoC}_HG>Uvg@o8`b7XzpUiUvn<8bw|3G&q9Sn0hR{g($PX%z}#|Xn$#N6nFbegCn>Y z@D`Lg1~fQKH0(57_hKB_ei|H8w&NCQzcn~1;?ee7gM(X$yM`+?IKsacGUTVh8I9i> zoYYAE(BMS*LxYnr-@^E804>Lc28SuW9zuf?oyXAN$oO>QUXD*_a0LG^f8(RUF(w6m zQRD%X63A+BT3btncgxPZc(CNf( z?zgps`HtwD#mC>^|C;oThIqi&TSwm_`XB0BbiPA;f}qk&}q-D@Z$cgS7^+2XT9RG3>*tP*TciRdZ%BW zDZjD)$S>c$^|{xFi|3=sldEKSacUwaq)dEl6GC+v%Y<;~IOOpydnPcdH?PT*j=yCq zPkhT(9(T(g&x9yX+=M8PYeHHKQ~{=l?F*j~5@rWfWRBnNx8cad@gd%1&wUeu8x`jk zNggpFA>QfZ?v_m+-FmDENr^mF^Jd6XHN}JwkE*7a5aLnQ6cZx&Vn;Q_gb)|i)bX)f zwryLD^>uZ8sJc2|pTYUv$ecqiE5WPGO=#ygQO0tzTegeu_3?1a78QRAILDGEMCIwK zX?wygTTH&ThbBbZLzD9>pNA%diK^`KxF&=qM|naMBF_S^;$F5ViOdw|nQAe?T^=zZ z#1qzpOh)54KI{jUlEquluhW6!KT{vWXZyIAkWhZLk8`U}qy%Tbt_Dv2=?)L^>wKJB zpw_z+_{V+x>=?ew$7eYBSAhKhnd5K{va$6>$CKkH{Ly(iH^9a8zTorEa_}U^|98N- zPR_G9xe|tW0wD3(#8bx59cuG(Fl;bwmD|;(bg{IiC*7If!l#=yufu~I6#^^rw5#oS zFv=Gw(30uy!P8HEqqnY@?v{t7t}HG?Dgv)am%KtIoh_O*wAmdC)1{7{=3G}EByprG zQ$Qp7H?j++D95IJzkSGaWNEo^x2>iz*U^)wZx}YHJ)iBzgV=yqC}cX>GP?^j=d46; zy3gL~6}`fMx2~OiY3|PD3*JgRQlgnl@`a|JbfL7!D@kuCfaktKDV-}VZ6=+^etMna z-pWw3b*ySdCYR~$@3jnTGS?Dn>@VflwXaAIF3J?aVIL?1%x*U_OWHgDEb*6Fp+yDku3m)&hD)&&gVkMH=|zHOhr;GEO)BQp=@Ky6W_*^r_yaqdE(oc@*IhFHQKf& z%!N2EK&BdtCoJu!nNS{HOV}Lk7q@oeT)TM6!TeRMd{#+$A1B*c9wf?^C-O8vSA-@y?s8NbJ-86Q08g0faDEFi zd8Q&W#d$(kB+4_*%2GaIcH{hO$mFRAY@))lex3G;6_K8Z{ox*|+*9-W7H zzr+=h_B@08UP30%3}mJ_4_%Sb#%E@LC(Ii-p8z59&=p~d^N1@VxI50SD?+_{J9t2H;^ta zE#&+ADCZP?f#zO#Z@gsVX|`kaL4;lLrhKlH&g67UtC#A+igEjzE$Kc|6j$Y%vYC#} zfP!8&m%Ls?;TaOFUs_1_^<+ADFHVPwd_c!ZXGTK#jc}jP;m$U1z)NQ#w8+b*hZcH> z_j^8O_r`?T|Bl_6N4{p}%$vA=-|oL#J^$hVe9v9aZ0?$N`319gJZ+wPZ3X738h$b7 z`S9MzageotcyEl_m`e6W+GE-T+8##wnBq1vd`yq-A>m_sg0Eg}*n@j1_eNuqmWMXx za+GLe;(H_4G4XJ3jPAYM8)eTFT=!nt8_6&8&b^nqkVID7)`8O@WZLGb#LJYaG9Sn3 zE@a}|8wIa6U&ZNne4Klu;589jULWA{W=7xeaBpNv;9VDaXv@jZy-|2-%|4uRU*kB3 zd!xJ}RvRDgjdhVdKinH@?VFqz!9jkzHhs&Zv21xF{o>x3ND-eH=~uWnPK@+xuEWpgoQ2?LzwF*T!`2e(~58i z!Y8=il+I?YKLh$G3Kt_H#rh$vo`<}dX9NA}`K(>)$#hpZc=3L1UUy{wI-LkyObOaXW^I50J#%o+DAeG?` zeMH|aWHd}dT8+g%M5oX?1R=6b=nA|xDM)YqLSwHVSF>W-e8=W3nIe14@~T3nJClQ7 zid1dR9sK;`_ci=-#{N^Dd8&NV9sPs%Ztv=T|K3wS{MI9{?0NpAt=!3U)gSh>LXAD_ zY5jSg7I!3C*gx0PIyB1_KFhR0fl5-8rC(#-I`L2cc<+B7*mM8H@14;7sf+K=fA!eG z4_!C!#$T5)4;hJ68SCNDmp+{rI=6IQ?9wlDT}1;W z_8}uhJjx$FWJEs?qG{&Zq*Fk(qEkWD;zI^g+zqfF<;K4jonsp?`6$6i^=^sV&oHH83xiIJj>)i?b zJ1CJyq6#6-=sj^p6(s5+^56Gy8&z<49`*5=fxOhqNC)echivyhuS69> zd99aGh0*F|RKdlyUK>?#+N1SKRDt{w4SN&!bG{f=U{ZWiLU0>Zuz12u0X74<9_0lT zMxy*YU`vp>J{v4bT=ZS_E@fo}ch`AifD6x+J`bY`OmUtji;d)26yU&*25~Mf} zqY4nQxZ9qk0gg9g5V#qc4hMC^lqoM!l$}1_9N^I?3Zn{%6y>8)6h;-K-e?r1CBTLM zOFloNn^JF-eiq+8sNhJJ)a+urBV6YD4!b1uTfI=%Z*B{rM%6;|5KlT z9k9{b58E;-KOLvh+J8lWivxWCLX@Mu*C@^F01!2@>+nkANSrU|bnw0Z`z$87JMUKo zc*2|rjv2_D_w^(xi#$FCG|PPa{Q+KWt^}6x@v8$o8ui@};L)gWnm7`pzU0}2+F0*K zf@R{h<{IEzk*QxD#F6xeL8@P!78Bg%L)F7iDHnIJ;qR!9x^=>9wmUgmV_an1kS>i}qulB3gVuHK<$_2PYefRkM zd6JZ^d?f1INBI=-Xw>%_;xo;(SoyFWflJ z-2X>w&j2}6rLVhLGvjA1p-*HmvAJ?d*qR>5WtZNRi*5c}Wc#QiA3ECz>q5rwAZH56ZKs2d}c7sv{9g)E$(yavzXa!T6kT zEuxX#i0q=dqhZolUkEZzRUydeDC!CUtt>Amast{ke$ymr;IU!*Jk0MdE8gF!u z!S%65w;tC<8(luS9Lne_PkeNhr_#|?p7`i0kB%<;%bzyQMLYSZ#nop_5~w^H&_!my zxIMc#U18!!6L#d6qePrz<>D2#v|A_%EA8pZ<;rd}{q7fP67I8UF4)AE`gP{qLueLu)+GN7t zE(RFT zlJUF=W%8eH@g3~1b%Augrp0g_Pu35oJ&@P&q!kc6VV*<3cA-20`AlSEl7YPPPmkfs ze^!7C&wVJ9=j;HFwsS@dSDteMTzI~LGI?eOc$A0p;I>nFW(BzLJccrP&I|A;&+Hhk zJm&|v@H~SudBV^{l!u{-(b~h%1abUip%lb`D>kP756Avbeo#jLg}+w7j|8kQW6#rr z!MWGz{CB+Mr8F+LW(M$!hZoq-;o-MxZ@X#mmJe*-_iW*MQ?q0}?Tfnkl;Ex^ zV~#?ZYjEscmFs;hyH7o!p2T-mt|QJ9uO)0Ae^*tW+CW}*L*=Q|?ki8+?kmrc;BWNX zvjh4zT1a{)Muh8yZD-$^I6f`F86skT#O{aqgTJ_rdvwLFB?*O=|= z;S@)_PkhixkG|-CE)o7lMgC_3)}<`U%aSwf$u6W?W&f zUi{}dzPw)ec-h%G~}`A|o>drrRZSz>#EZTGRyzI4jBJ04nXHelK90LE4Pzz=7i(LNuK ztXOio3YK@j`ql2LTNCqu?STv^%tzXud6U@d!1&n~SMI4#|7vm%unAaxttfNV&VK!8 ztB73ztb{VPqU+}Kw-b8;nBM#Tv%hr@vHe)0yTOM`=Jro?J^a*Hj;p=_%kV6exq4TA zYyO!(0rr4{-T1E?ZhP|aQ>vc^wi_}>A#a-g$%#J#R>o5Ow2$T19#~H7BrH?KF5U9$ zwZt9(_JA)p>$1no#5Q2rD&GyK=f1f5s?(|`OqOv$RpzW|4{zP|rY?|Yzs=8YJnx1ZUw&!TL%)6Kk?FtLw~G^F%+>kt zpYbm5$E$9<8 z;{lPi<6vtz$RE`wjvJF6r6hkyzg?PdwMP$2p;AxYFCwo+)NFX0n;m zkpB?_*W)^Txs9jiPMnTNY|D7<@w*zVHxlT&<+oU%H2us-v?(UQ)COgujA^mT=@s{iaOb>Dt0vaY$}`o`;TaLu=YtdF}; z^d+{~mp`X(@qVdIVLhtn>=#tsAIoC!#s6PoKDB>p&sne2KmVnCW&Kkwa%j^2ss5-f zFJXbr+bG6g#H|@KxGJnzeRQt<1*k9^LFt8|BGPdLO7ZgVKW}b(s+`#i&zWwSy z3&yf$K~%Tm{P8lSb$ofQdpu9WEcG4v(`mN8qfi&K)Cnmhtxt7J(DCg6Wz?6!X*ta0 zhTP}2>AO3^LI1SUarD~N z0oTqemmVu^m&$Qmxz3VDB`pQlw4Pg_qCe6v_QBUBjO&*dj&`fo>s}je+-NKJ-`*IA z9qc}xZvGu37w7OPt~YC4^Q;x=;${Y?{UG!?@sFhK=hHKj z(Yt0Q+xby+J~#jTS+n_XW)k<6`U~FtoY!9}q_Z=Vt^FGjxW3#QTASbO<>u$`@wN3) zlhup08+J@skabaR;5qvi2;f|kJ05ZWhifZ7pS;fzV>Q=!yjHBYYajBEjcVR3aVgG`gZr-NFQudGn6`!In%sGc z+as0X(Ups@@3G|cx!=9+kGBKqx)(da3+`U$`qj=&JjHxRvVVCm_8{iqTE+dwJ>@X7 zU2bAov*7NY;7VR~%fbcBXJ56df!V$0pWC({Y(8|HaZfqSmA5O-pPKXheC8`I>1<&3 z+u|N7YF7}G8K+%s&39a)nf8xKV-Y-e{chL);x#AP_Mogs|59|0Z2ZQj{2Q;td-Zj*KKEXzk)vaHyrFf)iaTk`~C+! C2T(=; literal 15974 zcmd^GTW{Mq7JkpK&^%0ECNW5gx&`P%>a-nWn>NS|SS%I+Ezyp)vJ^;i(#&A~`yTR; zk}S(qXX@@wYmmZ)Cy;%$g5dVE{;Vh^LpR;bCzaua=7o1zYIzDF?hwl z{%x+G$VG7@lX0=QE^>I*-dkMaT4tlY6&IH$MNxkg3yGWWyip&JQtJD}^SP@xu(+I5 zxRBi-Z5X4uqWA**3Yi}Te5bRnKJp-gV1t^6xZ>J2%zKe$lGn1#MYg(46oq2Y0JA;) z=7ueb(|Znx6}i+|h%0$g7q;&)H;h8H-Y_MlNDK6#A9B}cn`s&I^tz1st{3@!sLyl% zy38j*z(dNpT6b~zN!-bD-@%i723hSppXKdETBXx813i7Wtm`7zq-SD&T9;`)-*?V) zP~^Ex^z})s6mM0V7MGvJ&5^9G%=$!Ap4Om|@%tpLi_)ku-k4Meah=}4%ZFs{a^DLA zpS>=bGlr66EC?e)ywJZ-k_;tDJxX2X(tBvFhEO2$LJ|^9J19vdnHLpZ5K$WVpqsBt zbSOAZLNAC2W%rn%>!RFv;CUgB(5i+lkQq`x3@NPI6C2tA8X(%7vYwX|UhAE|FFf4+ zcKBLrcbo;08!^HkVoRP!SrqwHi+a$OPGlwP^U2FfB=AGe4ZK(82~9-v{K(}VVXKj+ ztN3R{k=5z-nJDM7eo;&G#2u_P-8Os;tbQlJNQJ256 zWZMP+7d$16Lic_nz{CrTz>Pc-JR~*ekfAXzg5qVfaoHpdw%|tG;~0b*d3V$8m(Q?S z2M60_L&D$NoAC=C3txcngMD^;R41?Et8j#$H&GEtQ1_CKi;ykBOrJjmyntbR{5 z=+QsOUlwF&MAZ7|EfY}_`8v#87118bNc{nhsy`2u5{h7xlt!w^0sI1`)qeY-QbXkG z$x>^4J$8-Yzdu+8(EgnL|I=(8{Q<>ykCfG zD@nk#0QkR==NFB5CiA=~x;|ux@&ZlYSgIV7?&cPu@Jm~ltRw9KczE&I-3S8 zk<*xo4#yN0g8;WyG<@SY6IC@yps5HAOO?Dg3jaHpZl=uFn&Nm_)y1N@JT5YA@$d{8 zQ9>i=Y=u5ZviE)3`z~NTWWj+_(j4qhRfnh7WvVQ(Q4M1yEg0X#pO$7VP~pO3k>7~w zV_7W0k2DJox9gzo32*O^S!L??cUDT+4*hVrUtHqGJA`)ORr~_n^R2j6i&tOrahAqk zEx#L1Pind72Nt_nf0rLiaaXAV5B`&+y3dT7bO5dmSe=~68>yPCSfm}wOx(Sb(3Y0= z1_+aRwkU(wwC2^mYa7kWb}64_UVG3jgN`1j5JNF!&%Bu*#2!m1bjp(%7h&Z3ahx#1 zggZ@|SPL%c5e8=Sg^qgkQiVjuEMeYMM$o#1G&F|1fpEg04+~QXJ`{|dRAF)1u|~KB zHVB_!dGOiV+ljb~Au&RD-^LbDx@DH>FbHukho&;-2Y`I2nTDzc9U6-aGaH;_z_0Ci z!WrZ&=vdCxXvO<{4j}dDd@?!`)mN35fi7NOrSWh5H@&}s#do2b-F<2o_^AGwk&3r; z1SrM`93DJfFH8A0m&>{o*{*ZEoPxdlL*AVgUuFI_hjVBdtho{ZQCGr@8_mE|&X@?2 zD3S>$fW1LpHl4bJdyGsiZ;edV`7FC^K5|f9LoQ*>2;yxvhO@Njhq`hk>#G8?K1?Fi zm4gMQR%m?ssjP^<-li42puPB|Oo4@Jn8Z$|te9cbEZaUaY@3$PGQ)n9^IbZf1;UN| z*bDrK$KiA)Vd4T}Dq*t(lmm_7aYm?HiVt$rLtebA#<9z8YLpbRPvC^RIe zGLoEgF>@uj%Sb@0f_nUEVz6CD`3>wz%fzV*2W>#xvn9}N$&SbDBf6+^h8p`fYt;R+ z+E5=rrjsvpxNIk2x<=PF61Gp;v}qJQ%jjM(_L*Go-XLaZdO-}G=Kn(wGv~iA7-6RO zlY$W$3`T7-`#)-8jk50Fd6BBkONSzE5ayX z9tRHUaxe;f9uO!NZE~uXXzCp`>H56dQZ1)4wW`0=>YkX{4*czI1W+E0Ca&ya^~sH= zAtUDLEJSTVFK`5DYkHmO;#zqtb>o9bh9wT%+HU9BRSjm0zu_NUu>+(ySjnu_FnSNp!zvk*b27#N zkZ1k*)E&e)8cam9>xD6S)|TKyn{Q`4ws7;^9IDwoU>_FUX?t!v&`GGbYj&WSmc#r{ zxBpff(@-Hja&`cofKHe3{(8kuYYbooSPnkF+YB4-Qmr+!ESpz{MxWE#RPF=25`gN1 zn^1EHBM;dy@{m#HzJPo8+?UDFY=z;BY7+p6Rzv*I0~HF(R;(fB{&9Mvn`B89PgXO8p9aQLtSYUxUw^nNQOISKNsVZon+;(d z0|c!-<9cfW^t(fOShPJ)QLWaks2sG#w Date: Tue, 5 Sep 2017 17:35:40 -0700 Subject: [PATCH 825/870] Changed min bounds for workspaces to accomodate close and reset buttons --- Workspaces/Base/Workspace.cs | 2 +- Workspaces/Common/Scripts/EditorWindowWorkspace.cs | 2 +- Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs | 2 +- Workspaces/InspectorWorkspace/InspectorWorkspace.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 8e7c08f89..c9d31889d 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -15,7 +15,7 @@ abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStenc const float k_MaxFrameSize = 100f; // Because BlendShapes cap at 100, our workspace maxes out at 100m wide public static readonly Vector3 DefaultBounds = new Vector3(0.7f, 0.4f, 0.4f); - public static readonly Vector3 MinBounds = new Vector3(0.55f, 0f, 0.1f); + public static readonly Vector3 MinBounds = new Vector3(0.677f, 0f, 0.1f); public const float FaceMargin = 0.025f; public const float HighlightMargin = 0.002f; diff --git a/Workspaces/Common/Scripts/EditorWindowWorkspace.cs b/Workspaces/Common/Scripts/EditorWindowWorkspace.cs index 0f4375d49..11d958b69 100644 --- a/Workspaces/Common/Scripts/EditorWindowWorkspace.cs +++ b/Workspaces/Common/Scripts/EditorWindowWorkspace.cs @@ -17,7 +17,7 @@ abstract class EditorWindowWorkspace : Workspace public override void Setup() { // Initial bounds must be set before the base.Setup() is called - minBounds = new Vector3(0.6f, MinBounds.y, 0.4f); + minBounds = new Vector3(0.727f, MinBounds.y, 0.4f); m_CustomStartingBounds = minBounds; base.Setup(); diff --git a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs index 8c00436ae..a5f0ed0f3 100644 --- a/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs +++ b/Workspaces/HierarchyWorkspace/HierarchyWorkspace.cs @@ -63,7 +63,7 @@ public virtual List filterList public override void Setup() { // Initial bounds must be set before the base.Setup() is called - minBounds = new Vector3(0.395f, MinBounds.y, 0.5f); + minBounds = new Vector3(0.522f, MinBounds.y, 0.5f); m_CustomStartingBounds = minBounds; base.Setup(); diff --git a/Workspaces/InspectorWorkspace/InspectorWorkspace.cs b/Workspaces/InspectorWorkspace/InspectorWorkspace.cs index ee59b9731..c51f9a178 100644 --- a/Workspaces/InspectorWorkspace/InspectorWorkspace.cs +++ b/Workspaces/InspectorWorkspace/InspectorWorkspace.cs @@ -29,8 +29,8 @@ sealed class InspectorWorkspace : Workspace, ISelectionChanged public override void Setup() { // Initial bounds must be set before the base.Setup() is called - minBounds = new Vector3(0.375f, MinBounds.y, 0.3f); - m_CustomStartingBounds = new Vector3(0.375f, MinBounds.y, 0.6f); + minBounds = new Vector3(0.502f, MinBounds.y, 0.3f); + m_CustomStartingBounds = new Vector3(0.502f, MinBounds.y, 0.6f); base.Setup(); var contentPrefab = ObjectUtils.Instantiate(m_ContentPrefab, m_WorkspaceUI.sceneContainer, false); From 9a645425918255d162736fbc836eb74092e235d4 Mon Sep 17 00:00:00 2001 From: Amy DiGiovanni Date: Tue, 5 Sep 2017 17:39:29 -0700 Subject: [PATCH 826/870] Enabled dynamic face adjustment for EditorWindowWorkspace, since it now has buttons on the front panel --- Workspaces/Common/Scripts/EditorWindowWorkspace.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Workspaces/Common/Scripts/EditorWindowWorkspace.cs b/Workspaces/Common/Scripts/EditorWindowWorkspace.cs index 11d958b69..eff1b26de 100644 --- a/Workspaces/Common/Scripts/EditorWindowWorkspace.cs +++ b/Workspaces/Common/Scripts/EditorWindowWorkspace.cs @@ -23,7 +23,6 @@ public override void Setup() base.Setup(); preventResize = true; - dynamicFaceAdjustment = false; m_CaptureWindow = this.InstantiateUI(m_CaptureWindowPrefab).transform; m_CaptureWindow.SetParent(m_WorkspaceUI.topFaceContainer, false); From e16db50dba329e1857f046144aa71416781d0794 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 6 Sep 2017 10:23:28 -0700 Subject: [PATCH 827/870] Fix inspector workspace; Set DefaultBounds to have a height of 0, which is a more sensible default --- Workspaces/Base/Workspace.cs | 2 +- Workspaces/InspectorWorkspace/InspectorWorkspace.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Workspaces/Base/Workspace.cs b/Workspaces/Base/Workspace.cs index 662649af1..d1ce61edb 100644 --- a/Workspaces/Base/Workspace.cs +++ b/Workspaces/Base/Workspace.cs @@ -14,7 +14,7 @@ abstract class Workspace : MonoBehaviour, IWorkspace, IInstantiateUI, IUsesStenc { const float k_MaxFrameSize = 100f; // Because BlendShapes cap at 100, our workspace maxes out at 100m wide - public static readonly Vector3 DefaultBounds = new Vector3(0.7f, 0.4f, 0.4f); + public static readonly Vector3 DefaultBounds = new Vector3(0.7f, 0f, 0.4f); public static readonly Vector3 MinBounds = new Vector3(0.55f, 0f, 0.1f); public const float FaceMargin = 0.025f; diff --git a/Workspaces/InspectorWorkspace/InspectorWorkspace.cs b/Workspaces/InspectorWorkspace/InspectorWorkspace.cs index ee59b9731..0c2db6c02 100644 --- a/Workspaces/InspectorWorkspace/InspectorWorkspace.cs +++ b/Workspaces/InspectorWorkspace/InspectorWorkspace.cs @@ -66,6 +66,9 @@ public override void Setup() Undo.postprocessModifications += OnPostprocessModifications; Undo.undoRedoPerformed += OnUndoRedo; + + // Propagate initial bounds + OnBoundsChanged(); } void OnUndoRedo() From c5c78cf19915ca69181a320cdabc7a942c3dcb8b Mon Sep 17 00:00:00 2001 From: Amy DiGiovanni Date: Wed, 6 Sep 2017 11:18:13 -0700 Subject: [PATCH 828/870] Switched asset serialization to force text --- Workspaces/Base/WorkspaceBase.prefab | Bin 62876 -> 106345 bytes Workspaces/Common/Prefabs/FilterUI.prefab | Bin 40348 -> 48730 bytes Workspaces/Common/Prefabs/ZoomSlider.prefab | Bin 25068 -> 22285 bytes .../Prefabs/CreateEmptyUI.prefab | Bin 25420 -> 18260 bytes .../HierarchyWorkspace/Prefabs/FocusUI.prefab | Bin 25420 -> 18258 bytes .../InspectorWorkspace/Prefabs/LockUI.prefab | Bin 23236 -> 16556 bytes .../Prefabs/UnlockAllUI.prefab | Bin 23572 -> 15694 bytes .../MiniWorldWorkspace/Prefabs/ResetUI.prefab | Bin 22756 -> 15979 bytes 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Workspaces/Base/WorkspaceBase.prefab b/Workspaces/Base/WorkspaceBase.prefab index 8296a23752809ac8de559d2420d557591aa840fc..02a233f815613f0854d9e5b94b7e749489af7f0f 100644 GIT binary patch literal 106345 zcmeI5*>c-fx~T8{6xtU%H``WW9$eKI9^%Ax;@I0mdJlEV1(Bf44n?X+%89${y!-k7 zHGlvJfYcN&CQ^6F5wQR+tbd;W{lA~R`RT+z^&kEF$7esB{M*&Pove%Vr&sgo`dc_Y z9W5>%2cGXgee~qX6S?Ypo`3S4{PyJM(Ys|iDbAigIyt%c{Pyf0lg73Zs` zCq5sq%H_0}P5)Vre<_!%>0gM{pw)Uspxabf*?+#gLV^VuR`o z^%J+YpeG{ti_2Hb#eDr^F(1#$x0A`LT&o>@EY3fy zm(%(A)00ngQ0}}OtIuDL1Vx%~zxe!f@%2r)`eMGoQ!78L!JX0f_Gzh0Jyk0#U zt*2l4_73RyVH5;mmU_nt9WPHq-^+OeIr47k1VNy{6Zk>udtsOd{cC++LmeVdqs+@Q zgKr(6d_O(^vVLE#pk)ElL7^D6Q91p%1vn~h~NnL#IAd@D?djan&rt@-n zPyj`#?}vU69~po&xrCXY`e_(xHr9FOH4(Eq=t0LGEHuebjE+k7n}bfhFpIOy8;~uA z4!jT*CkxVaKuJhA4ACdzJeCtl2B^zQA%ru^M3DPK+zyKRshk*%;;_)>)zUo6j*_eb z0dyFLTC?qzLKfO-kmhL`L<5LnpdBQBkOT=>)Xz&Tv_YR3^(4}Kx1X>D+AkJMn5fnw z4+`@%O|v}6ljyi8ywdKYEJ;JCa)59v{V|6xWUStYa!~<7FN-vabi(p^G5S?N>4*x6 zBAsWLIY&mk7LZ{Q$9dvM@c^M&K#FP>g}JfQx=Fnv%Gis7Eb+X44M$1acg4J%9h4FU zdTE*@*>O@LY%hpCTm{Or&a6k>u%y&tk;W+njUm`Q+wk&*$p6|5(LtZn%?KZH~ z8b?4J%P3FxaM8j4gFMU=4e@T8wLC`5tuzi|%{MwFh8s4N9|V5l1>Ujxj^H>UfJu`* z^l1;{I!*#V9>5C=KtBuv)M-p9LAOo-iazazE{$&q$&=;zk+EIl_JA?r)Qf`w8Z?v* zu10}}%pcI%tRWo60Swy92N1&o8=;-}9t>s=!~ov{FGinNYdaC6>47|?j_${C5D|tr zHY3Zhd}4nnb+JDHZG#x7iFt@EHl$A(Rgrj16k>$yr}hF6ZR((q!{sWXDL*pnN<$7h z&EZKwI6zPaa&Yeu{EW4|+bvZsDssS%IBn}{D)z#bZJNHjW1b3g1iZ_r|Ygmz~_zlW5hxcGc=(*{QdYRi8^yv(r4 zc!&}$)uP2l=taQ1A2BMb#g!xOoL!RC4HK1wsU%1fd^pEQu%tUh5!)XkEo-6%;A)7Y zVE}|ypAGSClggrf7oC=f$}LjN_tk+7k|4}e@o)RVaRJbhA?J)O?34G^E95@C7C$Yy zt4_FUgEWdF0#Ct_>7B*`^uQD^PX>-#+$12i8;6b0pHOCUoQ@K#Vv>hZZwDm5VNb-B zae&6Y&NJ;cw~YslRJ$0xFd2%!Sz$yJRoGs-D@RPJkgnvCgkDar6NxoPMq!qv;j+y6 zLFwz)7Anmm2fxz{7T&+s0+aMgj0e1@{h=*)%=1vZ$E1NBTL43|Nl6UJ6UrL~w1tXt zaR?H&9?BfDzHb~d@ZT^QFcdAYk?SOvVfGIokzI=#o@JuXsyD~#b8Ck?qR+I1c>l_IsHnh&+-8B)7vV#!42dE5qYLZcHWki2Be>3I1?}G)ebjy z)In36#asZd@va{wW=nMwin#WCbaIfU$y2!?4uIy{)k|TJ;)zKpS2(W2w`d-Q2?;uc z%ljq!dnqAQ#bSp=bDTanexmeP8A^;|i8pSKDn7J0qRC`n^z)ugu813CfTxinxG>v8 zadt7Yki>Vg=_$DD4?=wymGkn%jnj@P$RNYzSj!wJTOi9j9?&nX>nzH7QS6R^rB=hm ze;y@}zRi zzvI$UjOQ=}-g#)UemYgedT7cG7M+Q+6W7|2MK`Qo=u_Mv(ea^-SwoKz-3f#kG(YbI z&+|4hxB(;5I4F(Fj?-`=+af0XkH2Uq$Mh&~mm0I7V3iT0NLy9huup|qAl}0uCiSsb zG;Xp491xIHSj6~I!lTTIC9_6U?0pImC_%s}nEOMeFDBsVlkH7jGyn7>krjIQ@?pfJ z+x1%|m2G}VVTZ85S)HZ+k-}Mub&+*LL`8dvDg^8VE2YvY3X`0~xZ_eVDse|k1D~WC ztA2`!+$;oC@tQa2?hFQ6!%=2B2F(W`zTO)^U^1xi5Ci=!bK{rrl$aygqv}wC0j{5 zJq^f1k(ZCGPyIN=XGwC$(a9m7rX}QWNU03malmm$B1=y16fsNaP()Jn0DFWKsdyk) zG07$2pGWsYo3;21!#Jjq1y+P-@EogZDgE2bGmJm5b}9U9rGL?85|$*HE8MVhdnOdn%? z6)9G9#)}iFrqDV2omlOH5{-1AATcDUj=Ly1K0$$UGxby!f~s6?wFz7rG9 z8;UWB&X#59KzNXd@?gsKa;5{eTt$5j(e@E!VsRds3LOD}geHBw09|p1+B5(R+{-a* zr0oq#_kh$!N5cflLy%g;;!q^NrfeTbbYsgA!GzOMMM{UqSo(y7E7ZS9MY$J3%*S=ocx5nRXhlP3Vxm+OcMWQ-If@_wZw7Foth_`_< z%!B*jVB9g#W2>0YN9cpgGgx{;%NAY$2=&tvWapDEL>D?H3}6Qhtwr5H*8tGCy$H6_ z>Z$*^N>3zz0Iv|v0?gQc-`>HzLD9)~Cb_DL9Y3n(c?=8)xyvpG7oTfww>Lv1^e7MM zd8i}ua?lt`i%~IqzmO>sYUIT4PfwnBk59hofBvce`HdkGwdL;?tLbLBUd?Z{_>>rd z)I$OJ+8rPG5++gni>JqWeR!IZCzhq^HU;#H&o91AXJba5n1Lo2pI;U0FEUG`8iZla zww1pw(@Wkisls4F%I2lMznYcHXY=z}x%zRc#;EY^_057lW}Zt8YBmz=7SuNJ_1dA{ z8PqHt2`bbe^~5{%f>_~#ufSv=T7ikPe$s|bvq-xGgf{%!Y~8Cz(A*IaEA(&+h?}C3 zULZEm^YO{vbTSe#E*$}*ef45b>ss;*f;h%VD(T$< z;if-9?NFQg^Bt>RfGMatmae&O5yz zYl`oExjq)Ep|aY8YXr7s_UI2<5bLsiB1u=NTIJqEg5OeY-WXqw!LsT*Ry*=0`P~eb zb?&E(jT#)&QxETg;*%*R5Nxt-zxFE4M$@9izn&IeW0SX(beqn+Zo!G@uIYE&3#Uq& z>7&&EQ0i87rFL(hoFijQ-6^EC8M4#zKghL6eT`P42r&X5gYSXpYX5J78+pZ$o zDw_&9w_v!bJFLOsE@*8pzKJ(il7wqeQ{2;htantYDP25Ng2|h%oHya2da&}1T@RZY zFUR0oRnGOowSlpFnLq*@vXm?_)}CBrq^uEp*l3()vHGwD&mH`22j+X3N_h zgIU!ypmwrNTD(5YxMQR8w}l>H(b{HiWuK^_%4u{HwX->j=UV);@nRk9vl_hU7RYF~ zXU19fgX~tuUZvwjnov zbjZ#o-z8kpQPW;$%pEmo^~;^z2ex97UF8gSg$vEfEoX3{RS(yT3)d%K(VvWup!U?7 z|7S=l_q%*LD()K~y1C1zg+k7Nh`t&1;?UY*-qz)FPataXJ-y+Y7`!=%WKdhJT*Vm> zwTggxL3CY?ie{^SnA0E)Au4OfL@sJyR3|KRn+bC0zkD65@=jIIINv|uv5Vkt?(AtX zWoMvCVMo2uPVJDJ1b0nnJ_%0~X|ETP2d3Gn(4U5+%@NBaN38aR+fenj+T$Cj+S@gn zw2hm7HoA*OZvoY2NuV=OZ53M94*6D41%#P#LkudcL(;CP>~s~hbeM^f!m-`Hq#+A; zxe*#dz2Qr55xp}&l&RgIy6qNpXF#kw9cmA)k>5sJ#o@I1V;|L(4ixQ5^15!?QPf|* z+>&{EciXCKN4Jza!iCn8oxz1xcbgj6ngrdz@*OseaOArt=N2vX01$HSC=k5^5C-AN zcUwawA4$`w_vM`87RpWptw@bdzR3d$ldZ^L!VmqE8setmJdSgwot`iIx{qYtGV zd^!GpJOxe~59RgPjm{K(Go4Q_t}fIAKTQA0=aIt3XIJaRr(fO_zrUQWc;tu+-f7&t zq-wLCo@BZD*uDlBOsh?R%I>SWFLO2@*xz)1uIj5_zpOS{`?U30RZwIKy=pYJX~XIq zjkRm^9%xKR?t#W2+T)@zTH2Y}s?O2aW)!ZL^G8Bs8S6Vt{Bs8M|wS|#v2!(A871Bjvb}0h@X*c0Ai<} zdo*2}f{8cwX&*JBX<0dL&{)6gq@*KYIHKVW4&AI^K2ecJXL(f6 zMK418d{8;b@%qcCoULwKE|F?yw#);mK9K5P&dV7RNidUhD6V8~0#gOF=K5+n!?Wr_ z9HHG*K|9qehcBIHJrW_b^Im!KYro3cf6ISbL57#u=oO6c=lod9U=$a5Fq!08nR{pW zrt*yTOJ_wf_VFW=kY_D}u*))F^ddu?=rrn@Rv5P0Mzqf0?rfugOelt8Fr~#YEC^eD zR`2ZuK&Mzno-jPrEjsW5^kST?cF_0zoq!DLpxdD5+6lCqQQhAOpm;Drfa#Ks;Xpgr zvULJ2UYMt45{8pW;!kpBSwxep92GL_gIVKec|l&gP7Uegg%Oq6p(IGUCJ)-h#`k#! z)eLvX@SvR!c&}$5l`koN3D?dblP;BbGw;z)(3Cvd%s8sFxVKO6&nJtWCa_um;G)?yp6E>Am!@$5X*A8>bnR^6>NxL`3 zeQ}UDeAMJ1Y{woiEeA2w@vHJRx6Jve;jaDi0 zzsD!sy}nwOf18(A>t!)}eDdzSzd4|d&!3o#M zuq|nCNQSWN2Ed}pSvE9r|0wkQhgEH59#_)H_P}W z%{BCvg)~hDX_F9{Ps~PB$((WxGwz8H4~iLh5n{&OWhNWSWz4`5B7ROB-95}`Tb6$U zo&n!zG{$!uGYB7~q3C%RjH)Ekmv zTZcZR=x)!cbeKW=A)=eWI=&+3FoO^u6Mq?C-Q79k!O4L$;=#%Br*LxkXd%9e8ahaZ zEvM~G8FYv*H6xRx@=M*1uTi&^cwf>na8-_tFOD{P+TZkC98lQRx_@NV8_<3%EX6%tY%UsT01pS96Zhn{ zI;5A7&^OcIV}84b-R&ULO|d)AyeQ7IPy!69ed_)2t4~wqm3y<0?xt0%S32F&FZA8? z_j0x(G9fVo%fi(1SB3P9wI97NC;Eo><%)i((j->rq>4^R33V;Vpc)Gdd?l{s>=Rkx!y<9Lb!mFd9p9 z>YJ2Cd|X`qNQ`kNamH$_XRS6ul`ml*A!aKJM5lq6-D-i#T2xL`c(m(37nZC!j6-c-(OADa?dwb~Y4+58K$y7sYNZEH^} zmv|2=qxE8nB}xXMd%z5-#tkS^OCQ`p52eO`?owm%1u>{G4jm-Jd*Z37SHuPN;Qm>P zmRCj$M<^yS+%yYiG+i}Iu_HHHO>>C#+=$A{bMm7&&u|!^G(|ZTQ4rFYZJZff=#Mu&w_wM(6Nx-1vWO- zvtXl|_AJ|L(c+~JX2BFvp_~^=;Xnk1u~6Q$6jQ?#bJn{4GktM0 zYM)!{Uo4hjch6lETv03?qn6h0dM{c<-whGI-ZZXy9jk4r8wS6J2Eou27PRpdK3}ZY ziwkx0))xha`Uvk(3q~~C>YMRA{gv z;Ep?*ly~u2@OkitCM{FcKtAu_4NcOmkbTtnRYMWj!ciWAgBn7b)^>G!2ty`NB7dwdy*avFcLrYK;|Za8nrt_6BG~?^1U*rOAxR<`&tjNUwF-j}3p6J8e?EjZGf@h0FOPUZPMQgW@JuXZ=q{B zd<6zf@GO97iI&mwAo&#TL=ZFcJPES7<Q}&k`4e5>?dVav-hkmb8G%i!4hihrgK({c*9Ft*4hC%ijT{0^!Nu7t3E)m%vz|gI!>HF;#$#gc|6f zNKfl1tlT$dwQWbTS)F;*(g3)K;uE^GYs@yQpW#lNTU2U8JIgp!8tDXN?mJeq649fY zcH@kqN#n#yv>QU(ot%qtISR&1Az>s*oP{C28oyx3Mvx`}B_auyw00an^z*uYKQH_- zm~CE>7P#V*EE?zOm>I;$ctZc8v+=~9ZKI!;=JoAOn2%V%uqD);wfYxYFmYrQ0~=14a=E=@Aj3w_^I- zjxM&cD#{|8U?>+^Sr+9aO6c{NoK4QsU|gP!f*U%Yo?WdMHO*MFxEJV|i;L>x8htc! zj-=mOJx8e{C&_e|d?qu5=QM*AkIGgHMnhs+GnM%aong+_9C6KaUKI1M#p;LU;_9-d z0W%Yi(G_`!vXEdzRE{(G_S!NOWv1Tb=#D72lFe%XCd;~v89V}b0hj@XK8y} z%f)YXyxqDk#(oX2x2`J}LVE$dS(n9pHP!Xc8c7tTD+H9U|9P>zC}s`nSLujRXz~%6 zClN=Spdx%aq(-Sns-kTwE03r!yBs&3bG^()#YN1KwtckN$bU#WY=#b?b2sBSkCU0QIh=DcVyo42TKty)m~%&anSs8*Q2%~iXx z>azVnoyTh#0z*N*fWtCC9r`uxM{0-)hsHBew?;L`wfxg=XSf@&S|!m9P`+(b8(PsI z)J=J-4zco~KthwOhO_?U+4B5KtY>qiY8?x8pA>ts_8zrwkq0){Jp-jL&Su{vado>@ zvR>P0glyhNZ-wLBe4$XW{Q)Cqi=y}9hxL-qE}L5$cRt5OvAI-#bLsD_aaqX~d7JKi z)8bjn#sAR%D1ldwyW2W%HFP$+*{iK{%YD(3yiVzdcWF00h%mvu2N6bnz;1#3Ai_)r zWjR)?rBWp-8Fh~$tW$k|5Mf48U3`8JVQmrCv`U>4VTsI#CHNpE#}6KO6j)^o@f)jy z-`3`MXf|1OF2rj^7&0lxL>Tk4BpMaIbl1%oJ6w)K@61^bJf8Ou-knIWFJwTSOMQLr z(iw8VK$tR&j8Tof)H$KXtaTM5vr+;U_0}oG5sHch(sW07X43?4&r;1B&#LwgXZby{u6l*tvv;s&`~| zIsfNJzuXTbv28s=Es%V&kUBy_W}V=F!4SC*UyAYKx2jz<*?Q&lYuWnr%|ZeXzcBG> zv8j}h3>S#f!^Fp5^c91qk7xEo~s)!3L;1qBG8ZfYx(Jy z>Rff3Z|&$`y;>}p=C@qGEZ6!_ZHVyo#pPnTF6QeW=uvB4rIdrmZL4M^>bR_N|LPo> zH&ddGR~PDmI(1P`w3E2e93Mxr6|+Tzza`0}KZHh!L>+ z3O~)+d|-cgt$!-Ml}qVeXf|24vz{L17oY$0ijnr~Z}!elmt&%*fB#a> z-%chg)dAR^tR=}V)YV8)ZJ6vBeh5ODZpc*LVK1H z=ZiTd8+wW&skyUqK8AcQ%fG9{QiJMGh%q4`B(TAMdgO4b|CTd(auVx*cK^mu1xMuz zw~zbTv**uk%*v)b{p)uQO0`LrFHM5@@yS1*stqKJ@}|9^3W^JyzyDowy?H8kz&q4E z>R;CLuVx=Fr_1#>^*sR7xIt*&c=DZ$>*R+(A?5D0OpJm@TGgnM0~FRAmKoMNI(Bb9 zk3vjGK;z!#>Cabs6v%n@8P97$xiI z$=5obb#0#F7swTU=OV#kJye~LJ2%gaS1GfhnYw!fE1f^=47SeA=agGysko}#+kCwh zeAnh9YPl$=WDJOlo3FJOYi-_-IP^54xi(bG*j=Yiek0P(!dd-P-(C zq@lHWm^;26x|+l!+PQ`{TZIa(&F2x*eaIHYBq7n;v6J6&E?1imMKRMIXUK9*sSBhc z$e@jAiZ-|9P}b>S;dh4xpp6)y1f+8mpG8NgYfc znP4ngJHnW~E0ytrGOvv@Yt0!;#xAxWcRk1~eSS6iwOnf(j@sn0DHK!R|BUg+VjdSW zv9e3C@9-VWRx-Sr4(}!rt!5@|8BaAs$!1CMnwR8^$`&j5M*@Fc)Q56z2CF`5*5f&V z23|m2Gt$xy!~1DLqU@$UiC830tPx}Em&Yf+0V8dcsO6jfBpZ{5dz7(LTc(U~W8`QP zN3AhWdhumC8!yYb&_=DgUZ0?9)eEf!#_8~?Sbynk03Zdpu~a-8EEJ2a0Wh`U@2_U% zQrXn2AE(yv(r>BvZSK~N2Ml+;YqLVXlDSrJK+0^>Z&bfljyn%VFAQ6PQ^Ax@6hluf8oRu)7t!H{BsosT5m!xmbI&9YgndzI{RT+ z1Wc8iNBOt*LbDDOY@?Yt8?Y?Y`-j4 zJ>+YR7u*WhY>sHRbDZ>Hua8B;Fs1t~vJjptdpK||DLH}xD(F*%J*+gP@n$;qg1PuPKbcviQQ_hEAPi)XiCU0UtB4er#~MUAgDMWm8s zo2zZ^CGJ_xboOOhmWk>0HRfedu}^YJVFf=jyxKYDRd;(GH&SUM;WkKB1LFp52$wVz zCjs*2Y8$DP)BldJs)plTx;_;c=wejhIfzwtPjC-bHFbUOlvWWWq@gY;h0Oe=k6OXB zQ^Qpf@CHKiHq1+#r~BcVZFbU@d`8zc0;;9pTOrlB+D0_Em-$Jfm<|ONSv*rS-x7#~ zrHq1AsbbgWVwJ(;9v9;%Xa*IhHUO@mbBDI&si#9|#&_EZiY5T^6thD{6 zy=iqX_HJx;4Ut}3V5|4e#^SsVPF`ObGpIAf_lA@)Wg3V8qz9)#LeDo`v@S$<8KC52 zh&R`ZU9G?tNl3NlOB_^1D7fZ+i|Uf z?cJ5dS(Emi;x){C#=XaM(RWU1BV{HE$wjl{yY8CZX`E3{y%ScaU276dqPo|&NoqG? zbhlUXI*_b|fWvZEaWG+N<|iRKmiu|1*tIqWo)X0YZH@f37$0#7B8bws+&NUNhY($1 zd4bOV^to6@EKLsM${g*D5^hxYlNbN~jv&n|8x#qTSZ}G@fo;Z}xA!zJ`Z} zGJ37pToMQ*Vb47*q#Kj;VXG#-?PQ3R{B1aZ4UVY0uWxS{wA06EJ-+vcgsCz^_d~)# zVcd;_<~1~yXbYu{gBtIwN{3v&H45&M${9tQ!4?P6 zi`?lTikX*DLxd)J)qE%tN>Mn$?`!*0p42h;M!058TPZ1|Fd^21I6LAFG9pmB+vTk~ z7HnLny$h@ttY?8xqz+s5EZCTpeG4k}t8YOi8D)WVooU644ed3eFgnNAM2vS?R=Ht} z8m9VNdVESPulGi$sGHZa%O0Ly>9>+Yg=<28SzE2BQ{c5ojI5xTNGo$foKt0SsFDvA6% zth^THRXxnz!#w6SkQ7a|RX=lYy36kp^Y+jkDimtXvDm`3os8}}Neef1R5q}1OK08i zH-=Y}lVpm)x{%H$#MrqB*Fv`#Zzo>q&_SD>Qe2uf`%!ubbh|O5gEuqhH~|-Xq-=$y z{fzGRfoCI#8zQ(FA>0G~3}&}*4s*%`q^+|kPxbd)3-PK{4)^$6NaIb^Jz5m&_qtmN zdjqv~r#IZI@{aV5Yi7_L;8M3rb~BX?>@hKw7Fsn7s_S6VMtgS;lj?O+d$=8IrqQ*{ zq5D9qjitGTR@c$Rc7&Ik0<_{%7VGp^cbfq<2X{TbEFbq+1e*Y}er^rZj6vS#Slq-l z-NQ5HD8~t%i0usf4vtmBty`JhH^8%Qn>na#EP+IaQ5{seNzVe}UMBX{x1h=e=vmNq zA6;Kl+(icmF^PLToOSD^hW9%iPMf)K?qR;TW*8%YWho%uol<=bQy3=VSqJ2;9h!|v zS~X-hrbuH>R_(GVi}a$Ql9mcLx+my%;LQavCi;Cy3AIltmZ8rrOtxw#9Sj;nvTCZr zE?nNjyHiIoSc*}49L{FFDPRZRKBHi~Jf3JvAcNY;EEM`oSwe&hz z_$`cUaG53~M)T@H<{Owi7ODIy;-RUq7yC9sR4=Sy-ydOfH&l&oo7*huM!C~#X9P7{ z4mpK(Q6x!9GM`X7CH#@Lj&RnE5vl%@5V-zS<3*JSw51wQndMX7Lzf&<8nnx!$qwna zmnEnUlshL$ZxTn8F|HuzDYWNdnUR<^bi4y*Xf@boF76HOCVeg~v?NPXaa{h@*Z1Xy zO_|~pTH@c{p32t24I9$vI$~X)R1Xu}!_62`F`O{Fh>m9T8A)~t+>Q36zqp2Dw@(u? zhtP*%S{yg8w%MK-OU8xRjbj?ajC3$=qdoDgMT>6XS=UUE4m`V!)V)5c4Z3=o!ek4b z?!whWTNesIC}K0HQ~j;Kt)r?64$f0qBOuWBP&Lv3p@vc|PNk*hUO$0_7uiYWbu z7`{gJZ5G~(1KaSOHXplsMInV>Pm{#x{YFIeR> zl1P{S=5Hl{j2c6|uEnUGWRN888?(^OsEEU&xPT&y0s@&Vgalb40wRKBNQPu2$;2!OE@jYK5i4$} zs8j=pbwNekP!w>fMZrqdDlVl+>-s5Ls}@_8@Atd+o%im0nUIO3|F8d+tCzX&_s%=_ z-0j?R*I3q~pIg>9%Ph-kZ&{0K@oNn_>C}_@%^g`3t&UYrp3t{qfc4|vy?X=wgdXcPoH!Q(0AZd;CG~0@zX3Tj!*XD5h2S8;J>?5t@zr2 z6;A^ca6ChnbtpXP`F$YH_bJxzz^4bE4}xc``kPd12RIJIGx@l@QmvD~e>kv~@Xg>g zeTwx5;5m3E|K`Nwe3u$H1$^jx$M&V-DVlh5rO zT=SogXYxl;C*DqG@s_4^6Kp1y1Z_}Gv(~! z;NJ2&+`+x&b%cSlT$m4(=ST-{<|&u125y$iQ4SukegQuB;+cH9Ie3bP&(Q{M@(DV4 zz#0fX>+noI-5uP^hxJ|OPl_jhdOCQ(8iO>wWIy-fZ^*LpD z5K7_TmkNi9g%y+yKUHBGXMwVSsSI3&qbtS>HXq6%1!wY63P-)u1uA@$!cllYDX8NR zW`$=Q8JgbH@TqV#t`(ptC@LJmsT8HcQ{iYl&FY1Umx*VlmtNz#AxL_ua0EBgONFCx zt-#0NnR!5kLr29<#dSaOf$~$~SaFqa9{H8R2@&_ouM`eGA#N%zSK(;>6G21%R5*$F zD}@uP%imQvUjDAa30NDDKLudRyrIIO^VbJg;dsl@RX93-it#P;$5l8Q|C`f+Jo`a_VyeORf{OZbKy5}7^w>nZ@g{C|Lt)gyIbsClBg!04DN~=&B8@?J7o)@Xa z@5FHNS=E)%@?y5HLZuwWh3AZoRFw!tUR6e6b#zWd36Gra@anKL-|stM;;t9Uem=T+ z{(@s6;}ToeYLvI9y(xU(9sIvjd!r(rW4BwQy?NTd+upq8?Y6go^#S;>-LlTJy;)We zWtn0vM-3f}C)NYjDH9)xC*o{xCO!;L#M$0Vd<33|>-I+eh!^=E0!H4dy(Ng3?akyP z@v^;{xWvo$rg68XSTNtc;uT$U$DJt z+^a9x-UO$CDEf}=P2<`i5WU9sCb+5B*xocAP=;m+o|#_uD*@%b{ei!O7d;+y=mV<$ zT!3emS9gWS!As}orFbU)9ty8zdOh_-cknJQ`Ps`yFZp?ljVG@!#>5K4r4wS++B%qP z&9g4DE~Jhio*%1<+E#;lJ_{H-@T`((X%YHs1ar{QD`mnSdwgY)3M=A~HKmctjPl~r zNL6kWhJ`BYy?a-b^*$pS|Ht&!Yww-^-k!Zxr$FR(DLQ)*v^**#PP~2H@j@|k*-InkdUTl)4T@sY?@ky5cf7stwM-< zo2FJF8XsviO|3$R>!vCBqq=M*Tbi?2Y=XyM&I;k$( z#5dcx+hyw}{s-X9OR5l|r>Q3LxLvkZ`63Thh{!{g^O4PmDuj+r+2muY5UL#EiJE-c9_pA`cWKQb#?2_b4`G6`0d{>_Tjs6n1VOU;e1RWuppg(WfC zhOR)9W2H41h|P&qRz`~`nd$}d$`wUfxI%pzsftw2iATYx?iFg<=VjPJ~tD?bN7o`M{23D{#dewN>1l;$!ck7ON0Y&)6 zul}@U!P5R$J-O_&jX&JF{WYrBk?^Qh%CQ?8Xova3>Q&!V7gcjU3DKp{YFEinjY?%okf0+p%v&>j$^WYPeneg$KnedS^W4?_+ z4kj`^h>K}M(<6YgAw5Sg1$Mmt(MvIK=BI!3618#v=w-Hz`$sQjz$v>nJ%Wf;Tie2) zriW#@xbUaxVdBD{rU&uN*xamGX(_a0BP(fs$-Js)p{R6KU2XM_nwwWOu`*g*tPEl+hgKr2=3*3Lukif(+u8Z@}o^euN?dFJqSU!J|{?b)+>p3%Qw?RM+EZ^wcx zHHDdMSuN0EvXaw|Q(wn*=GUi~NK;=WXQm{oh~Oo{Ewz7~1>m0aX8 zD|sy{n^eL!lrh82hcl2zl-;f50jmV^e+rx!D>$<@2MQ(}R* z;^P_OvXay8@Y~U>)!PFMDIh`85IXFBky!p}q< zIUk;US;;jXuxQh93WNDT-w685IsQ4@geg>YH|JuHG zan@tvw69^QIrQUgyqgb48WcUtLDTDT(pl=+0tdJZz6)4|2+o6NzI7)aC!S(0MsNi@ zaVkHJr&^C9_`HqxbnrA!IregJJ*6sBv$U`20+^&GALcXp)4taHn_F8Dd>fwm+#8-w z)^?=6Y5Q8^<`l;9ik5hDH3hp1&*XmsnZy;nN6r%g>-yGGjaNj@KE#!8>6wD<>)?6~ z=L&?V9!kaV4*FpZn(>hIt!RJyv` z{Apxp{w+P}8c6yO`Lyz+YY=heTY1uTs)Oq_v`i2&UC@`xG5?n%rhFS`JD?-Zc2@wL z=^a8aPTVUGr*0C-b2@S5z4CBMN8>Hj`2GSs@Oe1AuD3e>;{Yiq4J|s>TgvlG;FKqw zV4S#jtt#sR+z@kaug$(?T+Q%0=kv* z=a2~;@mk3LAox>`Q3Nwwe4~x$8aVlIyhuKI#No(iIqQdpu!UG_7_cbb7v)B!T8sv>1GOXp3TR}ryU=9O0)ZO+mo~H-*yhAxFSoz$_{(Zm zSwl}H6Eu z>N4x#yPwNCbU@^u<&SLII%n(BrPJ@)`)%H?AJ%+&!}mwAk4W^hkm9x@Vtd;~Xi_2|f>D(z`S9 zn*NtI-VMKWLca`Q(sQIhN1PVIY8AGuAi)gmrb%)UUUyBH@~w9E)~FsTR#RCR@xbV2 zrpOvwez>SeFU6lz7n)iZnxdv*jjw#qdZWxFPF$a*V%BOPU=^IveDv){E^l*No2lc+ zWh{Ao#VN!8a^4&BkLa+zZ~Wu6J0>zaIrG7yIWS@1R)+&>pz&&e%}55SN)4bHv3aq3 zLr^t4ssXwb;288c&7Eq1j_QFER5KA4H4v~uNjFDXkeCp`5=K>|XjEmmq9j^KOE#1C z9vYptXia2nxN0^DqS&0KCfZW1)vMAz{^pNg1;<2tUs=8P=*4YPZ++p3N0(){{dJes ze_1_cYA?w5KT6&M?S^G5YV<(6X?(j$Wd2Ea#fb{G18Fyc%S4#lZUWYOXgAYA+Y;VC z(N<;i(cNcIwX@}De>FC)yHDb}yMeK};~8yTHO4Lor{ z_qPgnrte-k?)w-^R;D!%^w_%Qu;)3Tc^a>I*ju9)-Y>&F*%qn|Wv=-W|`6c&!IPk;{kNgZGU!1B%KhQjx4+myQ z1EDx_;iq*}Y=-+g!^Cx=88#ocd3u{6n`feC=r&J%T&EOtTytadq(igytVy~ivNyd! zMNRrtwIPXX!c13p2lsAYr-`iP(R*acmnJ?Q1di+qgL+*hgWc*L)tsGx=~Wn$FLM zYtdRB@600Cq9uPQ^DFS=7F18OkKcArr)3_6Jrz4dUcg9lVQ{Cv(;SY19e-*modK7(vN)5!$R&*waa z)#bx}#^f``=2HNi&d(>Tu)2I^I=Gf6Z1X836F5JgB8AoE6LD}|pD(oeaAk$g&!<>n zb@`Myc)((PzSic$Wdu4upYs(~m(Oem*L+sld`ig#&d;YzVRiY?w3d7hBCyfs6C)Ei zKc5PP)#Y=6gXjVCwo;!0Xq+#?R_qBIDfk4DXea~E^_dIMLwlApNq)^&d=u(h1KPAsf{N) z3`sD6IIA#H9?6Q8SBInJvVFFfXOWC^0y&kS$PbrCO7V~zE-%8NGCla|l^L#zXoQ5A zw8Jq09%hyId1W|H;qVv}nN_W+g)5P)SS2F&;uAPNN&xw2Gh@}&u`(r}Lp(87f$79L zsX9AWIlHO?FP!NO|8$3)q_eOlQ64GsPmJX7AcGPczbZz?;ta>?ym6v2Ng$ib$L#1F z?pHQnP0C|AaMO=d9CpsTxymfo6El*}K$wLdl1$8ZdH^MD9WsU1Wyi1U&?=U7Vn%A5 zRGL!jqVQBBO72t+{~KL?V6SGKBquc&``n4na2A0NCL(jcItEQJHeAWgLlUj7H#W0u zJ=@Fj%P2a(rmC8It?bfws!3)Is+KzDomCpEis(m&pZ%y*Q7h}m&fnj8|JR>vdZ^Wl zhZWy=+C#BNJIww0#e)}pG;a9hHOC+JLr=6+Y4rz2-qd6VM&3Vl5}d7Fo}lEjMdSKiIKU|z#W~d)xUlXWr6Ec9CCZh zhVz^O#Z<18glh1ut?#b?{-o8pUwl9Li)FiC-`V?+g24~|^X4Ol4!`e{hXyX0ee8sx z5b{#w1T*76gJ(V*Xz)L^!P5j~gJ)e*4L(EXCx&V2MvHd9+2AcJ2pWB+%3O`cWP*cp zNXdqz8@!8i=t!Im-lXRck+^Q~qz_nZ)Ev67VH;Czo?`@T@RXPGm_yW{g9j{{yVt^# zPj`4azoKD-PsE2Es>TD>T?jt`Pd>fi>HK^+)s~14r`m+iZxDVBo_u=4)A{*GIr!6M zPPM&_?>>bmpA+Ee{Ctv`YWoMiYYE}VXMd*JSby4s57Vip+A=>`m{8=yqV`UEFJu;w2PVRR144#NB$6-MZb?m+G zn#MnB&~~DU+ID7ExO`5yN*y6!M`S$O1kT7w-3_FBsqm9fE!qg4AZzQi2W!RnrjJk@(FrDZ& z(N(T7tgo+RU)B;{_l+(ePScSO`$jrHAJ-W6@-h2H8rqzOBA*~Uou5y4g=yUEOU=HK ze0~m3KI|Lm{Cs*TtS%q7Z`8*263{W<*f-KqH!sKUYWQ4uvu~UX9sC$D+92#3Eu@0+ zfNJ_ zPj>it<7MAy$|LczZxow|>D_^6#;f~Am%qfz`e^czcv(kHT+*xiMwgGod#XdP)B8D| z8L#Ra6XY}dMw7q9%f8XXC0>qEOkCnU-NCgj`2(I=Uc=z&*p67fZ37w~u3_K-s~fNr z;ClfZ;ovFOU|>1$te@!)uG_n`yAW`YzS2 z9pm7d|HC%_vA}h_UjAH$O2nUIgGBuE9bEH&(dN%FLn8hYNFO3EulyWKB;r5O!8QN4 zZ2psgC*qH`mXJTkABp%+ad17>`~*a#qrMkgat{C;c~$jrDsecL7uvLQ1o~WsY24Je z(;Pftbq0?U;92g|$t14naYcfaYvboRc&arOSk%U6IJo!7dVzy`kF1A@!|}*E`Owy8 zyfX>Li8r?{06rg{?W>SDod3vrk-{`?rYqv$`pEi1@F9QpZ<>D#&zPW?^da)`9$7CT zuDtiidep)7k!gHtrNJW|%2EEC5a&ue-q}RsT27|xA$X>%lsKHkD|(|$VH!8nF?8Yu z$~;xBk38dGi#+0DEQ;qmD|{^Wn@1~3qv|@DoN!SjyQWenRgWI!fVKH#C)hb-?Tp$Y zMfQ->iQ9RW$ZbFm+HexpzRQN`N`&dOx)!m1pp*=(Q0*qm^>A1EG_NrqL=~_r6Z) z{0~voE^daX2VhPiNCX!@#|R-a`$1U-xxN{&Z5j z$zM;bNqMnzl=7-Ycnv(uw==xP^?jYs;hA-bgJ%>hkH~;Cin} zXC#LC(^KJb@X__^c;NV74QTXagvL*^@nd}SGEvFFb0DPoFn?y*{CgYp#4odP4xWYo za^N@F`0+lRd)_D~^GWER0`@vQ^Wj8z^S(~W≺lw;gftEPN=>$2R|y3_OT({0=zl z$;k@mHyAnsZwZiiKjI;clMfAK%E`eqo#bbC;9zABo?ZMj8)tp7LK+_j>>PNeYanqr zfBEXcv&PMOa;l=$eApffz=!P-`qGxu+aC4cne^WFs0Ys)H?OwVgJb^K#_#`S8r=kVCKA*ClqoWjMGVEIMVa7z{NIyJ$Mc(IVsOAz$p(0&z9xlx7s)d&nAAmjjO@4 zqSyR?W%JMT(F_04K3w>7@SKSM7zfww_ipfK3ORUYy-l#`rxA+@2d2 z;nHX|51>w}D8d5B*(H(k@v~-Csne)HrQ&#Q6jr7?7k#*z!e9Jk;*YK9Gw!&~7*`Qj zM9x;;4Y?yKs`mO??I;J32P(RCqQVQ5@_j8e<>|AHRVpe3CT~ zg^%Ar6h5sXR|dRZSaVJ?COa7Y6Fx=mp8d-mKW6OMa((E>-F@1$`D7@~o-Rl}bAgVz zo3DciF<0u(U8bzQ+@%?mD0gW_G$wb2k3V;XPqMiyeEhj9d?a_7-dc1A9`hU7PMl@{ z%>|~5T{s0I+$ z<1&}yn%^3~%%*qEZ;jK8XM7ww(NX^8kn?_o886LmI!W(K2otCIZG~L?V>}Y?3@`Er zk*@FXjGo9azXR4F;9U17otWRc7B`|t(iPsFILX33$;z-^X=VtjB)=3pdW~zm)!}yx zyl3f)+ptNKm!?;#>+qRgTNDz|*|^+q?~2{vS*;Lp`SXL1EqnC1W@WgcKX6oX(Hm;kgi_`idJ@d-sLo16oo2kb2)zahe zMBciYx_l&F-Ar9v;?>R6#U)t;a0Wc`%`=*3Gu60v^uX>yaC7v)QL@JM=t0Vnqh!IU_M{xC7B#M|`#E@Kes+To zD6iG0@Nq}U+PW7$L5E(e=lOVMd39HK9K3XXUX5q+@1gKordO#w$b0VC@b@y_ zXU6Q^`(yLlubzADB}=xvQ+cVCmNT9DMY?!WQ19zJ$3vWTuzvH5^}Rm5&vw9e;@A7E zM=U443n;(u*-_!s+@aU)Q}`sS_l1vN?+c&S;Gbd3Q=fUZ967@JLfM&iI_A$9;4)ir zu!bG{3`HY)-=&{s<4W&`#OT)3_Q}`2jM9n{7O`g)!M-M}%D%IghKT+PC;Emx6-Slz z2Q6rA@!y;2kUL}a+DGHRi(iwfZceYU<^1vD*Q^D=*5LV48{2*LHO+|eFY!ceY|X6S zv?NvwY@UtH&Hbn&v0#dY%Y=2guX*di!-#R|^eW-^VV@(2bwQ=M-o}c$^y^J*4X_0^ zmV5Hf{=^2OAS8~o$%O-mtuwG`55F`>(IJHo*x!EH`R&2PJ_aUf8+uT51hE2CGKshA zwJS1+?Exm~-St`aC}ML_>29+5Ro6_NM64YuweWi?^`sfZ76OxR-#qA!nZ#P60!lij zeDGW$vFi+MLZ6#w5$l2qDRc)lTW~(HT3}b$@qT9g?owjMwQ=M4zSALB61&I1roFvE zVaK7uN*QH8GHV&>mI8~|{QBJ7_g-QgUq~KYc2CB`iVm2hBedhDwZyu>kP*7pLt3sQ zwg#BQ(f^$j6c$7Umoo2q*@^2(w-A`*)x^#1o+d^^N9fjE9^62z1enkrH1+G>659z( zWX?IQ?-pXY?Oj>k48EqYoxpCj)Am~b`LB{L4&$iI#!5%FevjCfz$9%u^Pc%Lu?iSV zSJ`yk9?kra7{@b`_pPhjd`fH~FyVLEL;dy;+XGBwo_6u{E$bfwzfP{qb6133|K|&- z)^-Eym-hQ^74M{4AsAOupL2eaY%q*1q02mCXV)#?qTU0O z`cnGI%!L#G4t_AcB(M79D&fn8wd zLCMS~x>ja1v%Ul-@y_{c+8^hyZe~@$V3RoJlpZqs*>{>*+kuJ9Pi3F^`rz-HS@|&F zgx@d!(z)ZJkD6PXfeF7I6RV!Rz8$t5z@U?K3|n#2F+U7C#M%a|0UyjUDle(&LG3GO(SGy?nBwgTW`?t~uw29AayL$+v6TtUrTTKNx^7*!~E(W zzjjThQ`=eu^Bt(^w;+3uS^uDzk1m4BQ|mwo-4?=C;2y|u}}-uv5_ zV{e(--s*R}n^&JbIIimz1?{ahz$D(wR;IUladvwv7e=h)>5i&XMif4NrnMOu>Clp` zZNGo9h*$wSf5E1mF#RK9dkn1WodZ52c3mHr?$pIyQi^~b*Vn~%-1+!3$38p3+61iD zj-%v?nw_s7HPI@7!7JG6s;_UDG#o7h#_mASrNNIr{U0|G8*E_f-aPwP#3~Hzt7Y%q zMeH5}d*i|dcN5!bU@291K1HlcKR1rx1f+-c&zfUxGq8ex{HE^-pMPkz1hagUV>9?EDPQChn_^&F`>d)W zc8`IDu3CH*u{{R%-qeLx6U!as@>{#P?R~_S8rX`jRy|JaV*|UR_>a#J8+@w!?Xr(g ze395f1AFegl`ZdH^oh0Iz~Uc`c&s?(roeG9{P~woVD4DCJr_MrZ17;ceVI1)YhR36 zM~vsEO7INR#_Dy(p-&V0*ueS>Jai|q{2?ygifJ*0tpg@;e7)nX4@kFps7rUlpWjR^ z0oD&ofwx9rneug8va${7wj0>gRpUDo3l7)%1?H1g z+kQ+JV%GtaI64k`xDT<~5iXWC^WDD0)}*^wzu_xSC$=f%#{2QHJ43`;X1Lg(Ml?dK3%m*w)iXZ`I{iE&9$(p!D?f|k1u{FS0Ct(I!&6oDSL47;Y{q`4YuD)4)3ry%fd-+exi7f?IfbU=$S_d`%VGXf8 zz(nQ_Uw!fjv6iDS=t(Fn`MGrvc(eAga7jD^m z--9;=+MVHI3kQ6f^4m{QMq?~%6TWK;Ke6+!OS{dwIj|Gh_o$QYfW0{Hw}Z=H1vbvb zRun(*+CRSshD3;b3%h)HVNU#(z?Wyb*yumMcuT8gw*+|SsKjy4xTjhUDqkAd1S}5z zlzB<^kw?6=?!!Q6A|4QLd;FyQ{I<{^9_g4GnxwbucL3JE=L=cHN(}7$%g&um>^cL> zTzzmAv2_Nv>+0#Z5Zh^BwV(X`abhheyKy|-Kk|EG{S2&SyRwgnO);=F9!7CQiEr^vaC3J zS;fSRE~&Y|kX_cH@H0RCYQby2J2JHv*j;$;NbK!DE+&>c#j=*#*b6=HxRKaSU~6pb z+jE~@PwcvLT)KnazH$Sxm&~)rQxJS<~Ea3yKbT zgV<7FBHzz$Ip-Z>q3JH&aZ^tI8?o&M_H?s16jpJb`|YPQR(?;qE;B4^kDZRR?Y&yR z4y;{)OSd$0;z7jL8Q6J!*K{RT5O(PnUpuBZv6eGkS$Zv=mqo1Bz;3>_ax}5Qg_iY( z9dBi9)w#sl6wrnT z6}u04sNd+LQVXIkUH05vkCmQrbm|@h`|+Dw=FD6eOug=W-6wZKT6T_4o3w0IkJQZu zMm>h+Xg#=Y>T8@+W;lPz^<(j)@K;*wogm@UX1AHcFjSMZbKXM?Dw|KjX$IcR2sbyv z>`#Qgr4jCeur(w0+hdN3yfJ>!kQd)eS@8&mhHzhBJ^$vrABu+Vx$W}H-VELOqDJEz zmS4H?lf8L&-1x=GmtOaBNTb$>Th`y(@sd%ujeq?wN1ygaP@_ksW%lTNe{J5fUktkO zz1biBOrtHPKDF}UCvG2ip=?|+hgSNh_Ddlz;dsnNeII(gxu z-Jgzs{I8F1?EU$c6&ij2iissZK2VUoVCxl|CcpFKH_RAZB=_o;&w6YaIDW%Fe}C@> zNB^CBR^W!eGXCu!;^&XPtH)()if&uCT%-36I(%qB+mcZ$zS%rY zCwFIda0&}9{l-(?{_R&Ejk;#s?lbaEU3rYARj=?5>ufSk=B$KXe$8)X z&Q7vibRucQUT58=PUh7?z8?{@j0KPBQV6kKg&zEn|1mN#D&l>Gj=1+D>gKt^9sp>6LtzK9BS=K4Dy);l26n z9x_fgt^0~!-pM$fane3B3bv{#;-PM&lX(M%W!%ZIj9VBM8=SJRjFl`rIG`(<8XxR$ zzKc9E-@$lgEX%NraTpf6newn7apdt_f7LYgLF&KQ6O3PMGlpf1L0M=oCb%D}N%BYJ z5PN`ei#^D&j4vn$$37}g^rd7?62G(yu{{{4%quWXwu?H~jcFB>bo}J$ccKT_Pt%Ew z$*|a}49obBVHrmTX1$pdCE~&p_=aXK> zQ4Gs`0OO}Yp{`VOu0-4a@{oLyxl_g|b6X6{Tnoc8&SzNWI7BY5?%#j8Bwu6>mT}6Q z7Q-?x$@tj@7(Xs%OR7wgDG!;iW?VAo#<0wNGG4ZivmzB?oXNtHH2?Te)1_O+kznbJ zzZsS}8OG1H;^=typ1h>;fV`5)2N@fZUdHVV%Uq7gk?5+wWON02B_oG3z6HI^3-DW+ zSEC%X^;CZNjIE}SL;7J^J7C;0@5->uu`?`lP?U)_3hJhFG%guglF1JlCo?{oi(y#i zG8wmHlQgn!Bon`^@i0!A<7Qaa5Ewu8m9jxqp{VAWRNdTH{PIrb7#I)jiv;&zCKVSx z-Dmxi_+*`n@o_HB);CTEwZG*m^-I>>D3`NVg0RfB6PGzy%5oUITj#xoUNSO~pQMpt zanfIl9+tT&zLz;YhGl+K%A5V8QQeX%gMGzMzI3wo$gr#zF)Zr?49lD|!!ozd?>Tp( zR6-NlAWRB)A`F! z<~$h}^|QK4IoP;(_LYz1ODAjQ49j{W!?I4su&i-0EbCbOo_4NlgC}RxkVi6d$({t# z%bF*{vTn$*vtEO+tnpATu0_-tO94x!?tyHd@`>!SCxP*C3~lz^ZYd=fr|@Ll;-o%E zJ(PKNzL&LF#*OVGb<=7HkW8BQ6~FX1vfqO7%epzkvKGs*ti4e#_I+-DqZMj0vXDMY{cR3O7Z@iLD*=xeMIG(X@zO}EiZMyuFwG@fRdkx|K$0K%%?1@2AEZN7v zu%sWWAE*Bx~Xf%N_>C&$4FxO;K;8-pal<#wGh87?yQW z#>;wZw4ElcFS7qm^0%q=pXhg4BWBuU-v#4T`rU1lO|BPYy_)gL{s)F--^jnJTxCxr zKXWd}Tt@-9 z#|ga&n(@otcJsX_y?D_v{lz-*n>L@spD3Iw9d*4_5t>5Z7?AqsQlovYF1{aLK z4aFyW{y`e2|8ei$WBuvX&nyEszs7@HBv zycWYU_F-7&H5it;Hil*XfniyTW!PMQ;O4IGoOrgxE$$@r%U=tW7auXA(_PJ8j4TOwtzJ5dT;&?eRQ+Z zJNy-X=3Ktyuk_d8<2a#r00hkZl`}Kud!~)g0|pFu20wAu-vI+2QT15pr2hK(`=3c~ z#wTZfgpdC9mgi#BUDjc<{+es9=C=*Sx7$9GmY{vclWCv+JZ&gGIb&wZDETRvPM=qg zn|o7)j=v4XC+G0YZ|wNu$&{b>yN2VFvuyu>zT3NZTt^2H!>px$w`Q@Vi z)4Szr>gUF^4>^12l~eOAZS~zyjq_RiG@H=e17pq;nR`*p^$KZ2w53efQ2xvLLDa8} z_%2Q_`r_&8L(y*O>gI>pcOgHX({v5zznpaxdj0F>GoRUZSjWuvW6l|y-!_y!IqQXQ z;;#3`_vWd=5IxI4`ZJj`!8ewSYZ;a~8-~sC6Q51jkX&*e&isb)^BL*4^Ig{o!TC<+ zSp59`&!jc=mYm5W?z)EKld*)KzyFy$&G_Ve9^km^HaSReUy`(3_Z*G{^BX%~*caPQ=LvD)C-s^H=6GGckYAyfXa1V`BKlqE_{(|fV4EQRZH&`- zNqvx}KSP~an^_+RiO+m*$|d7bq5F4{OYBoqF3t`7U+0(fOaE?iiG6L##W}K{l3(P} zRP{^rfyhOD#{DlM7w2Ooj9`*3`8FW&nvBi*Fa5C4{kzF0<6!Qad8fCV3X#`Ey!uAQ zvyJ^u?igtFclNy%jr~sSuEu^R6H1<2WSEI4t$z3Cj{Z7V7jr~sU zX=v zc_6;yxAHxo#hLN=<*hHC`sQoNGnsg#oryg4#Z%wBX|nOieO(d{fB&27qv%V?kNWbx zzV)PJ^Ih&|lX(8y^Ii0;nICdSo_R_q@8k@E9>@=!A2M!{ z{P?Nu+~05iR6hQG=%@0LJ31v@{QYm%19JE3zVbuY2>tKxw{06Po``(+e{Fx8GD?`T zHP-%?@sgzLr`9tWx9%?=8Se|9`s}az_I)ug_^o`;XK`l#DDyr-$9zjPUXZh)LMOcV zYx48U{ZsQ%=7%J{`s9)`6+%~^Tz9EJ_n_<$H%susT zE=1lj-Qr9=B=;^09rum;>mSzu)SmpHb3=$?m1v)e@R47MlfP!Xa__Rx@z<{hxL^L? zeO`;_24!B0eGk(?Z}zLy?UGIe9cSi;+y^am{PpLD^PvjJxKGdV$#?%Lc82VCk#te_ z`0FL#iLJ$7Jr?%nlAJ*xD(6fXmNO9yn|rV1%m8^y+$JsQ;hcRW`ceODmZ#iPEYTZGF`2#JYby+QSVq;6HUPn}Yb|CuWv^qW1jXR{qj%66KX2`%f!>`8xoT zPX7A!`Tr078}A%xivBH;KJ@1Y+mP%2v->yMwq$NFEgZ-QQ?F-?N$Zq7l2Dl$4QtjG}!R%;Rq@3%AxCfOk(VkFKHch4fHTA2U zhm!dD%d`8gy=Z>9udueC*cWS?%|f5L?|qlN7k8JjCx-hMFWhkShIOG7d(SENuP5u` z&un|{N_@8&--vh1#^hqA-#;H)ADw^wxIQ}n`ci##{_%T#bpCn7`sn=g?Df(4*B$Gl z^RHvnN9Ui{tB=m#kJm@%*Z1|&`Nuu=(fRddeRSsh0mm6$hx%kUki)$%1ooh2{gQoE zAc(tOw-x&%;I59Ac4*!$Xx`Inf8+a+?|m@z4-onW<&<_H96EjR{D>Ksm#S|CYYsVE zz&F!&uYzT4ZMS)wbYPu!d*}TRJWaoC>(=2ouP0-S2KA$qi^!mVnO@UL`s3+Rc5<$U zROXzI`BidZ;jQwqL3yPedU@9`uh2<8O8E#5#Uq{b6nw{gq_^oBluPuD%a@_# z<&u2$ey{R`5am*5LtMGEymiy#weLk=QW$!kVUlx9c(xsRiPwITbI_QQfY?s`eD;sM-^OWK8b zhnYFgtiGu8k9@CR@csdtB$T|Hsq1C$*)zQbc~&H`@Q6+gCbzs8?v7saNPBE%g3*`%)9TT-QoKL zPRhpRsr6Rl+MWD;NkkBLy~|T$Zd{UXS+l`=OY$;}4+))okBdTn==Tio3E*5mNS!}iA;*GB9;D0zSF44Lrq!Cux9PbCHS<)%y8PJL^6=2=(se5bjt=Z#CABo02ie;OJON!1%UPsER1@1_HH z45+&3Z+GVY1Zj7YM)2`Dm!G_7toPA@5g1#EUIs-W_J%181J66`AZ` zsRQzB!_HhsQu!+DlwRImdCmGE_02ppFFIJ#;^k#g4!U&c3%d@>85H$Sy%)ZkRR3%0 zT^YCIP2BbM%c(iIb98?Gp+P%_(@z;vluj@7#&1&jH`o3naoqK;yb~vF>tmL;9f@ZxPcZ&YyEbzK{qfVrr_-D7 z>~K=~DD$4)?_Iex&S&kVJk2xiQV;8nuM{8qTU8ICE9e?u4`rT-AG^MOIYFbGIae$g uf14`*WIhcncmE4#GT^2F diff --git a/Workspaces/Common/Prefabs/FilterUI.prefab b/Workspaces/Common/Prefabs/FilterUI.prefab index a70c58df07815ba7368032385247859af233603f..93aea064bff925440cb119103a81b246053b13c1 100644 GIT binary patch literal 48730 zcmeHQU31$uy1w_X&|d8B#l{*C;HPJL;W$m|*|^QbNzV41Ipd*3%I2vgdL-G2yR-lO zJirTpAVtx#Eyr~0%rvP;5Cnnu`}42A9-h1(ctdaRub&Rz4gPZVm%%DMKe(C~s~eFG z$K~u5XP$Skx4*wH?|O`RgTKkYnf$Z&VUbVL(ZSweFgyEY^ndwy^;41MZ>Q<`@?hZM z@-kl(>9qJg&%We~Wl_!#23(CkDYIfyjMJ68hAVQ0Pm6TEoRo{%hjfw8R|kWCPl{=N z{N`Z5{-cMukKq;n^S}D~$9z^^=h;y?yDaB;*4&$&(Oi0=jTvWWAIoy}E}iAHc;}7k z13mmL{6KhtFBdR7J6_U6W`UmF7_}>MUxWywIF5L@=gg}fZrva(Q0*bjxV8-S;bzS7 ze3dWe>9oE~ItsbImdy^-o9(v9o!%edSZSA>i8%M=iF!QtL*Mt}IF>VR8q3vK5wVyB zK9AHY+sAqy&C7h|2Qdo+zIk3V*7Fmd_}KW6cKv;NlP?Yi^esQ*vPx9r3o|37Nrz?Qr_{XeRl?x5KbmMq= zI9?UkcwgH=CoGOc$e!szd$CAZAfl+_Kscv^<^fJRVqVfQ)*PPi1#u{1#6_=;w)nc4KDN=>Z3nf&tXS&xO zAUckHPf@ORifE8Z$Ww_T5qFF=NF{Zo6k^^yQe(5idEizbVObI#rV7=4ile6 z;Wo@HOrkIjL!yVRDD}3Of?0n)e%d4P{Fp^i65oC#Qdl!`##758Br$j(Ti_%f>tG~8 zC_%)7te|ACE}=yaWx%^Q3<5RO9vwlXmMzlpZ|95hYMx0+;b{*r5?&O0@iQZbTI5T@ zD2fArD*^{>f{4iIST+$(95Rks1UyUxg4B#bY`vKSRpXgp6Z zRC+-Yi`YxpGm|y+fk#ps@FCFMF5`3V`BA`GxS6B9ws`oYI2f`d;eO(6frEYIYXX0Q z7&x#6wg`~hI0?dJ3myo0H~`La-XXqlP8jQR5ikx_TC345SV*|{zF4ll-(j;g?cEC% zy-1!L$28izz|k?E^DYcD@+XUU5+pt-=@!^3SnNSIinkaG(klc95N*cnqiMO!dq8br zsDWG!dHs3GNA|Q6KjK~zcpa#1PdoGj2(2Jxx1Y9%V-bRHlWD-pNUr_mO}-p2ic4v| z`+oSkZiInGB!!G%8{NE*#F;_t@gbv=rK?-)VN97}U|qSzDz-c-VFxSb`Qk~BCJ8|N zxi6lpeGEn{Puj6Mc%eZq4)p_~4CK<=k&D5WmVoFQlX43${JyIEIv3=g5K8fQW^_^O zjbR`{?nCj|;xJ&WWRO>*j)OBoj0nIj1HkhZ6x55Q>wv`_Jn-~tHcJ;h&^d70FcBos zGM^_GgcZ#fF^6!nkuFMv>IG5cz6br4!}{>N_FC(AF<=EovMw3ISY(0-9|;Ri7h;h` z1}a39K$##fl9e`U78&L3d1`A64ZMm=y80atvNpr}y~)-FHvpcr)UKdw>yxc3AhKnYU5t_CWt`Bw7?S)i)XsmpuG@@WysBK zd;Mh0!XNytDVOZo=)I0`z+HNnXJ<};T@~l0!r{D1+S7Yjj??MKQU-ddsIYGbgMIdD za6|w6PXByGoR>5FL%A%f;WQe5W3b{D;No)9Q~ZYjv43MmJ`524=SOPZ>IWXs(;i(E z(+r`F6ozL*(~Oi*CusZCH<8Mc z@oJhc4(I37eECzM!ZGoUjcw3zp%pw>7hu2Op>nJ`2mBy-*k?mX2pN5AFe*ilYzJ`(f!GwNz1KiMI*5f2*XKQC}p{M2v zterYVf877ntzn>Fr(T&`oI`l%spF93#*0vskD)p$gf2wPN8~D?L6H-48Cw%4;RYy( zhCzs6TXBDqQ8RwEP=q=&X&KPu>}%kop{!_!O*}OOf8WYKG*Pda2s-FM-RZQ;qpV0#-;UA*!tLrPT{Z|#z&4TjfKE~VgJaaf zvnA)0ztD12`a~@=rDe-xh25}e&th}G4yy7zZF^ABkOv64_49o%el_Tp;D%tRFaW}9 zu6eGe+~A8IXJEuN!VRYg3?cpo%6(_-v@DXoY>mtsF5Q8h_v6xB4F0xe@7t5c^pE)* zG9RQqWtV;Q^praZ>_5)a(KOE}i)eOslrC4N7im_0MP?5%oR9f9M{Y*r>Paa@_Akgp zDi?O>`{Mj!^gEzJ)ILKihx7V0xrY#`G4l|8%;FUB<7wiL5`1sR>V!g$5F=t{+~l%Fka;(r<4NaF));xWR^GowK);=5sKJ6ZM4o48%qw z0ST~y)!Wn5dvl8QArDD;^i|fHdeXgW7fvHBG1qF8i>lTu)<0CWPD~u>2-nR-98{hQ-yCxha{>yRU))fqN2$ik=pZ= zJ=|iBpQrHzY$1*FJk2M5IPxapXfld;mXF3fb)ZHjGEyd=lE3MVN7HnU}KS86JO0C9dC`VVzRXMYlkIJc1grsw12y{>2agJg9MZJOA?@{A-YTZ7EG8J?V zwM51to?b2rsi0UAp_K=U2asT6)$(eL(ci67KtOhs&aczuJLD=ty|NRw2dtua1>Wuq zv%u5{NUjA-I^&Ijq8V>V3wH+EiEAYvptXKYFXiORU*<>CV*Hy?hU`usuku+_-!_xg zgUlQ|wjIz&T6nieZIft#d)m?3`)Fc{asE&D*i9?&n|>3lyUFADZjd)y>|b7K3Ow#xX*ti z{I@8iaZd_B{zvR{BZDD|sS@LQ${>sM+O3 zF>WEZbqa}kOq$A?<;eO=%M}RWQ932FCLKxb=RRIeFKT%MtCc;FPs_EQ%QH&D?&ueU3?Q4dgk6#URjjbQNAzV^J_DZkj2#9#K$bXpU zSF1%jeKq)SH39?vXMXdk{4JmVFu$5kH}E+V#@IhTSB0rQh|ldup-cgS6aI1eobe|# z!CBKvT!wrJ{SRyde}h2dZ;)rrh(4w_V|YLeW|GJP1joTCFoJ=5j=EQdczx)`^{Q;z zMxZ-Mm%mBkqsh%bnr~_cKn-tAFdS?JfD$h@k!iV3BQ6>T!r}4~R!4Ic7J=yzkV1;~ zv_0|)(I#W{msbvFWbPkcz-OuRF8|1Q zp#$m~ctJASp8+qRWh>{kAzDeEBx#mqNJ2%ehYaK_8Kp@yMmZ|vH*(jgBJqsyiF{;D zd~z^j_xQxy`HU4TdWcVr5|BHxXN2QC6648a1Z#ry_U5ranFJ$LKU0aL*2H}`ZA#}^ zeagSN>W)>B8;M#@691+r8cH<@AyUM1_?R&a)GLk5&S)^eOO^<&%o7x#i%J^^o%9e& zXF*uT$VXxnrqVn*@*|jekb<3t!8i#-HYRCiRk_n4y{qbs_t981{m?>pZ3e{fMjk3V zDqak)Fw$caK|I;{WmG3A%XJxHnpykR4!(oi+}##!+pE`LF}oRaU z0uo_;w7KdGZar=# z)-uEgs{Oc^wX9K5^~G9NS;k(hW%sg{Rb|Wj$K-b86?(Cjt(%r%qJ6QJby>@*Vo3eN zi${u9KpF5fK~!k&dwG(hY(P2@IrO09>)}Mw_%>)pqUQfj1LDcVy0CaX#|W zD4vXxd@{koCnA~T6P}^iTRN7xC1kj`qd7+v0b(g>{!0b%SMv-RX_LP;uB*XRHvF^9DWOgR8{xxN6YU{<>_+#0 zLPpt0Es}o%ii{f`#N_G0S z0I#FNgl`kQg7l?!Z$?#fzK2K9NNU~@`|GE?Q!kfsyS&q^p0TaGQ*~$Q-+`k(lJ2PU zAe`$DKg;ql&v-D((Y-20wUsf_FVQ&yMZY*4O_CHik^Im zW`ze~iqsggx{GJ8d5LbvO!RRm@K0H`WH`yc>Pef$ChB|k3sv_!i# z)ROy?aW<@LB^#rX+o?N2#2+w5=q*ImH|Z)hL4fkNW7I)s&sxL~>QKW!J;}m6=M2Tt zd7MTQR4PKIJ@3-@MC9q}ne~q|My;Sd1?yRK-kJ3F)#D!DL#>5+M3jMpj?H^Byt5mVgjM z(6oR5QsiF;h|b;H`+KWx3+?)JqpJSVh-Ss29SQd@saLYMT%%NScQ8)9McKyGt4eVo zqJC@YRionR#%P^-t=fmCUNu~$kC|CjwVvrAdf9eCFD&?l1vm323`6`rEZDHPJF#HH zMN#*LSg>!d^oj=`PNzzTUk=L2pj2JumjiT!A6&~$jnll9FIR1+`$srXA4Inbe-PpL zGudEBCi??Q>1!D-%}9P^xyzXSJVP7oWEA@2R5pxZF@mD=44#~tTy7%yB_31qr!1}Y zgqbnE?dbl8MZ=dsPk@>m=t;P$46Tjy+1rh;5^SB+S?7T@HQz*5QZBXmW#aG+{5O-I zWi%!t_@%u=nvtrXYMSb&JC8}lt*xdSdh0|;6HsL$RQ-0jFg4Lu5uOTu_A9=VBu_F4^*0+D?XXZhRX2-4mauN2x<}f-E!3j0_G#;2;7YKaPh8Q)w+1w z-KmF*chipA7B8^z3}$)stLq=Nal^@57oVU?R20Ej-p9o|ArW@*sP1IqDXTEqy?W?n z56FDg+la&()w1J39W9WYC><l)ZlWamYn?qHJ7i+z1}UT$)*Xi!HqzX zF%~(%tRjo`){3FQ+pfNU;EHdTjbsAbg?7E;SB=!&)+~bdsEaJpA>;3D8?@L)H*)8l5{B&^b~bj1 z@RAr!n9=so6bHI@Tad>ip?a$c#2V1}Ad2ZB)YOXs#$o?Juo-K)TZ*YqTTSW`Nd>6w zP`I(bj3tH*hw_ezp@-6kiVk`SLBbjZtSF_HBWOgE>~(=t?cQCOZ^a4v2TJe?pm0P2 zicTB%T|i0m7HCaqK&ekoGHJt-wjH-cHq8KmhCCdKsJGT6 z1x<+Y$MZtefe~P=3I!a(X=cEJQ6wH@LGRWY>D2v{Hp`y7VEwz1JvFaJOZ7O?j9Ryn z^JF_gF51OV&R}(pg)CzSj0=+?M}7pI&z*3>Zgu}~!nIZGULbuG@>=W8SL?JUW9YO@ zy-lCZ$K%u_hy$f#^sCgOw%&^--}e1s2u~zM;)c3s{GFgH=F%{LR>=K>E`~3Q8F0*W zI9`_@8y#cs(t3=jX_qv~hFYsOfzH*>7Wr}`XV;Xj(F@Sw>wN<}#=;1Zsa%7V1V>G` zn&9^kMZ0RP+ds&w`mld*UT;86vUGw?rIc^Q)+<3=4sT(~XoVXh*&VSAG~Xtsyctw` z!<1_x=8nMFXOjnHIqeW*{VI zhZ~JIMzUnuta&G%Ypn(S12I?v(ANhxzRf(>n66k1lSi14DbQYI5uR4vbipHI2*5BG z2GVK^jP33PdOJhj-n?Vfkb3LRHj>!rz`aHiwcxc|nAMux29tQ(-8J=lh^l5hNPG>5 zM9>?A5II^Lbp@cb>M7fxwR&5dIlR*2`Uk77%j=QIArxFVSwOsKe|Jh2D`N*u?tmDT z0akB&E~<#sc8L^_rc2*+7qVDMC;bC8*EPI*PPw^oF_YgR2N_xP)Xv1M!pSJZYvN*aEd~hai?p*rZ(G1^QfOl z6KQR58?ZWYVNS3^RU@N+pvq;SMwG;Svv{~0lg$1Gn)tnJGCP30p&@uRYKKgpyG1?( z!vN|iwjDAwL6iivc9Zji{CJg`)<3vIZF&@QhA8V&ubpYWR(av5!Nn0+L%ioM(q21> zgpErZ6KKYbG_YAP&XEOopdu@xRrBUmP`G|?jUNwrh^Mvwy(mhK%oC%^(4V zqn8H!vYLUc(Kr*tMRcM1^+*9;yWq33pL!ey#&qt(qm_h)Q#52gxMX3ULQ`X+Wy7|? z>jY5xyxU{78Zw~aBt8u7*k}C~Lh?2VP)0>siWta%SEW^fkAvnwrLxhw)KOM>D4#g1 zp%K*8sAzFGy}Xc#TWY0kRp4Jw(c5dOOH|t0LewyW%9W~5#U0z|3!75yOjXB0$1(S3 pXSxgdeTSWq=0IPBCNZElJ9A4(=SSa}su54`V5YkW*-m%n{{dg@EtLQO literal 40348 zcmeHw3w%}8mG{001hl0hK5G>(8U+<8h){4O55g?a?eGkSg`<*d2-e8P5*qCNqj2Sm-{HW0@r#7T==}cYiscmD; zyLaX8DsKzWDl}P z856^Qw-lTF-7%Bz2Po!8ri?iRk@S2%mgoH<^HcCS4*8EGvQ&Ad*t`Iarz1~30k2{+ z3j8Ml8;IB+QRs`zbHJw|PyQvu^SoCa8v{O!#0U6zKg<79c!s>mOZfCNbx42Sqd&l> z?{7LF=Q89e=Yhm+ED6c^F$Z_$E*6h-Brlls4Nw(%dFfG-bte%2IO(NH16Ye8fa80)*Gr0~IHMvBl zF_|-M-aS5QmM5CqlP107^U3;LZE|T6{Ogn8Tbpc2FHbg9rCZw4ttc~V%VOywFiFzs z-1J0Ca*ll%Ky_B`c~Y`9Fci*Rc;o~3T)OVOdv^YA)UW?|T7n(13Xv0iBN}9X70z=| zMC=HwaB!u|x<-{+xnBeSCb}*Gepm1bhJmT@89NKX%AFFWeJ?T*8V-=3YV^%?p zK$-)dWmF1%XyQ}h2rddx6%-YY;#7({;Hhu~?`KLe@FpYA`Z5YG6G7`sg`>DzUn(5I zMS;&mo^3#d!$8GO#dQbTf$~$~n7nPbko;ERR1go#Zxs$6A?_-!K;a1g`Jf?xDx5<6 zt-`73&OcB%Vg7-_iJ1q{K8wMYZ9|2_5FHPJ!U^|dpm3yp8u2XKCr~(o|CeX@sBny_ z0Dqat%aMyAs=}$M$z{$I%R6;tF4>yJR4&7;=ss2bNoD+0O(K;s^*Y(`)XYRjGK1^< zMB}_%Ce_-=`BiU~!|cTJS;=gZQdDOv>vO5)Nh>^BddSbtocrRbW9Ps0NXwVbDydm@ zB4k|W$(lodhvu8b_io@nO7o41c)2%ko%t4;|G|6<_jfSgV&-??!+Faw&-rFd9DP}2 zx-dc~AjfgQG3DZCAV-|@&Bf0|jyUI=iw@%P5ILyTZkOzGv`|+BHAsaFF4->59hu)oYw@io1G^^G)!Wbu^ohXMJf`Vm5~DLDayj9*_Ik9dGbHb;+?E-Xqzc z1o4`5HsyH@Ha`y-4R}>ks<{F78p&xe^j4YBV$aDm*t8{{+TNVZRJJxYC$lqBa4c+J z@7c4yW%${t{96kTy!-Y`ckJGi9RraE7fJIXX+kO_PrPRp!s*hJ3SrZ+$)hHFBrr~I z-jgofyUA8QQIoBFT$8;w6{38iDn$9XDrBa?RDdd?e8CzaW;!uN#(8po99IUm5AiCS z_EZQSRGcP~d_;u=c!P(#CYyZJ^jH;AA@rP@Uk5#>rl=6&;i)Mqgm`#riV6{Ysxvi3 zg%FpisqJG;ww0})^>wvUGq7!lY==`2jV(9ao@_tiAMTe^eOy%Uiyr?` z4jxDQ{{=Y5$)_z&UNJ*F29Wq@;uXfw9jZ;XLa{-$^~f|;qtCaiwaOOgw+iAGr@Ep5haP=(-GiCi+1N;GH9JnHQF$%$Nj zQ+4aoG?+w@rKt>rXkWrAn5lW6CFL z#+1*2kgL+l8Z%>YEkooq7Ef5@r#= zToLl`sSnlbjP{{=i|k)%gT1>V$|u@~%BQz|sC=S*sC?W$?1V}TxgwR6RmSq!Xd}uV z^kK|2!4$p*oEZC%K~0#J%ef-;l|I*U>56DOM0XEjdCMoX8lWpe6&-asdb@it7IM<1 zp(_&0=P751zjZ|_h=*Mo)&q}Pd@jcF=MgElxFW>GB@+|q?H+jTRtH+H0_k4S6)`3b zYVrE#AjkF;S0unuhQ-Ad3GjIyF0M#`FYs`>A~0%*F>?;mNksO`P(+4kzpx)z5902s zDDLAi^97{WB9hNAM20Azz!eGeIo{HeK4vx`{X<0ZDMe(6@)1|0yFAtvvGg(Xued&g zNIrB$7@~Z%AENaVS48A_9?!joNIoYcGDP{%6)Ds{BYiw(-a>jHh{%Vo2t$;QxFUkP z?d-ZDoOcI<56hz~LZ!-fqbpttkmGg?aRl%WjoZ@%1|A-_)W;0O$AJgOE#*`@rLMTn z({YxT^x}%^JRR@jGR~)f7yjqc&6kt%pX=cq?<#*6%1i<0IG;!yq4!=D4gCzbO3iea zpxvw5v$=GOk5r|b;k;x_qgi4S!nSl?TPBrD(iBwEinPM9;9i%&9u19z`go+A+@8y& zTV2#6tV*;lPh_WO((P@ebFv;mbql;V-m?2?wqm9J4!h!2>DF8#)v6|~REi4<#^du= zB-+R#JEyg(IaR+5kYCH{T(Skb@Z1tCot{awHKpqLERr2rF3^!^NXb@yCEO=exS=+= zJeg<)(UfF!qGNIr`~67|v$nCHS@)R%H-CF%zvhzMoKe)VP5+n3zDa@W?Iue)#X z`g@z7z2Q>y(|8y#_H&%@3W0z9n%}zNPSFQM7_hEJ_gm16-ZMzh;0;nI`Zcs zQdiM7GN^7-T@@_T<(04Ms$iL3WXNYJBKZW%bdg{A&^B_6lfSE*UE4@L?TF+PM`Vb~ zGt6S$`M9=`e7=N8KD3PtQ9iVdh2#lrqbzgRfsXA)+sMH2*@f#y#2JXg5gFLdb8l#4ZoEmv$~z(>pFcy#$_xg4V|uH}kt4ESid<9&K5 z_jRvaYa0u+Gi{^GU(2O!ba5@0YZMpPa{s}{#g}{sdG;4~h8fuJ?B9c8f=?0{c+3n1 zb~0iqurePnG82GJL*)1@_wn$2sQ?ZV#PEEn^l{;HzQ<=WaE9nOud-NoK2v;L_ND;JFaUdU9EaxRSA)d_ck7k(@e(_3SA!4v)4mD+0U$TP6pC*&Mr4QAsjr0}74+z!kLgF?a5ULm5UBTt3)QjNHdSwwA*#2E8 zX_trR1hzQ$BzP8$?M(Y$NS@{7Q9(Xoc~%g&F)YtYA0J>};|wkqx(?tn{-yno1x`6H zB95T?>J;FVhwE~YC#+AtNZJb0hxOIP#BB`gt4ln*w`(#S7)Ukh(V|cW$AgmIDn+(< z6HA)y(nxZ1S{HEZSTj@7EBHE5von)RxxUkEt+(E@ODTCJY1ev_o6~k}WHa1*mR;xY zI?!1<@z4>Mh}`W?X0t&So5>WIa!tk zi%x&lmTd5roPODUUJLgCS+rr}e|{#_*ocj5lwJsvx_U&Qaf%8+ubu&*g#}1;E7rw{ z`Wzde`?7MrJ=o=~GmR`&?UEEb_RD3JscY04$cjyQfK`d+X1hveONUS_Ttj&fkXYBV za^8!}St%EZS;<^ex?wgp@l9o>5w9Z1zP`!63-I!6A$d|Mx&f8w?Up6Y9rHWdl9m^i z=&d=2d|Gol;pXLJj6*Ovoo;rrlv)RX&(toai_FeLHl()v(2SdKz``dtd}Z#W`~Gy! z&Cf4edi>d^jqd!V+3_Zge=!sZCt%-Vn(ffHn2uHC(F*TvG0jB;jqQ<$3{mIklNJ-) zHMU$#ixG&~MPU{4T%2(+ZA{$q>4I6Ib4%kRi|GL8I3|7!qAW_n8`(o6IGs|`%VL^* zq~F!~jN_gBc5j&MdnH**CP@?4p+g8%@2@#*u#(a@vyU2>f>Q&?F8Zo zbk@j6oi)3d&J!;&T(~}u$aWr%$PjhbxR{pq91z+(ILXJwS$he2%6~GhB7fLfJB9QW z5E-I+V2Z^A zcl(ixX*`N3n@Lz~!XHry>(8-8Pg*Z^eQxsWYkHlO?1@b(1z!CRJD8N z9cK?(8$-TMJESNEC2G` zIVD@SJ$ul=q^t7bhFduqa#P`o*n4eskqqi`x zy`?3Q>0lPQDamYoCe_9xnHCXqhohaj&>Mc)BAJPe5Zz3{)mZ(n(7t++FvZ*Dh=2WgjFhE|Ld3kH5`%)%(N_E7I`?$G=tJ#h&1VGrWq7pg*0(B)4f$kdYD?~HD(tM zM4yvtz;A19az@hI7pFSG`Rrta-t+;VWLk4_WePjIN}+j=z)sYG=G`OS{>~k5yt?(S z10FrR@tdEyEB%8ZE5G!G32S~ods5w|lMa7}_WmMUvA&(lO4|;76ZO4LRPKmyqH;&X z`qOz%nD9|XPE^?u2`d6lRN8ea2zN(>6IJk--96$?1^uC5qK5sLz@HBL4VxKPGN5!Cn7&n2*cON+a@A1oWpFdanrP|g7vhNAqU`Mi7AL;jVnOC-2!?4tSATe0lW1s=-{+s#9Xh`|bgunv zmh)63FJI4Cz+ba@n!(!r5;LNt{*dAS{neSpukBoQ*j0zD7*Rg8?)=xwN=gRSPHTI9 z_fgch+zn>c`_w?68aRw&p(2m*5Vp&FW3;cI#=L;(OI5(>8>j)XkK9)vt`2%{rx#8? zq%*0Dc(A^CT8gXnI((uAAHA_TJIG_^iC<5@a`iVy96D;@HKXTl|G{IQ>$-l;Wl!9A zUH{dK{^i!=D{3gzX2iZhZdDuFq0iR6*FlbRVs?;oQ!*Ij;(VS4%pK(FOiuLhU==F# zFf*1uScM8s=azh2TgS;&v6ne7JaY>6K4u1Xn)tT3+~2&UK(8{}U}e=cyu&JD6~OE9__IIW_SeJkLLFMdgB=I`^*m!sUM~gM^HVZ<2E=r6#n&(E)~_Yc@TU! z&gro*DE@?p&k)$+o$wg&B?Y9tgF}@8{ck+_;NXyWLj2VT`BUF8D1Urk&*C!$_WADt zj{gnykQ_8BvZwD4_G~Nn{S~L@aWru9pF|yFfq1!?87K1ML*IJ8OY+ zyR(*P-qME-$Z=Pr&~_(Z^;6#HcIN^Q@2$rpyAXN^if`~VZG95=*VFiDP2Yhi?|eD^ zxEw!}s7J5>^yWDDG^|IbBytIm`$_2nX4(9_dKd5eHbmy-I_!7WCMUBwS9{8*F zVGMqb*lm}tpSj@rvp)N^X?4SAZRyweF`#^x#xco&v|a5;j(E>syEzC%J$)&K9zW+< zF`|rj*_P+=ihAR20=K#=G+GoP@9O&WlHeEj<(CbaX zop>CrJ84IJ#4qkx`1tIOqSTug{ObF(YA+(PrVMOdY7NQly>&kUqMll}6!!|XE)TWr zPwOh5XzMDU-nOptiMFot(bnZ?;#W0k)#+t&^cfQeD%zIThV`PQa&cM};)4h~^t2wt z*;X!2D?ywiRB-u9Bdq~>vuu}M%RM-PYq>)rxR!f}j|>0LAy58?`gpir+-!5pRsOWX zF0TBK@NxNG$TH+Pez*@&iHLR!SsiY+2_9ZWa34bPy?s@)6m)Didig>x-wV-x4ndo$deDf{6c(Aj^N7Y z6dxBp{|9;U8R_HU`m+68{>o>Rj|-pe$deB}L6=_ZH9CSTpD{ize4a<1e7Mh5h|kyv zu6*RsTHJ(RhxFFB@xEF5f8|@I{6QW+ln1j6Q|hG?EB$n`LEp^)qPfO*SF9UQlUk0C z?Y+nb*t6%|lIy>=a_tw_J^8E5#irl1h14$>B693AQ145dBatw<#QnTS910;{0lD?hz9<#fT?n&|0;eohHLk>}U5o-fS} zLis$Ryos|X^|FR;yfK}P|J~mv@JFVCF>fyZ-N#pbz1VKltOCw%D!FCoU}9U5R&2+i zCmum;1_+WK-CHB>Jet@hU^=W`dZFudVk3&=>@fMg8J{zb*tNhe_MV;clP4w+I}&5& zs~%SK@Db+{yA4>2hmHE(V-`CS{qSWE8~W=#pCw(VgOz?MQ%`IJYS`h?y>iBoM#~SF z$~WbL^IC|-F~$^o{Oe{Vv1@^;ENeQ;EH(mTPU}1S$ct8!?kZqf#w`P$`3AAU80YO? zxetBok#7=P4NU2t`ps`GHV|V{`Awei(A}hK1E%f#$ig!oAhz3~D{UCJo!DZGTYYv! z%|Aa+>~RO%apN0*etX;}%;=BFN7K>VX7tlz4t@vNtI(ryW_`= zMOVk30=5mj`Xi2%i!)+M^=wc9=mUuZG%=oVAD?%G%ro*fK7NXuBfv}F*n_$LE?XMSTzoY-ji zIXOH>wNo}PJAv43z?zUpx0nr27nfOn*xgk5CjVgkG|TU3LzQDy(EMdv=MrlJru>fE zan>4QuK?3$*G%}&D~RoeU$hd>qN~gw1|GK7J`0~{G}?eF>aDka^KD|C@Q1b{&-VM} zLw~rQ*y1=gWjwk^@2J^G?6zS+8S~G`+(qoZY1N@s(9du##{^8Fl@{}UVhaz#5x`9zMn6?huDPS#%%KFDqdLo z2(edy>9d>e|HI?NxH5g*qucP?MgKu;#z_I)RR=!wM`Al2?C2Aowb;s&gEF>#=e%8{ z8*xhT?73r4-c4*PFqNhAgybpz2CQvlK=;t!K0cM$z*7UPq_%Yiu})z6Y~3BduOU`5 zDxll6;`1iec;JY+7aUu>6&U9)rkz=R z+ylFb?RKzlpMS?H(^=q7C3bzCj5CI{mj!LTzsJMO|?(N}-H?eNREyrAy7^S<++ z(e%szGYPFHG}{Nro)>9`PCBMR@nfoK#wo=5CJ+M~L6ILI4(9;9gPy5pMu6d~Bz>5b7+R-|8&*9%$ zFm3Hm*NmAsyFP}DR)&1XoY)I_# zmjs=d%x=CV{pYi9efP4ix*NuA7rtvIZYrBJ;pRCTzEJhef!nA5O3>Fwo_fzsH500C z=&Fb}zI4~&f)1{~<~J{o%1`~ri`J&T_rw0%gzxSlv6lypyMNloF}3;hi<349YAYyx z>?QYlQGbGCf)bK9fdu8PlpynN~ge_mD$nRQRqPQS719(uSI`I^Fg$Sw!iwAELZ&-mP=h8 zv_bF28F@s5_P5qw?HcLS*I`?Xw^Fd~fOVQ=lN<4@N>q}MeF)9T|et-e2H zpw12dYOVKkVQ=#2J@rGiEb3Rk!BKW^+FW^o+z;B%+TOZuB!RBcnAWu(({|4LUpMYu z*?g`y<*TnwdR;>>t!o?BpKCj>tv|4O>$;j{={l5YUH3Bm_o%nFiTdo?zu})^^sbGS z7iHC;{j1|z*ATp~>nx^qz00(&r76n??Ki26x;E1Ke$eAt%h5HCmh(aTMOu!oJ0s@ z2NCV^#lJl8#5=jolk%H3KRM_x-P%QUDhty7V_L@y)2#r=E`gYk0b^aSLXIay-90yH+bzMf*d?yEfA zV+CoRaqC0Sd;k1fH#4tM`MEYn>#O&`#}9=tx4t?*l#ad&^;i63 zam#~tL(>-M)gNgu&ZT}r5Bcv#n{^Lbu6xIoPsgd!ebnUB@uKqaO26Xo*=B4jEstpp zZo8>m+?U;XL#2}J^EqvA+U@;$PRG&yKBwbf>%*(=N2$=no_^}7Ng8D?=v}$GzLx86 zs?SR*S9iI49vo8)>Mt>^YXqh}*~*+WlYR)byZ7Em>qFkU2d59HjnRB>uW$afz5H*x zSC+r^w+^chv^{ubn>_LOjI!<9X4=TSOTQ|ghx}HL*m~@%OzHsn&Z(@=oNt_3Uy@&z z!e?CVSl2I`YMr$mHLrUQ+ykAL%yF?9EW3fREH@mB%z{>Y+hS@fzBrW}CExHE8Fw(3 z-1ZO4N=KesP(4bPS*OUw{d#JM+o%QABjY%i#edy*(wI@B`QOMmzC@O5&mOVfHbBbwKH>nSZ*OO+)FAlnZ?>^mm z&pChZf0^>Xe5Ke%(E-7J1o^ppMY=yk+}*cx_tV_9{l4m_@1&KEZKCfXSO$aK%Wr{f z-J(7xl=9bYze4ltqo8j;^VLbVVVi~Z9tIu<{C z{nBlK0AQV5{X!b8C(|0-`4RQ6_6fT|&)x^ z_P3r3QXU-t`mUF}H4tY|I?2gjw|#Xzu5|k|ehTfIC?CD{RIZ+(Qo2I(nB!LaRqR^W zcOvf(yI(&jKcP^+>id7U4c)Z19k0iJd0E-ohyH5k6={fRWZn&K|LZv}<;8x`^9A~h z+YeFSL!bMw`+;X}u<2$+*0IkF<%{NncFC7>{alwyu88Ab9pKtl>w}~p-1dsj7t%-d z9Xk97W{@SHN?eRhQ>C#TF-j{t3>LEt9D{Q_Wqxn^NV`;W;+lD=q zeTVnsr|bC^?c2Y%pU&E_tdHWpNL0_bE$_~wsDIZJUDQtXL>JwE=!q^mUVEa8u0MOC zi>^z0qKo=HJ<;hoXWY*RG1wpBb8jpfQ1*k%x9K{RkblNm$Djq}59R^qg2YE3xOF4^ zg&*Mr=VXb37kDn@_iI0ZPdwU&-Two18qSHBIBXW9$< z*N!?4@NhneJ~d7n;vo*e!a)MMk&ZWyXF@yiEeVe(eIuyc;7OK5hV8hzUGha_wL!V zW$fmL*lF|sW7%j|E-6Z7%9m?9>N{TEkM5bsGX?)rCWi7$rgd8X=IAGqd_SbV&OYaf z+AZ+N2a)ng828%T`-3(NaGfXI&yIv}J9_iv+te!F@t9BQ>^Fa*CmokHPlzgye ziuO~*xECfdo;$IjoKfkWtCc(Y9Phh&Mc3(o^Ni8?`}Xbsw8d>N?O%7?xn~K~&J-#a z{8@y`D!=+P`MU)-7BBRiE3f|kii{Ye@)FydzA3=pwiBMS*JCSlcfJ=tLj69LA4I>d zfcP(&GcQr)aL<aV|ABZh|<;Vt27HI1t3!|A_DVDb zFN@zr{!uimqOJ}-s(PQ+d9f%m-pYHpBS(1O@M^WFo8?>Hh^jsG{#X>HIC*~P`G1-& z?qitZpZ_xV--%^?E%M`fc~w_<*0wFr^;l-1qY;-1!##OI8Ngymx(NK@Lu?#b>?sHPLqN#W}T&8A) zB+vx0Lp5_p7D?#?4{X&`at30OpCpK*H1fkBH1odZH=+Ug)hNG$PKVz6x-Q$|>a1Qj znNauN^NX{#DXNP@??VOgxe&R!f09Xd4|%ve|CL{#iq+*{%#VU7iIgTxYgnf>eiV`@Ch2xQ zo)*=5B|+^``IkajLYl-+OkXrMksx7V5GN7c&b=T|kmrY#2H;+L3*=GVl>tX%7R8a0 ziB1PytEGWX8lJ~wUhhtP8SM1xcf&cb%11~@QbOo$?6V3*z`8JvSi0Q|{iCjz3Kg5j zWl9Q|2;t~`nJLnx-4&0`GKHovJ_#k{4v6Td5shP(Xn*z#h)Cf?q%aq^_$QXxl*Sks z{@5)@OKGTmnE><#)@r1^eGNp;p8zn1n(g{B&v^FfqN&%Fb~+!)8KnU{7=rhIVz6w5 zCXIH5!8=qfZ#!* z{o2llagpv9wU2mI<^i&g%-co(g+|0@X&480UcejNML zdtLDCmT26!bX}I`PJFA6^60o3kksr_4DsrWm+xvB=20=B-w;!pNpAqZBn(&(#QWY2 zVuQ0N!UiD>!~qHSz26VL1G4XZ#y?$mcp6cf#IZB*+j>JwaHLZSygzAVZdQAiyz>w;KQfP2uty>1>y(O&ZQQijpGQLNP+ zx^6le`KHNbUmYcVEf@Y`U5e(Yx+ul!mqLX_CHaPLY2ve;VDu(ow*;d%v=0A9g5kcI zV!mOCBF2!{2bv60Isz>&+c>TUg)B{QSVxhU=NoJq>zH1$3>h0HX^eX?lX^MXEhhCb z?5#}d2(PJ5XYl@gpFwXa{Q}RDna?O;A%l*CA<%lsKFyk7hG07*evCHdiNX+$b=TmA ze$=0(>ZiFs*4>A5R&Vs~%UK$DKW@Y%_GHxIov5JJP;6zs|Ld86dx7(diqA`t>x9kn z{FtxWvrC@WpOHk-68=tP0#W$U-P2lv?nfkj>Za@ZT85S1HuYS5Sn&(stsP-eq9gim zww-dMHIOA*jj)#L%*MWVu`aN>l!rk|c;H71KZ#;SIbHZU@slLO-b>{BUVC$e2~B9J z2ixH=f*?Si0qrB09-c75Q#MZ-kNkkm=Zj=8%<^2PCZ6#&yF95DwOpd-Es6#-TF)hC z^&2AjqA!oJ6Gi4qzqRwQL=DFR7?@JTII6PC+BFXr!#YxatjjfWRM(!lj-3<$d*z@s$7eyjWq#3=RHFyR}`D zGH!=nlBy@{Yak_tj1y!7tM9mJXmf`3A>*WS8!ADlo^#8H^|urE+@O|wO~h~g}y zISC_{FBnhKAj+~F?h_B@c?SldnGF2t?3wysJ?C-BSF4j831=j;rQ4?3ETB1JJHoPD zWHhJYT%5I)2q+<;T3#(5sX1`m)cgzXz!5_x>QO0$x-XMI~k* zPG+Zk^+_6zR}H_qEV7@*GrhRR;QL4kyHD+7S@LJ90e&Vk*!~%07*DtBM*Lifb=&ZA z-+Q~Bmqqqhar3_ZB&we)yoY+Fv#X|%sMD!|K?J!@tMeB4j#gIyEqfP=T^?gil24jE z^3JJfFKd_=jaKr`(Nbf0-{-ijvrnIk6(;C!zG(`OLJn?=BV2Xr!{587PJJ5UtJDeE z0JVX$$`ms`M=EBX%Di^QVOjH3$SpULa6y=IE7bQ>ranpF@Z5ryyGftqLbr+EJuVy!BnGWUgUAt3W5diS{iPbFzjVie+oas{!D{-h zYB~Mo=0I?^d}3q6a$#zqQ^0L;RVte$NhTX!@?1P$Hzr2oqbN+?)p)C2J=4*l(KH%6 z@4vl+eX;2t%kv}nlWHyR0kjv=3pCSfcAC3~p1#~%TGzo@uIXiX)AcadrqwR2YqmGg zjuJ3wKzPrkchqLXMZ?(h^89(x4E=Wa;2(Lp z?(87EZgZ`9`M1lu6u+*QbLCTOFUdYIBT1rO@Qohhe*S_YovdPlHmV%M1QmLdC;?CZ zmgn03Y7e8wdbfiD8o5~e$We2F?T{?;>uyTU=v}pKbQWN6#6CXkcLXh6&dZx=KS%c+ zcrk-HAr1Y6{Tk(RUY0fA+NcZW`bP(YK0}FJ-_(yP_vXf%(~>8rnO-;iGaa4&N&hqL zjBU7KW*K*P#?-D5yLwZ#7fky?T^4uutS~{vkIw#oQ!7j;;tB{W2u4II7-M`92<$yl zo+L7*{xBc_w(Wpb0`tLU6HQ(VQ%z`C=Z^T+B22KrdK^N;*4c&Cc<9 z)z-`I_P|3xE>XEG@b{F9;9M&o!MV2H228Gud{hYP$SSvOcDXO5>VlfR%eN8z)LM1S zt82b`g)$A-Kb)=zfr%X!4sWxfvfFWuieqd@-SC+;m*dh*y>LgiZ7k_Czmj9Euv^BK z^OGfSN7$2AEXTpg=|wrIAlpHrOJ7(x)nQa30XO1ig|v^{Sm%XOE^Vo`LnQKd;#$Ze zaDDf=DEZAZfwFngHOy!@sgC_xc26CBz@jcp{VE{-9^?66jPX#^%FCY(HO!-crx~IQ zapp6&K>n5m2;PT&oW*o5<9n?N2boaAj>U$M{xX$yyQhX*{UMDuPaxE4P<>zx!!SWL z2Pz7bE$pt8CG4(xJNWK<3lW=z$DD^`;b)xAcin8+gJrv?hCZ=}0iUWGZknylRG;bd-8?;Zst*;usPr-Q z@cp5RJ-yHE_QeRN*|4OOoz}5f*i{^z{ual6Z!Pw5{W%k%87#g(Be#Q#clU&oi|E&tP)#U3K^lF5a!Um|A?$9Z256#k7X5K6ACx&m8ssmbNQuZ#4YvDdb@e&0!#_C zx{eMxFogJ2fjRbjYLTIS7t_wsc1yd+hb6|ygZg?PQ-hAUYDDcZVOi;h2waQ3qaIV1 zt*c3ine}aPtt$V#lmfS~P`}4rNC$Hlorzv^WFRy?T z@QGt4+fN#xT@p(7oyJCuiTFEl#sHq66Z-G)Z*U%I;skyK5tS#fq0$oqxb-MRCyS#GnLPZM%Y@9CSJLYr+hMI)ZrfPi29Iw@nvWAFQaAMo z_mQzaL%4e~hEKGZ592sozk?(A&F!r-y?caC>-D6pO@rOIdTHahRVRsq4;lCYv345-x!~!AtW*<2bDb9C;Y$%b;HQr zV2pN!n(p7$9qi*0QtT%D#qn1Nm^$O+i0A;XjO1B|}U&YdL2 zYH#e_{V2xSrP!*2;lv2A;br2RcmxM%4A7cW;kw&cYdY=@5UIQCM>u;P+k@pBx+FjG zhR+#MEk+M;HhSjmo;JC$$}ecs;Jm(tbFk^*hx89{>Ng7Ut*=m?`k!_;Y^2G`gDoAK z^gq7r>y8Y8gYP;x|5YBw%!YubcUUOMH_|$2A4@ARei(QH;zvY(c4T8KkG^(LOTjPt z8len`jz7s{qPe3fu Hbw2h#g_xx> literal 25068 zcmeHP33MFAnXZw9ZOmcrBLQcO4dyVyU<~H4t+8y`GO{h75W?ZH)RG2|X2i@$SR7#p zM~n#&UYreQ)-omu;c~bWLSVxYSaU52%dtF;ybuD9GfP-0lR2bYgoyf4s~5GxR0sW9aujVU8bFOs-2CV~Hc zP-)7yCrr5tP$G!DGG=E)$}@kW%=;DQDe&xr^tOmBRq|AtSHO5U(&P!bDor)`Cj%RX zxD}$vSD5F3*C9>*A;inPSD82zJdDJL26&a_|1$EBn_R+EWtQOjG+%z}Kz=LJ4Lz45 zO+AMbw{b{B&utvs)suNdek(HzWfqX8K5S~yb4Wzb?TObg&(MgTBZ%8L)XayD)RXBQ z0$ljdMVkER>VElmB3{#%pZ(Jx|1JS8?QkK|tkbRm9&Lx+9NcY(-2+_u>$^x(&piS> z+FyGHc(lL16g76+|_6A08f~Uz;h$g1A{B&6$==Q@WJN=S=&l zvE-scI#+DT7up-s1us{EKwT#5)lbJoW4hF4FWf9eu;x3wLaEzDO(|Vy^-8A0zsIbm zE1m81On%vEUQ=m-*W!V{$ph~KuRY)8HP`0bJMuY{S+r%bbWxZh`Fv?+y4{;+GXtnE z$~|98wg!g62`BGy-(Baf{_0(?y;1#N?;VzAN1TVqiGDL0WOEJ9b1+2g2y1ZgOM^qh z!U4*OUuiMH*`e%U8iUZ_$iR5m=b;|jaW0QFIQE`&sPb5YWATJFQ2XPW1D<81L_RX{ zX>bG=1E>ay21jukMIG=oID%K1F&KE$kY;@u1(%7S^`*g4+^sJSj^JXz8<1uj(BLr8 zu+wnegm$3*G&rVg+byEMH8?fIqxxHegDk{d!xb7F;a>z9^3&k-$8QZzO<(@d;6(XD zgOf17K>I8OE!&0$hao;5LW2|S$I#$N`?Ml2+b1+Qg8#R_@X_EHQv-gP$X!S!5Y^x` zHkJy<%E~)qMajz*F_ouaR`i{!!K5<5Rbx6+FikqykgFlx?G^C5DBZfSRLJC7Ilr2$ zahRL#n&TDQRHD9^YAR*AJgYofdZ(w4o&Wm56BhmU;r0t=4{1DaKj^sH*R_QHj?6cU zZ+wCOBF#4%;x2#QI`b_u|HJtf?eB2DCCnS(;k@OT=X^6JiN35bJs6>rkm5Mtm~!!> zks{9d=Hka9MV#}^#it-eT;?13Q7+oQ1{k^ReCwxN&Nr7w%jJA?aV?kgO>p6FM2h@& zzV*Y;`R4K{Kj)i^D?jI(^3x$Z87aci4@daM(cruVr*zt2Z((JEM7B7QK+VdQw$-j@q z*RZ~kaUu(Rh--U}iOFkw?(5@&w-*ihrgU~ez9ink3e#=QG-uF85O2&EGrreg(+h!d z0k3V#WSg;G~Wd$Urru= z`;F(m{7G-|P^i2^g)}cNO~izhi4SZ-I9&!ZA#6G}d3?zp2aMC3_oPcVzGN#;e92ZG zcgfzE2~nQ72~i%`gftjT1(+i07w!=fW(}suL|^Z1@yo#WAzo{*eG`I=igSr1kC>1U zZ}xF_$tI63J=TQOh&-p}rI6>;6ca)`IyJ?F5RXnxF(HD_aHgi15aKd5wSDZ8ZFQ@% zzOJ?pr>^$bRk*$pk$uQvC3uCo1bW_wG=`I1vR(W!9}kyonc~j@XIs*Qs61UY)hArC z#pJ6#G$E=FP0pJ>4^0RIr?SiAnh=^C;?XWywoR&$PnilWii2B9x)-r6V`<6 z0Oi;|tOtgY#T!tseSqVCGbVU z%Y6KR7{1oW4|MQ5fIWf8b~p&p*m9%o$@UZeXuljB;9`1T_xYcb;EgA9(M6huYKo%Pp^96S(?`wh!|Bia2Y$?zvd5z z*FZ;IH1Pv1V=Ru-tkQCjM}|A6%jPU&$`fD4lxMKZnDWGzG36N!y;4@!gqeWfDTtiL z;t7lXG!x3hdkGt(_2SY_oMRWe9Q5CyC!d|9%*PJ5W4{0*gx7XnmwDhGGjY<^CvRBy z&H0n>{owc;UR>TX`nbc!uX(||{P7&fRATP4+@Y{7o8yX*f1o~8uQT3<>MgQ=r42Uj ziYQOK50z)IeW*O~K2#pJ57)pXMqH5;b(OJv9NLJwhkckZZCDE522PB9$e>G@mdm*! z^_4!?a_Nd_JH$^95@pL1*$vPYp^1*W9D_YQm;gQL($E!2l*`mJ!f#!X8sbrxhV?*J zi_gbcJ`It2iz`ArVYvKpx5sw)drl9QfV&nPbjRq57?T9M>=KScitR71NQiSB6Q?VJ zMJwA7VD(@@cfW!UwOgUnkzjfC8~ zGYO_b`~e@I<>2I@YfYYd;t1sF0sf+o&lcF?m6IUG3v?M zRoeGzv0&Hcvv5EQrqwJnX`~mVyPM!kFOugAwVm0lbq?VY=33!2cF8k~dAax<(+HOj zE+X#NrnA|Zg?y)VRU;@KW<=5~AHsln;5tU0K2Slwc={8iwtVwkxRgNg1jI9`LM!}Z zmeSN_9aKL}S6B#Cq7RTN7QOam+3rQ%9iC5FpDQ`yb=iE{P0MkuBQPzW&pJseufB6Y zDs@@dQOJ}$)}fA9gftiQJI{Wpdm@J`#rKR*BcJCFMM+g!;w z8!&*jcv`j{WF~L%v_7Aw#TAJb_VapLn`gNeX0Z`2a4Mac&$mlTMt+5vU%maxy}rAD z+b2)7{AiyK3frFf&83U3KJ%InzjsB~g`@ZA+V2u*c}wM%kv|;mkV4coY|F_1d?TMe z9sRfX$gcs$HJ-nZAAA*&Glj>U47#^bUnD&4lvihTZx$YR3Qr62k|#Xw6#bQF zq~#WV*Qb#^MyOAx&y&P2LtLLx7VFEyJqA|~t=9#(raq$)8R9%+EY_EYdkog!m&q&OL_gwJNRe z^(!B@dklx?aUUNS$V<5!kY>5uWAs-p_ZTj}mdibci)*>uW4O4MD|?J2?n$}u`)s+~ zV;DzItuM!;%cJGmJ%%H%<;os|{L&6uE-kw7NV)GK&HBn7Bb3*2xyR_QT<$SkT+6k4 z3`ZX=SN0g>mp%5U$j^S{9)m&g5edQV9>d}ZGZNT=h#YHED2zb)Nx+k!{X8T zQe!d7N9SECz=h{TpND%4hWI$IwOC)C=>aZ0r};cHNP-aO;T{7bee{_b;0eQ{{!0C4YE zkpB1^16=qY_4#==(jWf<%GdPe*E18=3weXHp+%IpQTU(t`4;fcf%*k9bssonmX#RPZl_DKPrFuQ|eoX>MINf6>Z zr&z2n_}JV*LGOMx@QdD0f^%d;%N#codrPZh8xLANL%54feV% zz}aqG-?ZI&&_12Me5)gW4zP<6IsV&-mqpL3f!*rknE>^)!4(@9dc@{uzd zZuDgQN6*5F#BGe8g_Qza&SGkiu0rJc&p`eEiZZvZl=kc*ShnTbdhH6F_VWzl2=TM9 z6&4fRtygz|%h}U@KL42{DO>qSz0RV14e{t%*xAHwjGjH66X0?dHWU1;*Vhpl^ek+# zkDn{B#d-GR`TCTJ;}7Z;(dRtC{ps@!;x z{4);wC^5Y(E9V?GH7~cA=RWe3ab9kE{tUjhqR9rYg$Ey+T)@Y$NZXfU<<%E^9yN`p z9l&jZ2Rrg~Gk#Vz3)!=z;LEK%#*#CZVwl83OR5*#wqkQSv!zT&HY3L_>1JTq)c8Kd z$t|%j9^-s2y+SXKZ_8)Bxt;CHq@DuH);&B!w5Wfw7&{sKKR7?sbGt9>!J*Czv};{9 z-CC40j!N^{?tlB&n?8E$!P~Zebhp;;9C=&*&Yf0VaMq+%Z_b^(Wc>lVeL5QRn)a3U zV9Rq#C_1cEhf0@TZ{~F;h}F%9-eV9#Cehy>&r7Lz-5i3kIA)pA4G=1u8~-` z@HhZV$s%t>$v2@9^QpJf_FIiWd||$`VBe$h@29Ya<@iWLCVZ9o^A&%qzIoRBe_QhY zweS7+w;jHE`F;zIhLY!?rMFCY>tmrEwoLfXJK@*(6P{zq zPWTkZRl**&O#;S4AWnE=l0fBcKxPXq@y-_(hC~e9lGvWvDit>q-}`6HPfM=?m1itoZ+&k`yj7*f!F1wvjC=h*>v|b z4QGJH{ zxOBA+l0gsI*N`2pJNf10{?FfZ@?&$mD>5IS^wKSyS+66yt;-orX$IDQpw`_U_XlcS zTGIYnmzHRAT331Et*bnPZC&Mwx32PN>$1N5;Ea}qD?W_`o0g&fZ-Pu$Z`o+R=lY?Lj;xwvMzqbyd&J!#KNkS4!)8f#cz`}k4& zOFWGb*Y;%j@M!~iZBJSO!4u|XtXyl69)`FdqA|%pUirn-2yx}#KadxmTahLYJ&pc& z4vgW-b5MW_&(Dx1&$s}O)|c()@+(hufD6x)NRx-2hAXf2vYv)hU*!=`gY^}j7m=Gh z;%S8KpgiJfgt+pEr;#*~6R|-XQ~z_m|Ci7FxOVaz5`4O0*HL?&UJ+b-&CXYa{H6md zYl$!VHD?@#B14?0$%!HI31Vw-t&e7& zxxacOu_OdCzT5?eoj#h_w}Ey0*tX|X9YTy>qbhdMy+fv2IbiL+T%qYRi*e9g=VQOT z;+FF%hd!~7w5ZF!?^eH(*dFKz)o;w4c^in8fpz+M_j_m9bHqLYruq%3z4@q5CvI=r zQ0tYDL-A%(cDtp-J^?{Ge^u=DX*cXMnAN9LM(fp^vOzJh{_! zU?A$)xcghHUTv-TZsJG4_^LT*&Fs3JhqM8^7lXeMX^!XShwt8l*f0#r@lb?gdEBcX z9YAc-HW*Y$bFNhHKJr+b7uX9(a}1xj{1-nU_H7JAEu-T8r*9*+X1fqO;nd7}V(T#g zRc_KjpIPid3_iuGZ@S|2=kD00@|hjvl^f27pD){eC9zK&?6gs1zeg+y2V{T9P_DeX z@p@vj9PE?}$L;fJVZlz^VC-&)1N6a|yBW zaA=e-_l>7Nn19k&Djx&JzT_Nd-*L>{dhdzP(x2gYd9C|4{FVOKYYedfXCB2_M{{ca zSNrbm{bt^(qaJ;^V(lFmk_$&a?XZ^Ci6?Rdyu zCp>igGC@c6{Iq`V>u*h8H}$fmH?G`$hM>P&b;!z9@4Y?m?ho&NVC=ga)(U###66E* zI-+gn+CM&%SUE0(e;i5F%?zn^R`hMf2+G~4ilC8hJZ8wo!e*NPooW1Szc^4dh->DsE-+rFRHhwfLeadBT z%)DX8!=Bl7#Lc%0YK!C_w%uTY+5?r>UpKGXD!r$3lrk9d#y@5CPhDm1EXKwb&)}L} z9=#@yaw*1NEk~=OW0d!FT=QDz5&N5VJlGG*_Sw$ezo&fFO~*OQ!PGJGgf3|xvL#am zFAa=#VpC;7WKi|hc}jV;0lZe5Lp^AN;E8k=?Xki?wtThGEK}_(uhstYnsz5V6d8Q^ z%o`8d-!jb6$G-icoZ4;HnPoaJCJ(C3wGYXqLCfPBz@YYt*J_7(t@hmF{u;n*wNt#- z^+NTVmTp?!icd0f81aJ{6C2Y{$G_T2mZ$cg*SfZ_Y?jrSmErLBma97Hy3Dei`R#u) z@{g;Zt}QG_*D_w~I?npBuVmg0u3YAi2kmzqXS!BVPJIC_%YXTOP<_b!+Gf1gpye^G zK3G-VJ=hA>j73c!xbxO`Z&z9V{^UEyr=I%RUNyKkRdsaxz_qtJW>rpkHl>I9ZYnRo z<*E2BU;fKK{hYrnKa3*b+5|!5@21LAUl!73#`8-TUqkNHi|eb0KR^2CbN}$*zWC&H z>PNlj`eh2QmKW!brzzcEJF6VqhhrzXO%i{_$J1*I4C;?ey3D<s%qqyx=Fi+daAyzpxcgde}(<5KA)RM=k=!ebg!avw7qdYwZ|_1 zrmlrA+7}=HsdK7E&V|Pxn-#=(`ni z?V7&Hq;*z%OCC44_E~V54?CS-Gez_2Ivro5T^?S41<@Tz@*!blbj7n++u9b(hjA+= z`XJ|Brw9#(_U9a=>}Rc)tBgDTbg!&(9KZ4L!l$$JSCY%RlhX@ugYj>1B=N6GC3PXg z{r>DbIh7ZeLD*RNT({!oljA?0d1kUkj;(;qzi@pz*ROHMg8IL1UUKVvaAnm;rL6iV zVZL%OUP3HtzxDh=>(AeRMmxuOkgS}c)v(oNVsq`Bjx$SuKmE0b-sA6x5hJE*WPhsy zUnIM)I(?q@(DNvlPSpP&4~hwJXS`l>yrFzUTcwVUcc&_3pn#s7B9#`MxP!_hC$$?EX%lSi544fkB} z?zK~oc=D`4>!tpn!;8!KdZ*()w2ST@Fq+p*Ssv&qzsJ1#{x5j9H{7#m9X7dc>o`I7 zGNbN?aBV~Gjoq$cIWt=>iu7xLYp~|&?|1m~*YlAGgVk+Q{i@Fr2I^O#>f3&VEW z);P%#{Tt+8PyD*_5AMgFlX?!i{nSrKo;wiB63Od^pqya+Q{5=#o-et%*zQOp%I{8p z?za8B>aq)_Jo!We{qI5RsdnhmN!uKb{Vn$S<*Bb+S0Rrt~_1l9q1ym4sq4?m2I5pr*8oTxn<&@Pn= hKit^-?}uO8)c(RQ-T&Ft@=rI{E@^uUKjt?s{ui<&F%JL$ diff --git a/Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab b/Workspaces/HierarchyWorkspace/Prefabs/CreateEmptyUI.prefab index f6b934bee787d122f8bd9598bc4cc7e67fde87dd..4742d7b172ac2f27fa4040c2c63321a0cdb48d98 100644 GIT binary patch literal 18260 zcmeHPTW{Mq7JkpK&^*k%Ok#-C-M~CJPA|qbZIDZW#bOcA676U!OMxt>%?#$h?;#IK zQL=Jrnoiu=Eig$;QY3XQ-?@5z{^#WQokK=s@8|Q$8|SCZPfo*@<4u`2w_Y|%tJOYr z2^sGl92|&Q;=087Mf`NdzrB;1FW7v%=Qyj&5A*-#;*%c+Kma75VQx z`^f8cUX^2q%GJkJmM`*@HDU}##17{*E7yyvUY)R-m(AGuW04npb~JX}Kh+ZZF*xF1 z|5oFtd{y1>Y+9|Zs}i2obE`|-OI@_LDj>7%jAW3{TRwut>x4a%ZxX*i_)YzG&RXMH7hUF!%<^Jbv zdDhf1 zXdSvF3~1=nAB)yVX_^p^gi#n%!MkCu5Tdx^Cy5&oKap}cyq3~Ha?ndiMB%SEet2Kc zrD5Pk5w2Zb4siQD|NJpu=kvS(OgP*$O;x@m&xuPxB|*#LACc!ijT0{kyf8#O>F5Az z*LhVHO@4h=ZR(W2D5bqP_PjW9!yl2-Ug)|sp&;6KYk}t>S^m>J`A$x5bc(`NIX9X{D1@!W(UbUtvPG>tJQULdog=a zT1P=ly#Pe$VOopWMZ4WE?V6(t=mU)-pHT9k>u}EMC2wAo(s2-wgwo^@PTDR?wd=*c zOQPsLi(=gE7}h2Pj8Vs>+qM$xorsydB#Hf)2J{DY47?~v2#H8?k6))91LAuDL_;CD z$BEF6ffv9sZ~=q6+4w@X!gqe@2aJ0rQ*ux0ulqO%cV>ofQd@&SLqzC4AMuK>M$83Bw;rySY5tm&6P-Rm}SQQ>>vQ3L=0z#X~XQ}r2>y#qQs ztlAcr(3yL(#?J&}Gn4uaat6~FXp&MS;P|@1nMjEkMDQUlA*P4?MokJDohF^R%?3pdgs^;&ZtOfLbUDeYo zRyRkyLEh+l&!8kzH>_;l%=FM17yRQHRz*;p#p}UsJSjHEd6};^E4kqr)Y!(3FUKdF zrn>le%)T7uYuGY{33r46iJ6jK%h-t%`GkHA2z8;v1F`|PH{4XTIfMH_iASb9Wlc^# zX^)zV<4R*Al?&v7s&1uRrK-Np3pjHZ6&1zJkiwTpWAp=(iIDr?By;C!HfKI#9!-Kc zpW_Vf^QsadOKY|ic61tEI2BhnKp7%a86Io1zkd~l-A`m>g zu5+P@Ml_U`wCR6if7&%$h6)Y$l$AGZ{id!qfFou@lVIr7^PmRZEvjl^>Ibl5naMbG zwncxbU+Be)TMPBZqCD89%mJQ1vum;W`a?M_^7NCYx1sc`;j6x3(VKN|X?f&kK`(Fn zre?Qm5%9quSuVQ*P}C-XeZY(Cl;3bs635XaUa;Fk4ow8yOaS!h_Jxl2nfKZ~?Q6?7 zC?QYPJ`bu@egFw}ZP6FOB8<|2W+VvxY~eGgM}}#dQI|4ro*7dNi1iiv2NnH%*=gl~ zJ`H82#5QQjK9m=>d`pF~XOF7STipWo{5!s|p=Im&Q`CN=KuRNJu0$mlP)H;cNC}ni zC@pgb9wavS5UEITNFo~eKtYKNNfi1}65V$+E{H9R=!*`NZ-W`Jop2)7{jIupqUt*E z+r9`GeCb$rZqa@6&bM(#G>~i;SCAVVZ$u@!kT@$GRWb3JW&CJUtK1GCDMiNu@eth; zwbY`@Fj`vgdiMhTO2aEwmxu%4<(}6$G@gLxqK-$8OO1{l{J4EJv%tEpTBZ14R;bTv zR$t6a>j9Vtloq`@ENuikG(uux9)RrnDo+QHwhNBXQKbM@Uq^IMtsB6=DJ#%*N1k*( z9>C#v(7*}MLlPyi2NpmBLhL1rB%z)cvIT=uCyOH%@VQGDp(repeR;Sz$FZG#99Uf* z^X96`&`f_QA$a?QcEl!?SPLs9BA^)I$fRC^i!FM!tTS{UnVz&>LMgmH8Y4QrZUP#! znisd{5Rl+?E<_XCt8xilN+Vpm58X*-taB!COK*gh1P_q{UsUYQN$h%RAMI><2%Q}5 zl>O#{Vak)&dNq9Si`fY2`78dC1{WfN8z5WfZAKTfeMhy}{YFNRXBoMgbyHB|P0fER z`KGB^vG1I0=3u!0!Eev2PrUrC+!V#2g=`Dpe_IQA5QRbPhCTtyhcWN>v5-38?u)ZR zS{Meu6p}7raNs9c8u$sou1we|yGptCbrX#kV+Z>L9N8!!1zgWEQO>p$2jiDEcaE-Vr*Ce1 zbuZPgR!<;eEQJjcQZp1Jv?h7?SlyO#dqDzvxsMIeUl0O&>BfwwG^4?sCvE_(hkgpV zN7r|06jEq24*?RJHr@CDa;j=z4>^%C;8*qV>~D^om@fQFk&_OqlZozkPo3IMx}G|r zt$3_DMJ}|=1`sj+?1u?^BBEy*W{9EYRs@Rzq{Pr6UpKFFI9Lxrz8{}5 z1MG|5MhK~R$g*gn7+{7DZ{P3=Qu{TuVd%$C^YjXBuYUS%Rp-CMO;{l+AB&=bHVwTR z+&cJ*#?Z_=p!?Z1OXU|pP+OEq*B}5LIZ&okZJcde&K_nyO{Nqstm8i`wTwFgdcjwX zo}(A<-b$TqRFy-}xqRDfyn~mw(}shWHx0DAczM&wY^o*D<{`wUpRnG8;%Kv5El}oL zUuZjI75jTP&p?RpigpU2(dtjpDJB2JYuwQbr77C)r8AjRy}<2t;cqYKbZI-^IH1V|SBR--`CAi%fA;x3dw@15sax93cCE8!LbRiTss769AKM7|8j z3}tPcKgn-oZMlEEQM!)Y>Sog2lUvU;>f(D1$gQFacJ1st_x9~|)>=DS9be$Y3qn4+ zW3T%yxd92&vfA%NxB7qn2V~4B>h8&yZIq0ze{XEOPt5LYQPQH+FO6EFguaMWlPAL! z^v}qmI7A2%y3J?Qm@W8<6QU7L{AsWH8W8IM+*bjZ0r?#iF3V~7%Y+MUE;cf%LaDK| z-y&RJ*#S3b3keh|QK}MKP%LX0qi(pPSmj7i;I>2w{0Ojju?HD)wI#S4A@tkE2~|Sa zGm}r2uok;_Pr}-7XjumBCE*JkCaZ6v#VqY*;5D~;nRO}Q$<50H;-)33gGolz250+X zCR&1trz8xo-j}Koyd#8V36yB0WV`CPufed^)!jh}GhfNs5efSi40{e=>-jJYC1zNx z?70U;DG+g}`u{7KFMO#W8XLEEA$QU9=6hX3lj8bHG>gca4)rG-ic;8GrOcrNRIQZ# dtC)C^uPQrRO{8N}#&oLf8f6}+iajf3{tNH@Cf@)6 literal 25420 zcmeHP33Oc5dA=jb3nmyt2z!i-1qNdrHnRoWBgvaUwuNkqB{+C2JxhZ}Gh${WTP$Tr zX-gnLnwSO(A+`f)AOyEbSW-gZgoMB`P6>eq5{@yPgcMprLIVXFP`~f~_kZucC&`kV zHYYvxh3k3ud;k0H{x5HlF)b$=)81^1*~gfc7W|r7Gf$p*-1_+)*>a)S)_QEuiROcW zfq~RsIQ42Z{uvlJ=g_^Uf3WcG-)?K&`@~}_A760<(4Qe!A#blTl~atV;F19pab!#i z|9z#}RKAfil^Q^)F!RWm46-!H^v9R31j_UR)b9v_GOJ=`CM143Np>qeB> z&I3a{K3@lgcznJN_HfP%$ARrRB*e$W=H*Zi_uKQ)5Ko!E1kar)lV@^>SH*Y^^KhT1 zHpElrB=9_dGI^$ic$|mpUBlCsSF~8BMamEj)(2giSv1^!m;OMLY2oV9E+!{f;tMvT=1-; zUgTpNp9)8CQGlwTsBjdgQq%=cg(G;4sl&o+K$-nz7F;%h_LmAralgM*ID(4;Z$_D8 zK!w9Z#ZJZbHH-t>PlaPDcHCm^w+bgsJl=k*aBvB6UvWhWNBEaRhWu1GL-AXMlOD_; zDV#Weq;OK^yBMEUpyk+5;V>oFL!@xx^B5@{8J|vE%kha6j^O|93?CJaF=_D2M(#r? zg{%svrKMavLoDz7_2nR6!d9MxT`_p8hMUTSM=hCb(X{Jk!&S|h{-B88<(bZ9DzgbI^i-6% z4!EX#{B)FvbHDlc87L9we)I7;C=r+aMt;tkZalZ+kvW{jK%Iq)gO3LQAJxCgO)#J6He9Eq$i&5r$O|f_dTr!@Q zqfGw8ExwWcjjaxrL6NB zY$Mu*X(-es3-)*5^BOL1|GIj)k4;fq~84)6U9P z-dj208+Tsu!aD<{dLNAWw&LNkT;8o^YwDUofv7D^Q_VLFZ9+_;};?Dx-SW<;La1_-CsH923%rGE*`8WtrXS9Z+tvCe!?H0mt#X*RPRfUf2N1mV*K9(&UNxJ zi<2v5h^GJ&KaP0X7`j8PK^}??s%`XowJ}pFFYC&56xK1iX${%~xKR9hY$9F2eg+-l-pWw3 zb*yS}HlOY8?Y0cdvX>C5?=2Trv@Oo8pO-Cx!v>TgX3dSvk~R+kBjQL5T8R$xV3aLD zYv2W2r`N{2J`kN3>ox`J0*dgNFTS|-%9~F3^tW&Qw};=q`MIa5UgslYRoO%{c9J{h z50}?)x4Nj}hcjcWj@zu-a*#)sJGaZOm@(x^nla@Wtr=6Eq#0A5320ZnZEMP$h~GKL z+{WSwOZ%xNl!xb1Hplx#(@vag7f}x8Z`7O5Zc<*y3Aby%2qL6+|N8ec?_TuA@7vzE z_18byF>T_iQ}6lDzd88y*>}CV<)jU3k8GuPbvY_!z2l%;cEuGT|8R4tUT1O+)m!BJ z${6h26;Yn#94gOf=TLc)bErK29Bzb4jJYE9Y^$v0voJ<%do+hB(*;xb8gOEqLnbw0 zS}*sC^jGFw>!mBADacGo zp2!u6^Gvm}luw!4aeO~AdFqgvl04#y3~rBgMXY?v`~bgCBa?@&2vd?r=ONiIaYdv( z&*Qq+kjXP0nJLLbS7fO1nGxbC^B#`JLx?*-f3Cy1-nIRkP-hl6*ZFD0kw))T(a{LuZg_7zW$&lij@5;C*cERqisJ`b6?inftSb(`v{C`^|}zN)LD zFulrvI!+??zsPJPnzN8wh-Z=jf%BKhO zGd38Cza_+l|1rnUm|-aXR?4Rb^D~whihp^C3;$0Y{|ewk@k6%^$DE@OpTByY-l_aT%JZ{^YMGpUD zh*z8Qfn^F(&34De)QVQ=PkcYlD>s?K-LVT>b82A;)>{mN+Bz=WP z`_*AF!To*(AwJfw+pEDte%d$T9~Wz9C*{-R8ERn5;BJE_qwji@#IpRoKulB3kVuJhq%7^$k+pk9)e}N4V z?O8|M=6HM7hxj=A7-v$o$n^u4^)KUp7;v`p65>dzuZ{uE_AoA&_QdtcWt2@*KCZ7W zCvJ0GU;UZGM;nvjg@J6RzFHJ3;Ps%uMJaNNH?ultLnA3I&9C6CV=c@ptmETEEj9;h z7~g5J)x~=@l#)l1Hr8v%6>Mx|3%vI%cb(&Lpcgvvr6Y!jyxSd=N>LFvli9rRv=v+2 zn=5B~a#;jwe9+ku%D#;P zvjA7-2+5TyF$k!~Yv^nBS9Uyv(g{Ia|m;|Vkr3OTRHR_g)?No_El zGCMwed-mb`&8$=RSh@A~zdC#N1HU=vj_22|nR?a<$8CJhyzn-Se>D^dH{kAIn&YrL zm`#`ZvDrlfOpki`V|jV*&|F#;(Y6gHyF;EchvF}0Rw6U+*oTN)n; zrX!r|nD|GLB`AsC$ex_Q>6B7lf@$)|ysPtBi*xGqwd0URkj8Ba@e1pxGS}m9GcxhR z@hf<>`4$czb@z7TriFie%vn2$@@ZZZca9{O z794A&!tp2X$&|NQoV5lN*e?mDc}|?Q7Kd{mFcD{aRsm;!Pa{|%9&e8grqjgZ?U7(w zaKAkarnNmA!GAFdEZbnZp2sr&6@YA~A5617p8?MH*kHOs`M9%|#x*iNac2$GwjMfh zetQ~1JY~KB?mLhty z9Ps-ueeHLzKC)$x$M*01{3%-s-`aQmRhOQ6&99csZu|SA_kVvXq!==BRqgh)qMf$; zvBj=?TGZgQ@YLYe)2eVhh~E${A$ndOtS`HuGWHx) zPiO3BL!tPxLT}N&(&f(A<4JFxA)jpcDzoLsXB@nI>yCxl&RK;AyY4=%@3wOa+vcu% z@951>ZoTcwY0tNzk>^#hW4kweJ;p#y>+TI7-;i`|M|y{cn|*g^wL7#D1-(18!gj!( z`TrSOZNwsA*la_q3dfyh_ZD{3ihFo~p6m_}Ks$SZ|Q0YY{AB9%J!{=(`x1p8Ck1r4{uAvqCMg9Tc_}}mr zkAz}^@8fJMpHnK%dJhFo{-wl`)ZsYZ;e1ZXM0^wE=Q$kVtWC62bg){1)4^&bTCwu6 zTL|`6QJQ#MpD%|v+e_RJk@=jG_-GxM-65m9r~b#eVZH#b!p+N+GYszZP^N%IM(q4` zKkf?vBFoDC_Di&epj2Lvr2sw^aOd%DfPO0wdXIej51wR0|H7bvuK|kvxS}=N-euiW zJUS^9vzLH2ljC;|YjOpC0@sF*-0|7G4>jYhy=6U_cKK%3UW~=h75n5Bo10hMa^@$l zUC=gd@xwKpdjjQcDy}^y9NXYQO2mi%9$;?>4fifNZ&h-iRU^xKmv?M=t8ctJC-~0a zC0CxY!|;p?arrE1xG!UsXAj8N+iT+Onc#4FRZ?HF9QAhGfy*(vvtOt^>Ze~@`S_Cl zs_fer{Os$zVfYd!uHtZKIm5pU{77hFC{>_eITos68aS**D7$O9DH zPWzxid1^y>3E!_kne|Swcm-TCp4XyG{=+T4k^Qw+S?7zl&G2X@#C1GbzmMy9QVR&4 zGB3c2Z$^1M@{!2K)P_9DKP`bP|4|_>JolhX9zH-Bif4KPSDs@+TzLKwW%A4j@pykZ zem=kQ%nWhi*@iNC=n4Ar+An#467^Skjt}L9hYym-!v`os@z@6_-nc0bAD~bk-xHR@ z+bN?~rtYimKg!qMd}V>362dIQl)B^0`tUgD@IEf5xyGC6)(vRM_Th8Hm)OsNfe*&s za_#yXF59s6XT{4+&4QKGFBc=Hcp8a%U&b7T3i08sD%bmPdY}7%`y^>qxsEtbJjXi8 z&p-S#+~0Rmp0T04SVQF*t=?Cjq~2Ga3E;1H?b(R^Hq_mnO&Afb7q*>!XJY%Cf$M{; zy#x;Nv#gBj{Yd@-hg-d$Midl%2eAvQuRhn)MNcpG!U?{%;2r*wd;Ai8Kq`Of$39Le zSw*$6^FPM8_J*IVn1imGc;$7~_BKu68oBwUdk!VG5#{R~_Q(&uK8qN?a#p#0zxTPb zh}{IN-^qPzx%mvS1FPf@3E`A^?7pTiTRvdDPVUI#=iF`Ouws;N!l#~jj#$ORUi;lG z+ll=PFkQIkcO3aEVyiGSiZv{LV#E8hCYtAfU4}YPmAPx+p@)c_J4XJ<3b7q?#=S`F zH^6$F+*h_g^$M|7Sapis^ybW~+V4BtJOykcSP{>`BOg*6e%f^Dh%ykCo5A%)rGwZ{h>BUBIr!%Hz{wF60k==h-e|H|;6)a-)2| z>b|RqjmL^pxtRyP^*Le(VznKGYq_W|JN=>Sp8e*2)oFMbN1@CGU3KxnTZwgf*rM<3 z*hcKL9=7WJcRv60j}EDR0N8hM9jZ5<`t+A>BDNkY^md1BAHV2MVztm3H#zJpuQzV7 z*Lv7v3*Y!Lv6g+JYp-9oHS-f-?*P+l+y1p?V(SHmReu&<3&)R}>bc1u>`m-(591he z-R$V!f`4T$?|I<-r|DpD4qy4t+176Hc-uIMbU8mN&+#$8xaMP5U-RqNmfrW<`yQV5 z`qs@9Fy_L-50Ch0@XXR{PJ8Tys?FcTB4V1d>Dx_9UV3%j?Q^eRb?4Ow%op^|SqGiI zYVWRvo8NpYb@hxa{{9}*Dtbhx9l(Ir1meo_{z-6 z{7+qSL-wxw$2=(vwo3lP@fc0geWmjH>tCySK+oxV;J8zv@w=($6Dv{RD-he^UAhjR zM~}&)T#E5m>%o?^N%trVx^H-_Yk zvFay|JN1QRj~uisfabR1N7P+s*Ck5#|1Zt6hZ7T_A>@ksLwkwHoOuWeHOr0ct} z7~q?}`Q1I`{uNEQdNlPYmtR@397F5 zeEyzO+osa~ugd$FjyEy&ad23PGV6-cKc8HiW@a07tW>8`%3l}0&hhnO#3n~0wM%^^ zNLQjP?YiN6Z_%t14#!2xkx!K5PnId~kAwPuB#pAvH{qvKN32iRF0Qp{r22H+RgTx! zAlL3$Yp>^8(_;&a>K|z@=ZIWL7@u!6$YK0nt=C8W@zC~BSMIpAJ`@}2I$h5y$6xhZ zl!VxipL%MxW|>DlE5E+&@a?DWMN0W=P<1`IbuN5a)xpAU|Fvse+v(x4b)o*g%8^@r zGQCFkgqBD9`}SMCbKiYu{oME7?YHY#$AiBdlP4ZuG-unB%{H^_%b)V;E9baz!|%w6 z^C;f~h(GLo3t;H0yUzfut#oc-S70lVk z&peL*&8Wp2d*$9@FgqXgmW!F(jM|po)%bM&te}5+VQr9~oyU87JGB#R-B9a6eRrN8 zoZ>o4$A+KdB>J{EQ(DVUEZnCQ#|-&~;r~=W2e(tkT=Yg|uC`NueR*F`B=v{u951~*q9tl+>goer%w>+PJjGGKk~XirSVt&!M^+B&%TW`9(wOV z<#>(8k2tjH|H63Kn6~9n+g^JU$+ew7UqE*DEHNIkP8)Gv`%igI{yNolGm>0#e=8S% zeZJ(l4=1PhpK!hst^0AfHe?IhyfW8brhOlEt`H|YG u`xc^=C|h0>HL3;Nc*wwT}MXhPuyP0b^irb(`@bl diff --git a/Workspaces/HierarchyWorkspace/Prefabs/FocusUI.prefab b/Workspaces/HierarchyWorkspace/Prefabs/FocusUI.prefab index 9c2b3b6206004c332f48133e7821c604f065fdea..6af23dfa925bacae2a7c63f4390ace159f5a2dd4 100644 GIT binary patch literal 18258 zcmeGj*>2o8^4(vdd6;<_yFpTS1M}b`PK=F{z(;_^Vqvf)c3T^@WJqc!p27V47Fi@k zb<57>iQ79HAht!8s8ZdRe*WkF>1&Tp=+4g<`!BtpRzG>{UU!7`ETc4Bj$WI-SNET)!W&BMAp43a&cVpMLYEOM%EcPgE~R1IB1XSxA^fV0m@Y;z0&M zY6+vLBIyz(flvG}2zH!v)y<;>0t6Ke@x%=@)QcOKld2O<#mga@$O?(y2(d%;WJ?xF z={*nFid1qAVl0pxr8K1hiD;Y#^2GaK8Nx_uL5b)zK`H%{99tSfHei6iVwk|bsUOQPq=K1O4ogp7oWFrQ&xOng6%qVP-D7sn|} z2}vF}*RYx-EDh7xXX@PL)d;H(R$ceBjHW@t{4n&R0aykmPHJgDK^h_oM}J(!IB8#>(lWC+3PX~n zU*cF1`|Wb91Po%DgyBQh)~F%#6BY$TtG8u}>nxEe?O_ehv8Y7zq^tpBAEW_`pIOXf zA|9}0fV@9+SFQ$J)OFbvHy6BFi0&yV?MqY%BmT4WT7Dn{>L^NeG(8B{bPR};KCf3z zCZ3eiK?t6W68g-1g^lC=AdXqYf}ve^O^6Jox59q-35h}y0=m!3FB@8e*9E~&LSNB( zJQ`yRb0$9~F$C#B^Z=}h+!%q}iU#2J2EKWnhfk>{eS-XX)@`L%W=R@_%*RM+)YBf< z*{Z!fc>*d2-Y@8)`p|F3)<_;Gx|n*wW7HIuS56tDFP~s}qz|aIfYuo=&uW=?t1SJ~ z)Y~Jw-W~q>9e;g{p9Yw66+P@PhYSBZ02GSy`Z|30JmE7HkmcF!vE;VUJ9R|ByUTB?$0yL;|otxV*ZD zOTAtp&axV)xg?91U=F^OOMQaAU0mwR9*@N($sZ`05gH|-;>3f>`w+8$;v4F=&Y=xP z8m%6tSC6T1y~b}BEBjpFu~>`37v($|R zeO)ZByLU}J6PGPtfRi*Q%u4_S_|3gj4vhrp%e3n*5_<`|-eOe%b}0}2lyaX$bCN`H zz&M+eoI)i(V`(JvU9Y>lfd}e>ly!lSHpzeH7y-etpAi~IP(tt=g?0M_-euP()x4G{dfvQffJUpCIG_jf7R8O?@#%sqoRc)GuR*#Od9N#3Oc4ElS);OixQr>jf#rmW=R2^Jy)>fIDsmGpgEak`HTmg zLy0d;B9Z0^4I*I#+yB$H2`R*JCcT4Zn=Z`noYqx+Ag=js0fmokAjEo{ux7DPCY@fd z*1oJMZd|3KRP`0CDF_5l<}3j#AOsilAezy6G@H+2mWx@&xI-}+eql{W2^v1}u;guf zl0$!OX-tNEY}^2Ic$if z6YUuQ>0I14@ymwawKDgEKk`Bi1)!+ygY5%egaEMz$iqadFLJW2g1%W_5-_h-3{yTCntg|RiUqr)3*`y3MsDFPT)_zC6| zeu5FzFlYQOgJ>5!DaLewC0UiFiftg6sbJItgFdKZ$)TaP1I`}u62ny-6~fDY{^tS$ zQS=s_%p zs5}Imq<6z2gj_il-E|EiIYxMLWq*lrZx3@=*4c-TMGFt;7vDAokU}0lW(0e4yM=mT zC#k+mFJh=pz(kC+Za-Kp*3zI{WGrXlOr#`Cpn#b{YDJ)#2Mv7~qKiOHoNNk`!aiWx z)Fxf&T+=4>f&YWrbPQeYBi?ai7UZ>Ke<(`^aXE~6L~%OLBOw?`ptqawcn)=b&f{4~ zvdmCg89r(HzDaU)%R!B|kARdRtw( zk-l<`?(R|j(GBr8_Fs#+EB+h%XP5`sR6_e+)jHC>7AZv9#;90bUSW;Gu{&g{PXiwKlHREceX z#qiF1--b+BXibAU;1t|`aZ{>{(1|jj& zd73ickNBK30?~5JLop+44zreNKut_271?pr@>0Gg251<9zOA5){Q)y-msA>3Sp*a# zT-k3HP;8V#>l$@j#+tR+bjYL?UP8%758?JfW0te>ZagAJ*g?EIcqVYGe;|4q^O)nZ z=J#&mtag9v;Lroe>H01A&1D#`Ynn!{#_@(o9_jfj{!*m}sEv+B?;CNu#^#Hn_pva! zm&fh%kp1w?T9}L`{!1%$PnbUbKTgJ6)mWInD(l3qfiy_6Me#$jPG$m57=MCBot}ZB z_PdcCtbN*ADJZJ3XHIchnuZ@X)6##yW2^Q<{C7!(u*;5hg>GWG)c;?&kH z{RR{0BSSGdPjIGS(1(0+Q(mem_EsS^hJXd8nGj9rKO$Z9E{C0acSSy&2~z_Jz8)^Y zV`P>MwSK4wsAC{vX90X3kwQ&V(s)Aj$ZI|=G%$)du8nL zhdDu2i5%}ktyO=@$xpS4XnbaxbA9&O7CnsBTmK?*17P^Y>xfxI0bid)`+Lc){VI6- zK`Uy z55;%iBVm|KeNRXy=VuZ%*8@E@6f|>vpS-2i2v7olx=RhO_V~JgyI+S{inG)gT}e7Eht>9=LlUyfwd{~6Ovj4y2PG7(TisHI j0ZI4rTg5wQZx!XNDOcl`{VYnt~+e literal 25420 zcmeHP4R}=5nLd+5g4!xte`>WDB#I&+q99U!CJ6+h0YZTIQ&<_2OENNQ;1DyY|`E)mB%n!oKhM?sxCGHwnac zf4a}Z(UZC7o$tQqJ3rrdzH{y!jA=T@nAS#P%u&WPHR01t95-p)_|>!8(#2f9rFm@E zIcD#^eftt0##gVF`vpePZ#cK!1T;hWyJiQ##L>5^mXt zBCd={;JDygyOm_hsfM;5h~548VNG+;xK4?!0BGV>JhdX&jOgm{VHl_$;y4>R$~0I#t8C*mG*lS_CiObf0r_vH@_ zp5Xyr7U4PB z!CjuJ08f~6!Sf)>F2V@d>$F#3Dbx+J?59I`I&^>=DiiE<#Tgw=@seL zR56{)n$F8&#YOp4wy+|X?`%rty=)Nz_34b)FcTL|sbYt{aBnGqHP_|ki@h#tim80N zS2SJzcf8f~q%z%}$t}O!Yb`c=D?ISGdf;vLI&(c~}Jt%3~dl#S_*+osMfx zc-B!P@)5(Q!x3B@pgJfz9L4Drb;8r(2wq{TG4X0qW_y_h7emnY(%~rXwwDe^aB<*` zD6A1d$exUwzIHqL#Euz15I7#AB{jI~nEyP{N6*?T@Uj!NQ)8X{TZyipu zFMsH8qWq!5Nto}Wf0lukeM5)C6rT^F!-Uj@Jl_m%t_cc@@g! zKgHsk+1|)Jkp(`)wLhz4^4g!L`uO1eMPsftm1)iuB|2Dbdd(WMiavsPQ?8KqqXt`E z2#gDOT}L|8hV>ek^;qbwGvSIoKi_7rt?;bwjF+#;wr9M;oHPOpJJ$R5ZS5R&VY>A0 z(!;jjvG)15_Z7~D%EQW}dvR$ZE~G?!U>8Dj8OVjO>)7S-C3_4onm50bA>IFytvvB1 zTY20idw(uOdEzcad0ZFLXkZF(Mbt0cBP7gbn8-w5?+@XViTy*o&R+X21UD+qC6YYi zLPEUF$K55HJi7E)7m^ftn&x$or)i1{As#hNaUsN`rYSB&@L7&&iVGnwrm6j7mu#zB zg^hK!e`vZoUYl@z2QtTy(@O9%b1n3I2xUwsyJWlg4j&JfY%%etfU_^@LR6lin(7lS z+2Zn5AG#3Lhc4$=J`Y_86HVFWaa{;qj`D;qMD_x2;$G@gh0GM^8DTNOT^?~E#1qzq z41;p)AGQNi$>NP@*D1j9zp0Ml<9%FQNGQL+$GOxel7h2cmjNgLD2Ipml|IfTQ0v_S z{CXchBZhDF@zD-`FR)$6?1wXvjjcD@pX@*3kB-aO02kN$qR&6h!K={!Zvf{!Im_bY zN*Lk^fW*fWPa4B;sM*WHvB9+s-mliB3dMyTskYoI?rxgBRu5rR2+YmVueM-gl*?0~ zG2PyQ-A``0x44jMmrc@&48Dd`1fH8JdiiuJQ!oqZvs-IZ#nz67?1~&n;>e109!hjC zXA?|8KI?Mbc9ZAG(sSc(TTM;2wIj#aFjS}|m+8hvtjEje({0qut^y5NE76(ivbTB# zFW=)WZed#*+OxU5HxFA%s9B%O*L9@w#hG4FT0;Ts`|`z9wm7?ibROI3wMlp@T}|y+ z)!cM8-Pzq~85XA35US}e<`%ciO|71pE`Y;sC#+2tU=v8BNO_+1=IUSj1 zERnG2PdA}F{4Qa0v|U`O^~Gyp7|NQk2ji%TdH z;tPFTLXi+(?BfhYu&5y?%tg5NkU1{Hk(uJ-!f{|bh`YO@ssK-zD{;L6nLHzqnc_TQ zC=%rvX=N#&Ft_6R0c7%2BQwQ$BoyhZj}1kve8T()pHCo@hoJ~loJYqY-YyA6M4xAI z->;F$Ga8vG&cjfozy28$;0g0Cu7^U1JPbvc;yeZ`Auy#817rnP+QjN{&??XE%QI3HXa*$*=J z53Y?-A2XP>k!w4BGJP0N`b>%a8TDayo1P>d<(IWlaChwux9JH(|1=w!zKv@mQ``s3 z+9Ump zqmMWg{aT*C;ZR@17v{S2c5mdDYv3}oo%9OU;LFUOkKCGm_yIF<@}Wz2-ui_F(;obf zi*9>%<%*FPP8h%W8T0&GbD?B8Ho^xD-mYDCLU2(#Xz)>k9E`!!*ck-SkgUPuGj2%M z;C-BO$j@L{c!rprxO^6w{Tv3v@=gfHsRB6+hASgMei#f7v5#(Ff-L!MFkE82 zl@UE{Fq|Yl)Sh#yo?~zy`-!;gpcxDcF7JN4hBEbGFwB%NL(E(Ftbh>fWiTx5se?2mj+UY&urydLd)K2NQANKJ%4$kr7IWu`0 zh$E3_3-D)s`~rak{#Se+`WxjZ&s)BHqc1<$1zzHKJ=SF)uh+PYZfJ0hoa$}G!SW(m z?CZKS8GBNS^U-WOPEdO!>c^fT_Kj)6`6tdx@qJw?ld&5Z&__}1DI!v=AHurTkXLc2 zpkF-?*NPpvws|;T1&Y^!JX4cz$6+yRY3;D5wSJlB!a|@DeSn%m!RuU}>0Q*@<@uBi z*`gy}pUI`%vb?+C2-G6F#h-=8wOrlUbQo#L+w*$t%Sa2iS{_C` z-$#LwlZ~_-{4pQ5k(Q4$0>k4md%umeYC@hDeEBfak|+JI`nZj>9DcksY3tQUi|r!+ zKH&J@aK|TpL-3>gwRN6@Q~#5IQ~&wIku(xL+sB&(w)hsv&-8Kb5SbV$GGcB9&WO30 zV9D}CB6z!VOcIa!^F7_)KEHXakr~l!< zv_NEGvDdylSL+pu^=S&=?FRpQyw0GnHw5Q&d|-hyyV~B_UJfrXPbGo&|9t7fX zKrWwN1KL!EuV$>sckTlp031C0F%JzhfhFeq95j(atSimDV_i_ssGef^-nU-HF8$TZ6F?W&dgTO=JW?;_sI8YL zfc@3W`RMX!d+iCJ(=KhVoB)zv`a$cR6!1vBzd@PpmAEvN*M8;+V1M=U1klB`UV8%Q z=%e+@2_X69MEiZ*&vE1lAd})pCIq)9fEG`f;lM^CbFNLNFcRe_1FJ{o{In;47MHk1 z?Jj9C%17<4CcuT~QlF<5I8%I{*IBGD&&&W9p38k6#-&Vgo-i(r>NDHQQXa3Zfa5x3 z#%VS#EfJR!&n-UQKyr&mPdpiyCX$qoo_I1Y#jO^1kr`g`5)zYPE3&w* z)n+ll-FA5aE>CE#0T21Pz6pQy2~9iYljMn>8*~u2Ir@Yq9pLhW0JoY7WVFL3>VG5Z z{9C`?l|)OTC)>3RneECDN78z=U7Z#a+-+Ajz~u?e4}AU{NlI2evY+are3E$d3C$J6 zZH_(>VYn-}oEy9dezvQC%*6iRf|_3Q@uI*M=l+gAKW9I4{qIko9&#kf6V+!Gahs$1 ztPXH_LNlyf zD_-_x2l*9}eHv2Bvv$bY0v{{Li{|ksCBfTL{GBo13X>E5LRiH6<5VyB+KSEX=DQY| zv>f`U+Ps!&+>JG|Uxev&DT6oug5uO~h<0%Z(?GKZ- z`a+O#stQ3q$v|Bppp}IP9;|rzRBMqP(DzL;dA{SnT4v4E835AYm~d_1d6E+GfqxHhB!mWf zm;6+GN2dTE;2X2NW6L0VsQ;Z9`TpM}SDqmQ@Kgr4{48mpU&boWp^&e!_eAwM%*W+b zNqxz3&}UnFa65W;+VfSX|NNUvcg*W8OTV?`7k4uhe-YX3UAja{GwrW;kHGf>^=>u3 z>#ujYb@?E@t32`ERi452uJXitS9!E|*zW^oT>?;>(uJt+G}%u zT+Xv^yqRv#)SJ>h_&MT>Z0Ejxdxw1e+SMCAwQ=V!@>iLP`la+Q8s<}itE%)l3MJ0L zfmc<|_ksLA?SOU?UsXAeI8OX7Ve|f1Rpl8H$jfS|JcIT7$`kkd%5xa_YkYk+!`}LP zRbmTzg!6^Ev+YdmpGM$3B4T^Q?}zw>J}!Pg#C1z;{eBXU6vN*^e1O?klj-WCs5ZC%=ONI~CNTtK9vphph;`SM+qX-(KVze&&)7MZ z*tc-K&c|+V8N0yBLEt(c+j`1BcM;nGjC(KMJNdh}-%N~W13J;lnvS@W826=~FL(cv z)9xmAI%bSw$2{|eM~U6wV0(|a?>S;`15>`Ik1hP3SQkcyXA-RU(h0BaeQ)9s=5b&f zQASnfhSo1#{64S_w7Sd3@+)uu9I(~Fw%f$W- z7~jO?ME-}nFL{&L+nA-N1EZnrx%bn>$mRv@)JKfvHU?`x8gojWu9D;xtrKB z%uvN{-!SY6Vnc^PS6}X>QBVAi*bZP{^RX`vtu6l#ESrhNOe^~BzGu;rUR|D6R( zPA1cN_l780j^~;hqOCeS*OTuV4AYG`oiJdUvHf zLS~-qP;e*eRxezS8c1+b29`EJ9!7hj!u>x}D{-EqzFvjn{?_v2GP z?manw{rQhRU$*sLOf9B6CY~^5*^wQyx4!Xs;+ipO{QG-M!>b<|)^2W}v!&tdw+^X$ zXoH}u<{Ufx!#lrs!JQ*7>A2;(npcG3H)F=$cT3acx|_BntJ+`McAUr#YyIjAuZ%0r z`plXQ={p}dWS7WJerMB!)^|rI*ZOeb^ z&9vxqART!BVDwO*KzX%iUhCZCwc0fGU~oOpTh)>-q?e~N>0+<1)SucfIv(oFSg-mV zUaL>yHSJxhwLj3d<1?84;Jxvr^FgPa`U1+S&9dDvdB4s=@C&@bw3$5n8wdSP{Waye zuttBGGq^EVE^=tn_UU)(@AW}ElIYKTZjL-I3xs3kRdR^4*57m!r(Vm-X z0SNA3=$1&A-Q01ea>_g4rI>cu` zi?dj}XJzqA18>~ohH-OKg_S(d_s{LmjQQx<9xUnx;prGIo#9XSI>C&onAZF)PDKNx%b$PIn#IVYP6YUSN^;&uA5E__2Tou ziGD{OV#&VEd4OftVE@^bU4!+pmG+I=J<^%Od+>f}tZokFtXdpT5-viaF`&F06w+9DOUlsbr{lzrljn=Mw z|8HiTc-B%IublLlM_Yt#8rmK60sBYKwI~}V%O4hlbtcr)jWso1c5cv1)k8mhdCJe zVTKfv#yp(sZd$UTb~^JJOXkmDE}ePxl;m^6r#LcJ=L5}Co%gt}6y~^IENhk;RIfOH za^f$iF<*Rs+YDxrj{F^zUTSBdPSkJkdPQnPA>Lo{?@=C2lN7Jc_uuphc#+7?*F;%1;99A{}^;w11AU@#aMC9))QLXieVIdM1o-{;iE zO_Y+@=~$UD5IJI9)^fKxck$2vJUM&qkO?{X`SRqI^V9k#r{;^}b&=KgUOGw2ahBI_Xa5mN{d<;*mpNaojva!>D^X=U&;AhU zdr_^jvN(3AqCP9rY@Q{&me24+&Tv`rVl^+TwmIdCmW6Ntjm)YoG#^v>SS=O)kQs~WhR#XQhgam=>2h39&SYA(8 zdLp|)(lADGMe+swif9mr?4UERI`SxkutCK`J>$kU%(|LpTGXN{c;4Tp7KLQc2(x{) za>EwM=_3bX)m-XK#H2ilhwb~+i{ePmH%>{2rUiWzM9d55c3Mh(H7})s=f^=1sq^ff z*CUY^xlv5i9+uay`Ms!)9et8FkkzsCMtppqt+H8`Lr$)t|IWPI*qOP)HaqL_b zP~?S3)$?g06|b*N%j-A%?o6z1%>1sRyr`j($%{0r%gU&+9+<99k~+J?;$t%RSm1|Y zKz}TmQ>rCNX&A+>>qo&ZNm4CI;uGRgkL;ke8bUzkLzJ$f9hIb%%#(^Pj0p(?=;n_l zIxRTnMt&H(gzhjw&(m^aq3=g5W^9Ly4QUWX1hWprrtLr*ptd<_Jx?mUC=9|Vh-vgA z3Xj6%LKaeQyLDWaWnO2um%Lht`YAcx-h-d#wAPdTxYewOV>FDtn7Zr>yp|i1FpfM} zn6#8pul2f2K3q+oR3LD{k>>{P7x=Ax6o?B*MLi!_X@@&9;K7UIfW>j>D=#-H5bcjv zrzLLvtPs_ciYAIemlBWtU}9(cEgE2e4b+c;s6S7O zEqF2WnYPy*B7aIjQ{qZS0W5#sDau%Azo0&oFg~CxRDfWV#pe3CDA!dYo|MxOG$)Kh z;{I5iZcNH&9tr(8-p*?YgrCxVG3OT(3^cIhpozzK1o+=lsh8KCkhu-lbSUmNV9#93 zWy16GQpRg4xchYM9JzzT8I2yxyo8{OFePDLkBO|`(93bfq#hg{=}?A zO^Q#Dn8{9WvOGnK!XzM;*DrZ}BZJf?#2mxtI@|EJN+qRs2mlg1f3eO*by6&HvHCqz zX%DQbH-}HXF_V93q|^rLdnTnO{n26jqoj1?P9SnzBH|vyq>4s5O+W3 z+87?*i5uFW&AK%{%^8_QG-mx+U1%=l{nCXN>U>*WkjAY&>o(^*k=Y9*Cbbi8zl~^w z&IUik8S9kv*IF?3oL}fLWpW^sBIlxjlZTsEpy_YV`|iFs2WI@D;Imw$_69oTtNP-G zr{zba%(eEOi$oyPIe2ZJ6L#MvK#eydDwQU+f z81)htDL!PYdBg~h*(_!}a6LAg&76v<85g$h>l8&gS@?va$P~q8d=uyr^GI?V}4JER7mOHS$brYwI@zf+8tY4{?6zxkgs9q6<58I4(VRx`0zz;xXTgljgV}r* z(p1b6$~zpB$V4Z)m7?htPjkLnO;Z#XQMi;4zESw!VY<0AUu%k|>s4JYo5!bRt}Gt! z$la*Vnfl~-L*J+;QVk1Om<$9jZmUe%S|fa82W{HDxnWwGjjKpce9DVEzIs)aYj}!g z!tuf!3Y=KILuS=wSjp){s~!4r7`D9D8}AU>iTg<*IN*=`R!+WpTb$-u^1*Vn;pMaz z%i+~wCmZhaRmJaDGLXZ6(o9v9wXU4Nd4bjGxwsRuoT{Hb7dgLwCQyJD%>aCtEq(XQ zr^ylTpZT=8daVH8$b4We;mq|o3dD@V;V>j*MdbSNd`3i)G&d<6&R3X^%%o433OY2p zxlNpkwy&Q^v-Z5=Eag5)=K_hXIrBqY_gt`q@g$nfyhO|gHhxv)a{b+N&i!OgfE&D& zFbN@$>rdeBq?<%_h#t>waQ}5j>8$i%Ty#ZrT$FBD0?H|On^0A=2Fz~(a{nh zCh5S-<#oq{V+bA`pYY)LY(4lnzfS1ejTp#;trD^q7$O~ z)*-A@{+M>0-^c_Z*aX)S-mce`_^lA@y5jkv^KLzZ2mXh+zbrq9;eN!S*(7;nZIaz8ru5)YZEot8$vlSL- zAHJy`p~lH+e;O z)GM|){eRXj2pU8f^U?hH_kt6&9cGJO-z%D0%?&7#vv!Jai>q$DrnI6v`n>$u4b(Qq zUyFG+7~U8^*YRotx~KNIBsoPB%E@-!HZYzLm#C>gu4d|dSCe(VThJw^lg6nNh|IA?R$^P?^0o6z01b zwHs@O?E{P>>macmPiiR+i_|oZHrTdvzi*2UZNk8AXE(f7RI(n3uJa+@uq*T%!K6gx zUN!90fc$MCagC1ny5}{N%B;06=qD%D0-0Ueoo?3Gk9C2-4tCCJ1TU%N(tWxUsQq%5 z-;c)!nzo1jduxK_?Sj(M?GLmzFZtF%-Cy0l+I#aE`W4%u?#X3PV-m>LIL7ylxJL8y zSN%(6fslwEjb%2X7_*x%ie(J=r<9_MLxK@6+kETD9`f!Iv_eh_}J## zW~@Ejd>6bnn@2+0W(?c<`T^=s^|@#(q~hyZ7HUE8S+ZwkVmdS?zCM;2=NQ{DF4D2S z90N#XaS4gp8W*=}#*r05a2mxzy~MlhPLzbT5y)=*Sw^=s5gE7Jp1scn+oKUM0wT4|*}v?}Qv zRvqC>`s7Bv61oOdDG-S)tx@*-HpPmGb!7N6w4N{fKFZZJG3}pn(WVtwGw-`77ZTL2 zY|>QH)BlzCta_@q(R5_?Z%6B^TF)=ZJJ+WrXzf|gw{d}fwxLr;%a2o3t93nyG zT%Rp=*gv%#7ClGQ()jxC57DfSwGelUj+uMt;q8PY-p}5V<0>^eI`na>NzXI7skc5r zWypq5hVUasy-wSxS?;sw%$E_s@Na}o_@a9jRD|`!Ep)pZQcm*Q8<|&9I~_}9Jj;-I7>~Uj){iENpzx<=t7;u#3UNWpev6hlV~2JqekudzO(PX_uNYZ zt;x*f2L}#y&v*Cz&OVR5&pxMaVNBCzV^%z3j5*wxrhD*drcF6}%G3>WI!>p)SI%F4BG6}%tB{|sGL>_Tso;?T z6mext0)PIg+EngMm`V+xM38x9%=?ik&*u{r-mfxGg69O3--pav<(X>pJQ&YHnLHs^ zwV49`24KUG4?!0BD)Th(xhRvrmUxBtsuQP!hnaX?fY(_5F?fdDoEc;W^&H zU7losC(K#k*@-fF#szqkhx1+fxhgWB#|L=AG^0(A`Q>_kri^JRdTTPP7Zy6QYqIT` za<-5+-IvCS%ZizNX-%Qn-I6JK`7#9NW^-QCY+STt%3b!teWV1|LXTH0_q(VmXNsL( z+4T7L_^9d2TkW1+jJkVl;*TNi5=g(*@fl;>r- zy~Xxn08J&i=WEH{z*M++<*^Ukw{gpd@7w*WDL;Stj0^{26EY3`E9j7S>u{ciBjP|< zhl5W#96Aqv`y#PI2G1Q!RW4vG#(aXLkv@N_tW*O+=tyjdu-z087(A!vK)a1?jjONS%4IPhka z*#~quOmysYTwg{%P=7icQ?dOP(ce0p6!ED3*5Tk0;;!Qg9ggrXgADoUa0cVI4kxuY zf9P9FaHM}a@htl%bU1?l$zS;BaEwWTUkteq zr3A7%oR*ey@d8_4=(=y-?rmN35p5ABw7p7v%;5@T6qwqb@&M~U-* zbIQffLy0);&BZT3i8$@e#b=;ITp^^hS3jN%US2ovy^%|FRvCvy*!WDaQvBO?l;W@oIub9qv=DgDUECLHV)&m3EyC+Dp*M&42m;zi8^$Yh139}U@GR@cfefVTz{}6Aq*S-tEgNk#BB#*d| z5byADcgZG?ErT_qoye?gm~06#f1ny$1zQDA;iTrwSVlAZFQ@$ zv99(HO;^Y3CS2cv%rWG&61>V>3q2n|8Pmxw*)IO5kB3XPnE2Dc*_U)7D$h_&^$C}3 zarvqbU5M&Km-8E+hc1MPrtI>#E`%;ec|sQ=dx2N+EcHnuGsStvSxj)3M_dT;gmodK zp&a{%?Z8yBcr)5{0&x5_^)Y;^kBbWl<(K$4m-<9XaJK7G;N+j+@DRVk$GHS*z1x6a z=i?{G@a;Z+ii3X**yG6Thf|S_tvA}A>_6d;j?3f#7uWlO&p*Y%lj#3H0_QwA&En)r z7~%)yu=N!L<$DuQp~%<)vMjj>3BGZd$!|4`EaYEG*EkwqavbC{my~ z+u4QPPhqvUyp-vbP12eiZbK>pFU*v^Vm6a2nWgmE?XxoF_O7P6K z!fZa<-P>&$mS!&}lpW}erxnBek(i@+BYsy#Vzw%bwE4RM< zqumn@TQ&WzKY#86=QZ5<(%olmS$9$^qpK@XDeJ9+Z+SPN2>JIlh8lIo$55k1j<58= z{zDPviI1W340Q~ZCq9PCA{)MlOYX5kwm3JJtO=!6iE?}hBRyk z9<}%q%;mMn)LTLk;u4a{66l{E`2E%fS?&TEUNICgCJAYY`WK_b{*+K8#8HREB@_wq zr9Lj9NQf`@afTvT)Q}VAB3ygO9G9`kO!0ByIItbW-Ca>Kz!T;QTwjk&o^i-bah@;~ ziSmrMvXoDl9k~7mGI{Eenc_SWitMeA4MnVc!u%UPpF$=NLlLGpkB&pUT@s3jKF{E} zJ;>xa1(_+%!%$?f{+Sfu3G*hdhe3!u3`LmYJQ9is?)I}AiqP&32M_CGC_<;oeq$(J z50LZrbmBIRr07(`i~-T5 zo=1Z9^NN|Cu53G>#btkq8+2TBWaTJ7jqnK#?r8P;yi5*4v%OrVf0l>ye$U73+L$oM zj&JH~J#6)+lTJJSKiB_h&C=O7>>54hrpl~=&pva)o+EZQ(?&mq%yB-rHnJaN?jKwm zqdsORYa{(JeG7dLPx_eRJ~G^{>x`>`OVonhsW)DME&q;WW{Y2c|K`~+$TwV})1?3uKM$AkJ zQ)^zsXAOi{FC%7YSDkGa4?Wo~8!_Wk>(zEKV%B=y$eR(f;B~fL<9vP_F;^^4q+N`d z6Di`uBkc+!=HZcco$c^H4~=JmpY5^{v%Obm4{cj~+(yhk&YkcoUmqJWSN7KDJj$l_ z*5`c7A-LPm7X)~n{qo>4@Z+y(K$dwc{a^9*nL!+h^OpL2#@A;i!3y!{i#RF3qEGZi zoHTKpYa;zKE5H-x^ANZVnd8`q%oJZmXIo5gcO2&gxE%i0;WUE%JQtZs?es42Q;&HB z(;@z#kI#2-ju#K3$)9`(eZ9tI zbk~E!=1hM(PM?>_8##@=xtu*t#UX0G6UVH5vNgcQB6i2L;E)uDs<_{n$>r=W2lP=C z8;^(->xZ!JN927SD(F|w6S#6$p<@vaVS(bEAI0CZ@g`88Q@_O1FkVql(3>Wb;t{AN)@+dU^A{q}fBU5<|mh``f0-fsWqJ*!Ld; z@uh{{qWx~lzn{jDRh~{y48GcIIj8QnnUc)oj>7gHNLmbm=~L;1V@RhPDU#GJ?j=P?lk9{JkX17-M85*&;xA+*-N%XuYzvqP*0LaM#w$t(9@~)OtA|T^_C1Zmk@7tyi{Ip*~tK z7aQS`dVhy9+bdhEP+sfh)@rbNxwUd}t=Dd?9DTH2*;3czh0nvS6;qt2(PDe^ z%noqjS?lx6Aqi5Phg&O%SlrcTUV!6ELkMg}X23z)Fcr$nR&tw@LUJuIOO8L~@{CZTx zcDY;gWt6vB_@-uK6O#h1mTmtBqAVfL(d)=zO4ggzcI}cY7N8)(F zrh}hCe8ggcyW@UIfG5l`;5Y@DA|W%?e;yAHOufqeow>0z7*3 zl_8GAqc8HTMQyBiHNgt;T5}ojjmWgGcH&6-n<=%g4vPuyw#y4}Ir_R9Jmly4Cj8N( zuTILR$P+#K>LPA)^yn)a;BxeWM@}Rh3gXz;pjud&K`m85zb5x%V0WL>hqpL-(AGmw;bv$tDc{y<; z^;f3?r#@E@tPqd-laEn0MLg=St|V@A)ZRbt<3rt$;1?R%PW>%cq+rih{G$u|PF-eo z&VCmyZ`du)FXy{@T9{o}&-b^r*zB$0d4?8S{V&+BR9C)Ex|yw)#SlajFVI9uc9g5YWm(1SeKrG1FdV2l!h` z=X-oPIP(D`-^|%}03v61_N9R6QQZH+ft?Z4(wg zSkpNYC<8zm922hXiHDSk@B3}cQ4reKn|vqY9-RVwfN#uldch!in14@6ceNx~RV@``RVX zewCs43&?Ko(j`)wX@9+Y81C<@ck6L)u-@g?<=ynI^2B>rd4}4%$`kKh<8443Wl&~Ye043t=D;IA@i8yDd;PNY?MJSP*b-VIf z@8L0A>pdcdYrXFeaN%c&M*brMJld|KVz}}%^l;$(tXptdg6kp2e&f-E;tYXw96uD`@{?j*oZRg9cS?hxTHU?MVb63SbQtnYeOI%ukkTl`;+w}Xb zuI(rfLp}-Fm}DTY{1alh@=pwK;kgTC@|+ytQ9VzI;mUJrfD6yJP$ti$0FUx;99%t> zXG(wz&l4z<=d=Ki@=T54%5!>v3(qqslP5fyi1P4gVlaJpG(jA{<|qeez(aPX{%`93 zPkw91_=P{@!0#t)EMu=T8-i=E!})0+e^`O{0?QfPZprrH#~?4TodW~!)ZTLKhU-7J zW!JOCD^1PZmGmzf=2L>Js`NPu70$tZud1By`||s=1KLS^RpmV5IPqS>=KZg#%2ON2 z%W9}RL-qU06ZiYdGXnf+U!Se8x5192x1mQkU#L6V&cyy{2F@cQwnzMah+pXA;`c*b zx760}r|_+K_!jEBn0@J7PZx(c5`E%bS4Q+D|2yOG=R5NMEZC5;qH@Oe);{8 zTi%{_nCSx6gJ(f&F7H0=7GggG#vL57JCD2TSz;HX)mwaQ#QA&vgV^tZ>9aTQ8S~xt z`6G=fw3 z*1un~^Xac0Sv?W+Z6eB?zKg!oaMDkJwK&){|GMgyr=A>By#d$`$biDEo$%S=KLVD- zoV?M;^2=UYKy0UjowxqC%ZRmLj^5+TO*#L`3Ngkd%6Ih%`L8aynG|4c*tf=O=Z|d^UG^ayZV}!_bk5u z5BEPf;di^XQyA}rZ5;WfsyW|Uu;rrbTHYA*SN{zddIZm&RaFAYu@%h{vdJnq%8htBc`$S50CCNx6j|! zbjyy~#s{t!bp8CJ#vZ!s+Y9a-|KYALZchJN7=FIuhp(*qrcj<3U8 zhu{38^zHLM-*wJ+Q?0LmL(tz%ntb0ETc$VOx-FILeDUt1h1XUY{=>c+N>ck$dHr;s zRXc|%*rc|>g3e)H>sazy=O@RF;o~B2eOtDaU7gKk%l)#4wR3hk-h9UvyMxcf6Ls02 zKGGfGoaFO5w|T90Lmj9)Uv#CN9H>r+45?oA2b2%&8`o<8#5wPzx%P)=Luxah+h4o& zp874e4<>4&-#m*?7)o1NpPO{Nbz%i}3nBGStdqW}8H>g8ruSYK>y6i^euwwe7qC9K z1HUgzjrxm;zs7j#yjDNPdetBDT74+5)yHc4{i*y{9amjbV&m$+K`^ww);U6*HEBQV zJ@wIA5A7r9SUfb8zEv)*gP&RtuXRnwWhKm&nYcFBfA`gY;U{jPtXUAXtvG+YOlh}1 zjXy{l=E}^+KX>o9QTCJ8Rhg-LS|0`6`KM3lr^;)YpKkpc*8r}BS=x)TO+Pt1nPO&} z)raX=P(baP*E$z??fPAo-E<(mG#0`$l`xB5BYryGj>Aak!%V%DTl+(H^Vu)k54YX%^`7Gr*Pjn5H+?{|dXBA< zv7=s7#$EeWC*qpidUX$=avVdA*;JluWjH5v9_pt^@mrSVdBhNN@_1R&o3gxV%EC-( z9Z$~v6Y^8zud&(}Tqh-?Pfbd;@wL@LzTxyKQ~76763>-;i(W(C>n#^Exk<^E-qko& zztHPnR#@ld8}fKP*2d4;2W$h|!z}Yr{0aM1+lk8{x&0BJM|?g$4#xxI`kKW5sFQ5U z+gD5r#bmjVly7CAz2zRvUugaM87P4ZR}bAcsoY@W;yx>LIUEyx?*DsSqB=^6y1C;* zRP_}J`S(Emq5BDahJEy2(rd5w&V1wb4Kv?-qu=`2AO7G64Vu}nk3Bkn#uJY>+sv{n zf6k{j&5*tiUJ%)@3iPk?^_1+}oUf(~eV+fVlwITX3n}dzwS6sX%*Qx>ah@|$q8{Z? zIaP@B*0nZyg*#$_Dr!IZJaYlreGaxQ6`d*{?w4K>Hh6*eYR_@qsgOG#;(m+wHMw$e zJ5m{bx^jAU;okSh)q&K$!uZ5p``vild5D*oSCQ=BeiUmYb8zo~cA)LXGnFt?FE_EQ zS#WpFawRXhe%1`;lP_63li9uJUt8S|G#=W|c%~BOq3adrPfdHif%)QdJ7zNby0{-h z(knPu+K*nXO*zH@pe+korf9+_z(LZ`|d~O z+h1%Pa#3a6&|P`MXQO&X*Gbre|G%Tb-UyRp9*4(@4C@EKm zj8Hm0I669#S1BRX`BAXG%eAO7o@c*_ z^pmLStSrV3Q`F~Wn$5F>H*yUtlEYQSi+WyGtB<@AMKgAOpJ%z4o{k;zM@!QG7;f>; zf3@ouVpZOWbW*Nv%L1P@*H$;0S1ag%=N$A~dcYLwELdL*D>>`9If(K1aNxRlb+^MZ$IDcC8#B#PoVj9B|b z@ADMuH;RcHD%RWq`ok%kCP_5!yR|1FN&g&c`OQEr}`KTUE(w1tBv`J`a$!(Z@)cCM9v?k~oNHw4p&A`E;Dsij(p3B_k~h1K%fc{4I%6OTS-< zk|4mvk?%hiJ&jv2H)4TDT6cXUBG!`<$u28I^^&S_J)ffRA@r5`m91f1FAQ10yiFhI z*BY{n*pI!ANZ=D6;=ZmJX7(Bp3RQCCyK1j@XClUQz37G{M1kT3kILEmI z#Id0cU(!vw=HTn9+sg>XqB!uGtFy|^sAQA<_4EaH+H-!?4{VS4NYiQhrRV6W zRyVyiu4^B4d)O5qt&x@q&o4^Zc&IMr*RgX%4xM}b>o@)D3;K>8`Ny)(I&w{oR}dS^ zmrO759}Uaz;20=|Y~-VQ_d-S4@|!HPJVocMyFA-G8&{=+uz1FsrR>2h;jY?Jx5yu= zR8ndyelG=jv(80zTr6@?zsppw4$%hEx1fPlV^_8Amm0fXpr@B7squ)6C{ucRRFzbb z;1$|_T!%wH(1LDh(5QN|IC%ygGS~TWtHL~xHROdTU>mRw6(Ig}jN`lf@lC;Jxkxn> zwYr(`y188PwEO~iNZay-NCcpO!RmP_J@OOatg^DC@3Y0S`B;@Rab5EToY8QY=O6_A z_O){kzy|nNJ@iP8*&I5Hbq48T?z=JNE(zu&3PO)@HYX_sVv?{p5b2@Q+~4AcZKGiQ z6(ySdF>C}9v6~PY255@Byq%h* zOCj|qQjHX8bC!<>XV#Y@znb9x+$+eo%3H$vl=WDTp%M|px8?) zLXMp%R-Z7Bfy4yF3$_92tv1`exrBUxy;SF|pilM5{;CyRQ`*?vhFce|y45!-S3S#e z+;bltRhygL3LvO`!w$m;9f_bRnI-9rdz_>7@}oe+X+*t17{hk|uy8Cz(lMnZK+P5a zIXEwi@)x+zz7c~a)e z<7KrlLJJuOB#cn90LR^UKO4N~HUl0@BQ4;6vPZkTtupC})-+l#=`akNe>$42M5VLk zgcoFj-iJ+S(SB_q|E2dG0m?!f?@^>!ozdt1JO~q? zrPL3+bnfvec7r5I8DZR=r8X5KVtt4InR23MJ*_+RybjeQd=0PgFucOATAB-fpP&G` z;?+V}?}c%#^IWAn(-D#X4jp{DSy$rcLadvL z=ZDV6^$dRTcX5AJeip^g1)f7~=0hPv%4zJ^)DOq?EpoqEMSjdDkVytSIlNrm$dz-^ zEK5{rI_b-mXCfwkgswS3wM{$%2%2Gj9l%X`1vdJGE{APgFtK{ZuZXB-bA@6sW@W0`;W>N}6MoDaA^qGU>W@>E!;cC{cY^fMv|b zFS2AQ$Ise*CF#4e%6^kzd@h@ld0qmxG1Q1nm@MzQ@*bh@@|GuRZmlDMW~+fT2V=9{ z!N4Z}Jq!lVlO!>!W1a_`IR0~^0geJ>i;ZI?I5PrUlD(W%tZw%{6xaPCP^HNJ)zk9J z)-i+r_4i`lcZ03ZU+5CqR+()MR_J95_epDNV~r}~`|uI#Q4de8bWfqA6e6bL!0 zSOyeyh19>0?R|TDt=D#S?C7`KqFI8TxGhzy2TReuZ?77`>}9in>o~O}OB$XuQXQs1 z(Pdy;n)L&EdtPU=gTU#owhJ-hJh?j5jnGf}m+Ei;!R)LEw`xHpgY#__;jYrFd$#?H zwyvEA4oWW_F1{5Ic)^zB|FxIyfBx)FMuU@oX(z)>@q&pi<^ksK0@cl?;g$FEaXH<6le1IuTvsZ)NZnUqX zuo`)8P6Po-$Ob}BY7d>KPIb{}f*oGJItsM=w{ZXoSjBLhYj7XTXY7nXmIL2Bzm>## zgoAzyH3BBQT1<>N^uDxLIj%f-Riv9EZp=o}CHi{%G#lBv0a8Slso0?UV;)Y&#lXqr z9*;80LR*@9*gX- zC1aIc$k>XP`ioId$a1xAYu|NJTxGF z9L20n$HTO(Z>{h9Jz=!-)IBt^UJ3r!8JV`RoyFi&EKDQPPqZ+=`mh9op^i2*^Zp@w zi>Wc72!Hmewrs9%K+k1dU7pxK%8UL5Ab}b}6BGCFw3S_$0^tx^8EhIF!~>sv~v!6t#L(b=b}}TfLp>4$th{ N&V1#7)wAx*e*o=tF&6*; literal 23572 zcmeHP3v^voncg=EO#y|XpdwgrAy9#~lt*hp+TNS=6`ImCZNjS^dYhakm)_hP?!8Hy zD)x4KAq;lL1tW~WYCA9kh@c`+2Nl-f16HYn2q?;EVMaz>qYOGQh)U-B_P_sg_Bl!0 zu;%5g)eSr6?CmJ>>MgkR^LqRl8M*NIBTs!}@m(+P={WMN>9r4Zo&@xV$aTm+t~0gw8&ktA zBPim`m=yl|n|f3GQp(gC0HwmrGh^P4%=)}PRpa$K^BwST z+uUeYKt{^R@}v+K{w*kzA5%Rh|J#UXM)Pxi#^UF)QTaIzA48daIwr*9mGz}^e|xSR6sxGPC|?L#7vQ8lSM9SW{w)=-mIi`yb=XHu zHCOHps%F4l^WR~QUTY2D>PceNu}AAr9*0B=XoUm6N}T1x!`r6Ss_*tXcZ2+S&_ zQgv~zKUi*W2GClOYfegz2A0A_Yu@$XeOs=(_`bbAo$;ezotfiAY(?fqzY7EMW);rU zP(+*vt8j3n!l7c}0_Dc9x0v9ZP);zFL8NeGVSK~!P!63qpT{a3drc-(d91>*c*-iM z_u-rio^52Mer)4Y;Rr4YP!$vvj^b2`y5OmB1aB}+Sa{7Sv%k!O%SO=tQsF4>_m>Js za8clGD02*`aG0prsklCeaiIKEIHqRDEhfKJI2qz``K`jiEyR7r6)7CyUxhm4r@|SF z-zuEUX#Pmy#Q7tIlQLh&_^bsj$A$`rDY+gZg%h90Na4u%^x|HQPo!`J|BW+zR5-?D zz%Ltl2&ELVDxCKAYWX~|ybCu~gJK0+c^-Df=&c%VDifZy=kjIKt(y&ZwdIC`GLEZq zy(_Ebe6g4NtJ^Av3vxrtf=Zv(Xsu+stNEe83XhR~+drJQ;`!-kt$N`b{U1GlLi^T} zA>(yU)+**Zw%;tie*^!=wBM+RhupsP_FHWKNBb>4-_d?cnV*7(`<82-`^}g%=CaQ0 zzzUs%64wFOl#ic_5^?S~A3qNz;@odOJ`W}0vfs#$b}{}LVC1&@ZH#ug-+Ufzm;24f zwO#Hv!G*saCGy+-HU>ZUo6n>C+;2Xv{M>KKPls#`O5D%fZ&_rFTTEYYzX=}K7u;`( z(?L{y$NeU_I0UNKxZf1_^&0n^;3?~9_My!F(ypXzj@yHzfmc1A4(q4v`ndvS&es%+ z*T5y?c_qr^Kf&VL+27bY5d$CLI-X65`Z}H`Ieh&3qOH`OD|D2q;vH-B|>-V6Sny2!`G&6I$%$!@hLKmgim@shk0kC)LUD;?%@cNR9ZuRS37szElW@jzgX_+0%e=d-Ix1 z>HbZ&@+3{R^7tlue=0z0HbtBI2K;|5BSqWZeu7R8nqKxHaO}39e>hQ>9%NBncILDGI zMC;R4Q+XnjEh=B-p$buXsB-?r@lb^@aVz^gz6znrQJzSJ$g{vJxR>&zk(rV_Q!FO9 z&m$^?c*?4fNf3_X!+u~XS-cJXIsrKTH%$qAro%;rMD%bbc>TKWr(K$5}!#tV+`G)j-Uv|2Gurxz1otiR9E)pdP*Dlbkh-Z2XLbzU|ETJ zwF?hMr7|nD<$L?^^ix_FbXIb`@{qK?fXk>AgO}y1K{=l*RLn~1?C$1VwY#sixV{9E zB(gqVh7g16*acIOV@qk!KID0Iskw2tZ6;gn?kmwZj0EZ`6$bGjHWZZ0`5sDUtw3wh z*67a-*js~2P#y|8yV#f3-eRd7T!2SPh`Fd#Zt2UFs|$jv^oAAi+*hvViq*xfqzl;3 zphw(W8EQ($rk3T4`ToIv%dj%PnNW7HTI%dtmfN%-Ujc`GpbRlwF6!IM<43z4y^ zY@!)E+nw{k<+ZO+7ghYe%ov;FHmkQBKnDQjenDUI*j44mjj497ykSl9t zO_{TBoQKS9ES|8)Pc@-Dyq2;#-Y=SV;#|9U%EA1Nd-K^%%KJFscI}rzg!J3L`2CE# zmb~=)u9t55)%W&JJ!0*gyMOnW?>=|#oj=Z;|sWW3Yc$M0t{Ps66AHL*+@%q4M~1xE(4n=89w~tE}av7$eFa&0)&)!4&=i zI5Ey4lbSGXmwQF}D|4>x(iPEhNJbA*HOmuw8lWpe6`gcB#v4623v$w>p(~QA)hK6- z-?}0h;&GRT{lKjjUxBrJIWpxISA@8@WMTqc^uUc<7wYmUknR;-5o6M*Enfd}lsKN^ zibOctu(-G)5x&yl;)+Cgr^D%rz^Eao%!N1)kU1}tk(rY7!g*jni2F}P=@3tu58`|q zGI^#TGbMQo~I)=!yl;`k&odFYBTC3$on zlKm1_MC5rE_x%EyJf|WvC3)zIj5R*fLOf+&$N5B5A`e{=rX-KJB7*zl?7Je|cSnJT z?a>vXQsubO6>kE_b$bSJB=E=9?U@1tkFQ(mVGZCW`{&Q}APf-J2_5sn38T>`s0G!p9Lv1apNwOT6rsH@nLD-Pu< zi_4|K0oL=1u0m@+yf;cuT2R&E<<~(wd~XsA1f`a$|0Q6qV)0mO{RJ z1E8>%t<|6(QFw*~n--UI1AX~!-iy=W3LnsM(vz1^eirT%I^5F{3fsl2 zo)6kaj)ScIgSIiQW5#0}sgJ1>sCyXcV@m4C=rKKRL!!s@6komCum^1^ZKE-1%R?Qr z6ea4Iq;2FnCLY4m;5Yy#NAuexb^bHSfBU1|Ry2wLaPJY@(;hA7|j^ceH?>lbZfDntCxSid6McxbF&vps%3=QM+#{j#>vUTd`BnRbU;+vsrmylb62);88g z%fn}svE=!Hr96KIoZ~;AV2ybE zm3s!T$P<6%o+WN`Lu`DSLp)_Zg9^7Ha~@lenUZ>7fyD&(=W$_(OPHq-&mEM15i*nR z)4Rb>ITjPlM)*SxU*h4MFNU4S(@GqPJUf6t>+tgh4*6enJk&SJPo7s@{We#BygrVY zb&c}SuIo8Y@XhB!twMjvG>k8R^7gw{@3Z?E18}k+RnC0c=d~d!8zZ9v?-1FV@ z-o0w~-o^ReS)~X2?mB1amJ3UJ=C6JIl%0?7zGdswXS-1A;yPKi2R*H5#~$>w4tiRu zVY{(M4tiP#JuMhnSYq*Lo1Miy=xIqbGU;h;$N12Tww_jv<5p+zeU^CunI0HDEhdc` zsV5zITJkZiMuF&Q;a1B-kLT+s&~vh$mWMy)aO-I~oY5gf%kBNv)5=CXKXLUVPfK3> z{oLW!)AIQ74V7(IJuUW&{3F2ezu^;~=ncV-a<=sX52yUc1E>7Ui6f~edWOT>1-AGO z)L-CmJ|QyEQ>4e-0h}Il2f>=Xetb@4+*gOZ=b*`A6wNED4)k`6Q71-R7+pz505ia-hmS>Oq8_GAxfq#tiV;92)t_po z`%(BpZ`;nTwU((Z1Q*)Ai1W3?-9$40kH-({?J z83FWhZC4_IRrz!o8MecA}1#pC-WV=>l``-j;O7oJNTPcv|)&GLW^hJa?pU-|$-|O@KYXA`8wd?Q_;z*n?+8x!~ms(74U;nQT@sxQd zI8H_8yssfiP3q&rU9-gDe-h&L<`Q6ehhG-r@i#PULp=V5CPy5JZ)nJKIa*`8>j>6} zPcT;i--68j)lD2ppJ%mSJr)z(?^h7w@`mOr@Q|POP59$)XnI*cL!NltppUrC@i#R2 z5SKRuxYaZuqaQX={_D}^U%PfU5Uq)v?AJZW>{o#}lD4b;>bIESe!q$#E^lZacKjuh z)NK9O^V9(AXNbq&&|E>>=J*>Ly1Rl)+~9fevtJctCXW9OwDgk0s{&h`&v*PaD#w}j ze=K>1$dMsWT%L`@ZH~*cDa7Rs&7^v%Hw;|Xzl{HTfm6=S#F12Aod%rpe2`#`cwC=+ zh;=i>?;5lVYeT7=GGPL#}V?$=kj7FKOWV> zg3?C*pg@al!FoQ|XtBe6@nJuvkRK)3w;|1pwWFRb@U?<`cba@t5`H|vpB?fe5sC0u zq9Q&grFh|GTW#53p_(5kj@SNmZhumqCnp#_$Alj@Us)I>Db!^v>leUaR=l#!N+tfr=zrk7lD^ORqkW+Si^T2t_?De*ou57b(rXrVOT%W zG2z_)NK8t^_x*YBk*Kt@+D!W!-6L>)U!&WEYh#TrA6?$e=qgWgbd_hkqpLj0(N!KDUG|qhL!1pc`RKvb zXG|KXJQ~nNX1{2jeVnc^@wXE8>YtAiagLRbx1mIwD^zg#S=$9Dk(+J%^|jrj61cYe zwgj&2zCFZ+pDr5tj}Gy8zm7@Z%1_tBmq+>E8RGJRC0!Y=ABHBf$QZYn%W-Uo$3wUb zO-TKE`}4ueP4w>!2reeL3H3N`3{5Cb7f9#vJs~c?QKC!1{!T_t*(|QF^7x?%pC=vG zmk_}gl-ceSi`T#<<9Q9r zCnFn^4(lub)C8{l?+bC^xf^BjoD$-3IZsXC%5z$X3(w!7OrB{W9_Qga_;M=Gj1U)| zJt&js^bn8p%uL|Qb4G{@&$B3#Ckjo(c^H})OCE+Mh~wu))$l9RaVt~zBhUYpAAiz+ z;V+92wxJ`G-HOOIeZF?e^aPI0ORPBs;;FT@!Db zvh~_}`*|rJ(AcYa^LI}t_63}8b=d7)(^uGfsGtu*J5Tt>0b;v=@!^a2&iTsiH`{u3 z(Mmh|2cP(s+I&$-S@9BuL0YRI$Vioeqr_-opT4x4d}Jb8KY#Hn#J+$f$6tDKQQhM*lztMZ+)At@-f5YJtEaoblbm{#!6MNXh&b#{LW1a!_GY`9Z=g6m@{LXRp zld$A&#eH0u&t`mshNQZ~f1JajYPcxwC7}kn;x0eYi?h%qxG}5PH1^>o1hz) z95eZ?yT5k+ohM%0cgwZe7lq-M)282dOZ%Lbn|5T8zzV1Js>-u8b)Qp`) zYO-vh;Dq?Ej)S(ZI)rViPT;xf44!kJNwf9`kaj-C(|_KZOgjIv=%W40db-cpXIf)v zvl9NoWjuW*&;G_;uc?k;TeMVMTVX>ekEbo=LiI3d|8#s+pRj`JG@h$&Wcyr`<6Yal zcdVrCs!XaY$xnS1uAk1PH)X*(>djl*dz%C-48_tL|eXJ)4}s4`#qbnIEl zU;o}s_EhWpxZl3oU0kn4xi){>-@o#;=pM==S^4}mul6IVADwCa2!Z|d`~>a4*5jJy zyr&OO+gmuVdTxPn{gLq_5AR2U{9kI8)A(O)*GI>ak85D>P1&&8f$r0B)p|UtO;ZwL z-+khVxte8+^{O0w9isY-S9I<3++Pc-d&#Z(!LO?}f%my&*P6nYZWh zHk(=Y>%ae#Tjvo&TR0v#aZV-5FE+u8@EeY$3+`L{pmBX&BmO=tp>BLd&k$36njHLi z{(tA%S6Td?`tzjEO?rK-eg6MpU90>&>bhdz{e8~99cVm~`<#55{BcX_N3Fx7Ur)#P zK<(;tfY0OBsRu(1~rOYD;Kg8v{bbkFg9j!N? z(~hib#`it_=N_2}Sq%bS&7*CAz(a$J6BpKO$+DfJDw*8Q}4Tk|~T zQ&umZ&s;n0qvvLRH2GYwj+I&G%fn;qS=T+T*P@)1i)GEiq;e(sGqZj?m-(V|dge1r x?bzRO$))=&l8N$-U#?h-C?v-#c^&0($))>6`i=eI1|T^OR!g!rVVlf7K=qdOSGe{ECrIBG&7k0zK1-d zB+Ig!Chf%8?SoTGM-+MP=R3#0{`2VgqeDk@@7MFA56&;kUz}RZ50`mb-@C~uE*ATY zPqXX@_i=e)uBV-awW@DWa%F= zxs+v<7WtvWH1%@wYmmZ)C%XN$g5dVE>1)#^ZL;FbCzau^7hane;JbQWAKW9 z{o7nWm5bt5CgWmpQ{?chy|=i+wai9)D=w~1i=zG@77{n#d80lcrPTL{=W|zYU~x66 za3Q-v+Av0QMezmr6*4~x_+DpSedIv~!3H%CamBT5nD-*hB(G(ei)?k9C2(?NT`%(eP@iY} zy38j*z(dNpT6b~vQQXV&(7}^@0$Ck8pXA+TTBXx813i7Stm`7zq~~IOR+ni$KXfi~ zP~^Ex^z})s6mM0V7FVCd?Xj$`&H6-Bp4Fg{@w+6gi_)ku-k4NJah=}6%ZFs{a^DLA zpS>)ZGlr66EC?e)ywKk!NrsZ79;GgG=@we6Ar#2Gkc33j4oXr<=2=A-M3e?T=;q53 z9SV+<&v}$8UfDWk| z7ZCQ-T$ax&8jnOC3po$J?Uq!Iyjv+C;~@t#@Q4;n<7ftq;H+4dv3yoehhab%b@>ZR zwrv1#!Bf&GbhjG;CSG6!Zsd{RA*nfs42^ja6fc{N%O+{C1vlaz#~{?myPIx5e}>IM zI8P7-l)NmHY6R_Zmj+%GtwxqElT{}CobHP|uliANuPMm4RQNyAdo8XyHFI09*;?G@ z7A6W5vB*vfRj}#m?km6q`_8@o{6l}bo9XwLi z$oOGG>^jrVq8;bRMjmlp9%#z;%Yf0XO4EwTT?vb8;s)fkQ;)6PZoMGxZcQ7|4Yy{8 zWD4>%ZuoJ!z+C6m8dS2Uz>rg!gL?-Duan}Rj`wa2myjtMWDAe|E*H~GCN}nrMOB|& zi=?;%s2urlDq{%J16kbX?(*Y!zROyxx-<`63F3bPCdfqwnou>kNI zdI1$;&`qplh+pqJ^JNOViv*;jR6u1r19&;$Ot2YAC<()uMZQe-o%;R;UT6@nP0L8i znHv*;_5h_8A*UkZ(})Y7xO_UDg)7S}t`PQpBkK5ilFtgYMaP+?CGcoDRg%RM0>qAA z$Hh{GYCLu4VWnH0Jixd;&5WZwzAm~+g7t|FD=&*|37v>rS(ea5SzksQ-Xzz&Ux*tk zNx-xK_`j7GmyLKP^SmhKC+MUAzuy<-_*#_pTUn!Q?7k<^1t@Eg*B>VK(wS89lL-Rg zsLtwmup3wF^l_S}i{(Nucm{2qLx=0@N6WgnxI7kL-=-BT8N&@S!t}PerIVaPCyewH z_88Fk08Afr19sm?)9~gD_6KObM(A}LNI%)V+H4#t8@o3BDi=(34FJ`q`aaFzox5nL zsBR4_04GuZtbGJQ$UQ1)LZ)#t6E9iH8ksj|dIHH?+CV0;sQTAH;$g$s{Gek-aE zWw8W5(kwXKu7kEGyuCwam8sv~St(&V^uytPafKW25ZZ-T@e6Rzcj87ZUVYBTSsH(_ z{BAfsspX;{SnOi`U4AIVeWeOK_)n7RJ~L|45x6#Bb#f|irE0Qbk@i+*;{J_Xf#=FR*d_E^{m-KX|}kLsTpsd!CC zfMSfm;lb1OvXrlLxvWc(?K>ySDcH+D(3*2q+y&$7$rBS+N@-=))8Al%50 zy}*xn98PBvCN3bR5;jXfInWrs&j@u(@j-5SNDS>H$L@)t4|?>(-O47Teizk)q!nK*UfpbcnywgkE@+3}ctL>E=gP-FjQjk;e} z8|ov-bn=A`m+b^h*XY_t!tP0%HjSbu8Qn9+K9lQh4Pu6-7sSwM{yzjUbN+3?2s6E( z6pYAVFlv+8|5>|$)PQmB!Q9}_%?V**FP*Q9jKVx9sk zao4S8*6x3lvu-`PcK;MhzNTujYNw`GO@j&5OdG2%OLX3=;h2sAlaVe6IRNFlB8&p& zap0gX2cy8}0fA!CCZ}qNrruGLu1~8i)p9CRtNKf=?unW0z~Amh0OiqW;>s>opWJvF zGGd<2Lev)Y0>_ZHrZ<@`u9de^H{OdxzFn54xrY^(x{jGEVp4{*!t+Ib zq+yE16;_7;ZJtBwIahF%c|F2x<|@plYB8^Gts&@a*HD?gH5BH%xobDp+_o3sK9uGv zr516m#9qz+wDBLs=ova+v?= z_TOq_8Y-mkoE?BCpwnf%zh1G^8Ut7XmV?i4Hp7OyRBO#F%jVUg(WkUFmHWW11fcrh zCe+-)$U`=aJYkn5Y3b~9jsS%AfC{u`5LPnv*yLFT7 zd(_F8ExzD;RH>c4+dWn4x>{wW1MceOs1nwn`Unr1bsF?a(Ers<9l%deqwM!hiWO1o z$U^vUm+J3Pu4b@d_mr!hr9`&;Ey@M(G*N?gT6*|j6+87++(t812YFg&)WiC!*7Ga! z0fN?^alN$w`puy{EZUx?s8;J%R1VtWyAeLy++p|BvX6@osHO4sn07sAaPZNwb6CgP z6nBG;nUv=7BSu5s&sfa{l^VLc=Ht{no>5KQc`qr0nw)W{J|bw=p^2Kebt7u~rY1G> zRQliliKnSuu(`YwRhRuqE}p#y^&e$7*9zOvI~^*g-(=8$stl?MQ!0j1&)DG4cJ)#9 Y^vw`w+MloN8fVlGIq^qCKc6%I1@qVfk2PDU8m5h(hM~+u!-l+2`cZ zTbDEAAKhi=oc%lB`R(WT?eBc&T#Q-vK4Y%B|#hsZ_zR=!w zZr_FGt>NL}#L>8Ppc;RMhu?GRq#185{lae_Ynyc8x#i2&odNV&Crr5pP$I}YGv*!0l;{14GOt&e$H8+t%5Otvt#VJbc^-@xp-i5T ztJ=&0|9oH*kdHtX`6}}i@Fggdzm|BJ*QyiegNK=TU4YkE{!?%dxydCwHKrZsn|%3+ zf&39>2<_aAGTV71ahq!+?L5lC-FEUGkw3yLL!AYb*&YtHw6iwS&SQwDcu!rVos)>$ zTxV9Jjcg~&lLK7%x1vmbO!cVz#}ZGC+jj9|6zZD3fPOfLBF$ zPIGXVCmG-ga}jtRMwvWQ13b#Z^)BOF6I0z6?_(5FZJay^eJV_FMdS9;@$d}pRB z(~&M^@;TFcb*#9ykj@pm@`c{kbivD&Ah0Bp^_myqq%~dYu_x{=MX=`kyh3TnMNKJP z==Msc&%ef7%|JTa@0t9@O0F3L5(l^hK$g)7#d^vwsiZh!BC`+qU(KVH5d&578COhx|!2INo;&QmZ% zoCs@haHPSZVc`O$;#XTta84*En8qM9II=Ll>+`T3I&m(KH8}Q~OsMi$gJbc8HBe{a zoC}_HG>Uvg@o8`b7XzpUiUvn<8bw|3G&q9Sn0hR{g($PX%z}#|Xn$#N6nFbegCn>Y z@D`Lg1~fQKH0(57_hKB_ei|H8w&NCQzcn~1;?ee7gM(X$yM`+?IKsacGUTVh8I9i> zoYYAE(BMS*LxYnr-@^E804>Lc28SuW9zuf?oyXAN$oO>QUXD*_a0LG^f8(RUF(w6m zQRD%X63A+BT3btncgxPZc(CNf( z?zgps`HtwD#mC>^|C;oThIqi&TSwm_`XB0BbiPA;f}qk&}q-D@Z$cgS7^+2XT9RG3>*tP*TciRdZ%BW zDZjD)$S>c$^|{xFi|3=sldEKSacUwaq)dEl6GC+v%Y<;~IOOpydnPcdH?PT*j=yCq zPkhT(9(T(g&x9yX+=M8PYeHHKQ~{=l?F*j~5@rWfWRBnNx8cad@gd%1&wUeu8x`jk zNggpFA>QfZ?v_m+-FmDENr^mF^Jd6XHN}JwkE*7a5aLnQ6cZx&Vn;Q_gb)|i)bX)f zwryLD^>uZ8sJc2|pTYUv$ecqiE5WPGO=#ygQO0tzTegeu_3?1a78QRAILDGEMCIwK zX?wygTTH&ThbBbZLzD9>pNA%diK^`KxF&=qM|naMBF_S^;$F5ViOdw|nQAe?T^=zZ z#1qzpOh)54KI{jUlEquluhW6!KT{vWXZyIAkWhZLk8`U}qy%Tbt_Dv2=?)L^>wKJB zpw_z+_{V+x>=?ew$7eYBSAhKhnd5K{va$6>$CKkH{Ly(iH^9a8zTorEa_}U^|98N- zPR_G9xe|tW0wD3(#8bx59cuG(Fl;bwmD|;(bg{IiC*7If!l#=yufu~I6#^^rw5#oS zFv=Gw(30uy!P8HEqqnY@?v{t7t}HG?Dgv)am%KtIoh_O*wAmdC)1{7{=3G}EByprG zQ$Qp7H?j++D95IJzkSGaWNEo^x2>iz*U^)wZx}YHJ)iBzgV=yqC}cX>GP?^j=d46; zy3gL~6}`fMx2~OiY3|PD3*JgRQlgnl@`a|JbfL7!D@kuCfaktKDV-}VZ6=+^etMna z-pWw3b*ySdCYR~$@3jnTGS?Dn>@VflwXaAIF3J?aVIL?1%x*U_OWHgDEb*6Fp+yDku3m)&hD)&&gVkMH=|zHOhr;GEO)BQp=@Ky6W_*^r_yaqdE(oc@*IhFHQKf& z%!N2EK&BdtCoJu!nNS{HOV}Lk7q@oeT)TM6!TeRMd{#+$A1B*c9wf?^C-O8vSA-@y?s8NbJ-86Q08g0faDEFi zd8Q&W#d$(kB+4_*%2GaIcH{hO$mFRAY@))lex3G;6_K8Z{ox*|+*9-W7H zzr+=h_B@08UP30%3}mJ_4_%Sb#%E@LC(Ii-p8z59&=p~d^N1@VxI50SD?+_{J9t2H;^ta zE#&+ADCZP?f#zO#Z@gsVX|`kaL4;lLrhKlH&g67UtC#A+igEjzE$Kc|6j$Y%vYC#} zfP!8&m%Ls?;TaOFUs_1_^<+ADFHVPwd_c!ZXGTK#jc}jP;m$U1z)NQ#w8+b*hZcH> z_j^8O_r`?T|Bl_6N4{p}%$vA=-|oL#J^$hVe9v9aZ0?$N`319gJZ+wPZ3X738h$b7 z`S9MzageotcyEl_m`e6W+GE-T+8##wnBq1vd`yq-A>m_sg0Eg}*n@j1_eNuqmWMXx za+GLe;(H_4G4XJ3jPAYM8)eTFT=!nt8_6&8&b^nqkVID7)`8O@WZLGb#LJYaG9Sn3 zE@a}|8wIa6U&ZNne4Klu;589jULWA{W=7xeaBpNv;9VDaXv@jZy-|2-%|4uRU*kB3 zd!xJ}RvRDgjdhVdKinH@?VFqz!9jkzHhs&Zv21xF{o>x3ND-eH=~uWnPK@+xuEWpgoQ2?LzwF*T!`2e(~58i z!Y8=il+I?YKLh$G3Kt_H#rh$vo`<}dX9NA}`K(>)$#hpZc=3L1UUy{wI-LkyObOaXW^I50J#%o+DAeG?` zeMH|aWHd}dT8+g%M5oX?1R=6b=nA|xDM)YqLSwHVSF>W-e8=W3nIe14@~T3nJClQ7 zid1dR9sK;`_ci=-#{N^Dd8&NV9sPs%Ztv=T|K3wS{MI9{?0NpAt=!3U)gSh>LXAD_ zY5jSg7I!3C*gx0PIyB1_KFhR0fl5-8rC(#-I`L2cc<+B7*mM8H@14;7sf+K=fA!eG z4_!C!#$T5)4;hJ68SCNDmp+{rI=6IQ?9wlDT}1;W z_8}uhJjx$FWJEs?qG{&Zq*Fk(qEkWD;zI^g+zqfF<;K4jonsp?`6$6i^=^sV&oHH83xiIJj>)i?b zJ1CJyq6#6-=sj^p6(s5+^56Gy8&z<49`*5=fxOhqNC)echivyhuS69> zd99aGh0*F|RKdlyUK>?#+N1SKRDt{w4SN&!bG{f=U{ZWiLU0>Zuz12u0X74<9_0lT zMxy*YU`vp>J{v4bT=ZS_E@fo}ch`AifD6x+J`bY`OmUtji;d)26yU&*25~Mf} zqY4nQxZ9qk0gg9g5V#qc4hMC^lqoM!l$}1_9N^I?3Zn{%6y>8)6h;-K-e?r1CBTLM zOFloNn^JF-eiq+8sNhJJ)a+urBV6YD4!b1uTfI=%Z*B{rM%6;|5KlT z9k9{b58E;-KOLvh+J8lWivxWCLX@Mu*C@^F01!2@>+nkANSrU|bnw0Z`z$87JMUKo zc*2|rjv2_D_w^(xi#$FCG|PPa{Q+KWt^}6x@v8$o8ui@};L)gWnm7`pzU0}2+F0*K zf@R{h<{IEzk*QxD#F6xeL8@P!78Bg%L)F7iDHnIJ;qR!9x^=>9wmUgmV_an1kS>i}qulB3gVuHK<$_2PYefRkM zd6JZ^d?f1INBI=-Xw>%_;xo;(SoyFWflJ z-2X>w&j2}6rLVhLGvjA1p-*HmvAJ?d*qR>5WtZNRi*5c}Wc#QiA3ECz>q5rwAZH56ZKs2d}c7sv{9g)E$(yavzXa!T6kT zEuxX#i0q=dqhZolUkEZzRUydeDC!CUtt>Amast{ke$ymr;IU!*Jk0MdE8gF!u z!S%65w;tC<8(luS9Lne_PkeNhr_#|?p7`i0kB%<;%bzyQMLYSZ#nop_5~w^H&_!my zxIMc#U18!!6L#d6qePrz<>D2#v|A_%EA8pZ<;rd}{q7fP67I8UF4)AE`gP{qLueLu)+GN7t zE(RFT zlJUF=W%8eH@g3~1b%Augrp0g_Pu35oJ&@P&q!kc6VV*<3cA-20`AlSEl7YPPPmkfs ze^!7C&wVJ9=j;HFwsS@dSDteMTzI~LGI?eOc$A0p;I>nFW(BzLJccrP&I|A;&+Hhk zJm&|v@H~SudBV^{l!u{-(b~h%1abUip%lb`D>kP756Avbeo#jLg}+w7j|8kQW6#rr z!MWGz{CB+Mr8F+LW(M$!hZoq-;o-MxZ@X#mmJe*-_iW*MQ?q0}?Tfnkl;Ex^ zV~#?ZYjEscmFs;hyH7o!p2T-mt|QJ9uO)0Ae^*tW+CW}*L*=Q|?ki8+?kmrc;BWNX zvjh4zT1a{)Muh8yZD-$^I6f`F86skT#O{aqgTJ_rdvwLFB?*O=|= z;S@)_PkhixkG|-CE)o7lMgC_3)}<`U%aSwf$u6W?W&f zUi{}dzPw)ec-h%G~}`A|o>drrRZSz>#EZTGRyzI4jBJ04nXHelK90LE4Pzz=7i(LNuK ztXOio3YK@j`ql2LTNCqu?STv^%tzXud6U@d!1&n~SMI4#|7vm%unAaxttfNV&VK!8 ztB73ztb{VPqU+}Kw-b8;nBM#Tv%hr@vHe)0yTOM`=Jro?J^a*Hj;p=_%kV6exq4TA zYyO!(0rr4{-T1E?ZhP|aQ>vc^wi_}>A#a-g$%#J#R>o5Ow2$T19#~H7BrH?KF5U9$ zwZt9(_JA)p>$1no#5Q2rD&GyK=f1f5s?(|`OqOv$RpzW|4{zP|rY?|Yzs=8YJnx1ZUw&!TL%)6Kk?FtLw~G^F%+>kt zpYbm5$E$9<8 z;{lPi<6vtz$RE`wjvJF6r6hkyzg?PdwMP$2p;AxYFCwo+)NFX0n;m zkpB?_*W)^Txs9jiPMnTNY|D7<@w*zVHxlT&<+oU%H2us-v?(UQ)COgujA^mT=@s{iaOb>Dt0vaY$}`o`;TaLu=YtdF}; z^d+{~mp`X(@qVdIVLhtn>=#tsAIoC!#s6PoKDB>p&sne2KmVnCW&Kkwa%j^2ss5-f zFJXbr+bG6g#H|@KxGJnzeRQt<1*k9^LFt8|BGPdLO7ZgVKW}b(s+`#i&zWwSy z3&yf$K~%Tm{P8lSb$ofQdpu9WEcG4v(`mN8qfi&K)Cnmhtxt7J(DCg6Wz?6!X*ta0 zhTP}2>AO3^LI1SUarD~N z0oTqemmVu^m&$Qmxz3VDB`pQlw4Pg_qCe6v_QBUBjO&*dj&`fo>s}je+-NKJ-`*IA z9qc}xZvGu37w7OPt~YC4^Q;x=;${Y?{UG!?@sFhK=hHKj z(Yt0Q+xby+J~#jTS+n_XW)k<6`U~FtoY!9}q_Z=Vt^FGjxW3#QTASbO<>u$`@wN3) zlhup08+J@skabaR;5qvi2;f|kJ05ZWhifZ7pS;fzV>Q=!yjHBYYajBEjcVR3aVgG`gZr-NFQudGn6`!In%sGc z+as0X(Ups@@3G|cx!=9+kGBKqx)(da3+`U$`qj=&JjHxRvVVCm_8{iqTE+dwJ>@X7 zU2bAov*7NY;7VR~%fbcBXJ56df!V$0pWC({Y(8|HaZfqSmA5O-pPKXheC8`I>1<&3 z+u|N7YF7}G8K+%s&39a)nf8xKV-Y-e{chL);x#AP_Mogs|59|0Z2ZQj{2Q;td-Zj*KKEXzk)vaHyrFf)iaTk`~C+! C2T(=; From 507f70dc4309e8c5cad8528935144e74ebe06c8c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 8 Sep 2017 11:34:30 -0700 Subject: [PATCH 829/870] Default to Vector3.down if Physics.gravity is Vector3.zero; Fix issue where blink target will be valid when visuals are transitioning out or otherwise invalid --- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index 86ca987f6..3132fb53c 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -117,6 +117,11 @@ void OnEnable() m_LineRenderer.SetPositions(m_Positions); } + void OnDisable() + { + targetPosition = null; + } + IEnumerator VisibilityTransition(bool visible) { var startValue = m_TransitionAmount; @@ -143,6 +148,9 @@ void Update() var blinkDistance = m_BlinkDistance + extraSpeed * extraSpeed * (m_MaxBlinkDistance - m_BlinkDistance); blinkDistance *= viewerScale; var gravity = Physics.gravity; + if (gravity == Vector3.zero) + gravity = Vector3.down; // Assume (0,-1,0) if gravity is zero + var timeStep = m_TimeStep * viewerScale / Mathf.Sqrt(blinkDistance * gravity.magnitude); blinkDistance *= m_TransitionAmount; var speed = Mathf.Sqrt(blinkDistance * gravity.magnitude); @@ -212,7 +220,7 @@ void Update() m_ArcLocator.SetActive(false); } - if (Vector3.Dot(transform.forward, Physics.gravity.normalized) < m_InvalidThreshold) + if (!m_Visible || Vector3.Dot(transform.forward, gravity.normalized) < m_InvalidThreshold) targetPosition = null; var lineWidth = m_LineWidth * viewerScale; From 018e954a71149a83fce80aa93a3199ea6bf1f205 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 11 Sep 2017 14:00:10 -0700 Subject: [PATCH 830/870] Add #if UNITY_EDITOR to IRaycast and BlinkVisuals; Fix failed NoEditorVR test in LocomotionTool --- Scripts/Interfaces/FunctionalityInjection/IRaycast.cs | 4 +++- Tools/LocomotionTool/LocomotionTool.cs | 3 ++- Tools/LocomotionTool/Scripts/BlinkVisuals.cs | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs index 21e294a49..5019d6d16 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IRaycast.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +#if UNITY_EDITOR +using System.Collections.Generic; using UnityEngine; namespace UnityEditor.Experimental.EditorVR @@ -31,3 +32,4 @@ public static bool Raycast(this IRaycast obj, Ray ray, out RaycastHit hit, out G } } } +#endif diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 69f9ea644..92a4d07ec 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -3,7 +3,6 @@ using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR.Core; -using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -552,7 +551,9 @@ IEnumerator MoveTowardTarget(Vector3 targetPosition) var offset = cameraRig.position - CameraUtils.GetMainCamera().transform.position; offset.y = 0; +#if UNITY_EDITORVR offset += VRView.HeadHeight * Vector3.up * this.GetViewerScale(); +#endif targetPosition += offset; const float kTargetDuration = 0.05f; var currentPosition = cameraRig.position; diff --git a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs index 3132fb53c..d29481747 100644 --- a/Tools/LocomotionTool/Scripts/BlinkVisuals.cs +++ b/Tools/LocomotionTool/Scripts/BlinkVisuals.cs @@ -1,4 +1,5 @@ -using System.Collections; +#if UNITY_EDITOR +using System.Collections; using System.Collections.Generic; using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Extensions; @@ -244,3 +245,4 @@ void OnDestroy() } } } +#endif From 94efb84a1a6905273faacd50b2d3d86d860bf8a9 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Mon, 11 Sep 2017 14:45:24 -0700 Subject: [PATCH 831/870] Cleanup annotation line and brush-cone shaders --- .../Materials/AnnotationBrushCone.shader | 62 +++++++++++++++ ...r.meta => AnnotationBrushCone.shader.meta} | 0 .../Materials/AnnotationLine.shader | 68 ++++++++++++++++ ...shader.meta => AnnotationLine.shader.meta} | 0 .../Materials/AnnotationShader.shader | 77 ------------------- .../Materials/BrushConeShader.shader | 72 ----------------- 6 files changed, 130 insertions(+), 149 deletions(-) create mode 100644 Tools/AnnotationTool/Materials/AnnotationBrushCone.shader rename Tools/AnnotationTool/Materials/{BrushConeShader.shader.meta => AnnotationBrushCone.shader.meta} (100%) create mode 100644 Tools/AnnotationTool/Materials/AnnotationLine.shader rename Tools/AnnotationTool/Materials/{AnnotationShader.shader.meta => AnnotationLine.shader.meta} (100%) delete mode 100644 Tools/AnnotationTool/Materials/AnnotationShader.shader delete mode 100644 Tools/AnnotationTool/Materials/BrushConeShader.shader diff --git a/Tools/AnnotationTool/Materials/AnnotationBrushCone.shader b/Tools/AnnotationTool/Materials/AnnotationBrushCone.shader new file mode 100644 index 000000000..63f463759 --- /dev/null +++ b/Tools/AnnotationTool/Materials/AnnotationBrushCone.shader @@ -0,0 +1,62 @@ +Shader "EditorVR/Annotation/Brush" + { + Properties + { + _EmissionColor ("Color", Color) = (0.5, 0.5, 0.5, 1) + } + + SubShader + { + Tags + { + "IgnoreProjector"="True" + "Queue"="Transparent" + "RenderType"="Transparent" + "LightMode" = "Always" + } + + Pass + { + Blend SrcAlpha OneMinusSrcAlpha + Cull Front + + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + float4 _EmissionColor; + + struct VertexInput + { + float4 vertex : POSITION; + half2 texcoord0 : TEXCOORD0; + }; + + struct VertexOutput + { + float4 pos : SV_POSITION; + half2 uv0 : TEXCOORD0; + }; + + VertexOutput vert (VertexInput i) + { + VertexOutput o = (VertexOutput)0; + o.uv0 = i.texcoord0; + o.pos = UnityObjectToClipPos(i.vertex); + return o; + } + + float4 frag(VertexOutput i) : COLOR + { + fixed4 finalRGBA = fixed4(_EmissionColor.rgb, _EmissionColor.a); + return finalRGBA; + } + + ENDCG + } + } + + FallBack "Diffuse" +} diff --git a/Tools/AnnotationTool/Materials/BrushConeShader.shader.meta b/Tools/AnnotationTool/Materials/AnnotationBrushCone.shader.meta similarity index 100% rename from Tools/AnnotationTool/Materials/BrushConeShader.shader.meta rename to Tools/AnnotationTool/Materials/AnnotationBrushCone.shader.meta diff --git a/Tools/AnnotationTool/Materials/AnnotationLine.shader b/Tools/AnnotationTool/Materials/AnnotationLine.shader new file mode 100644 index 000000000..0e73586f4 --- /dev/null +++ b/Tools/AnnotationTool/Materials/AnnotationLine.shader @@ -0,0 +1,68 @@ +Shader "EditorVR/Annotation/Line" + { + Properties + { + _Texture ("Texture", 2D) = "white" {} + _EmissionColor ("Color", Color) = (0.5, 0.5, 0.5, 1) + } + + SubShader + { + Tags + { + "IgnoreProjector"="True" + "Queue"="Transparent" + "RenderType"="Transparent" + "LightMode" = "Always" + } + + Pass + { + Blend SrcAlpha OneMinusSrcAlpha + AlphaToMask On + Cull Off + + CGPROGRAM + + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + float4 _EmissionColor; + sampler2D _Texture; + float4 _Texture_ST; + + struct VertexInput + { + float4 vertex : POSITION; + float2 texcoord0 : TEXCOORD0; + }; + + struct VertexOutput + { + float4 pos : SV_POSITION; + half2 uv0 : TEXCOORD0; + }; + + VertexOutput vert (VertexInput i) + { + VertexOutput o = (VertexOutput)0; + o.uv0 = i.texcoord0; + o.pos = UnityObjectToClipPos(i.vertex); + return o; + } + + float4 frag(VertexOutput i) : COLOR + { + half4 color = tex2D(_Texture, TRANSFORM_TEX(i.uv0, _Texture)); + color.rgb = _EmissionColor.rgb * color.rgb; + color.a *= _EmissionColor.a; + return color; + } + + ENDCG + } + } + + FallBack "Diffuse" +} diff --git a/Tools/AnnotationTool/Materials/AnnotationShader.shader.meta b/Tools/AnnotationTool/Materials/AnnotationLine.shader.meta similarity index 100% rename from Tools/AnnotationTool/Materials/AnnotationShader.shader.meta rename to Tools/AnnotationTool/Materials/AnnotationLine.shader.meta diff --git a/Tools/AnnotationTool/Materials/AnnotationShader.shader b/Tools/AnnotationTool/Materials/AnnotationShader.shader deleted file mode 100644 index a37dac156..000000000 --- a/Tools/AnnotationTool/Materials/AnnotationShader.shader +++ /dev/null @@ -1,77 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -Shader "EditorVR/Annotation/Line" - { - - Properties - { - _Texture ("Texture", 2D) = "white" {} - _EmissionColor ("Emission Color", Color) = (0.5,0.5,0.5,1) - } - - SubShader - { - - Tags - { - "IgnoreProjector"="True" - "Queue"="AlphaTest" - "RenderType"="Transparent" - } - - Pass - { - Name "FORWARD" - - Tags - { - "LightMode"="ForwardBase" - } - - AlphaToMask On - Cull Off - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #include "UnityCG.cginc" - - uniform float4 _EmissionColor; - uniform sampler2D _Texture; - uniform float4 _Texture_ST; - - struct VertexInput - { - float4 vertex : POSITION; - float2 texcoord0 : TEXCOORD0; - }; - - struct VertexOutput - { - float4 pos : SV_POSITION; - float2 uv0 : TEXCOORD0; - }; - - VertexOutput vert (VertexInput i) - { - VertexOutput o = (VertexOutput)0; - o.uv0 = i.texcoord0; - o.pos = UnityObjectToClipPos(i.vertex); - return o; - } - - float4 frag(VertexOutput i) : COLOR - { - float4 tex = tex2D(_Texture, TRANSFORM_TEX(i.uv0, _Texture)); - float3 finalColor = _EmissionColor.rgb * tex.rgb; - fixed4 finalRGBA = fixed4(finalColor, tex.a); - return finalRGBA; - } - - ENDCG - } - } - - FallBack "Diffuse" -} diff --git a/Tools/AnnotationTool/Materials/BrushConeShader.shader b/Tools/AnnotationTool/Materials/BrushConeShader.shader deleted file mode 100644 index 9dacf2ae6..000000000 --- a/Tools/AnnotationTool/Materials/BrushConeShader.shader +++ /dev/null @@ -1,72 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -Shader "EditorVR/Annotation/Brush" - { - - Properties - { - _EmissionColor ("Emission Color", Color) = (0.5,0.5,0.5,1) - } - - SubShader - { - - Tags - { - "IgnoreProjector"="True" - "Queue"="Transparent" - "RenderType"="Transparent" - } - - Pass - { - Name "FORWARD" - - Tags - { - "LightMode"="ForwardBase" - } - - Blend SrcAlpha OneMinusSrcAlpha - Cull Front - - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - #include "UnityCG.cginc" - - uniform float4 _EmissionColor; - - struct VertexInput - { - float4 vertex : POSITION; - float2 texcoord0 : TEXCOORD0; - }; - - struct VertexOutput - { - float4 pos : SV_POSITION; - float2 uv0 : TEXCOORD0; - }; - - VertexOutput vert (VertexInput i) - { - VertexOutput o = (VertexOutput)0; - o.uv0 = i.texcoord0; - o.pos = UnityObjectToClipPos(i.vertex); - return o; - } - - float4 frag(VertexOutput i) : COLOR - { - fixed4 finalRGBA = fixed4(_EmissionColor.rgb, _EmissionColor.a); - return finalRGBA; - } - - ENDCG - } - } - - FallBack "Diffuse" -} From 47aeed3eb32fe3683ed49196fa527bd63f406329 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 11 Sep 2017 16:38:43 -0700 Subject: [PATCH 832/870] Address PR comments --- Scripts/Core/EditorVR.Menus.cs | 5 ++--- Scripts/Interfaces/IUsesCustomMenuOrigins.cs | 13 ++++++++++++- Scripts/Interfaces/IUsesRayOrigins.cs | 10 ++++++++-- .../IntersectionModule/IntersectionModule.cs | 1 + .../UserInterface/ColorPickerActivator.cs | 15 +++++---------- .../UserInterface/ColorPickerUI.cs | 19 +++++-------------- 6 files changed, 33 insertions(+), 30 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index da1025b97..76d265684 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -90,7 +90,6 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) customMenuOrigins.customMenuOrigin = GetCustomMainMenuOrigin; customMenuOrigins.customAlternateMenuOrigin = GetCustomAlternateMenuOrigin; } - } public void DisconnectInterface(object obj, Transform rayOrigin = null) @@ -120,7 +119,7 @@ static void UpdateAlternateMenuForDevice(DeviceData deviceData) mainMenuActivator.activatorButtonMoveAway = alternateMenu.menuHideFlags == 0; } - Transform GetCustomMainMenuOrigin(Transform rayOrigin) + static Transform GetCustomMainMenuOrigin(Transform rayOrigin) { Transform mainMenuOrigin = null; @@ -135,7 +134,7 @@ Transform GetCustomMainMenuOrigin(Transform rayOrigin) return mainMenuOrigin; } - Transform GetCustomAlternateMenuOrigin(Transform rayOrigin) + static Transform GetCustomAlternateMenuOrigin(Transform rayOrigin) { Transform alternateMenuOrigin = null; diff --git a/Scripts/Interfaces/IUsesCustomMenuOrigins.cs b/Scripts/Interfaces/IUsesCustomMenuOrigins.cs index b59bf6904..ebe997aab 100644 --- a/Scripts/Interfaces/IUsesCustomMenuOrigins.cs +++ b/Scripts/Interfaces/IUsesCustomMenuOrigins.cs @@ -1,9 +1,20 @@ +#if UNITY_EDITOR using UnityEngine; using System; +/// +/// Provides access to transform roots for custom menus +/// public interface IUsesCustomMenuOrigins { + /// + /// Get the root transform for custom menus for a given ray origin + /// Func customMenuOrigin { set; } - + + /// + /// Get the root transform for custom alternate menus for a given ray origin + /// Func customAlternateMenuOrigin { set; } } +#endif diff --git a/Scripts/Interfaces/IUsesRayOrigins.cs b/Scripts/Interfaces/IUsesRayOrigins.cs index 3528fed67..000132301 100644 --- a/Scripts/Interfaces/IUsesRayOrigins.cs +++ b/Scripts/Interfaces/IUsesRayOrigins.cs @@ -1,9 +1,15 @@ +#if UNITY_EDITOR using UnityEngine; using System.Collections.Generic; +/// +/// Provides access to all ray origins in the system +/// interface IUsesRayOrigins { - + /// + /// A list of all ray origins provided by the system + /// List otherRayOrigins { set; } - } +#endif diff --git a/Scripts/Modules/IntersectionModule/IntersectionModule.cs b/Scripts/Modules/IntersectionModule/IntersectionModule.cs index 5a9b99243..742433fb3 100644 --- a/Scripts/Modules/IntersectionModule/IntersectionModule.cs +++ b/Scripts/Modules/IntersectionModule/IntersectionModule.cs @@ -181,6 +181,7 @@ internal Renderer GetIntersectedObjectForTester(IntersectionTester tester) Renderer obj = null; if (tester) m_IntersectedObjects.TryGetValue(tester, out obj); + return obj; } diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index 6b40534f7..0dbb6a7eb 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections; +using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -63,31 +64,25 @@ public void OnPointerClick(PointerEventData eventData) public void OnPointerEnter(PointerEventData eventData) { - if (m_HighlightCoroutine != null) - StopCoroutine(m_HighlightCoroutine); - showColorPicker(rayOrigin); - m_HighlightCoroutine = StartCoroutine(Highlight()); + this.RestartCoroutine(ref m_HighlightCoroutine, Highlight(true)); m_Undo.SetActive(false); m_Redo.SetActive(false); - + eventData.Use(); } public void OnPointerExit(PointerEventData eventData) { - if (m_HighlightCoroutine != null) - StopCoroutine(m_HighlightCoroutine); - hideColorPicker(); - m_HighlightCoroutine = StartCoroutine(Highlight(false)); + this.RestartCoroutine(ref m_HighlightCoroutine, Highlight(false)); m_Undo.SetActive(true); m_Redo.SetActive(true); } - IEnumerator Highlight(bool transitionIn = true) + IEnumerator Highlight(bool transitionIn) { var amount = 0f; var currentScale = m_Icon.localScale; diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index ebab6aa4e..5a9fced5c 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -3,6 +3,7 @@ using System.Collections; using UnityEngine.UI; using System; +using UnityEditor.Experimental.EditorVR.Extensions; using UnityEngine.EventSystems; public class ColorPickerUI : MonoBehaviour, IPointerExitHandler @@ -55,18 +56,12 @@ void Update() public void Show() { - if (m_FadeCoroutine != null) - StopCoroutine(m_FadeCoroutine); - - m_FadeCoroutine = StartCoroutine(FadeCanvas(false)); + this.RestartCoroutine(ref m_FadeCoroutine, FadeCanvas(false)); } public void Hide() { - if (m_FadeCoroutine != null) - StopCoroutine(m_FadeCoroutine); - - m_FadeCoroutine = StartCoroutine(FadeCanvas(true)); + this.RestartCoroutine(ref m_FadeCoroutine, FadeCanvas(true)); } public void OnSliderChanged(float val) @@ -86,10 +81,7 @@ IEnumerator FadeCanvas(bool fadeOut) var target = 1 - start; if (current == target) - { - m_FadeCoroutine = null; yield break; - } var ratio = fadeOut ? 1 - current : current; while (ratio < 1) @@ -104,7 +96,6 @@ IEnumerator FadeCanvas(bool fadeOut) canvasGroup.alpha = target; canvasGroup.interactable = !fadeOut; canvasGroup.blocksRaycasts = !fadeOut; - m_FadeCoroutine = null; } void OnDrag() @@ -116,7 +107,7 @@ void OnDrag() var localRayPos = worldToLocal.MultiplyPoint3x4(toolRayOrigin.position); var localRayForward = worldToLocal.MultiplyVector(toolRayOrigin.forward).normalized; - + var height = localRayPos.z; var angle = Vector3.Angle(new Vector3(0, 0, height), localRayForward); var sine = Mathf.Sin((90 - angle) * Mathf.Deg2Rad); @@ -124,7 +115,7 @@ void OnDrag() var distance = Mathf.Abs(height / sine); var point = localRayPos + localRayForward * distance; point = point.normalized * Mathf.Min(point.magnitude, rect.width / 2f); - + m_PickerTargetPosition = point; GenerateBrightnessBar(); PositionToColor(); From c84de16bc350766811321220c411955304bd1442 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 13 Sep 2017 13:55:36 -0700 Subject: [PATCH 833/870] Switch IUsesCustomMenuOrigins to use extension methods --- Scripts/Core/EditorVR.Menus.cs | 11 ++--- Scripts/Interfaces/IUsesCustomMenuOrigins.cs | 42 +++++++++++++++----- Tools/AnnotationTool/AnnotationTool.cs | 5 +-- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 76d265684..0ad984cc3 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -49,6 +49,8 @@ public Menus() { IInstantiateMenuUIMethods.instantiateMenuUI = InstantiateMenuUI; IIsMainMenuVisibleMethods.isMainMenuVisible = IsMainMenuVisible; + IUsesCustomMenuOriginsMethods.getCustomMenuOrigin = GetCustomMenuOrigin; + IUsesCustomMenuOriginsMethods.getCustomAlternateMenuOrigin = GetCustomAlternateMenuOrigin; } public void ConnectInterface(object obj, Transform rayOrigin = null) @@ -83,13 +85,6 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) menuOrigins.alternateMenuOrigin = alternateMenuOrigin; } } - - var customMenuOrigins = obj as IUsesCustomMenuOrigins; - if (customMenuOrigins != null) - { - customMenuOrigins.customMenuOrigin = GetCustomMainMenuOrigin; - customMenuOrigins.customAlternateMenuOrigin = GetCustomAlternateMenuOrigin; - } } public void DisconnectInterface(object obj, Transform rayOrigin = null) @@ -119,7 +114,7 @@ static void UpdateAlternateMenuForDevice(DeviceData deviceData) mainMenuActivator.activatorButtonMoveAway = alternateMenu.menuHideFlags == 0; } - static Transform GetCustomMainMenuOrigin(Transform rayOrigin) + static Transform GetCustomMenuOrigin(Transform rayOrigin) { Transform mainMenuOrigin = null; diff --git a/Scripts/Interfaces/IUsesCustomMenuOrigins.cs b/Scripts/Interfaces/IUsesCustomMenuOrigins.cs index ebe997aab..ebe6164be 100644 --- a/Scripts/Interfaces/IUsesCustomMenuOrigins.cs +++ b/Scripts/Interfaces/IUsesCustomMenuOrigins.cs @@ -1,20 +1,40 @@ #if UNITY_EDITOR -using UnityEngine; using System; +using UnityEngine; -/// -/// Provides access to transform roots for custom menus -/// -public interface IUsesCustomMenuOrigins +namespace UnityEditor.Experimental.EditorVR { /// - /// Get the root transform for custom menus for a given ray origin + /// Provides access to transform roots for custom menus /// - Func customMenuOrigin { set; } + public interface IUsesCustomMenuOrigins + { + } - /// - /// Get the root transform for custom alternate menus for a given ray origin - /// - Func customAlternateMenuOrigin { set; } + public static class IUsesCustomMenuOriginsMethods + { + internal static Func getCustomMenuOrigin { get; set; } + internal static Func getCustomAlternateMenuOrigin { get; set; } + + /// + /// Get the root transform for custom menus for a given ray origin + /// + /// The ray origin for which we want custom the menu origin + /// + public static Transform GetCustomMenuOrigin(this IUsesCustomMenuOrigins obj, Transform rayOrigin) + { + return getCustomMenuOrigin(rayOrigin); + } + + /// + /// Get the root transform for custom alternate menus for a given ray origin + /// + /// The ray origin for which we want the alternate menu origin + /// + public static Transform GetCustomAlternateMenuOrigin(this IUsesCustomMenuOrigins obj, Transform rayOrigin) + { + return getCustomAlternateMenuOrigin(rayOrigin); + } + } } #endif diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index c92a99a11..d6b050a09 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -72,9 +72,6 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr public Transform menuOrigin { private get; set; } public Transform alternateMenuOrigin { private get; set; } - public Func customMenuOrigin { private get; set; } - public Func customAlternateMenuOrigin { private get; set; } - public ActionMap actionMap { get { return m_ActionMap; } @@ -111,7 +108,7 @@ void Start() if (m_ColorPickerActivator == null) { m_ColorPickerActivator = this.InstantiateUI(m_ColorPickerActivatorPrefab); - var otherAltMenu = customAlternateMenuOrigin(otherRayOrigins[0]); + var otherAltMenu = this.GetCustomAlternateMenuOrigin(otherRayOrigins[0]); m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); m_ColorPickerActivator.transform.localRotation = Quaternion.identity; From fade8c9f00bcb720f5aeea8b4f77934845c7cd16 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 13 Sep 2017 14:36:37 -0700 Subject: [PATCH 834/870] Remove MultiDeviceTools from opposite hand when despawning --- Scripts/Core/EditorVR.Tools.cs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 402b1a448..f22396b22 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -268,7 +268,8 @@ static bool SelectTool(Transform rayOrigin, Type toolType) static void DespawnTool(DeviceData deviceData, ITool tool) { - if (!IsDefaultTool(tool.GetType())) + var toolType = tool.GetType(); + if (!IsDefaultTool(toolType)) { // Remove the tool if it is the current tool on this device tool stack if (deviceData.currentTool == tool) @@ -284,12 +285,13 @@ static void DespawnTool(DeviceData deviceData, ITool tool) topTool = deviceData.toolData.Peek(); deviceData.currentTool = topTool.tool; - // Pop this tool of any other stack that references it (for single instance tools) foreach (var otherDeviceData in evr.m_DeviceData) { if (otherDeviceData != deviceData) { - if (otherDeviceData.currentTool == tool) + // Pop this tool of any other stack that references it (for single instance tools) + var otherTool = otherDeviceData.currentTool; + if (otherTool == tool) { otherDeviceData.toolData.Pop(); var otherToolData = otherDeviceData.toolData.Peek(); @@ -300,6 +302,22 @@ static void DespawnTool(DeviceData deviceData, ITool tool) SetToolsEnabled(otherDeviceData, true); } + // Pop this tool of any other stack that references it (for MultiDeviceTools) + if (tool is IMultiDeviceTool) + { + if (otherTool.GetType() == toolType) + { + otherDeviceData.toolData.Pop(); + var otherToolData = otherDeviceData.toolData.Peek(); + if (otherToolData != null) + { + otherDeviceData.currentTool = otherToolData.tool; + evr.m_Interfaces.DisconnectInterfaces(otherTool, deviceData.rayOrigin); + ObjectUtils.Destroy(tool as MonoBehaviour); + } + } + } + // If the tool had a custom menu, the custom menu would spawn on the opposite device var customMenu = otherDeviceData.customMenu; if (customMenu != null) From 83cfdab02a4f376013833454808b65102c6568eb Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 13 Sep 2017 14:49:32 -0700 Subject: [PATCH 835/870] Address misc PR comments --- Tools/AnnotationTool/AnnotationTool.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index d6b050a09..7ed2e5f7c 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -22,6 +22,7 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr public const float MinBrushSize = 0.0025f; public const float MaxBrushSize = 0.05f; const float k_MinDistance = 0.003f; + const int k_InitialListSize = 1024; // Pre-allocate lists to avoid GC [SerializeField] ActionMap m_ActionMap; @@ -37,8 +38,6 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr Action onBrushSizeChanged { set; get; } - const int k_InitialListSize = 1024; // Pre-allocate lists to avoid GC - List m_Points = new List(k_InitialListSize); List m_UpVectors = new List(k_InitialListSize); List m_Widths = new List(k_InitialListSize); @@ -108,7 +107,8 @@ void Start() if (m_ColorPickerActivator == null) { m_ColorPickerActivator = this.InstantiateUI(m_ColorPickerActivatorPrefab); - var otherAltMenu = this.GetCustomAlternateMenuOrigin(otherRayOrigins[0]); + var otherRayOrigin = otherRayOrigins.First(); + var otherAltMenu = this.GetCustomAlternateMenuOrigin(otherRayOrigin); m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); m_ColorPickerActivator.transform.localRotation = Quaternion.identity; @@ -122,7 +122,7 @@ void Start() m_ColorPicker.toolRayOrigin = rayOrigin; m_ColorPicker.onColorPicked = OnColorPickerValueChanged; - activator.rayOrigin = otherRayOrigins.First(); + activator.rayOrigin = otherRayOrigin; activator.showColorPicker = ShowColorPicker; activator.hideColorPicker = HideColorPicker; @@ -176,7 +176,8 @@ void OnColorPickerValueChanged(Color color) { m_ColorToUse = color; - color.a = .75f; + const float annotationPointerAlpha = 0.75f; + color.a = annotationPointerAlpha; m_AnnotationPointer.SetColor(color); m_BrushSizeUI.OnBrushColorChanged(color); From e92d9037af28ac342d9b71fff8624ba6ca4ec18e Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 13 Sep 2017 21:01:18 -0700 Subject: [PATCH 836/870] WIP implementing mesh combine grouping; Refactor settingsmenu/itemprovider to work for non-default tools --- Menus/MainMenu/MainMenu.cs | 113 ++- Scripts/Core/EditorVR.Menus.cs | 18 + Scripts/Core/EditorVR.Rays.cs | 10 +- Scripts/Interfaces/Entity/IMainMenu.cs | 14 + Tools/AnnotationTool/AnnotationTool.cs | 159 +++- Tools/AnnotationTool/AnnotationTool.cs.meta | 9 +- .../AnnotationTool/Prefabs/SettingsUI.prefab | 827 ++++++++++++++++++ .../Prefabs/SettingsUI.prefab.meta | 8 + Tools/LocomotionTool/LocomotionTool.cs | 28 +- .../LocomotionTool/Prefabs/SettingsUI.prefab | 106 ++- 10 files changed, 1198 insertions(+), 94 deletions(-) create mode 100644 Tools/AnnotationTool/Prefabs/SettingsUI.prefab create mode 100644 Tools/AnnotationTool/Prefabs/SettingsUI.prefab.meta diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 47610a9e4..3c1bd94b8 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -43,11 +43,13 @@ sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantia float m_LastRotationInput; MenuHideFlags m_MenuHideFlags = MenuHideFlags.Hidden; readonly Dictionary m_ToolButtons = new Dictionary(); + readonly Dictionary m_SettingsMenus = new Dictionary(); + readonly Dictionary m_SettingsMenuItems = new Dictionary(); public List menuTools { private get; set; } public List menuWorkspaces { private get; set; } - public Dictionary, ISettingsMenuProvider> settingsMenuProviders { private get; set; } - public Dictionary, ISettingsMenuItemProvider> settingsMenuItemProviders { private get; set; } + public Dictionary, ISettingsMenuProvider> settingsMenuProviders { get; set; } + public Dictionary, ISettingsMenuItemProvider> settingsMenuItemProviders { get; set; } public List menuActions { get; set; } public Transform targetRayOrigin { private get; set; } public Type proxyType { private get; set; } @@ -116,13 +118,7 @@ void Start() m_MainMenuUI.buttonHovered += OnButtonHovered; m_MainMenuUI.buttonClicked += OnButtonClicked; - var types = new HashSet(); - types.UnionWith(menuTools); - types.UnionWith(menuWorkspaces); - types.UnionWith(settingsMenuProviders.Keys.Select(provider => provider.Key)); - types.UnionWith(settingsMenuItemProviders.Keys.Select(provider => provider.Key)); - - CreateFaceButtons(types.ToList()); + CreateFaceButtons(); m_MainMenuUI.SetupMenuFaces(); UpdateToolButtons(); } @@ -155,8 +151,38 @@ void OnDestroy() ObjectUtils.Destroy(m_MainMenuUI.gameObject); } - void CreateFaceButtons(List types) + void CreateFaceButtons() { + var settingsMenuProviderTypes = ObjectUtils.GetImplementationsOfInterface(typeof(ISettingsMenuProvider)); + var settingsMenuItemProviderTypes = ObjectUtils.GetImplementationsOfInterface(typeof(ISettingsMenuItemProvider)); + var types = new HashSet(); + types.UnionWith(menuTools); + types.UnionWith(menuWorkspaces); + types.UnionWith(settingsMenuProviderTypes); + types.UnionWith(settingsMenuItemProviderTypes); + + const string menuPrefabProperty = "m_SettingsMenuPrefab"; + const string menuItemPrefabProperty = "m_SettingsMenuItemPrefab"; + var allImporters = Resources.FindObjectsOfTypeAll(); + var settingsMenuPrefabs = new Dictionary(); + var settingsMenuItemPrefabs = new Dictionary(); + foreach (var importer in allImporters) + { + foreach (var settingsMenuProvider in settingsMenuProviderTypes) + { + var type = importer.GetScript().GetClass(); + if (type == settingsMenuProvider) + settingsMenuPrefabs[type] = importer.GetDefaultReference(menuPrefabProperty) as GameObject; + } + + foreach (var settingsMenuItemProvider in settingsMenuItemProviderTypes) + { + var type = importer.GetScript().GetClass(); + if (type == settingsMenuItemProvider) + settingsMenuItemPrefabs[type] = importer.GetDefaultReference(menuItemPrefabProperty) as GameObject; + } + } + foreach (var type in types) { var customMenuAttribute = (MainMenuItemAttribute)type.GetCustomAttributes(typeof(MainMenuItemAttribute), false).FirstOrDefault(); @@ -209,40 +235,47 @@ void CreateFaceButtons(List types) if (isSettingsProvider) { - foreach (var providerPair in settingsMenuProviders) + foreach (var providerType in settingsMenuProviderTypes) { - var kvp = providerPair.Key; - if (kvp.Key == type && (kvp.Value == null || kvp.Value == rayOrigin)) - { - var menuProvider = providerPair.Value; - if (buttonData == null) - buttonData = new MainMenuUI.ButtonData(type.Name); + if (providerType != type) + continue; - buttonData.sectionName = k_SettingsMenuSectionName; + if (buttonData == null) + buttonData = new MainMenuUI.ButtonData(type.Name); - CreateFaceButton(buttonData, tooltip, () => - { - menuProvider.settingsMenuInstance = m_MainMenuUI.AddSubmenu(k_SettingsMenuSectionName, menuProvider.settingsMenuPrefab); - }); - } + buttonData.sectionName = k_SettingsMenuSectionName; + + var thisType = providerType;// Local variable for closure + CreateFaceButton(buttonData, tooltip, () => + { + var menu = m_MainMenuUI.AddSubmenu(k_SettingsMenuSectionName, settingsMenuPrefabs[selectedType]); + m_SettingsMenus[selectedType] = menu; + + ISettingsMenuItemProvider provider; + if (settingsMenuItemProviders.TryGetValue(new KeyValuePair(thisType, rayOrigin), out provider)) + provider.settingsMenuItemInstance = menu; + }); } } if (isSettingsItemProvider) { - foreach (var providerPair in settingsMenuItemProviders) + foreach (var providerType in settingsMenuItemProviderTypes) { - var kvp = providerPair.Key; - if (kvp.Key == type && (kvp.Value == null || kvp.Value == rayOrigin)) - { - var itemProvider = providerPair.Value; - if (buttonData == null) - buttonData = new MainMenuUI.ButtonData(type.Name); + if (providerType != type) + continue; - buttonData.sectionName = "Settings"; + if (buttonData == null) + buttonData = new MainMenuUI.ButtonData(type.Name); - itemProvider.settingsMenuItemInstance = m_MainMenuUI.CreateCustomButton(itemProvider.settingsMenuItemPrefab, buttonData); - } + buttonData.sectionName = k_SettingsMenuSectionName; + + var item = m_MainMenuUI.CreateCustomButton(settingsMenuItemPrefabs[selectedType], buttonData); + m_SettingsMenuItems[selectedType] = item; + + ISettingsMenuItemProvider provider; + if (settingsMenuItemProviders.TryGetValue(new KeyValuePair(providerType, rayOrigin), out provider)) + provider.settingsMenuItemInstance = item; } } } @@ -284,6 +317,20 @@ void SendVisibilityPulse() { this.Pulse(node, m_MenuHideFlags == 0 ? m_HidePulse : m_ShowPulse); } + + public GameObject GetSettingsMenuInstance(Type providerType) + { + GameObject settingsMenu; + m_SettingsMenus.TryGetValue(providerType, out settingsMenu); + return settingsMenu; + } + + public GameObject GetSettingsMenuItemInstance(Type providerType) + { + GameObject settingsMenuItem; + m_SettingsMenuItems.TryGetValue(providerType, out settingsMenuItem); + return settingsMenuItem; + } } } #endif diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 0ad984cc3..a00caa6a0 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -36,6 +36,7 @@ internal class MenuHideData const float k_TwoHandHideDistance = 0.25f; const int k_PossibleOverlaps = 16; + readonly Dictionary m_MainMenus = new Dictionary(); readonly Dictionary, ISettingsMenuProvider> m_SettingsMenuProviders = new Dictionary, ISettingsMenuProvider>(); readonly Dictionary, ISettingsMenuItemProvider> m_SettingsMenuItemProviders = new Dictionary, ISettingsMenuItemProvider>(); List m_MainMenuTools; @@ -57,11 +58,23 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) { var settingsMenuProvider = obj as ISettingsMenuProvider; if (settingsMenuProvider != null) + { m_SettingsMenuProviders[new KeyValuePair(obj.GetType(), rayOrigin)] = settingsMenuProvider; + foreach (var kvp in m_MainMenus) + { + if (rayOrigin == null || kvp.Key == rayOrigin) + settingsMenuProvider.settingsMenuInstance = kvp.Value.GetSettingsMenuInstance(obj.GetType()); + } + } var settingsMenuItemProvider = obj as ISettingsMenuItemProvider; if (settingsMenuItemProvider != null) + { m_SettingsMenuItemProviders[new KeyValuePair(obj.GetType(), rayOrigin)] = settingsMenuItemProvider; + IMainMenu menu; + if (m_MainMenus.TryGetValue(rayOrigin, out menu)) + settingsMenuItemProvider.settingsMenuItemInstance = menu.GetSettingsMenuItemInstance(obj.GetType()); + } var mainMenu = obj as IMainMenu; if (mainMenu != null) @@ -70,6 +83,7 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) mainMenu.menuWorkspaces = WorkspaceModule.workspaceTypes; mainMenu.settingsMenuProviders = m_SettingsMenuProviders; mainMenu.settingsMenuItemProviders = m_SettingsMenuItemProviders; + m_MainMenus[rayOrigin] = mainMenu; } var menuOrigins = obj as IUsesMenuOrigins; @@ -96,6 +110,10 @@ public void DisconnectInterface(object obj, Transform rayOrigin = null) var settingsMenuItemProvider = obj as ISettingsMenuItemProvider; if (settingsMenuItemProvider != null) m_SettingsMenuItemProviders.Remove(new KeyValuePair(obj.GetType(), rayOrigin)); + + var mainMenu = obj as IMainMenu; + if (mainMenu != null) + m_MainMenus.Remove(rayOrigin); } public void LateBindInterfaceMethods(Tools provider) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index d9ddfa26d..adca6198f 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -18,7 +18,7 @@ partial class EditorVR [SerializeField] ProxyExtras m_ProxyExtras; - class Rays : Nested, IInterfaceConnector + class Rays : Nested, IInterfaceConnector, IForEachRayOrigin { internal delegate void ForEachProxyDeviceCallback(DeviceData deviceData); @@ -42,7 +42,7 @@ public Rays() IRayVisibilitySettingsMethods.removeRayVisibilitySettings = RemoveVisibilitySettings; IRayVisibilitySettingsMethods.addRayVisibilitySettings = AddVisibilitySettings; - IForEachRayOriginMethods.forEachRayOrigin = ForEachRayOrigin; + IForEachRayOriginMethods.forEachRayOrigin = IterateRayOrigins; IGetFieldGrabOriginMethods.getFieldGrabOriginForRayOrigin = GetFieldGrabOriginForRayOrigin; IGetPreviewOriginMethods.getPreviewOriginForRayOrigin = GetPreviewOriginForRayOrigin; IUsesRaycastResultsMethods.getFirstGameObject = GetFirstGameObject; @@ -71,7 +71,7 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) if (rayOrigins != null) { List otherRayOrigins = new List(); - ForEachRayOrigin(ro => + this.ForEachRayOrigin(ro => { if (ro != rayOrigin) otherRayOrigins.Add(ro); @@ -276,7 +276,7 @@ internal static void UpdateRaycasts() { var intersectionModule = evr.GetModule(); var distance = k_DefaultRayLength * Viewer.GetViewerScale(); - ForEachRayOrigin(rayOrigin => { intersectionModule.UpdateRaycast(rayOrigin, distance); }); + IterateRayOrigins(rayOrigin => { intersectionModule.UpdateRaycast(rayOrigin, distance); }); } internal void UpdateDefaultProxyRays() @@ -329,7 +329,7 @@ internal static void ForEachProxyDevice(ForEachProxyDeviceCallback callback, boo } } - static void ForEachRayOrigin(ForEachRayOriginCallback callback) + static void IterateRayOrigins(ForEachRayOriginCallback callback) { ForEachProxyDevice(deviceData => callback(deviceData.rayOrigin)); } diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 4f93aeef6..6f6b489e0 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -39,6 +39,20 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool /// Does this menu have focus? /// bool focus { get; } + + /// + /// Get this menu's settings menu for a given type + /// + /// The type for which we want to get a settings menu + /// + GameObject GetSettingsMenuInstance(Type providerType); + + /// + /// Get this menu's settings menu item for a given type + /// + /// The type for which we want to get a settings menu item + /// + GameObject GetSettingsMenuItemInstance(Type providerType); } } #endif diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 7ed2e5f7c..560889adf 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -5,19 +5,35 @@ using System.Linq; using UnityEditor; using UnityEditor.Experimental.EditorVR; +using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Proxies; +using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; using UnityEngine.InputNew; +using UnityEngine.UI; using UnityEngine.VR; [MainMenuItem("Annotation", "Create", "Draw in 3D")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IRayVisibilitySettings, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale, IUsesSpatialHash, - IIsHoveringOverUI, IMultiDeviceTool, IUsesProxyType + IIsHoveringOverUI, IMultiDeviceTool, IUsesProxyType, ISettingsMenuItemProvider, ISerializePreferences { + [Serializable] + class Preferences + { + [SerializeField] + bool m_MeshGroupingMode; + + [SerializeField] + Color m_AnnotationColor = Color.white; + + public bool meshGroupingMode { get { return m_MeshGroupingMode; } set { m_MeshGroupingMode = value; } } + public Color annotationColor { get { return m_AnnotationColor; } set { m_AnnotationColor = value; } } + } + public const float TipDistance = 0.05f; public const float MinBrushSize = 0.0025f; public const float MaxBrushSize = 0.05f; @@ -36,15 +52,20 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr [SerializeField] GameObject m_ColorPickerActivatorPrefab; + [SerializeField] + GameObject m_SettingsMenuItemPrefab; + Action onBrushSizeChanged { set; get; } - List m_Points = new List(k_InitialListSize); - List m_UpVectors = new List(k_InitialListSize); - List m_Widths = new List(k_InitialListSize); + Preferences m_Preferences; + + readonly List m_Points = new List(k_InitialListSize); + readonly List m_UpVectors = new List(k_InitialListSize); + readonly List m_Widths = new List(k_InitialListSize); + readonly List m_Groups = new List(); float m_Length; MeshFilter m_CurrentMeshFilter; - Color m_ColorToUse = Color.white; Mesh m_CurrentMesh; Matrix4x4 m_WorldToLocalMesh; @@ -65,19 +86,39 @@ public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOr public bool primary { private get; set; } public Type proxyType { private get; set; } - public Transform rayOrigin { private get; set; } + public Transform rayOrigin { get; set; } public List otherRayOrigins { private get; set; } public Transform menuOrigin { private get; set; } public Transform alternateMenuOrigin { private get; set; } - public ActionMap actionMap + public ActionMap actionMap { get { return m_ActionMap; } } + + public GameObject settingsMenuItemPrefab { get { return m_SettingsMenuItemPrefab; } } + public GameObject settingsMenuItemInstance { - get { return m_ActionMap; } + set + { + var defaultToggleGroup = value.GetComponentInChildren(); + foreach (var toggle in value.GetComponentsInChildren()) + { + if (toggle == defaultToggleGroup.defaultToggle) + { + toggle.onValueChanged.AddListener(isOn => + { + // m_Preferences on all instances refer + m_Preferences.meshGroupingMode = !isOn; + }); + } + } + } } void OnDestroy() { + if (m_Preferences.meshGroupingMode) + CombineGroups(); + if (rayOrigin) this.RemoveRayVisibilitySettings(rayOrigin, this); @@ -96,6 +137,9 @@ void OnDestroy() void Start() { + if (m_Preferences == null) + m_Preferences = new Preferences(); + this.AddRayVisibilitySettings(rayOrigin, this, false, false); if (primary) @@ -174,7 +218,7 @@ void HideColorPicker() void OnColorPickerValueChanged(Color color) { - m_ColorToUse = color; + m_Preferences.annotationColor = color; const float annotationPointerAlpha = 0.75f; color.a = annotationPointerAlpha; @@ -226,7 +270,7 @@ void SetupAnnotation() var mRenderer = go.AddComponent(); var matToUse = Instantiate(m_AnnotationMaterial); - matToUse.SetColor("_EmissionColor", m_ColorToUse); + matToUse.SetColor("_EmissionColor", m_Preferences.annotationColor); mRenderer.sharedMaterial = matToUse; m_WorldToLocalMesh = goTrans.worldToLocalMatrix; @@ -240,47 +284,42 @@ void SetupHolder() var mainHolder = GameObject.Find("Annotations") ?? new GameObject("Annotations"); var mainHolderTrans = mainHolder.transform; - var newSession = GetNewSessionHolder(mainHolderTrans); + var newSession = GetNewSessionHolder(); if (!newSession) + { newSession = new GameObject("Group " + mainHolderTrans.childCount); + m_Groups.Add(newSession); + } m_AnnotationHolder = newSession.transform; m_AnnotationHolder.SetParent(mainHolder.transform); } - GameObject GetNewSessionHolder(Transform mainHolderTrans) + GameObject GetNewSessionHolder() { - const float kGroupingDistance = .3f; - GameObject newSession = null; - - for (var i = 0; i < mainHolderTrans.childCount; i++) + const float groupingDistance = .3f; + for (var i = 0; i < m_Groups.Count; i++) { - var child = mainHolderTrans.GetChild(i); + var child = m_Groups[i]; child.name = "Group " + i; - if (newSession == null) + var renderers = child.GetComponentsInChildren(); + if (renderers.Length > 0) { - var renderers = child.GetComponentsInChildren(); - if (renderers.Length > 0) + var bound = renderers[0].bounds; + for (var r = 1; r < renderers.Length; r++) { - var bound = renderers[0].bounds; - for (var r = 1; r < renderers.Length; r++) - bound.Encapsulate(renderers[r].bounds); - - if (bound.Contains(rayOrigin.position)) - newSession = child.gameObject; - else if (bound.SqrDistance(rayOrigin.position) < kGroupingDistance) - newSession = child.gameObject; - - if (newSession) - break; + bound.Encapsulate(renderers[r].bounds); } + + if (bound.Contains(rayOrigin.position) || bound.SqrDistance(rayOrigin.position) < groupingDistance) + return child.gameObject; } } - return newSession; + return null; } - + void UpdateAnnotation() { var upVector = rayOrigin.up; @@ -605,5 +644,59 @@ IEnumerator SetAnnotationPointerVisibility(bool visible) annotationPointerTransform.localScale = targetScale; } + + void CombineGroups() + { + foreach (var group in m_Groups) + { + group.name = group.name.Replace("Group", "Annotation"); + var meshFilters = group.GetComponentsInChildren(); + var renderers = group.GetComponentsInChildren(); + + if (meshFilters.Length == 0) + { + ObjectUtils.Destroy(group); + continue; + } + + var length = meshFilters.Length; + var combines = new CombineInstance[length]; + var materials = new Material[length]; + for (var i = 0; i < length; i++) + { + var combine = combines[i]; + var meshFilter = meshFilters[i]; + combine.mesh = meshFilter.sharedMesh; + combine.transform = meshFilter.transform.localToWorldMatrix; + materials[i] = renderers[i].sharedMaterial; + } + + var mesh = new Mesh(); + mesh.CombineMeshes(combines, false, true); + group.AddComponent().sharedMesh = mesh; + + group.AddComponent().sharedMaterials = materials; + + foreach (var meshFilter in meshFilters) + { + ObjectUtils.Destroy(meshFilter.gameObject); + } + } + } + + public object OnSerializePreferences() + { + if (primary) + return m_Preferences; + + return null; + } + + public void OnDeserializePreferences(object obj) + { + var preferences = obj as Preferences; + if (preferences != null) + m_Preferences = preferences; + } } #endif diff --git a/Tools/AnnotationTool/AnnotationTool.cs.meta b/Tools/AnnotationTool/AnnotationTool.cs.meta index ac0281dce..539f1673a 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs.meta +++ b/Tools/AnnotationTool/AnnotationTool.cs.meta @@ -1,20 +1,19 @@ fileFormatVersion: 2 guid: ecba8b13e3259e14eab642c0d0657d5c -timeCreated: 1479813204 -licenseType: Free +timeCreated: 1505345373 +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: - m_ActionMap: {fileID: 11400000, guid: 6615fd7d8b165fe43bc85867850097e5, type: 2} - m_AnnotationMaterial: {fileID: 2100000, guid: 252a12e5980ef5b438bcc0dbc0d35529, type: 2} - - m_ConeMaterial: {fileID: 2100000, guid: facc16e9d19b3b84e9110a7805dfa457, type: 2} - - m_ColorPickerPrefab: {fileID: 1000014053269536, guid: da56ed8b2b72e414589b2938af94c498, - type: 2} - m_BrushSizePrefab: {fileID: 1000012251850158, guid: 76909d1f493d664469c9e0f4726790a3, type: 2} - m_ColorPickerActivatorPrefab: {fileID: 1000010255295176, guid: a643645e8043ba84a8109a98e55603ff, type: 2} + - m_SettingsMenuItemPrefab: {fileID: 1000013404610172, guid: 9d3d2d6c1e56f4e49ab368e814bf8801, + type: 2} executionOrder: 0 icon: {instanceID: 0} userData: diff --git a/Tools/AnnotationTool/Prefabs/SettingsUI.prefab b/Tools/AnnotationTool/Prefabs/SettingsUI.prefab new file mode 100644 index 000000000..de7353428 --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/SettingsUI.prefab @@ -0,0 +1,827 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1000013404610172} + m_IsPrefabParent: 1 +--- !u!1 &1000010398065086 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012653929454} + - component: {fileID: 222000012891014098} + - component: {fileID: 114000012025195674} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011430478146 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000012493860698} + - component: {fileID: 222000012612170110} + - component: {fileID: 114000010706236210} + m_Layer: 5 + m_Name: Foreground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011512978662 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011405639814} + - component: {fileID: 222000011416400564} + - component: {fileID: 114000011583981380} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000011772923556 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010858218954} + - component: {fileID: 114000011920048442} + m_Layer: 5 + m_Name: Mesh + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000012753606596 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000010616025136} + - component: {fileID: 222000010570603678} + - component: {fileID: 114000011835530144} + m_Layer: 5 + m_Name: Foreground + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013404610172 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011487074538} + - component: {fileID: 222000012862005820} + - component: {fileID: 114691388261995722} + m_Layer: 5 + m_Name: SettingsUI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013494423478 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011444372664} + - component: {fileID: 114000013714903302} + m_Layer: 5 + m_Name: Transform + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013599855740 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013724969698} + - component: {fileID: 222000011524760356} + - component: {fileID: 114000011422230102} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000013796857246 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000011778163486} + - component: {fileID: 222000011646980040} + - component: {fileID: 114000013593928534} + - component: {fileID: 114000012940195592} + - component: {fileID: 114261882201029984} + m_Layer: 5 + m_Name: Grouping Mode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1000014118413922 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000013716393632} + - component: {fileID: 222000012522696328} + - component: {fileID: 114000013077659776} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1123566551031880 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224874559224435002} + - component: {fileID: 222817483957468890} + - component: {fileID: 114210595956423184} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &114000010706236210 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011430478146} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011422230102 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013599855740} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: db3c88ad8f7fe11479d2d3e48c08e6f0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011583981380 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011512978662} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Mesh +--- !u!114 &114000011835530144 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012753606596} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 0.10196079, g: 0.10196079, b: 0.10196079, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000011920048442 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011772923556} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0, g: 0, b: 0, a: 0.76} + m_HighlightedColor: {r: 0, g: 0, b: 0, a: 0.866} + m_PressedColor: {r: 0, g: 0, b: 0, a: 0.76} + m_DisabledColor: {r: 0, g: 0, b: 0, a: 0.76} + m_ColorMultiplier: 1 + m_FadeDuration: 0.2 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000011835530144} + toggleTransition: 1 + graphic: {fileID: 114000013077659776} + m_Group: {fileID: 114000012940195592} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_IsOn: 0 +--- !u!114 &114000012025195674 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010398065086} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} + m_FontSize: 20 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Transform +--- !u!114 &114000012940195592 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1184210157, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_AllowSwitchOff: 0 +--- !u!114 &114000013077659776 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014118413922} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: db3c88ad8f7fe11479d2d3e48c08e6f0, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114000013593928534 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -405508275, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 +--- !u!114 &114000013714903302 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013494423478} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 2109663825, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 0, g: 0, b: 0, a: 0.76} + m_HighlightedColor: {r: 0, g: 0, b: 0, a: 0.866} + m_PressedColor: {r: 0, g: 0, b: 0, a: 0.76} + m_DisabledColor: {r: 0, g: 0, b: 0, a: 0.76} + m_ColorMultiplier: 1 + m_FadeDuration: 0.2 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 114000010706236210} + toggleTransition: 1 + graphic: {fileID: 114000011422230102} + m_Group: {fileID: 114000012940195592} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null + m_IsOn: 1 +--- !u!114 &114210595956423184 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1123566551031880} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 280 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: ' Annotation Grouping Mode:' +--- !u!114 &114261882201029984 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e93c342d881ae654d8d190dda4e84c44, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DefaultToggle: {fileID: 114000013714903302} +--- !u!114 &114691388261995722 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013404610172} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 +--- !u!222 &222000010570603678 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012753606596} +--- !u!222 &222000011416400564 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011512978662} +--- !u!222 &222000011524760356 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013599855740} +--- !u!222 &222000011646980040 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} +--- !u!222 &222000012522696328 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014118413922} +--- !u!222 &222000012612170110 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011430478146} +--- !u!222 &222000012862005820 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013404610172} +--- !u!222 &222000012891014098 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010398065086} +--- !u!222 &222817483957468890 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1123566551031880} +--- !u!224 &224000010616025136 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012753606596} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000010858218954} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.25, y: 0} + m_SizeDelta: {x: -0.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000010858218954 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011772923556} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000013716393632} + - {fileID: 224000010616025136} + - {fileID: 224000011405639814} + m_Father: {fileID: 224000011778163486} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011405639814 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011512978662} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000010858218954} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.25, y: 0} + m_SizeDelta: {x: -0.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011444372664 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013494423478} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000013724969698} + - {fileID: 224000012493860698} + - {fileID: 224000012653929454} + m_Father: {fileID: 224000011778163486} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000011487074538 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013404610172} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224874559224435002} + - {fileID: 224000011778163486} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 263.2, y: 60} + m_Pivot: {x: 0.5, y: 1} +--- !u!224 &224000011778163486 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013796857246} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224000010858218954} + - {fileID: 224000011444372664} + m_Father: {fileID: 224000011487074538} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 40} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012493860698 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011430478146} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011444372664} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.25, y: 0} + m_SizeDelta: {x: -0.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000012653929454 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010398065086} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011444372664} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0.25, y: 0} + m_SizeDelta: {x: -0.5, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013716393632 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014118413922} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000010858218954} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2, y: 2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000013724969698 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013599855740} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011444372664} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2, y: 2} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224874559224435002 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1123566551031880} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011487074538} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 20} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Tools/AnnotationTool/Prefabs/SettingsUI.prefab.meta b/Tools/AnnotationTool/Prefabs/SettingsUI.prefab.meta new file mode 100644 index 000000000..94ed47c6c --- /dev/null +++ b/Tools/AnnotationTool/Prefabs/SettingsUI.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d3d2d6c1e56f4e49ab368e814bf8801 +timeCreated: 1491439922 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index dc58cf9f5..b0c37a83d 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -593,20 +593,20 @@ public object OnSerializePreferences() public void OnDeserializePreferences(object obj) { - if (this.IsSharedUpdater(this)) - { - var preferences = obj as Preferences; - if (preferences != null) - m_Preferences = preferences; - - // Share one preferences object across all instances - foreach (var linkedObject in linkedObjects) - { - ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; - m_BlinkToggle.isOn = m_Preferences.blinkMode; - m_FlyToggle.isOn = !m_Preferences.blinkMode; - } - } + //if (this.IsSharedUpdater(this)) + //{ + // var preferences = obj as Preferences; + // if (preferences != null) + // m_Preferences = preferences; + + // // Share one preferences object across all instances + // foreach (var linkedObject in linkedObjects) + // { + // ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; + // m_BlinkToggle.isOn = m_Preferences.blinkMode; + // m_FlyToggle.isOn = !m_Preferences.blinkMode; + // } + //} } } } diff --git a/Tools/LocomotionTool/Prefabs/SettingsUI.prefab b/Tools/LocomotionTool/Prefabs/SettingsUI.prefab index 1ab3df846..f568dbbcf 100644 --- a/Tools/LocomotionTool/Prefabs/SettingsUI.prefab +++ b/Tools/LocomotionTool/Prefabs/SettingsUI.prefab @@ -104,6 +104,7 @@ GameObject: m_Component: - component: {fileID: 224000011487074538} - component: {fileID: 222000012862005820} + - component: {fileID: 114691388261995722} m_Layer: 5 m_Name: SettingsUI m_TagString: Untagged @@ -180,6 +181,23 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1123566551031880 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224874559224435002} + - component: {fileID: 222817483957468890} + - component: {fileID: 114210595956423184} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!114 &114000010706236210 MonoBehaviour: m_ObjectHideFlags: 1 @@ -478,6 +496,39 @@ MonoBehaviour: m_TypeName: UnityEngine.UI.Toggle+ToggleEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_IsOn: 1 +--- !u!114 &114210595956423184 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1123566551031880} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 280 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: ' Locomotion Mode:' --- !u!114 &114261882201029984 MonoBehaviour: m_ObjectHideFlags: 1 @@ -490,6 +541,28 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_DefaultToggle: {fileID: 114000013714903302} +--- !u!114 &114691388261995722 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013404610172} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 0 --- !u!222 &222000010570603678 CanvasRenderer: m_ObjectHideFlags: 1 @@ -538,6 +611,12 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010398065086} +--- !u!222 &222817483957468890 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1123566551031880} --- !u!224 &224000010616025136 RectTransform: m_ObjectHideFlags: 1 @@ -626,6 +705,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: + - {fileID: 224874559224435002} - {fileID: 224000011778163486} m_Father: {fileID: 0} m_RootOrder: 0 @@ -633,7 +713,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 263.2, y: 45} + m_SizeDelta: {x: 263.2, y: 60} m_Pivot: {x: 0.5, y: 1} --- !u!224 &224000011778163486 RectTransform: @@ -648,12 +728,12 @@ RectTransform: - {fileID: 224000010858218954} - {fileID: 224000011444372664} m_Father: {fileID: 224000011487074538} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} + m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012493860698 RectTransform: @@ -727,3 +807,21 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 2, y: 2} m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224874559224435002 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1123566551031880} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011487074538} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 20} + m_Pivot: {x: 0.5, y: 0.5} From 22793eeba69af3ca286c2ba6088f927f255e27cd Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 14 Sep 2017 15:11:14 -0700 Subject: [PATCH 837/870] Add menu buttons on demand to allow for tool settings to be added/removed --- Menus/MainMenu/MainMenu.cs | 133 ++++---- Menus/MainMenu/Scripts/MainMenuFace.cs | 138 +++++--- Menus/MainMenu/Scripts/MainMenuUI.cs | 304 +++++------------- Scripts/Core/EditorVR.Menus.cs | 10 +- .../Capability/ISettingsMenuProvider.cs | 3 +- Scripts/Interfaces/Entity/IMainMenu.cs | 26 +- .../Interfaces/ISettingsMenuItemProvider.cs | 3 +- Tools/AnnotationTool/AnnotationTool.cs | 76 ++++- Tools/LocomotionTool/LocomotionTool.cs | 29 +- 9 files changed, 351 insertions(+), 371 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 3c1bd94b8..23d79b18b 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -43,8 +43,6 @@ sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantia float m_LastRotationInput; MenuHideFlags m_MenuHideFlags = MenuHideFlags.Hidden; readonly Dictionary m_ToolButtons = new Dictionary(); - readonly Dictionary m_SettingsMenus = new Dictionary(); - readonly Dictionary m_SettingsMenuItems = new Dictionary(); public List menuTools { private get; set; } public List menuWorkspaces { private get; set; } @@ -119,7 +117,6 @@ void Start() m_MainMenuUI.buttonClicked += OnButtonClicked; CreateFaceButtons(); - m_MainMenuUI.SetupMenuFaces(); UpdateToolButtons(); } @@ -153,35 +150,11 @@ void OnDestroy() void CreateFaceButtons() { - var settingsMenuProviderTypes = ObjectUtils.GetImplementationsOfInterface(typeof(ISettingsMenuProvider)); - var settingsMenuItemProviderTypes = ObjectUtils.GetImplementationsOfInterface(typeof(ISettingsMenuItemProvider)); var types = new HashSet(); types.UnionWith(menuTools); types.UnionWith(menuWorkspaces); - types.UnionWith(settingsMenuProviderTypes); - types.UnionWith(settingsMenuItemProviderTypes); - - const string menuPrefabProperty = "m_SettingsMenuPrefab"; - const string menuItemPrefabProperty = "m_SettingsMenuItemPrefab"; - var allImporters = Resources.FindObjectsOfTypeAll(); - var settingsMenuPrefabs = new Dictionary(); - var settingsMenuItemPrefabs = new Dictionary(); - foreach (var importer in allImporters) - { - foreach (var settingsMenuProvider in settingsMenuProviderTypes) - { - var type = importer.GetScript().GetClass(); - if (type == settingsMenuProvider) - settingsMenuPrefabs[type] = importer.GetDefaultReference(menuPrefabProperty) as GameObject; - } - - foreach (var settingsMenuItemProvider in settingsMenuItemProviderTypes) - { - var type = importer.GetScript().GetClass(); - if (type == settingsMenuItemProvider) - settingsMenuItemPrefabs[type] = importer.GetDefaultReference(menuItemPrefabProperty) as GameObject; - } - } + types.UnionWith(settingsMenuProviders.Keys.Select(provider => provider.Key)); + types.UnionWith(settingsMenuItemProviders.Keys.Select(provider => provider.Key)); foreach (var type in types) { @@ -211,7 +184,7 @@ void CreateFaceButtons() if (buttonData == null) buttonData = new MainMenuUI.ButtonData(type.Name); - m_ToolButtons[type] = CreateFaceButton(buttonData, tooltip, () => + var toolButton = CreateFaceButton(buttonData, tooltip, () => { if (targetRayOrigin) { @@ -219,6 +192,9 @@ void CreateFaceButtons() UpdateToolButtons(); } }); + + if (toolButton) + m_ToolButtons[type] = toolButton; } if (isWorkspace) @@ -235,47 +211,21 @@ void CreateFaceButtons() if (isSettingsProvider) { - foreach (var providerType in settingsMenuProviderTypes) + foreach (var providerPair in settingsMenuProviders) { - if (providerType != type) - continue; - - if (buttonData == null) - buttonData = new MainMenuUI.ButtonData(type.Name); - - buttonData.sectionName = k_SettingsMenuSectionName; - - var thisType = providerType;// Local variable for closure - CreateFaceButton(buttonData, tooltip, () => - { - var menu = m_MainMenuUI.AddSubmenu(k_SettingsMenuSectionName, settingsMenuPrefabs[selectedType]); - m_SettingsMenus[selectedType] = menu; - - ISettingsMenuItemProvider provider; - if (settingsMenuItemProviders.TryGetValue(new KeyValuePair(thisType, rayOrigin), out provider)) - provider.settingsMenuItemInstance = menu; - }); + var kvp = providerPair.Key; + if (kvp.Key == type && (kvp.Value == null || kvp.Value == rayOrigin)) + AddSettingsMenu(providerPair.Value, buttonData, tooltip); } } if (isSettingsItemProvider) { - foreach (var providerType in settingsMenuItemProviderTypes) + foreach (var providerPair in settingsMenuItemProviders) { - if (providerType != type) - continue; - - if (buttonData == null) - buttonData = new MainMenuUI.ButtonData(type.Name); - - buttonData.sectionName = k_SettingsMenuSectionName; - - var item = m_MainMenuUI.CreateCustomButton(settingsMenuItemPrefabs[selectedType], buttonData); - m_SettingsMenuItems[selectedType] = item; - - ISettingsMenuItemProvider provider; - if (settingsMenuItemProviders.TryGetValue(new KeyValuePair(providerType, rayOrigin), out provider)) - provider.settingsMenuItemInstance = item; + var kvp = providerPair.Key; + if (kvp.Key == type && (kvp.Value == null || kvp.Value == rayOrigin)) + AddSettingsMenuItem(providerPair.Value); } } } @@ -284,6 +234,9 @@ void CreateFaceButtons() MainMenuButton CreateFaceButton(MainMenuUI.ButtonData buttonData, ITooltip tooltip, Action buttonClickCallback) { var mainMenuButton = m_MainMenuUI.CreateFaceButton(buttonData); + if (mainMenuButton == null) + return null; + mainMenuButton.button.onClick.RemoveAllListeners(); mainMenuButton.button.onClick.AddListener(() => { @@ -318,18 +271,54 @@ void SendVisibilityPulse() this.Pulse(node, m_MenuHideFlags == 0 ? m_HidePulse : m_ShowPulse); } - public GameObject GetSettingsMenuInstance(Type providerType) + public void AddSettingsMenu(ISettingsMenuProvider provider) + { + var type = provider.GetType(); + var customMenuAttribute = (MainMenuItemAttribute)type.GetCustomAttributes(typeof(MainMenuItemAttribute), false).FirstOrDefault(); + + ITooltip tooltip = null; + MainMenuUI.ButtonData buttonData; + if (customMenuAttribute != null && customMenuAttribute.shown) + { + tooltip = customMenuAttribute.tooltip; + + buttonData = new MainMenuUI.ButtonData(customMenuAttribute.name) + { + sectionName = customMenuAttribute.sectionName, + description = customMenuAttribute.description + }; + } + else + { + buttonData = new MainMenuUI.ButtonData(type.Name); + } + + AddSettingsMenu(provider, buttonData, tooltip); + } + + void AddSettingsMenu(ISettingsMenuProvider provider, MainMenuUI.ButtonData buttonData, ITooltip tooltip) + { + buttonData.sectionName = k_SettingsMenuSectionName; + + CreateFaceButton(buttonData, tooltip, () => + { + provider.settingsMenuInstance = m_MainMenuUI.AddSubmenu(k_SettingsMenuSectionName, provider.settingsMenuPrefab); + }); + } + + public void RemoveSettingsMenu(ISettingsMenuProvider provider) { - GameObject settingsMenu; - m_SettingsMenus.TryGetValue(providerType, out settingsMenu); - return settingsMenu; + } - public GameObject GetSettingsMenuItemInstance(Type providerType) + public void AddSettingsMenuItem(ISettingsMenuItemProvider provider) { - GameObject settingsMenuItem; - m_SettingsMenuItems.TryGetValue(providerType, out settingsMenuItem); - return settingsMenuItem; + provider.settingsMenuItemInstance = m_MainMenuUI.CreateCustomButton(provider.settingsMenuItemPrefab, k_SettingsMenuSectionName); + } + + public void RemoveSettingsMenuItem(ISettingsMenuItemProvider provider) + { + } } } diff --git a/Menus/MainMenu/Scripts/MainMenuFace.cs b/Menus/MainMenu/Scripts/MainMenuFace.cs index 8cf089a07..8c98fbdfd 100644 --- a/Menus/MainMenu/Scripts/MainMenuFace.cs +++ b/Menus/MainMenu/Scripts/MainMenuFace.cs @@ -12,6 +12,8 @@ namespace UnityEditor.Experimental.EditorVR.Menus { sealed class MainMenuFace : MonoBehaviour { + static readonly Vector3 k_LocalOffset = Vector3.down * 0.15f; + [SerializeField] MeshRenderer m_BorderOutline; @@ -33,15 +35,40 @@ sealed class MainMenuFace : MonoBehaviour Material m_BorderOutlineMaterial; Vector3 m_BorderOutlineOriginalLocalScale; Transform m_BorderOutlineTransform; - List m_MenuButtons; Material m_TitleIconMaterial; Coroutine m_VisibilityCoroutine; + Coroutine m_RevealCoroutine; + GradientPair m_GradientPair; + Vector3 m_OriginalLocalScale; + Vector3 m_HiddenLocalScale; + readonly Stack m_Submenus = new Stack(); const string k_BottomGradientProperty = "_ColorBottom"; const string k_TopGradientProperty = "_ColorTop"; readonly GradientPair k_EmptyGradient = new GradientPair(UnityBrandColorScheme.light, UnityBrandColorScheme.darker); - public GradientPair gradientPair { get; private set; } + public GradientPair gradientPair + { + get { return m_GradientPair; } + set + { + m_GradientPair = value; + m_BorderOutlineMaterial.SetColor(k_TopGradientProperty, gradientPair.a); + m_BorderOutlineMaterial.SetColor(k_BottomGradientProperty, gradientPair.b); + m_TitleIconMaterial.SetColor(k_TopGradientProperty, gradientPair.a); + m_TitleIconMaterial.SetColor(k_BottomGradientProperty, gradientPair.b); + } + } + + public string title { set { m_FaceTitle.text = value; } } + + public bool visible + { + set + { + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateVisibility(value)); + } + } void Awake() { @@ -53,54 +80,23 @@ void Awake() m_FaceTitle.text = "Not Set"; m_TitleIconMaterial = MaterialUtils.GetMaterialClone(m_TitleIcon); - SetGradientColors(k_EmptyGradient); - } - - public void SetFaceData(string faceName, List buttons, GradientPair gradientPair) - { - if (m_MenuButtons != null && m_MenuButtons.Any()) - { - foreach (var button in m_MenuButtons) - { - ObjectUtils.Destroy(button); - } - } - - m_FaceTitle.text = faceName; - m_MenuButtons = buttons; + m_OriginalLocalScale = transform.localScale; + m_HiddenLocalScale = new Vector3(0f, m_OriginalLocalScale.y * 0.5f, m_OriginalLocalScale.z); - foreach (var button in buttons) - { - var buttonTransform = button.transform; - buttonTransform.SetParent(m_GridTransform); - buttonTransform.localRotation = Quaternion.identity; - buttonTransform.localScale = Vector3.one; - buttonTransform.localPosition = Vector3.zero; - } - - SetGradientColors(gradientPair); + gradientPair = k_EmptyGradient; } - void SetGradientColors(GradientPair gradientPair) + public void AddButton(Transform button) { - this.gradientPair = gradientPair; - m_BorderOutlineMaterial.SetColor(k_TopGradientProperty, gradientPair.a); - m_BorderOutlineMaterial.SetColor(k_BottomGradientProperty, gradientPair.b); - m_TitleIconMaterial.SetColor(k_TopGradientProperty, gradientPair.a); - m_TitleIconMaterial.SetColor(k_BottomGradientProperty, gradientPair.b); + button.SetParent(m_GridTransform); + button.localRotation = Quaternion.identity; + button.localScale = Vector3.one; + button.localPosition = Vector3.zero; } - public void Show() + public void Reveal(float delay = 0f) { - m_BorderOutlineTransform.localScale = m_BorderOutlineOriginalLocalScale; - this.StopCoroutine(ref m_VisibilityCoroutine); - m_VisibilityCoroutine = StartCoroutine(AnimateVisibility(true)); - } - - public void Hide() - { - this.StopCoroutine(ref m_VisibilityCoroutine); - m_VisibilityCoroutine = StartCoroutine(AnimateVisibility(false)); + this.RestartCoroutine(ref m_RevealCoroutine, AnimateReveal(delay)); } IEnumerator AnimateVisibility(bool show) @@ -132,6 +128,62 @@ IEnumerator AnimateVisibility(bool show) m_VisibilityCoroutine = null; } + + IEnumerator AnimateReveal(float delay = 0f) + { + var targetScale = m_OriginalLocalScale; + var targetPosition = Vector3.zero; + var currentScale = m_HiddenLocalScale; + var currentPosition = k_LocalOffset; + + transform.localScale = currentScale; + transform.localPosition = currentPosition; + + const float kSmoothTime = 0.1f; + var currentDelay = 0f; + var delayTarget = 0.25f + delay; // delay duration before starting the face reveal + while (currentDelay < delayTarget) // delay the reveal of each face slightly more than the previous + { + currentDelay += Time.deltaTime; + yield return null; + } + + var smoothVelocity = Vector3.zero; + while (!Mathf.Approximately(currentScale.x, targetScale.x)) + { + currentScale = Vector3.SmoothDamp(currentScale, targetScale, ref smoothVelocity, kSmoothTime, Mathf.Infinity, Time.deltaTime); + currentPosition = Vector3.Lerp(currentPosition, targetPosition, Mathf.Pow(currentScale.x / targetScale.x, 2)); // lerp the position with extra emphasis on the beginning transition + transform.localScale = currentScale; + transform.localPosition = currentPosition; + yield return null; + } + + transform.localScale = targetScale; + transform.localPosition = targetPosition; + } + + public void AddSubmenu(Transform submenu) + { + submenu.SetParent(transform.parent); + + submenu.localPosition = Vector3.zero; + submenu.localScale = Vector3.one; + submenu.localRotation = Quaternion.identity; + m_Submenus.Push(submenu.gameObject); + visible = false; + } + + public void RemoveSubmenu() + { + var target = m_Submenus.Pop(); + target.SetActive(false); + ObjectUtils.Destroy(target, .1f); + + if (m_Submenus.Count > 1) + m_Submenus.Last().SetActive(true); + else + visible = true; + } } } #endif diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 3b38af9f8..212afbb8f 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; +using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -39,6 +40,14 @@ enum VisibilityState TransitioningOut } + const float k_FaceRotationSnapAngle = 90f; + const float k_DefaultSnapSpeed = 10f; + const float k_RotationEpsilon = 1f; + const int k_FaceCount = 4; + + readonly string k_UncategorizedFaceName = "Uncategorized"; + readonly Color k_MenuFacesHiddenColor = new Color(1f, 1f, 1f, 0.5f); + [SerializeField] MainMenuButton m_ButtonTemplatePrefab; @@ -57,35 +66,12 @@ enum VisibilityState [SerializeField] Transform m_AlternateMenu; - public int targetFaceIndex - { - get { return m_TargetFaceIndex; } - set - { - m_Direction = (int)Mathf.Sign(value - m_TargetFaceIndex); - - // Loop around both ways - if (value < 0) - value += faceCount; - m_TargetFaceIndex = value % faceCount; - } - } int m_TargetFaceIndex; - public Dictionary> faceButtons { get { return m_FaceButtons; } } - readonly Dictionary> m_FaceButtons = new Dictionary>(); - - const float k_FaceRotationSnapAngle = 90f; - const int k_FaceCount = 4; - const float k_DefaultSnapSpeed = 10f; - const float k_RotationEpsilon = 1f; - - readonly string k_UncategorizedFaceName = "Uncategorized"; - readonly Color k_MenuFacesHiddenColor = new Color(1f, 1f, 1f, 0.5f); + readonly Dictionary m_Faces = new Dictionary(); VisibilityState m_VisibilityState = VisibilityState.Hidden; RotationState m_RotationState; - MainMenuFace[] m_MenuFaces; Material m_MenuFacesMaterial; Color m_MenuFacesColor; Transform m_MenuOrigin; @@ -94,14 +80,21 @@ public int targetFaceIndex Coroutine m_VisibilityCoroutine; Coroutine m_FrameRevealCoroutine; int m_Direction; + - Transform[] m_MenuFaceContentTransforms; - Vector3[] m_MenuFaceContentOriginalLocalPositions; - Vector3[] m_MenuFaceContentOffsetLocalPositions; - Vector3 m_MenuFaceContentOriginalLocalScale; - Vector3 m_MenuFaceContentHiddenLocalScale; + public int targetFaceIndex + { + get { return m_TargetFaceIndex; } + set + { + m_Direction = (int)Mathf.Sign(value - m_TargetFaceIndex); - readonly Dictionary> m_FaceSubmenus = new Dictionary>(); + // Loop around both ways + if (value < 0) + value += k_FaceCount; + m_TargetFaceIndex = value % k_FaceCount; + } + } public Transform menuOrigin { @@ -131,8 +124,6 @@ public Transform alternateMenuOrigin public float targetRotation { get; set; } - public int faceCount { get { return m_MenuFaces.Length; } } - public Node? node { get; set; } public bool visible @@ -146,18 +137,16 @@ public bool visible case VisibilityState.Hidden: if (value) { - this.StopCoroutine(ref m_VisibilityCoroutine); gameObject.SetActive(true); - m_VisibilityCoroutine = StartCoroutine(AnimateShow()); + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateShow()); } + return; case VisibilityState.TransitioningIn: case VisibilityState.Visible: if (!value) - { - this.StopCoroutine(ref m_VisibilityCoroutine); - m_VisibilityCoroutine = StartCoroutine(AnimateHide()); - } + this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHide()); + return; } } @@ -189,30 +178,6 @@ void Awake() public void Setup() { - m_MenuFaceContentTransforms = new Transform[k_FaceCount]; - m_MenuFaceContentOffsetLocalPositions = new Vector3[k_FaceCount]; - m_MenuFaceContentOriginalLocalPositions = new Vector3[k_FaceCount]; - m_MenuFaces = new MainMenuFace[k_FaceCount]; - for (var faceCount = 0; faceCount < k_FaceCount; ++faceCount) - { - // Add faces to the menu - var faceTransform = this.InstantiateUI(m_MenuFacePrefab.gameObject).transform; - faceTransform.SetParent(m_MenuFaceContainers[faceCount]); - faceTransform.localRotation = Quaternion.identity; - faceTransform.localScale = Vector3.one; - faceTransform.localPosition = Vector3.zero; - var face = faceTransform.GetComponent(); - m_MenuFaces[faceCount] = face; - - // Cache Face content reveal values - m_MenuFaceContentTransforms[faceCount] = faceTransform; - m_MenuFaceContentOriginalLocalPositions[faceCount] = faceTransform.localPosition; - m_MenuFaceContentOffsetLocalPositions[faceCount] = new Vector3(faceTransform.localPosition.x, faceTransform.localPosition.y, faceTransform.localPosition.z - 0.15f); // a position offset slightly in front of the menu face original position - } - - m_MenuFaceContentOriginalLocalScale = m_MenuFaceContentTransforms[0].localScale; - m_MenuFaceContentHiddenLocalScale = new Vector3(0f, m_MenuFaceContentOriginalLocalScale.y * 0.5f, m_MenuFaceContentOriginalLocalScale.z); - transform.localScale = Vector3.zero; m_AlternateMenu.localScale = Vector3.zero; } @@ -239,8 +204,8 @@ void Update() void OnDestroy() { - foreach (var face in m_MenuFaces) - ObjectUtils.Destroy(face.gameObject); + foreach (var kvp in m_Faces) + ObjectUtils.Destroy(kvp.Value.gameObject); } public MainMenuButton CreateFaceButton(ButtonData buttonData) @@ -257,139 +222,90 @@ public MainMenuButton CreateFaceButton(ButtonData buttonData) mainMenuButton.SetData(buttonData.name, buttonData.description); this.ConnectInterfaces(mainMenuButton); - var found = m_FaceButtons.Any(x => x.Key == buttonData.sectionName); - if (found) - { - var kvp = m_FaceButtons.First(x => x.Key == buttonData.sectionName); - kvp.Value.Add(button.transform); - } - else - { - m_FaceButtons.Add(buttonData.sectionName, new List { button.transform }); - } + MainMenuFace face; + if (!m_Faces.TryGetValue(buttonData.sectionName, out face)) + face = CreateFace(buttonData.sectionName); + if (face == null) + return null; + + face.AddButton(button.transform); + return mainMenuButton; } - public GameObject CreateCustomButton(GameObject prefab, ButtonData buttonData) + public GameObject CreateCustomButton(GameObject prefab, string sectionName) { var button = ObjectUtils.Instantiate(prefab); - button.name = buttonData.name; - if (string.IsNullOrEmpty(buttonData.sectionName)) - buttonData.sectionName = k_UncategorizedFaceName; + if (string.IsNullOrEmpty(sectionName)) + sectionName = k_UncategorizedFaceName; - if (m_FaceButtons.Any(x => x.Key == buttonData.sectionName)) - { - var kvp = m_FaceButtons.First(x => x.Key == buttonData.sectionName); - kvp.Value.Add(button.transform); - } - else - { - m_FaceButtons.Add(buttonData.sectionName, new List { button.transform }); - } + MainMenuFace face; + if (!m_Faces.TryGetValue(sectionName, out face)) + face = CreateFace(sectionName); + + if (face == null) + return null; + + face.AddButton(button.transform); return button; } - public void SetupMenuFaces() + MainMenuFace CreateFace(string sectionName) { - var position = 0; - foreach (var faceButtons in m_FaceButtons) + if (m_Faces.Count == k_FaceCount) { - m_MenuFaces[position].SetFaceData(faceButtons.Key, faceButtons.Value, - UnityBrandColorScheme.GetRandomGradient()); - ++position; + Debug.LogWarning("Main Menu does not support more than 4 faces"); + return null; } - } - public GameObject AddSubmenu(string face, GameObject submenuPrefab) - { - var index = FaceNameToIndex(face); - if (index > -1) - { - if (submenuPrefab.GetComponent() == null) - return null; + var faceTransform = this.InstantiateUI(m_MenuFacePrefab.gameObject).transform; + faceTransform.name = sectionName; + faceTransform.SetParent(m_MenuFaceContainers[m_Faces.Count]); + faceTransform.localRotation = Quaternion.identity; + faceTransform.localScale = Vector3.one; + faceTransform.localPosition = Vector3.zero; + var face = faceTransform.GetComponent(); + m_Faces[sectionName] = face; + face.gradientPair = UnityBrandColorScheme.GetRandomGradient(); + face.title = sectionName; - var submenu = this.InstantiateUI(submenuPrefab); - AddSubmenuToFace(index, submenu); - - var submenuFace = submenu.GetComponent(); - if (submenuFace) - { - submenuFace.SetupBackButton(() => { RemoveSubmenu(face); }); - submenuFace.gradientPair = m_MenuFaces[index].gradientPair; - } - - if (!m_FaceSubmenus.ContainsKey(face)) - m_FaceSubmenus.Add(face, new List { submenu }); - else - { - foreach (var faceSubmenu in m_FaceSubmenus[face]) - faceSubmenu.SetActive(false); - m_FaceSubmenus[face].Add(submenu); - } - m_MenuFaces[index].Hide(); - - return submenu; - } - - return null; + return face; } - void AddSubmenuToFace(int face, GameObject submenu) + public GameObject AddSubmenu(string sectionName, GameObject submenuPrefab) { - var submenuTrans = submenu.transform; + if (submenuPrefab.GetComponent() == null) + return null; - submenuTrans.SetParent(m_MenuFaceContainers[face]); + MainMenuFace face; + if (!m_Faces.TryGetValue(sectionName, out face)) + face = CreateFace(sectionName); - submenuTrans.localPosition = Vector3.zero; - submenuTrans.localScale = Vector3.one; - submenuTrans.localRotation = Quaternion.identity; - } + var submenu = this.InstantiateUI(submenuPrefab); - void RemoveSubmenu(string face) - { - var index = FaceNameToIndex(face); - if (index > -1) - { - if (m_FaceSubmenus.ContainsKey(face)) - { - var target = m_FaceSubmenus[face].Last(); - m_FaceSubmenus[face].Remove(target); - target.SetActive(false); - ObjectUtils.Destroy(target, .1f); - - if (m_FaceSubmenus[face].Count > 1) - m_FaceSubmenus[face].Last().SetActive(true); - else - m_MenuFaces[index].Show(); - } - } - } + face.AddSubmenu(submenu.transform); - int FaceNameToIndex(string face) - { - var index = 0; - foreach (var faceButtons in m_FaceButtons) + var submenuFace = submenu.GetComponent(); + if (submenuFace) { - if (faceButtons.Key == face) - return index; - - index++; + submenuFace.SetupBackButton(() => { face.RemoveSubmenu(); }); + submenuFace.gradientPair = face.gradientPair; } - return -1; + return submenu; } - int GetClosestFaceIndexForRotation(float rotation) + static int GetClosestFaceIndexForRotation(float rotation) { - return Mathf.RoundToInt(rotation / k_FaceRotationSnapAngle) % faceCount; + return Mathf.RoundToInt(rotation / k_FaceRotationSnapAngle) % k_FaceCount; } - int GetActualFaceIndexForRotation(float rotation) + static int GetActualFaceIndexForRotation(float rotation) { - return Mathf.FloorToInt(rotation / k_FaceRotationSnapAngle) % faceCount; + return Mathf.FloorToInt(rotation / k_FaceRotationSnapAngle) % k_FaceCount; } static float GetRotationForFaceIndex(int faceIndex) @@ -429,14 +345,11 @@ IEnumerator SnapToFace(int faceIndex, float snapSpeed) IEnumerator AnimateShow() { - if (m_VisibilityCoroutine != null) - yield break; - m_VisibilityState = VisibilityState.TransitioningIn; - foreach (var face in m_MenuFaces) + foreach (var kvp in m_Faces) { - face.Show(); + kvp.Value.visible = true; } if (m_FrameRevealCoroutine != null) @@ -444,9 +357,11 @@ IEnumerator AnimateShow() m_FrameRevealCoroutine = StartCoroutine(AnimateFrameReveal(m_VisibilityState)); - for (int i = 0; i < m_MenuFaceContainers.Length; ++i) + const float faceDelay = 0.1f; + var count = 0; + foreach (var face in m_Faces) { - StartCoroutine(AnimateFaceReveal(i)); + face.Value.Reveal(count++ * faceDelay); } const float kTargetScale = 1f; @@ -475,20 +390,11 @@ IEnumerator AnimateHide() m_VisibilityState = VisibilityState.TransitioningOut; - foreach (var face in m_MenuFaces) + foreach (var kvp in m_Faces) { - face.Hide(); + kvp.Value.visible = false; } - foreach (var submenus in m_FaceSubmenus) - { - foreach (var submenu in submenus.Value) - { - ObjectUtils.Destroy(submenu); - } - } - m_FaceSubmenus.Clear(); - if (m_FrameRevealCoroutine != null) StopCoroutine(m_FrameRevealCoroutine); @@ -571,40 +477,6 @@ IEnumerator AnimateFrameReveal(VisibilityState visibilityState) m_FrameRevealCoroutine = null; } - IEnumerator AnimateFaceReveal(int faceIndex) - { - var targetScale = m_MenuFaceContentOriginalLocalScale; - var targetPosition = m_MenuFaceContentOriginalLocalPositions[faceIndex]; - var currentScale = m_MenuFaceContentHiddenLocalScale; // Custom initial scale - var currentPosition = m_MenuFaceContentOffsetLocalPositions[faceIndex]; // start the face in the cached original target position - var faceTransform = m_MenuFaceContentTransforms[faceIndex]; - - faceTransform.localScale = currentScale; - faceTransform.localPosition = currentPosition; - - const float kSmoothTime = 0.1f; - var currentDelay = 0f; - var delayTarget = 0.25f + (faceIndex * 0.1f); // delay duration before starting the face reveal - while (currentDelay < delayTarget) // delay the reveal of each face slightly more than the previous - { - currentDelay += Time.deltaTime; - yield return null; - } - - var smoothVelocity = Vector3.zero; - while (!Mathf.Approximately(currentScale.x, targetScale.x)) - { - currentScale = Vector3.SmoothDamp(currentScale, targetScale, ref smoothVelocity, kSmoothTime, Mathf.Infinity, Time.deltaTime); - currentPosition = Vector3.Lerp(currentPosition, targetPosition, Mathf.Pow(currentScale.x / targetScale.x, 2)); // lerp the position with extra emphasis on the beginning transition - faceTransform.localScale = currentScale; - faceTransform.localPosition = currentPosition; - yield return null; - } - - faceTransform.localScale = targetScale; - faceTransform.localPosition = targetPosition; - } - void OnButtonHover(Transform rayOrigin) { if (buttonHovered != null) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index a00caa6a0..f85cebb3b 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -63,7 +63,7 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) foreach (var kvp in m_MainMenus) { if (rayOrigin == null || kvp.Key == rayOrigin) - settingsMenuProvider.settingsMenuInstance = kvp.Value.GetSettingsMenuInstance(obj.GetType()); + kvp.Value.AddSettingsMenu(settingsMenuProvider); } } @@ -71,9 +71,11 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) if (settingsMenuItemProvider != null) { m_SettingsMenuItemProviders[new KeyValuePair(obj.GetType(), rayOrigin)] = settingsMenuItemProvider; - IMainMenu menu; - if (m_MainMenus.TryGetValue(rayOrigin, out menu)) - settingsMenuItemProvider.settingsMenuItemInstance = menu.GetSettingsMenuItemInstance(obj.GetType()); + foreach (var kvp in m_MainMenus) + { + if (rayOrigin == null || kvp.Key == rayOrigin) + kvp.Value.AddSettingsMenuItem(settingsMenuItemProvider); + } } var mainMenu = obj as IMainMenu; diff --git a/Scripts/Interfaces/Capability/ISettingsMenuProvider.cs b/Scripts/Interfaces/Capability/ISettingsMenuProvider.cs index ce701ebf7..11597a0c9 100644 --- a/Scripts/Interfaces/Capability/ISettingsMenuProvider.cs +++ b/Scripts/Interfaces/Capability/ISettingsMenuProvider.cs @@ -15,6 +15,7 @@ public interface ISettingsMenuProvider /// /// An instance of the menu face prefab that was added to the menu + /// May be null if settings menu could not be added to menu /// GameObject settingsMenuInstance { set; } @@ -24,4 +25,4 @@ public interface ISettingsMenuProvider Transform rayOrigin { get; } } } -#endif \ No newline at end of file +#endif diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index 6f6b489e0..a67acc000 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -41,18 +41,28 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool bool focus { get; } /// - /// Get this menu's settings menu for a given type + /// Add a settings menu to this menu /// - /// The type for which we want to get a settings menu - /// - GameObject GetSettingsMenuInstance(Type providerType); + /// The object providing the settings menu + void AddSettingsMenu(ISettingsMenuProvider provider); /// - /// Get this menu's settings menu item for a given type + /// Remove a settings menu from this menu /// - /// The type for which we want to get a settings menu item - /// - GameObject GetSettingsMenuItemInstance(Type providerType); + /// The object which provided the settings menu + void RemoveSettingsMenu(ISettingsMenuProvider provider); + + /// + /// Add a settings menu to this menu item + /// + /// The object providing the settings menu item + void AddSettingsMenuItem(ISettingsMenuItemProvider provider); + + /// + /// Remove a settings menu from this menu item + /// + /// The object which provided the settings menu item + void RemoveSettingsMenuItem(ISettingsMenuItemProvider provider); } } #endif diff --git a/Scripts/Interfaces/ISettingsMenuItemProvider.cs b/Scripts/Interfaces/ISettingsMenuItemProvider.cs index 34941d999..b42fd5538 100644 --- a/Scripts/Interfaces/ISettingsMenuItemProvider.cs +++ b/Scripts/Interfaces/ISettingsMenuItemProvider.cs @@ -15,6 +15,7 @@ public interface ISettingsMenuItemProvider /// /// An instance of the menu face prefab that was added to the menu + /// May be null if menu item could not be added to menu /// GameObject settingsMenuItemInstance { set; } @@ -25,4 +26,4 @@ public interface ISettingsMenuItemProvider Transform rayOrigin { get; } } } -#endif \ No newline at end of file +#endif diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 560889adf..4ba3aeaef 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -19,7 +19,7 @@ [MainMenuItem("Annotation", "Create", "Draw in 3D")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IRayVisibilitySettings, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale, IUsesSpatialHash, - IIsHoveringOverUI, IMultiDeviceTool, IUsesProxyType, ISettingsMenuItemProvider, ISerializePreferences + IIsHoveringOverUI, IMultiDeviceTool, IUsesProxyType, ISettingsMenuItemProvider, ISerializePreferences, ILinkedObject { [Serializable] class Preferences @@ -30,8 +30,12 @@ class Preferences [SerializeField] Color m_AnnotationColor = Color.white; + [SerializeField] + float m_BrushSize = MinBrushSize; + public bool meshGroupingMode { get { return m_MeshGroupingMode; } set { m_MeshGroupingMode = value; } } public Color annotationColor { get { return m_AnnotationColor; } set { m_AnnotationColor = value; } } + public float brushSize { get { return m_BrushSize; } set { m_BrushSize = value; } } } public const float TipDistance = 0.05f; @@ -82,7 +86,9 @@ class Preferences GameObject m_ColorPickerActivator; - float m_BrushSize = MinBrushSize; + Toggle m_TransformToggle; + Toggle m_MeshToggle; + bool m_BlockValueChangedListener; public bool primary { private get; set; } public Type proxyType { private get; set; } @@ -94,6 +100,8 @@ class Preferences public ActionMap actionMap { get { return m_ActionMap; } } + public List linkedObjects { private get; set; } + public GameObject settingsMenuItemPrefab { get { return m_SettingsMenuItemPrefab; } } public GameObject settingsMenuItemInstance { @@ -104,12 +112,33 @@ public GameObject settingsMenuItemInstance { if (toggle == defaultToggleGroup.defaultToggle) { + m_TransformToggle = toggle; toggle.onValueChanged.AddListener(isOn => { + if (m_BlockValueChangedListener) + return; + // m_Preferences on all instances refer m_Preferences.meshGroupingMode = !isOn; + foreach (var linkedObject in linkedObjects) + { + var locomotionTool = (AnnotationTool)linkedObject; + if (locomotionTool != this) + { + locomotionTool.m_BlockValueChangedListener = true; + //linkedObject.m_ToggleGroup.NotifyToggleOn(isOn ? m_FlyToggle : m_BlinkToggle); + // HACK: Toggle Group claims these toggles are not a part of the group + locomotionTool.m_TransformToggle.isOn = isOn; + locomotionTool.m_MeshToggle.isOn = !isOn; + locomotionTool.m_BlockValueChangedListener = false; + } + } }); } + else + { + m_MeshToggle = toggle; + } } } } @@ -190,10 +219,11 @@ void CheckBrushSizeUI() trans.localRotation = Quaternion.Euler(-90, 0, 0); trans.localScale = scale; - m_BrushSizeUI.onValueChanged = (val) => + m_BrushSizeUI.onValueChanged = (val) => { - m_BrushSize = Mathf.Lerp(MinBrushSize, MaxBrushSize, val); - m_AnnotationPointer.Resize(m_BrushSize); + var brushSize = Mathf.Lerp(MinBrushSize, MaxBrushSize, val); + m_Preferences.brushSize = brushSize; + m_AnnotationPointer.Resize(brushSize); }; onBrushSizeChanged = m_BrushSizeUI.ChangeSliderValue; } @@ -231,23 +261,25 @@ void HandleBrushSize(float value) { if (m_AnnotationPointer != null) { + var brushSize = m_Preferences.brushSize; if (VRSettings.loadedDeviceName == "OpenVR") // For vive controllers, use 1:1 touchpad setting. { - m_BrushSize = Mathf.Lerp(MinBrushSize, MaxBrushSize, (value + 1) / 2f); + brushSize = Mathf.Lerp(MinBrushSize, MaxBrushSize, (value + 1) / 2f); } else // For touch and hydra, let the thumbstick gradually modify the width. { - m_BrushSize += value * Time.unscaledDeltaTime * .1f; - m_BrushSize = Mathf.Clamp(m_BrushSize, MinBrushSize, MaxBrushSize); + brushSize += value * Time.unscaledDeltaTime * .1f; + brushSize = Mathf.Clamp(brushSize, MinBrushSize, MaxBrushSize); } if (m_BrushSizeUI && onBrushSizeChanged != null) { - var ratio = Mathf.InverseLerp(MinBrushSize, MaxBrushSize, m_BrushSize); + var ratio = Mathf.InverseLerp(MinBrushSize, MaxBrushSize, brushSize); onBrushSizeChanged(ratio); } - m_AnnotationPointer.Resize(m_BrushSize); + m_AnnotationPointer.Resize(brushSize); + m_Preferences.brushSize = brushSize; } } @@ -338,7 +370,7 @@ void UpdateAnnotation() m_Length += distance; } - var brushSize = m_BrushSize * viewerScale; + var brushSize = m_Preferences.brushSize * viewerScale; InterpolatePointsIfNeeded(localPoint, upVector, brushSize); m_Points.Add(localPoint); @@ -686,17 +718,37 @@ void CombineGroups() public object OnSerializePreferences() { - if (primary) + if (this.IsSharedUpdater(this)) + { + // Share one preferences object across all instances + foreach (var linkedObject in linkedObjects) + { + ((AnnotationTool)linkedObject).m_Preferences = m_Preferences; + } + return m_Preferences; + } return null; } public void OnDeserializePreferences(object obj) { + if (this.IsSharedUpdater(this)) + { var preferences = obj as Preferences; if (preferences != null) m_Preferences = preferences; + + // Share one preferences object across all instances + foreach (var linkedObject in linkedObjects) + { + ((AnnotationTool)linkedObject).m_Preferences = m_Preferences; + //Setting toggles on this tool's menu will set them on other tool menus + m_MeshToggle.isOn = m_Preferences.meshGroupingMode; + m_TransformToggle.isOn = !m_Preferences.meshGroupingMode; + } + } } } #endif diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index b0c37a83d..84d36f587 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -593,20 +593,21 @@ public object OnSerializePreferences() public void OnDeserializePreferences(object obj) { - //if (this.IsSharedUpdater(this)) - //{ - // var preferences = obj as Preferences; - // if (preferences != null) - // m_Preferences = preferences; - - // // Share one preferences object across all instances - // foreach (var linkedObject in linkedObjects) - // { - // ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; - // m_BlinkToggle.isOn = m_Preferences.blinkMode; - // m_FlyToggle.isOn = !m_Preferences.blinkMode; - // } - //} + if (this.IsSharedUpdater(this)) + { + var preferences = obj as Preferences; + if (preferences != null) + m_Preferences = preferences; + + // Share one preferences object across all instances + foreach (var linkedObject in linkedObjects) + { + ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; + //Setting toggles on this tool's menu will set them on other tool menus + m_BlinkToggle.isOn = m_Preferences.blinkMode; + m_FlyToggle.isOn = !m_Preferences.blinkMode; + } + } } } } From 07f9032f8141ccf6d1e10de99a657dc6f198962b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 14 Sep 2017 15:58:30 -0700 Subject: [PATCH 838/870] Finish implementing add/remove of SettingsMenu/Items --- Menus/MainMenu/MainMenu.cs | 26 ++++++++++++++++++++++++-- Menus/MainMenu/Scripts/MainMenuFace.cs | 7 ++----- Menus/MainMenu/Scripts/MainMenuUI.cs | 22 +++------------------- Scripts/Core/EditorVR.Menus.cs | 16 ++++++++++++++++ Scripts/Core/EditorVR.Tools.cs | 8 ++++---- Tools/AnnotationTool/AnnotationTool.cs | 19 +++++++++++++------ Tools/LocomotionTool/LocomotionTool.cs | 7 +++++++ 7 files changed, 69 insertions(+), 36 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 23d79b18b..6f3146444 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -43,6 +43,8 @@ sealed class MainMenu : MonoBehaviour, IMainMenu, IConnectInterfaces, IInstantia float m_LastRotationInput; MenuHideFlags m_MenuHideFlags = MenuHideFlags.Hidden; readonly Dictionary m_ToolButtons = new Dictionary(); + readonly Dictionary m_SettingsMenus = new Dictionary(); + readonly Dictionary m_SettingsMenuItems = new Dictionary(); public List menuTools { private get; set; } public List menuWorkspaces { private get; set; } @@ -302,23 +304,43 @@ void AddSettingsMenu(ISettingsMenuProvider provider, MainMenuUI.ButtonData butto CreateFaceButton(buttonData, tooltip, () => { - provider.settingsMenuInstance = m_MainMenuUI.AddSubmenu(k_SettingsMenuSectionName, provider.settingsMenuPrefab); + var instance = m_MainMenuUI.AddSubmenu(k_SettingsMenuSectionName, provider.settingsMenuPrefab); + m_SettingsMenus[provider] = instance; + provider.settingsMenuInstance = instance; }); } public void RemoveSettingsMenu(ISettingsMenuProvider provider) { + GameObject instance; + if (m_SettingsMenus.TryGetValue(provider, out instance)) + { + if (instance) + ObjectUtils.Destroy(instance); + m_SettingsMenus.Remove(provider); + } + provider.settingsMenuInstance = null; } public void AddSettingsMenuItem(ISettingsMenuItemProvider provider) { - provider.settingsMenuItemInstance = m_MainMenuUI.CreateCustomButton(provider.settingsMenuItemPrefab, k_SettingsMenuSectionName); + var instance = m_MainMenuUI.CreateCustomButton(provider.settingsMenuItemPrefab, k_SettingsMenuSectionName); + m_SettingsMenuItems[provider] = instance; + provider.settingsMenuItemInstance = instance; } public void RemoveSettingsMenuItem(ISettingsMenuItemProvider provider) { + GameObject instance; + if (m_SettingsMenuItems.TryGetValue(provider, out instance)) + { + if (instance) + ObjectUtils.Destroy(instance); + m_SettingsMenuItems.Remove(provider); + } + provider.settingsMenuItemInstance = null; } } } diff --git a/Menus/MainMenu/Scripts/MainMenuFace.cs b/Menus/MainMenu/Scripts/MainMenuFace.cs index 8c98fbdfd..17a80d4a5 100644 --- a/Menus/MainMenu/Scripts/MainMenuFace.cs +++ b/Menus/MainMenu/Scripts/MainMenuFace.cs @@ -77,7 +77,6 @@ void Awake() m_BorderOutlineMaterial = MaterialUtils.GetMaterialClone(m_BorderOutline); m_BorderOutlineTransform = m_BorderOutline.transform; m_BorderOutlineOriginalLocalScale = m_BorderOutlineTransform.localScale; - m_FaceTitle.text = "Not Set"; m_TitleIconMaterial = MaterialUtils.GetMaterialClone(m_TitleIcon); m_OriginalLocalScale = transform.localScale; @@ -101,8 +100,8 @@ public void Reveal(float delay = 0f) IEnumerator AnimateVisibility(bool show) { - if (m_VisibilityCoroutine != null) - yield break; + if (show) + m_BorderOutlineTransform.localScale = m_BorderOutlineOriginalLocalScale; m_CanvasGroup.interactable = false; @@ -125,8 +124,6 @@ IEnumerator AnimateVisibility(bool show) m_CanvasGroup.interactable = true; else m_TitleIcon.SetBlendShapeWeight(0, 0); - - m_VisibilityCoroutine = null; } IEnumerator AnimateReveal(float delay = 0f) diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 212afbb8f..91b29b2a5 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -2,9 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Helpers; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; @@ -92,6 +90,7 @@ public int targetFaceIndex // Loop around both ways if (value < 0) value += k_FaceCount; + m_TargetFaceIndex = value % k_FaceCount; } } @@ -352,10 +351,7 @@ IEnumerator AnimateShow() kvp.Value.visible = true; } - if (m_FrameRevealCoroutine != null) - StopCoroutine(m_FrameRevealCoroutine); - - m_FrameRevealCoroutine = StartCoroutine(AnimateFrameReveal(m_VisibilityState)); + this.RestartCoroutine(ref m_FrameRevealCoroutine, AnimateFrameReveal(m_VisibilityState)); const float faceDelay = 0.1f; var count = 0; @@ -379,15 +375,10 @@ IEnumerator AnimateShow() } m_VisibilityState = VisibilityState.Visible; - - m_VisibilityCoroutine = null; } IEnumerator AnimateHide() { - if (m_VisibilityCoroutine != null) - yield break; - m_VisibilityState = VisibilityState.TransitioningOut; foreach (var kvp in m_Faces) @@ -395,10 +386,7 @@ IEnumerator AnimateHide() kvp.Value.visible = false; } - if (m_FrameRevealCoroutine != null) - StopCoroutine(m_FrameRevealCoroutine); - - m_FrameRevealCoroutine = StartCoroutine(AnimateFrameReveal(m_VisibilityState)); + this.RestartCoroutine(ref m_FrameRevealCoroutine, AnimateFrameReveal(m_VisibilityState)); const float kTargetScale = 0f; const float kSmoothTime = 0.06875f; @@ -421,8 +409,6 @@ IEnumerator AnimateHide() var snapRotation = GetRotationForFaceIndex(GetClosestFaceIndexForRotation(currentRotation)); m_MenuFaceRotationOrigin.localRotation = Quaternion.Euler(new Vector3(0, snapRotation, 0)); // set intended target rotation m_RotationState = RotationState.AtRest; - - m_VisibilityCoroutine = null; } IEnumerator AnimateFrameRotationShapeChange(RotationState rotationState) @@ -473,8 +459,6 @@ IEnumerator AnimateFrameReveal(VisibilityState visibilityState) if (m_VisibilityState == VisibilityState.Hidden) m_MenuFrameRenderer.SetBlendShapeWeight(0, 0); - - m_FrameRevealCoroutine = null; } void OnButtonHover(Transform rayOrigin) diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index f85cebb3b..a73fbec70 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -107,11 +107,27 @@ public void DisconnectInterface(object obj, Transform rayOrigin = null) { var settingsMenuProvider = obj as ISettingsMenuProvider; if (settingsMenuProvider != null) + { + foreach (var kvp in m_MainMenus) + { + if (rayOrigin == null || kvp.Key == rayOrigin) + kvp.Value.RemoveSettingsMenu(settingsMenuProvider); + } + m_SettingsMenuProviders.Remove(new KeyValuePair(obj.GetType(), rayOrigin)); + } var settingsMenuItemProvider = obj as ISettingsMenuItemProvider; if (settingsMenuItemProvider != null) + { + foreach (var kvp in m_MainMenus) + { + if (rayOrigin == null || kvp.Key == rayOrigin) + kvp.Value.RemoveSettingsMenuItem(settingsMenuItemProvider); + } + m_SettingsMenuItemProviders.Remove(new KeyValuePair(obj.GetType(), rayOrigin)); + } var mainMenu = obj as IMainMenu; if (mainMenu != null) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index f22396b22..8580ae568 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -289,7 +289,7 @@ static void DespawnTool(DeviceData deviceData, ITool tool) { if (otherDeviceData != deviceData) { - // Pop this tool of any other stack that references it (for single instance tools) + // Pop this tool of any other stack that references it (for single instance, multi-device tools) var otherTool = otherDeviceData.currentTool; if (otherTool == tool) { @@ -302,7 +302,7 @@ static void DespawnTool(DeviceData deviceData, ITool tool) SetToolsEnabled(otherDeviceData, true); } - // Pop this tool of any other stack that references it (for MultiDeviceTools) + // Pop this tool of any other stack that references it (for IMultiDeviceTools) if (tool is IMultiDeviceTool) { if (otherTool.GetType() == toolType) @@ -312,8 +312,8 @@ static void DespawnTool(DeviceData deviceData, ITool tool) if (otherToolData != null) { otherDeviceData.currentTool = otherToolData.tool; - evr.m_Interfaces.DisconnectInterfaces(otherTool, deviceData.rayOrigin); - ObjectUtils.Destroy(tool as MonoBehaviour); + evr.m_Interfaces.DisconnectInterfaces(otherTool, otherDeviceData.rayOrigin); + ObjectUtils.Destroy(otherTool as MonoBehaviour); } } } diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 4ba3aeaef..c01ee2709 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -107,6 +107,13 @@ public GameObject settingsMenuItemInstance { set { + if (value == null) + { + m_TransformToggle = null; + m_MeshToggle = null; + return; + } + var defaultToggleGroup = value.GetComponentInChildren(); foreach (var toggle in value.GetComponentsInChildren()) { @@ -122,15 +129,15 @@ public GameObject settingsMenuItemInstance m_Preferences.meshGroupingMode = !isOn; foreach (var linkedObject in linkedObjects) { - var locomotionTool = (AnnotationTool)linkedObject; - if (locomotionTool != this) + var annotationTool = (AnnotationTool)linkedObject; + if (annotationTool != this) { - locomotionTool.m_BlockValueChangedListener = true; + annotationTool.m_BlockValueChangedListener = true; //linkedObject.m_ToggleGroup.NotifyToggleOn(isOn ? m_FlyToggle : m_BlinkToggle); // HACK: Toggle Group claims these toggles are not a part of the group - locomotionTool.m_TransformToggle.isOn = isOn; - locomotionTool.m_MeshToggle.isOn = !isOn; - locomotionTool.m_BlockValueChangedListener = false; + annotationTool.m_TransformToggle.isOn = isOn; + annotationTool.m_MeshToggle.isOn = !isOn; + annotationTool.m_BlockValueChangedListener = false; } } }); diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 84d36f587..25dd6be69 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -113,6 +113,13 @@ public GameObject settingsMenuItemInstance { set { + if (value == null) + { + m_FlyToggle = null; + m_BlinkToggle = null; + return; + } + var defaultToggleGroup = value.GetComponentInChildren(); foreach (var toggle in value.GetComponentsInChildren()) { From 2904a3c301d5435909ca6981fa0ec934aeac6e0f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 14 Sep 2017 16:39:42 -0700 Subject: [PATCH 839/870] Don't add rayOrigin to m_HoverSources if the cone is hidden for that rayOrigin; this prevents interaction with the manipulators when the rayOrigin cone is hidden (during a grab locomotion action, etc). --- Scripts/Handles/BaseHandle.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Scripts/Handles/BaseHandle.cs b/Scripts/Handles/BaseHandle.cs index 1614c5679..99c3d2c46 100644 --- a/Scripts/Handles/BaseHandle.cs +++ b/Scripts/Handles/BaseHandle.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Handles /// Base class for providing draggable handles in 3D (requires PhysicsRaycaster) /// class BaseHandle : MonoBehaviour, ISelectionFlags, IRayBeginDragHandler, IRayDragHandler, IRayEndDragHandler, - IRayEnterHandler, IRayExitHandler, IRayHoverHandler, IPointerClickHandler, IDropReceiver, IDroppable + IRayEnterHandler, IRayExitHandler, IRayHoverHandler, IGetRayVisibility, IPointerClickHandler, IDropReceiver, IDroppable { protected const int k_DefaultCapacity = 2; // i.e. 2 controllers @@ -106,6 +106,9 @@ public void OnBeginDrag(RayEventData eventData) return; var rayOrigin = eventData.rayOrigin; + if (!this.IsConeVisible(rayOrigin)) + return; + m_DragSources.Add(rayOrigin); startDragPositions[rayOrigin] = eventData.pointerCurrentRaycast.worldPosition; @@ -141,7 +144,11 @@ public void OnRayEnter(RayEventData eventData) if (!UIUtils.IsValidEvent(eventData, selectionFlags)) return; - m_HoverSources.Add(eventData.rayOrigin); + var rayOrigin = eventData.rayOrigin; + if (!this.IsConeVisible(rayOrigin)) + return; + + m_HoverSources.Add(rayOrigin); OnHandleHoverStarted(GetHandleEventData(eventData)); } From b7c004d89dea1d0eaa5a6ecdfd55bdabe937fe0d Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 14 Sep 2017 17:12:17 -0700 Subject: [PATCH 840/870] Verify that ray and cone are visible before adding rayOrigin to drag or hover sources --- Scripts/Handles/BaseHandle.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Handles/BaseHandle.cs b/Scripts/Handles/BaseHandle.cs index 99c3d2c46..7f611a4e7 100644 --- a/Scripts/Handles/BaseHandle.cs +++ b/Scripts/Handles/BaseHandle.cs @@ -106,7 +106,7 @@ public void OnBeginDrag(RayEventData eventData) return; var rayOrigin = eventData.rayOrigin; - if (!this.IsConeVisible(rayOrigin)) + if (!this.IsConeVisible(rayOrigin) || !this.IsRayVisible(rayOrigin)) return; m_DragSources.Add(rayOrigin); @@ -145,7 +145,7 @@ public void OnRayEnter(RayEventData eventData) return; var rayOrigin = eventData.rayOrigin; - if (!this.IsConeVisible(rayOrigin)) + if (!this.IsConeVisible(rayOrigin) || !this.IsRayVisible(rayOrigin)) return; m_HoverSources.Add(rayOrigin); From e3ac51611ff1dc860ef945dc3dfc4131930890bf Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 15 Sep 2017 16:52:00 -0700 Subject: [PATCH 841/870] WIP getting SerializePreferences to work on tools that are spawned/despawned at runtime --- .../Modules/SerializedPreferencesModule.cs | 26 ++++++++--- Tools/AnnotationTool/AnnotationTool.cs | 46 ++++++++++++------- 2 files changed, 50 insertions(+), 22 deletions(-) diff --git a/Scripts/Modules/SerializedPreferencesModule.cs b/Scripts/Modules/SerializedPreferencesModule.cs index 91d06b6cd..42bfee2c4 100644 --- a/Scripts/Modules/SerializedPreferencesModule.cs +++ b/Scripts/Modules/SerializedPreferencesModule.cs @@ -62,14 +62,23 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) { var serializer = obj as ISerializePreferences; if (serializer != null) + { + if (m_Preferences != null) + Deserialize(serializer); + m_Serializers.Add(serializer); + } } public void DisconnectInterface(object obj, Transform rayOrigin = null) { var serializer = obj as ISerializePreferences; if (serializer != null) + { + // TODO: Support serializing one type at a time + SerializePreferences(); m_Serializers.Remove(serializer); + } } internal void DeserializePreferences(string serializedPreferences) @@ -81,12 +90,7 @@ internal void DeserializePreferences(string serializedPreferences) foreach (var serializer in m_Serializers) { - SerializedPreferenceItem item; - if (m_Preferences.items.TryGetValue(serializer.GetType(), out item)) - { - var payload = JsonUtility.FromJson(item.payload, Type.GetType(item.payloadType)); - serializer.OnDeserializePreferences(payload); - } + Deserialize(serializer); } } } @@ -120,6 +124,16 @@ internal string SerializePreferences() return JsonUtility.ToJson(m_Preferences); } + + void Deserialize(ISerializePreferences serializer) + { + SerializedPreferenceItem item; + if (m_Preferences.items.TryGetValue(serializer.GetType(), out item)) + { + var payload = JsonUtility.FromJson(item.payload, Type.GetType(item.payloadType)); + serializer.OnDeserializePreferences(payload); + } + } } } #endif diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index c01ee2709..4f4815d82 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -107,6 +107,7 @@ public GameObject settingsMenuItemInstance { set { + Debug.Log("set instance " + value + ", " + rayOrigin); if (value == null) { m_TransformToggle = null; @@ -173,8 +174,7 @@ void OnDestroy() void Start() { - if (m_Preferences == null) - m_Preferences = new Preferences(); + SetupPreferences(); this.AddRayVisibilitySettings(rayOrigin, this, false, false); @@ -212,6 +212,29 @@ void Start() } } + void SetupPreferences() + { + if (this.IsSharedUpdater(this)) + { + // Share one preferences object across all instances + foreach (var linkedObject in linkedObjects) + { + ((AnnotationTool)linkedObject).m_Preferences = m_Preferences; + } + + if (m_Preferences != null) + { + Debug.Log(m_Preferences.meshGroupingMode); + //Setting toggles on this tool's menu will set them on other tool menus + m_MeshToggle.isOn = m_Preferences.meshGroupingMode; + m_TransformToggle.isOn = !m_Preferences.meshGroupingMode; + } + } + + if (m_Preferences == null) + m_Preferences = new Preferences(); + } + void CheckBrushSizeUI() { if (m_BrushSizeUI == null) @@ -741,21 +764,12 @@ public object OnSerializePreferences() public void OnDeserializePreferences(object obj) { - if (this.IsSharedUpdater(this)) - { - var preferences = obj as Preferences; - if (preferences != null) - m_Preferences = preferences; + Debug.Log("Deserialize" + obj); + if (m_Preferences == null) + m_Preferences = (Preferences)obj; - // Share one preferences object across all instances - foreach (var linkedObject in linkedObjects) - { - ((AnnotationTool)linkedObject).m_Preferences = m_Preferences; - //Setting toggles on this tool's menu will set them on other tool menus - m_MeshToggle.isOn = m_Preferences.meshGroupingMode; - m_TransformToggle.isOn = !m_Preferences.meshGroupingMode; - } - } + if (m_Preferences != null) + Debug.Log(m_Preferences.meshGroupingMode); } } #endif From 9ea5851421be143d77545403c9d1703f63159896 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 15 Sep 2017 23:02:35 -0700 Subject: [PATCH 842/870] Finish mesh grouping changes; Misc fixes to Annotation tool; Fix ILinkedObjects to remove objects and lists as they are disconnected; Fix issue with color picker where edge selections would be transparent --- Scripts/Core/EditorVR.Tools.cs | 14 ++++ Tools/AnnotationTool/AnnotationTool.cs | 73 +++++++++++++------ .../UserInterface/ColorPickerUI.cs | 16 +++- 3 files changed, 78 insertions(+), 25 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 8580ae568..ecef42f40 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -54,6 +54,20 @@ public void ConnectInterface(object obj, Transform rayOrigin = null) public void DisconnectInterface(object obj, Transform rayOrigin = null) { + var linkedObject = obj as ILinkedObject; + if (linkedObject != null) + { + var type = obj.GetType(); + List linkedObjectList; + if (!m_LinkedObjects.TryGetValue(type, out linkedObjectList)) + return; + + linkedObjectList.Remove(linkedObject); + linkedObject.linkedObjects = null; + + if (linkedObjectList.Count == 0) + m_LinkedObjects.Remove(type); + } } bool IsSharedUpdater(ILinkedObject linkedObject) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 4f4815d82..b3b70901a 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -76,6 +76,7 @@ class Preferences ColorPickerUI m_ColorPicker; BrushSizeUI m_BrushSizeUI; + Transform m_AnnotationRoot; Transform m_AnnotationHolder; AnnotationPointer m_AnnotationPointer; @@ -107,7 +108,6 @@ public GameObject settingsMenuItemInstance { set { - Debug.Log("set instance " + value + ", " + rayOrigin); if (value == null) { m_TransformToggle = null; @@ -156,6 +156,8 @@ void OnDestroy() if (m_Preferences.meshGroupingMode) CombineGroups(); + CleanUpNames(); + if (rayOrigin) this.RemoveRayVisibilitySettings(rayOrigin, this); @@ -172,6 +174,22 @@ void OnDestroy() ObjectUtils.Destroy(m_AnnotationPointer.gameObject); } + void CleanUpNames() + { + if (m_AnnotationRoot == null) + return; + + var groupCount = 0; + var annotationCount = 0; + foreach (Transform child in m_AnnotationRoot) + { + if (child.childCount > 0) + child.name = "Group " + groupCount++; + else + child.name = "Annotation " + annotationCount++; + } + } + void Start() { SetupPreferences(); @@ -224,7 +242,6 @@ void SetupPreferences() if (m_Preferences != null) { - Debug.Log(m_Preferences.meshGroupingMode); //Setting toggles on this tool's menu will set them on other tool menus m_MeshToggle.isOn = m_Preferences.meshGroupingMode; m_TransformToggle.isOn = !m_Preferences.meshGroupingMode; @@ -344,17 +361,18 @@ void SetupAnnotation() void SetupHolder() { var mainHolder = GameObject.Find("Annotations") ?? new GameObject("Annotations"); - var mainHolderTrans = mainHolder.transform; + m_AnnotationRoot = mainHolder.transform; var newSession = GetNewSessionHolder(); if (!newSession) { - newSession = new GameObject("Group " + mainHolderTrans.childCount); + newSession = new GameObject("Group " + m_AnnotationRoot.childCount); + newSession.transform.position = GetPointerPosition(); m_Groups.Add(newSession); } m_AnnotationHolder = newSession.transform; - m_AnnotationHolder.SetParent(mainHolder.transform); + m_AnnotationHolder.SetParent(m_AnnotationRoot); } GameObject GetNewSessionHolder() @@ -386,7 +404,7 @@ void UpdateAnnotation() { var upVector = rayOrigin.up; var viewerScale = this.GetViewerScale(); - var worldPoint = rayOrigin.position + rayOrigin.forward * TipDistance * viewerScale; + var worldPoint = GetPointerPosition(); var localPoint = m_WorldToLocalMesh.MultiplyPoint3x4(worldPoint); if (m_Points.Count > 0) @@ -516,7 +534,7 @@ void FinalizeMesh() m_CurrentMesh.RecalculateBounds(); m_CurrentMesh.RecalculateNormals(); - m_CurrentMesh.UploadMeshData(true); + m_CurrentMesh.UploadMeshData(false); CenterHolder(); @@ -711,7 +729,6 @@ void CombineGroups() { foreach (var group in m_Groups) { - group.name = group.name.Replace("Group", "Annotation"); var meshFilters = group.GetComponentsInChildren(); var renderers = group.GetComponentsInChildren(); @@ -722,30 +739,48 @@ void CombineGroups() } var length = meshFilters.Length; - var combines = new CombineInstance[length]; - var materials = new Material[length]; + var combines = new List(length); + var materials = new List(length); for (var i = 0; i < length; i++) { - var combine = combines[i]; var meshFilter = meshFilters[i]; - combine.mesh = meshFilter.sharedMesh; - combine.transform = meshFilter.transform.localToWorldMatrix; - materials[i] = renderers[i].sharedMaterial; + var sharedMesh = meshFilter.sharedMesh; + if (sharedMesh && sharedMesh.vertexCount > 0) + { + var combine = new CombineInstance + { + mesh = sharedMesh, + transform = group.transform.worldToLocalMatrix * meshFilter.transform.localToWorldMatrix + }; + + sharedMesh.UploadMeshData(false); + combines.Add(combine); + materials.Add(renderers[i].sharedMaterial); + } } var mesh = new Mesh(); - mesh.CombineMeshes(combines, false, true); + mesh.CombineMeshes(combines.ToArray(), false, true); group.AddComponent().sharedMesh = mesh; - group.AddComponent().sharedMaterials = materials; + group.AddComponent().sharedMaterials = materials.ToArray(); + + this.AddToSpatialHash(group); foreach (var meshFilter in meshFilters) { - ObjectUtils.Destroy(meshFilter.gameObject); + var go = meshFilter.gameObject; + this.RemoveFromSpatialHash(go); + ObjectUtils.Destroy(go); } } } + Vector3 GetPointerPosition() + { + return rayOrigin.position + rayOrigin.forward * TipDistance * this.GetViewerScale(); + } + public object OnSerializePreferences() { if (this.IsSharedUpdater(this)) @@ -764,12 +799,8 @@ public object OnSerializePreferences() public void OnDeserializePreferences(object obj) { - Debug.Log("Deserialize" + obj); if (m_Preferences == null) m_Preferences = (Preferences)obj; - - if (m_Preferences != null) - Debug.Log(m_Preferences.meshGroupingMode); } } #endif diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index 5a9fced5c..d9343dbf4 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -160,10 +160,18 @@ Color GetColorForCurrentPosition() var rect = m_ColorPicker.rectTransform.rect; var dir = m_PickerTargetPosition; - var x = (dir.x + rect.width / 2f) / rect.width; - var y = (dir.y + rect.height / 2f) / rect.height; - var textureX = (int)(x * m_ColorPickerTexture.width); - var textureY = (int)(y * m_ColorPickerTexture.height); + dir.z = 0; + + // We want to avoid the edge of the image, which has feathered pixels + var maxMagnitude = rect.width * 0.495f; + if (dir.magnitude > maxMagnitude) + dir = Vector3.ClampMagnitude(dir, maxMagnitude); + + dir.x = (dir.x + rect.width * 0.5f) / rect.width; + dir.y = (dir.y + rect.height * 0.5f) / rect.height; + + var textureX = (int)(dir.x * m_ColorPickerTexture.width); + var textureY = (int)(dir.y * m_ColorPickerTexture.height); var col = m_ColorPickerTexture.GetPixel(textureX, textureY); return col; From 3635ae5f63bafee512d6ca01b7b456625fb5031c Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Fri, 15 Sep 2017 23:38:48 -0700 Subject: [PATCH 843/870] Update BrushSizeUI on start --- Tools/AnnotationTool/AnnotationTool.cs | 85 +++++++------- .../AnnotationTool/Prefabs/BrushSizeUI.prefab | 2 +- .../Prefabs/ColorPickerUI.prefab | 106 ++++++++---------- .../UserInterface/BrushSizeUI.cs | 6 +- 4 files changed, 92 insertions(+), 107 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index b3b70901a..6bf1d8ead 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -198,35 +198,32 @@ void Start() if (primary) { - m_AnnotationPointer = ObjectUtils.CreateGameObjectWithComponent(rayOrigin, false); - m_OriginalAnnotationPointerLocalScale = m_AnnotationPointer.transform.localScale; - CheckBrushSizeUI(); + SetupBrushUI(); + HandleBrushSize(m_Preferences.brushSize); - if (m_ColorPickerActivator == null) - { - m_ColorPickerActivator = this.InstantiateUI(m_ColorPickerActivatorPrefab); - var otherRayOrigin = otherRayOrigins.First(); - var otherAltMenu = this.GetCustomAlternateMenuOrigin(otherRayOrigin); + m_ColorPickerActivator = this.InstantiateUI(m_ColorPickerActivatorPrefab); + var otherRayOrigin = otherRayOrigins.First(); + var otherAltMenu = this.GetCustomAlternateMenuOrigin(otherRayOrigin); - m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); - m_ColorPickerActivator.transform.localRotation = Quaternion.identity; - m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; - m_ColorPickerActivator.transform.localScale = Vector3.one; + m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); + m_ColorPickerActivator.transform.localRotation = Quaternion.identity; + m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; + m_ColorPickerActivator.transform.localScale = Vector3.one; - var activator = m_ColorPickerActivator.GetComponentInChildren(); + var activator = m_ColorPickerActivator.GetComponentInChildren(); - m_ColorPicker = activator.GetComponentInChildren(true); - m_ColorPicker.onHideCalled = HideColorPicker; - m_ColorPicker.toolRayOrigin = rayOrigin; - m_ColorPicker.onColorPicked = OnColorPickerValueChanged; + m_ColorPicker = activator.GetComponentInChildren(true); + m_ColorPicker.onHideCalled = HideColorPicker; + m_ColorPicker.toolRayOrigin = rayOrigin; + m_ColorPicker.onColorPicked = OnColorPickerValueChanged; + OnColorPickerValueChanged(m_Preferences.annotationColor); - activator.rayOrigin = otherRayOrigin; - activator.showColorPicker = ShowColorPicker; - activator.hideColorPicker = HideColorPicker; + activator.rayOrigin = otherRayOrigin; + activator.showColorPicker = ShowColorPicker; + activator.hideColorPicker = HideColorPicker; - activator.undoButtonClick += Undo.PerformUndo; - activator.redoButtonClick += Undo.PerformRedo; - } + activator.undoButtonClick += Undo.PerformUndo; + activator.redoButtonClick += Undo.PerformRedo; } } @@ -252,28 +249,30 @@ void SetupPreferences() m_Preferences = new Preferences(); } - void CheckBrushSizeUI() + void SetupBrushUI() { - if (m_BrushSizeUI == null) + m_AnnotationPointer = ObjectUtils.CreateGameObjectWithComponent(rayOrigin, false); + m_OriginalAnnotationPointerLocalScale = m_AnnotationPointer.transform.localScale; + var brushSize = m_Preferences.brushSize; + m_AnnotationPointer.Resize(brushSize); + + var brushSizeUi = this.InstantiateUI(m_BrushSizePrefab); + m_BrushSizeUI = brushSizeUi.GetComponent(); + + var trans = brushSizeUi.transform; + var scale = brushSizeUi.transform.localScale; + trans.SetParent(alternateMenuOrigin, false); + trans.localPosition = Vector3.zero; + trans.localRotation = Quaternion.Euler(-90, 0, 0); + trans.localScale = scale; + + m_BrushSizeUI.onValueChanged = value => { - var brushSizeUi = this.InstantiateUI(m_BrushSizePrefab); - m_BrushSizeUI = brushSizeUi.GetComponent(); - - var trans = brushSizeUi.transform; - var scale = brushSizeUi.transform.localScale; - trans.SetParent(alternateMenuOrigin, false); - trans.localPosition = Vector3.zero; - trans.localRotation = Quaternion.Euler(-90, 0, 0); - trans.localScale = scale; - - m_BrushSizeUI.onValueChanged = (val) => - { - var brushSize = Mathf.Lerp(MinBrushSize, MaxBrushSize, val); - m_Preferences.brushSize = brushSize; - m_AnnotationPointer.Resize(brushSize); - }; - onBrushSizeChanged = m_BrushSizeUI.ChangeSliderValue; - } + var sliderValue = Mathf.Lerp(MinBrushSize, MaxBrushSize, value); + m_Preferences.brushSize = sliderValue; + m_AnnotationPointer.Resize(sliderValue); + }; + onBrushSizeChanged = m_BrushSizeUI.ChangeSliderValue; } void ShowColorPicker(Transform otherRayOrigin) diff --git a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab index 62b83e662..2acfcc611 100644 --- a/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab +++ b/Tools/AnnotationTool/Prefabs/BrushSizeUI.prefab @@ -622,7 +622,7 @@ RectTransform: m_GameObject: {fileID: 1000012251850158} m_LocalRotation: {x: 0.7071012, y: -0.000000029802322, z: -0.000000702632, w: 0.70711243} m_LocalPosition: {x: 0, y: 0, z: -0.03} - m_LocalScale: {x: 0.0001, y: 0.0001, z: 0.0001} + m_LocalScale: {x: 0.0001, y: 0.0001, z: 1} m_Children: - {fileID: 224000013958544464} - {fileID: 224000010282135770} diff --git a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab index c42be5980..e64b01236 100644 --- a/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab +++ b/Tools/AnnotationTool/Prefabs/ColorPickerUI.prefab @@ -16,10 +16,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013914949862} - - 65: {fileID: 65000013187502658} + - component: {fileID: 224000013914949862} + - component: {fileID: 65000013187502658} m_Layer: 5 m_Name: Collider m_TagString: Untagged @@ -32,11 +32,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013185230874} - - 222: {fileID: 222000010561662458} - - 114: {fileID: 114000012897558622} + - component: {fileID: 224000013185230874} + - component: {fileID: 222000010561662458} + - component: {fileID: 114000012897558622} m_Layer: 5 m_Name: Handle m_TagString: Untagged @@ -49,11 +49,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011175436320} - - 222: {fileID: 222000012511099340} - - 114: {fileID: 114000010107362308} + - component: {fileID: 224000011175436320} + - component: {fileID: 222000012511099340} + - component: {fileID: 114000010107362308} m_Layer: 5 m_Name: Background m_TagString: Untagged @@ -66,11 +66,11 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011329703258} - - 222: {fileID: 222000013522047514} - - 114: {fileID: 114000010921122496} + - component: {fileID: 224000011329703258} + - component: {fileID: 222000013522047514} + - component: {fileID: 114000010921122496} m_Layer: 5 m_Name: ColorPicker m_TagString: Untagged @@ -83,9 +83,9 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011490740336} + - component: {fileID: 224000011490740336} m_Layer: 5 m_Name: Handle Slide Area m_TagString: Untagged @@ -98,10 +98,10 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000011527980190} - - 114: {fileID: 114000012700991384} + - component: {fileID: 224000011527980190} + - component: {fileID: 114000012700991384} m_Layer: 5 m_Name: BrightnessSlider m_TagString: Untagged @@ -114,12 +114,12 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013645424882} - - 222: {fileID: 222000012581356688} - - 114: {fileID: 114000012154235052} - - 114: {fileID: 114000011102508162} + - component: {fileID: 224000013645424882} + - component: {fileID: 222000012581356688} + - component: {fileID: 114000012154235052} + - component: {fileID: 114000011102508162} m_Layer: 5 m_Name: Viewport m_TagString: Untagged @@ -132,11 +132,11 @@ GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000013852143400} - - 222: {fileID: 222000011226943598} - - 114: {fileID: 114000011520655588} + - component: {fileID: 224000013852143400} + - component: {fileID: 222000011226943598} + - component: {fileID: 114000011520655588} m_Layer: 5 m_Name: Picker m_TagString: Untagged @@ -149,14 +149,14 @@ GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - serializedVersion: 4 + serializedVersion: 5 m_Component: - - 224: {fileID: 224000010585279630} - - 223: {fileID: 223000011449390414} - - 114: {fileID: 114000012075775966} - - 114: {fileID: 114000010288221908} - - 114: {fileID: 114000013470492078} - - 225: {fileID: 225000011919119404} + - component: {fileID: 224000010585279630} + - component: {fileID: 223000011449390414} + - component: {fileID: 114000012075775966} + - component: {fileID: 114000010288221908} + - component: {fileID: 114000013470492078} + - component: {fileID: 225000011919119404} m_Layer: 5 m_Name: ColorPickerUI m_TagString: Untagged @@ -187,7 +187,6 @@ MonoBehaviour: m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 @@ -214,7 +213,6 @@ MonoBehaviour: m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_IgnoreReversedGraphics: 0 m_BlockingObjects: 0 m_BlockingMask: @@ -231,7 +229,6 @@ MonoBehaviour: m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Content: {fileID: 224000013852143400} m_Horizontal: 1 m_Vertical: 1 @@ -263,7 +260,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d26287cff9f94b448a1b36ffa9eccd4e, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Navigation: m_Mode: 3 m_SelectOnUp: {fileID: 0} @@ -300,7 +296,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 0 @@ -328,7 +323,6 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_UiScaleMode: 0 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 @@ -350,7 +344,6 @@ MonoBehaviour: m_Script: {fileID: -98529514, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 @@ -377,7 +370,6 @@ MonoBehaviour: m_Script: {fileID: -113659843, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Navigation: m_Mode: 3 m_SelectOnUp: {fileID: 0} @@ -437,7 +429,6 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 @@ -465,10 +456,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ab372430e8c50ee47b774cdb4ac79e18, type: 3} m_Name: m_EditorClassIdentifier: - m_RunInEditMode: 0 m_FadeTime: 0.25 m_ColorPicker: {fileID: 114000012154235052} - m_BrightnessSlider: {fileID: 114000012700991384} m_SliderBackground: {fileID: 114000010107362308} m_Picker: {fileID: 224000013852143400} m_ColorPickerSquare: {fileID: 114000011102508162} @@ -509,7 +498,7 @@ Canvas: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014053269536} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 2 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -518,6 +507,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -529,14 +519,14 @@ RectTransform: m_GameObject: {fileID: 1000014053269536} m_LocalRotation: {x: 0.6427876, y: 0, z: 0, w: 0.7660445} m_LocalPosition: {x: 0, y: 0, z: -0.03} - m_LocalScale: {x: 0.00024999998, y: 0.00025, z: 0.00025} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.00024999998, y: 0.00025, z: 1} m_Children: - {fileID: 224000011329703258} - {fileID: 224000011527980190} - {fileID: 224000013914949862} m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0.08, y: 0.0225} @@ -551,10 +541,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011527980190} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.25} m_AnchorMax: {x: 1, y: 0.75} m_AnchoredPosition: {x: 0, y: 0} @@ -569,11 +559,11 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013645424882} m_Father: {fileID: 224000010585279630} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -588,11 +578,11 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013185230874} m_Father: {fileID: 224000011527980190} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -607,12 +597,12 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000011175436320} - {fileID: 224000011490740336} m_Father: {fileID: 224000010585279630} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -627,10 +617,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000011490740336} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 4.1, y: 0} @@ -645,11 +635,11 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 224000013852143400} m_Father: {fileID: 224000011329703258} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} @@ -664,10 +654,10 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000013645424882} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: -256} @@ -682,10 +672,10 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 224000010585279630} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} diff --git a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs index d4915d38d..3bd265382 100644 --- a/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs +++ b/Tools/AnnotationTool/UserInterface/BrushSizeUI.cs @@ -24,6 +24,7 @@ void Awake() { // We record property modifications on creation and modification of these UI elements, which will look odd when undone Undo.postprocessModifications += PostProcessModifications; + m_SliderHandleImage = m_SliderHandle.GetComponent(); } UndoPropertyModification[] PostProcessModifications(UndoPropertyModification[] modifications) @@ -38,11 +39,6 @@ UndoPropertyModification[] PostProcessModifications(UndoPropertyModification[] m return modificationList.ToArray(); } - void Start() - { - m_SliderHandleImage = m_SliderHandle.GetComponent(); - } - public void OnSliderValueChanged(float value) { m_SliderHandle.localScale = Vector3.one * Mathf.Lerp(k_MinSize, k_MaxSize, value); From 62170e0697c7434e0089b2b2547ca887273cbcd2 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Sat, 16 Sep 2017 00:05:22 -0700 Subject: [PATCH 844/870] Clean up code --- Menus/MainMenu/Scripts/MainMenuUI.cs | 2 -- Tools/AnnotationTool/AnnotationTool.cs | 2 +- Tools/LocomotionTool/LocomotionTool.cs | 7 ++++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index 91b29b2a5..d1c76a22a 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -78,7 +78,6 @@ enum VisibilityState Coroutine m_VisibilityCoroutine; Coroutine m_FrameRevealCoroutine; int m_Direction; - public int targetFaceIndex { @@ -229,7 +228,6 @@ public MainMenuButton CreateFaceButton(ButtonData buttonData) return null; face.AddButton(button.transform); - return mainMenuButton; } diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 6bf1d8ead..69f5c02e1 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -419,7 +419,7 @@ void UpdateAnnotation() var brushSize = m_Preferences.brushSize * viewerScale; InterpolatePointsIfNeeded(localPoint, upVector, brushSize); - + m_Points.Add(localPoint); m_UpVectors.Add(upVector); m_Widths.Add(brushSize); diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 25dd6be69..1778c7aec 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -610,10 +610,11 @@ public void OnDeserializePreferences(object obj) foreach (var linkedObject in linkedObjects) { ((LocomotionTool)linkedObject).m_Preferences = m_Preferences; - //Setting toggles on this tool's menu will set them on other tool menus - m_BlinkToggle.isOn = m_Preferences.blinkMode; - m_FlyToggle.isOn = !m_Preferences.blinkMode; } + + //Setting toggles on this tool's menu will set them on other tool menus + m_BlinkToggle.isOn = m_Preferences.blinkMode; + m_FlyToggle.isOn = !m_Preferences.blinkMode; } } } From aae5c29e434b552c9f619f63ae052b30f84650e7 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 19 Sep 2017 14:19:20 -0700 Subject: [PATCH 845/870] Add IBlockUIInteraction interface; allows implementers to prevent/allow UI interaction for a given RayOrigin --- .../IBlockUIInteraction.cs | 29 +++++++++++++++++++ .../IBlockUIInteraction.cs.meta | 12 ++++++++ 2 files changed, 41 insertions(+) create mode 100644 Scripts/Interfaces/FunctionalityInjection/IBlockUIInteraction.cs create mode 100644 Scripts/Interfaces/FunctionalityInjection/IBlockUIInteraction.cs.meta diff --git a/Scripts/Interfaces/FunctionalityInjection/IBlockUIInteraction.cs b/Scripts/Interfaces/FunctionalityInjection/IBlockUIInteraction.cs new file mode 100644 index 000000000..20b22a0f6 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IBlockUIInteraction.cs @@ -0,0 +1,29 @@ +#if UNITY_EDITOR +using System; +using UnityEngine; + +namespace UnityEditor.Experimental.EditorVR +{ + /// + /// Provides functionality that allows all UI interaction to be negated for a given rayOrigin + /// + public interface IBlockUIInteraction + { + } + + public static class IBlockUIInteractionMethods + { + internal static Action setUIBlockedForRayOrigin { get; set; } + + /// + /// Prevent UI interaction for a given rayOrigin + /// + /// The rayOrigin that is being checked + /// If true, UI interaction will be blocked for the rayOrigin. If false, the ray origin will be removed from the blocked collection. + public static void SetUIBlockedForRayOrigin(this IBlockUIInteraction obj, Transform rayOrigin, bool blocked) + { + setUIBlockedForRayOrigin(rayOrigin, blocked); + } + } +} +#endif diff --git a/Scripts/Interfaces/FunctionalityInjection/IBlockUIInteraction.cs.meta b/Scripts/Interfaces/FunctionalityInjection/IBlockUIInteraction.cs.meta new file mode 100644 index 000000000..027466726 --- /dev/null +++ b/Scripts/Interfaces/FunctionalityInjection/IBlockUIInteraction.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fead67c3812306d47b36c911399269d6 +timeCreated: 1489789739 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 2495e68dce3cb2c32a4f1cb3bbae006a2fd02a83 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 19 Sep 2017 14:37:47 -0700 Subject: [PATCH 846/870] Refactor previous input fix to support new IBlockUIInteraction implementation instead --- Scripts/Core/EditorVR.Rays.cs | 15 +++++++++++++++ Scripts/Handles/BaseHandle.cs | 9 +-------- Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs | 2 +- Tools/LocomotionTool/LocomotionTool.cs | 4 +++- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 94a86c5f5..bf3bc661e 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -27,6 +27,7 @@ class Rays : Nested, IInterfaceConnector internal Dictionary defaultRays { get { return m_DefaultRays; } } readonly Dictionary m_DefaultRays = new Dictionary(); + static readonly List m_BlockedUIRayOrigins = new List(); readonly List m_Proxies = new List(); StandardManipulator m_StandardManipulator; @@ -49,6 +50,7 @@ public Rays() IRayToNodeMethods.requestNodeFromRayOrigin = RequestNodeFromRayOrigin; IGetRayVisibilityMethods.isRayVisible = IsRayActive; IGetRayVisibilityMethods.isConeVisible = IsConeActive; + IBlockUIInteractionMethods.setUIBlockedForRayOrigin = SetUIBlockedForRayOrigin; } internal override void OnDestroy() @@ -204,6 +206,10 @@ void OnProxyActiveChanged(IProxy proxy) // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => { + // Proceed only for raycast sources that haven't been blocked via IBlockUIInteraction + if (m_BlockedUIRayOrigins.Contains(rayOrigin)) + return false; + // Do not invalidate UI raycasts in the middle of a drag operation if (!source.draggedObject) { @@ -508,6 +514,15 @@ static Color GetDefaultRayColor(Transform rayOrigin) var highlightModule = evr.GetModule(); return highlightModule.highlightColor; } + + static void SetUIBlockedForRayOrigin(Transform rayOrigin, bool blocked) + { + var rayOriginCurrentlyBlocked = m_BlockedUIRayOrigins.Contains(rayOrigin); + if (blocked && !rayOriginCurrentlyBlocked) + m_BlockedUIRayOrigins.Add(rayOrigin); + else if (!blocked && rayOriginCurrentlyBlocked) + m_BlockedUIRayOrigins.Remove(rayOrigin); + } } } } diff --git a/Scripts/Handles/BaseHandle.cs b/Scripts/Handles/BaseHandle.cs index 7f611a4e7..610ad953b 100644 --- a/Scripts/Handles/BaseHandle.cs +++ b/Scripts/Handles/BaseHandle.cs @@ -106,9 +106,6 @@ public void OnBeginDrag(RayEventData eventData) return; var rayOrigin = eventData.rayOrigin; - if (!this.IsConeVisible(rayOrigin) || !this.IsRayVisible(rayOrigin)) - return; - m_DragSources.Add(rayOrigin); startDragPositions[rayOrigin] = eventData.pointerCurrentRaycast.worldPosition; @@ -144,11 +141,7 @@ public void OnRayEnter(RayEventData eventData) if (!UIUtils.IsValidEvent(eventData, selectionFlags)) return; - var rayOrigin = eventData.rayOrigin; - if (!this.IsConeVisible(rayOrigin) || !this.IsRayVisible(rayOrigin)) - return; - - m_HoverSources.Add(rayOrigin); + m_HoverSources.Add(eventData.rayOrigin); OnHandleHoverStarted(GetHandleEventData(eventData)); } diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs index c8ea7e7e3..5b1b6b399 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveMenu.cs @@ -18,7 +18,7 @@ sealed class CreatePrimitiveMenu : MonoBehaviour, IMenu public MenuHideFlags menuHideFlags { - get { return gameObject.activeSelf ? MenuHideFlags.Hidden : 0; } + get { return gameObject.activeSelf ? 0 : MenuHideFlags.Hidden; } set { gameObject.SetActive(value == 0); } } diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index cf60ca5b9..3362680da 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Tools { sealed class LocomotionTool : MonoBehaviour, ITool, ILocomotor, IUsesRayOrigin, IRayVisibilitySettings, ICustomActionMap, ILinkedObject, IUsesViewerScale, ISettingsMenuItemProvider, ISerializePreferences, - IUsesProxyType, IGetVRPlayerObjects + IUsesProxyType, IGetVRPlayerObjects, IBlockUIInteraction { const float k_FastMoveSpeed = 20f; const float k_SlowMoveSpeed = 1f; @@ -307,6 +307,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_StartCrawling = true; m_ActualRayOriginStartPosition = m_RayOriginStartPosition; m_CrawlStartTime = Time.time; + this.SetUIBlockedForRayOrigin(rayOrigin, true); } var localRayPosition = cameraRig.position - rayOrigin.position; @@ -327,6 +328,7 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) return true; } + this.SetUIBlockedForRayOrigin(rayOrigin, false); this.RemoveRayVisibilitySettings(rayOrigin, this); m_StartCrawling = false; From 1f8541a6b1ec5649b54a094b92a6211fd5c2487f Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Tue, 19 Sep 2017 16:04:25 -0700 Subject: [PATCH 847/870] Add UI blocking support for all locomotion modes in the Locomotion tool. --- Tools/LocomotionTool/LocomotionTool.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 3362680da..88ae7473d 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -189,6 +189,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon { m_LocomotionInput = (LocomotionInput)input; + this.SetUIBlockedForRayOrigin(rayOrigin, true); + if (DoTwoHandedScaling(consumeControl)) return; @@ -206,7 +208,10 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon return; } - DoCrawl(consumeControl); + if (DoCrawl(consumeControl)) + return; + + this.SetUIBlockedForRayOrigin(rayOrigin, false); } bool DoFlying(ConsumeControlDelegate consumeControl) @@ -307,7 +312,6 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) m_StartCrawling = true; m_ActualRayOriginStartPosition = m_RayOriginStartPosition; m_CrawlStartTime = Time.time; - this.SetUIBlockedForRayOrigin(rayOrigin, true); } var localRayPosition = cameraRig.position - rayOrigin.position; @@ -328,7 +332,6 @@ bool DoCrawl(ConsumeControlDelegate consumeControl) return true; } - this.SetUIBlockedForRayOrigin(rayOrigin, false); this.RemoveRayVisibilitySettings(rayOrigin, this); m_StartCrawling = false; @@ -543,7 +546,6 @@ void CancelScale() locomotionTool.m_Scaling = false; } - m_ViewerScaleVisuals.gameObject.SetActive(false); } From 1438481b3bcec8539814e83c3e7fd950822fdd79 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 21 Sep 2017 02:14:56 -0700 Subject: [PATCH 848/870] Fix color picker aliasing bug with UI rects --- .../Prefabs/AnnotationUI.prefab | 3 ++- .../UserInterface/ColorPickerUI.cs | 21 ++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab index 77df12681..0b4673e5f 100644 --- a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab +++ b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab @@ -1130,6 +1130,7 @@ MonoBehaviour: m_ColorPicker: {fileID: 114000010862220058} m_SliderBackground: {fileID: 114000013248295880} m_Picker: {fileID: 224000013288384236} + m_PickerBounds: {fileID: 224000012639415320} m_ColorPickerSquare: {fileID: 114000012642262872} --- !u!114 &114000010862220058 MonoBehaviour: @@ -1903,7 +1904,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -4, y: -4} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013901019326 RectTransform: diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs index d9343dbf4..894e923f7 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerUI.cs @@ -20,6 +20,9 @@ public class ColorPickerUI : MonoBehaviour, IPointerExitHandler [SerializeField] RectTransform m_Picker; + [SerializeField] + RectTransform m_PickerBounds; + [SerializeField] ColorPickerSquareUI m_ColorPickerSquare; @@ -157,21 +160,15 @@ void PositionToColor() Color GetColorForCurrentPosition() { - var rect = m_ColorPicker.rectTransform.rect; - - var dir = m_PickerTargetPosition; - dir.z = 0; + var rect = m_PickerBounds.rect; - // We want to avoid the edge of the image, which has feathered pixels - var maxMagnitude = rect.width * 0.495f; - if (dir.magnitude > maxMagnitude) - dir = Vector3.ClampMagnitude(dir, maxMagnitude); + var position = m_PickerTargetPosition; - dir.x = (dir.x + rect.width * 0.5f) / rect.width; - dir.y = (dir.y + rect.height * 0.5f) / rect.height; + position.x = (position.x + rect.width * 0.5f) / rect.width; + position.y = (position.y + rect.height * 0.5f) / rect.height; - var textureX = (int)(dir.x * m_ColorPickerTexture.width); - var textureY = (int)(dir.y * m_ColorPickerTexture.height); + var textureX = (int)(position.x * m_ColorPickerTexture.width); + var textureY = (int)(position.y * m_ColorPickerTexture.height); var col = m_ColorPickerTexture.GetPixel(textureX, textureY); return col; From 2257147267e3db52c26e1cfeda584c23f76827fb Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 21 Sep 2017 02:22:32 -0700 Subject: [PATCH 849/870] Fix comments --- Menus/MainMenu/Scripts/MainMenuUI.cs | 2 +- Scripts/Core/EditorVR.Tools.cs | 2 +- Scripts/Interfaces/Entity/IMainMenu.cs | 4 ++-- Tools/AnnotationTool/AnnotationTool.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index d1c76a22a..8184e1663 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -288,7 +288,7 @@ public GameObject AddSubmenu(string sectionName, GameObject submenuPrefab) var submenuFace = submenu.GetComponent(); if (submenuFace) { - submenuFace.SetupBackButton(() => { face.RemoveSubmenu(); }); + submenuFace.SetupBackButton(face.RemoveSubmenu); submenuFace.gradientPair = face.gradientPair; } diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index ecef42f40..d389e3f6f 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -303,7 +303,7 @@ static void DespawnTool(DeviceData deviceData, ITool tool) { if (otherDeviceData != deviceData) { - // Pop this tool of any other stack that references it (for single instance, multi-device tools) + // Pop this tool off any other stack that references it (for single instance, multi-device tools) var otherTool = otherDeviceData.currentTool; if (otherTool == tool) { diff --git a/Scripts/Interfaces/Entity/IMainMenu.cs b/Scripts/Interfaces/Entity/IMainMenu.cs index a67acc000..95fe24c42 100644 --- a/Scripts/Interfaces/Entity/IMainMenu.cs +++ b/Scripts/Interfaces/Entity/IMainMenu.cs @@ -53,13 +53,13 @@ public interface IMainMenu : IMenu, IUsesMenuActions, ISelectTool void RemoveSettingsMenu(ISettingsMenuProvider provider); /// - /// Add a settings menu to this menu item + /// Add a settings menu item to this menu /// /// The object providing the settings menu item void AddSettingsMenuItem(ISettingsMenuItemProvider provider); /// - /// Remove a settings menu from this menu item + /// Remove a settings menu item from this menu /// /// The object which provided the settings menu item void RemoveSettingsMenuItem(ISettingsMenuItemProvider provider); diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 69f5c02e1..4dfff2fad 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -126,7 +126,7 @@ public GameObject settingsMenuItemInstance if (m_BlockValueChangedListener) return; - // m_Preferences on all instances refer + // m_Preferences on all instances refer to a single preferences object m_Preferences.meshGroupingMode = !isOn; foreach (var linkedObject in linkedObjects) { From 7c6127da4853e33f2a3dd97e0d316c9279c7532f Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 21 Sep 2017 02:26:56 -0700 Subject: [PATCH 850/870] Rename rayOrigin argument to InstantiateUI; Rename toolsMenuUI --- Menus/ToolsMenu/ToolsMenu.cs | 58 +++++++++---------- .../FunctionalityInjection/IInstantiateUI.cs | 8 +-- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Menus/ToolsMenu/ToolsMenu.cs b/Menus/ToolsMenu/ToolsMenu.cs index 10bab5956..0b200450a 100644 --- a/Menus/ToolsMenu/ToolsMenu.cs +++ b/Menus/ToolsMenu/ToolsMenu.cs @@ -39,11 +39,11 @@ sealed class ToolsMenu : MonoBehaviour, IToolsMenu, IConnectInterfaces, IInstant float m_AllowToolToggleBeforeThisTime; Vector3 m_SpatialScrollStartPosition; - ToolsMenuUI m_ToolsMenuUi; + ToolsMenuUI m_ToolsMenuUI; public Transform menuOrigin { get; set; } - List buttons { get { return m_ToolsMenuUi.buttons; } } - public bool alternateMenuVisible { set { m_ToolsMenuUi.moveToAlternatePosition = value; } } + List buttons { get { return m_ToolsMenuUI.buttons; } } + public bool alternateMenuVisible { set { m_ToolsMenuUI.moveToAlternatePosition = value; } } public Action highlightSingleButton { get; set; } public Action selectHighlightedButton { get; set; } @@ -69,16 +69,16 @@ void OnDestroy() void CreateToolsMenuUI() { - m_ToolsMenuUi = this.InstantiateUI(m_ToolsMenuPrefab.gameObject, rayOrigin, true, rayOrigin).GetComponent(); - m_ToolsMenuUi.maxButtonCount = k_MaxButtonCount; - m_ToolsMenuUi.mainMenuActivatorSelected = this.MainMenuActivatorSelected; - m_ToolsMenuUi.buttonHovered += OnButtonHover; - m_ToolsMenuUi.buttonClicked += OnButtonClick; - m_ToolsMenuUi.buttonSelected += OnButtonSelected; - m_ToolsMenuUi.closeMenu += CloseMenu; + m_ToolsMenuUI = this.InstantiateUI(m_ToolsMenuPrefab.gameObject, rayOrigin, true, rayOrigin).GetComponent(); + m_ToolsMenuUI.maxButtonCount = k_MaxButtonCount; + m_ToolsMenuUI.mainMenuActivatorSelected = this.MainMenuActivatorSelected; + m_ToolsMenuUI.buttonHovered += OnButtonHover; + m_ToolsMenuUI.buttonClicked += OnButtonClick; + m_ToolsMenuUI.buttonSelected += OnButtonSelected; + m_ToolsMenuUI.closeMenu += CloseMenu; // Alternate menu origin isn't set when awake or start run - var toolsMenuUITransform = m_ToolsMenuUi.transform; + var toolsMenuUITransform = m_ToolsMenuUI.transform; toolsMenuUITransform.SetParent(alternateMenuOrigin); toolsMenuUITransform.localPosition = Vector3.zero; toolsMenuUITransform.localRotation = Quaternion.identity; @@ -89,20 +89,20 @@ void CreateToolsMenuButton(Type toolType, Sprite buttonIcon) // Verify first that the ToolsMenuUI exists // This is called in EditorVR.Tools before the UI can be created herein in Awake // The SelectionTool & MainMenu buttons are created immediately after instantiating the ToolsMenu - if (m_ToolsMenuUi == null) + if (m_ToolsMenuUI == null) CreateToolsMenuUI(); // Select an existing ToolButton if the type is already present in a button if (buttons.Any( x => x.toolType == toolType)) { - m_ToolsMenuUi.SelectExistingToolType(toolType); + m_ToolsMenuUI.SelectExistingToolType(toolType); return; } if (buttons.Count >= k_MaxButtonCount) // Return if tool type already occupies a tool button return; - var buttonTransform = ObjectUtils.Instantiate(_mToolsMenuButtonTemplate.gameObject, m_ToolsMenuUi.buttonContainer, false).transform; + var buttonTransform = ObjectUtils.Instantiate(_mToolsMenuButtonTemplate.gameObject, m_ToolsMenuUI.buttonContainer, false).transform; var button = buttonTransform.GetComponent(); this.ConnectInterfaces(button); @@ -116,13 +116,13 @@ void CreateToolsMenuButton(Type toolType, Sprite buttonIcon) if (toolType == typeof(IMainMenu)) PreviewToolsMenuButton = button; - m_ToolsMenuUi.AddButton(button, buttonTransform); + m_ToolsMenuUI.AddButton(button, buttonTransform); } void DeleteToolsMenuButton(Type toolTypeToDelete, Type toolTypeToSelectAfterDelete) { - if (m_ToolsMenuUi.DeleteButtonOfType(toolTypeToDelete)) - m_ToolsMenuUi.SelectNextExistingToolButton(); + if (m_ToolsMenuUI.DeleteButtonOfType(toolTypeToDelete)) + m_ToolsMenuUI.SelectNextExistingToolButton(); } public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeControl) @@ -142,7 +142,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon consumeControl(toolslMenuInput.select); OnButtonClick(); CloseMenu(); // Also ends spatial scroll - m_ToolsMenuUi.allButtonsVisible = false; + m_ToolsMenuUI.allButtonsVisible = false; } if (spatialScrollData == null && (toolslMenuInput.show.wasJustPressed || toolslMenuInput.show.isHeld) && toolslMenuInput.select.wasJustPressed) @@ -150,11 +150,11 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_SpatialScrollStartPosition = alternateMenuOrigin.position; m_AllowToolToggleBeforeThisTime = Time.realtimeSinceStartup + kAllowToggleDuration; this.SetSpatialHintControlNode(node); - m_ToolsMenuUi.spatiallyScrolling = true; // Triggers the display of the directional hint arrows + m_ToolsMenuUI.spatiallyScrolling = true; // Triggers the display of the directional hint arrows consumeControl(toolslMenuInput.show); consumeControl(toolslMenuInput.select); // Assign initial SpatialScrollData; begin scroll - spatialScrollData = this.PerformSpatialScroll(node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUi.buttons.Count, m_ToolsMenuUi.maxButtonCount); + spatialScrollData = this.PerformSpatialScroll(node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUI.buttons.Count, m_ToolsMenuUI.maxButtonCount); } else if (spatialScrollData != null && toolslMenuInput.show.isHeld) { @@ -163,7 +163,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // Attempt to close a button, if a scroll has passed the trigger threshold if (spatialScrollData != null && toolslMenuInput.select.wasJustPressed) { - if (m_ToolsMenuUi.DeleteHighlightedButton()) + if (m_ToolsMenuUI.DeleteHighlightedButton()) buttonCount = buttons.Count; // The MainMenu button will be hidden, subtract 1 from the activeButtonCount if (buttonCount <= k_ActiveToolOrderPosition + 1) @@ -177,22 +177,22 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon // normalized input should loop after reaching the 0.15f length buttonCount -= 1; // Decrement to disallow cycling through the main menu button - spatialScrollData = this.PerformSpatialScroll(node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUi.buttons.Count, m_ToolsMenuUi.maxButtonCount); + spatialScrollData = this.PerformSpatialScroll(node, m_SpatialScrollStartPosition, alternateMenuOrigin.position, 0.325f, m_ToolsMenuUI.buttons.Count, m_ToolsMenuUI.maxButtonCount); var normalizedRepeatingPosition = spatialScrollData.normalizedLoopingPosition; if (!Mathf.Approximately(normalizedRepeatingPosition, 0f)) { - if (!m_ToolsMenuUi.allButtonsVisible) + if (!m_ToolsMenuUI.allButtonsVisible) { - m_ToolsMenuUi.spatialDragDistance = spatialScrollData.dragDistance; + m_ToolsMenuUI.spatialDragDistance = spatialScrollData.dragDistance; this.SetSpatialHintState(SpatialHintModule.SpatialHintStateFlags.CenteredScrolling); - m_ToolsMenuUi.allButtonsVisible = true; + m_ToolsMenuUI.allButtonsVisible = true; } else if (spatialScrollData.spatialDirection != null) { - m_ToolsMenuUi.startingDragOrigin = spatialScrollData.spatialDirection; + m_ToolsMenuUI.startingDragOrigin = spatialScrollData.spatialDirection; } - m_ToolsMenuUi.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); + m_ToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); } } else if (toolslMenuInput.show.wasJustReleased) @@ -202,12 +202,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (spatialScrollData != null && spatialScrollData.passedMinDragActivationThreshold) { - m_ToolsMenuUi.SelectHighlightedButton(); + m_ToolsMenuUI.SelectHighlightedButton(); } else if (Time.realtimeSinceStartup < m_AllowToolToggleBeforeThisTime) { // Allow for single press+release to cycle through tools - m_ToolsMenuUi.SelectNextExistingToolButton(); + m_ToolsMenuUI.SelectNextExistingToolButton(); OnButtonClick(); } diff --git a/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs b/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs index 93471d1d0..ddf02f39d 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs @@ -22,13 +22,13 @@ public static class IInstantiateUIMethods /// The prefab to instantiate /// (Optional) A parent transform to instantiate under /// (Optional) If true, the parent-relative position, scale and rotation are modified - /// (Optional) RayOrigin override that will be used when connecting interfaces on this object + /// (Optional) RayOrigin override that will be used when connecting interfaces on this object /// such that the object keeps the same world space position, rotation and scale as before. /// - public static GameObject InstantiateUI(this IInstantiateUI obj, GameObject prefab, Transform parent = null, bool worldPositionStays = true, Transform connectInterfacesOverride = null) + public static GameObject InstantiateUI(this IInstantiateUI obj, GameObject prefab, Transform parent = null, bool worldPositionStays = true, Transform rayOrigin = null) { - return instantiateUI(prefab, parent, worldPositionStays, connectInterfacesOverride); + return instantiateUI(prefab, parent, worldPositionStays, rayOrigin); } } } -#endif \ No newline at end of file +#endif From 987ebbff16fa055e67233505a004311b38ab91aa Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 21 Sep 2017 03:17:44 -0700 Subject: [PATCH 851/870] Prevent opening the main menu on both hands; Add interactable state for menu button to signify hidden menus --- .../ToolsMenuButtonClickPulse.asset | 2 +- .../ToolsMenuButtonHoverPulse.asset | 2 +- .../ToolsMenuMenuHidingPulse.asset | 2 +- Menus/ToolsMenu/Prefabs/ToolsMenu.prefab | 2 +- Menus/ToolsMenu/ToolsMenu.cs | 5 + .../Materials/ToolsMenuButtonBorder.mat | 2 +- .../Materials/ToolsMenuButtonFaceMask.mat | 2 +- .../Materials/ToolsMenuButtonUIContent.mat | 2 +- .../Materials/ToolsMenulButton.mat | 146 +++++------------- .../ToolsMenuButton/ToolsMenuButton.cs | 12 ++ .../UI/Materials/ToolsMenuButtonUIContent.mat | 2 +- .../UI/Materials/ToolsMenuSecondaryButton.mat | 146 +++++------------- Scripts/Core/EditorVR.Menus.cs | 49 +++++- Scripts/Core/EditorVR.ToolsMenu.cs | 19 +-- Scripts/Interfaces/Entity/IToolsMenu.cs | 5 + Scripts/Interfaces/Entity/IToolsMenuButton.cs | 5 + .../FunctionalityInjection/IInstantiateUI.cs | 2 +- Scripts/UI/GradientButton.cs | 28 +++- 18 files changed, 186 insertions(+), 247 deletions(-) diff --git a/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset b/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset index c9631db4c..5e632b863 100644 --- a/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset +++ b/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonClickPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: PinnedToolButtonClickPulse + m_Name: ToolsMenuButtonClickPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.4 diff --git a/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset b/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset index fbf7c28cb..13e89fd29 100644 --- a/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset +++ b/Menus/ToolsMenu/HapticPulses/ToolsMenuButtonHoverPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: PinnedToolButtonHoverPulse + m_Name: ToolsMenuButtonHoverPulse m_EditorClassIdentifier: m_Duration: 0.005 m_Intensity: 0.75 diff --git a/Menus/ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset b/Menus/ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset index 9a183d708..b086ff0b9 100644 --- a/Menus/ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset +++ b/Menus/ToolsMenu/HapticPulses/ToolsMenuMenuHidingPulse.asset @@ -9,7 +9,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 1efd705dfe960584581b3390e04777f1, type: 3} - m_Name: PinnedToolMenuHidingPulse + m_Name: ToolsMenuMenuHidingPulse m_EditorClassIdentifier: m_Duration: 0.5 m_Intensity: 0.35 diff --git a/Menus/ToolsMenu/Prefabs/ToolsMenu.prefab b/Menus/ToolsMenu/Prefabs/ToolsMenu.prefab index abc144e82..0ba5d371e 100644 --- a/Menus/ToolsMenu/Prefabs/ToolsMenu.prefab +++ b/Menus/ToolsMenu/Prefabs/ToolsMenu.prefab @@ -37,7 +37,7 @@ GameObject: - component: {fileID: 4000011260103804} - component: {fileID: 114000010527895234} m_Layer: 0 - m_Name: PinnedToolsMenu + m_Name: ToolsMenu m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Menus/ToolsMenu/ToolsMenu.cs b/Menus/ToolsMenu/ToolsMenu.cs index 0b200450a..665a3103f 100644 --- a/Menus/ToolsMenu/ToolsMenu.cs +++ b/Menus/ToolsMenu/ToolsMenu.cs @@ -56,6 +56,11 @@ sealed class ToolsMenu : MonoBehaviour, IToolsMenu, IConnectInterfaces, IInstant public ActionMap actionMap { get { return m_MainMenuActionMap; } } public Transform rayOrigin { get; set; } + public bool mainMenuActivatorInteractable + { + set { PreviewToolsMenuButton.interactable = value; } + } + void Awake() { setButtonForType = CreateToolsMenuButton; diff --git a/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat index f8dcb9477..e866d9e16 100644 --- a/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat +++ b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonBorder.mat @@ -6,7 +6,7 @@ Material: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_Name: PinnedToolButtonBorder + m_Name: ToolsMenuButtonBorder m_Shader: {fileID: 4800000, guid: b10f0b677131a2945855a113a27b7093, type: 3} m_ShaderKeywords: _EMISSION m_LightmapFlags: 1 diff --git a/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat index f981fb9df..b281f4863 100644 --- a/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat +++ b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonFaceMask.mat @@ -6,7 +6,7 @@ Material: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_Name: PinnedToolButtonFaceMask + m_Name: ToolsMenuButtonFaceMask m_Shader: {fileID: 4800000, guid: da29182e4499c6740bf4e5dc3198313a, type: 3} m_ShaderKeywords: _EMISSION m_LightmapFlags: 1 diff --git a/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat index 401f9b214..941f30e65 100644 --- a/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat +++ b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenuButtonUIContent.mat @@ -6,7 +6,7 @@ Material: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_Name: PinnedToolButtonUIContent + m_Name: ToolsMenuButtonUIContent m_Shader: {fileID: 10760, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _ALPHABLEND_ON _EMISSION m_LightmapFlags: 1 diff --git a/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat index 4d15ec81b..9fd6ea2b6 100644 --- a/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat +++ b/Menus/ToolsMenu/ToolsMenuButton/Materials/ToolsMenulButton.mat @@ -6,149 +6,81 @@ Material: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_Name: PinnedToolButton + m_Name: ToolsMenulButton m_Shader: {fileID: 4800000, guid: c8cf0b95851289d40aecbbb604f214fd, type: 3} m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 m_CustomRenderQueue: -1 stringTagMap: {} + disabledShaderPasses: [] m_SavedProperties: - serializedVersion: 2 + serializedVersion: 3 m_TexEnvs: - - first: - name: _BumpMap - second: + - _BumpMap: m_Texture: {fileID: 2800000, guid: 06dc8da358c6ebb4dad67b286b513f95, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _DetailAlbedoMap - second: + - _DetailAlbedoMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _DetailMask - second: + - _DetailMask: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _DetailNormalMap - second: + - _DetailNormalMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _EmissionMap - second: + - _EmissionMap: m_Texture: {fileID: 2800000, guid: 3cd61233b718b974e99810df6209b4c4, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _MainTex - second: + - _MainTex: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _MetallicGlossMap - second: + - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _OcclusionMap - second: + - _OcclusionMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _ParallaxMap - second: + - _ParallaxMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _SpecGlossMap - second: + - _SpecGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - - first: - name: _Alpha - second: 1 - - first: - name: _BumpScale - second: 2 - - first: - name: _Cutoff - second: 0.5 - - first: - name: _DetailNormalMapScale - second: 1 - - first: - name: _DstBlend - second: 10 - - first: - name: _GlossMapScale - second: 0.414 - - first: - name: _Glossiness - second: 0.5 - - first: - name: _GlossyReflections - second: 1 - - first: - name: _InvFade - second: 1 - - first: - name: _Metallic - second: 0.256 - - first: - name: _Mode - second: 3 - - first: - name: _OcclusionStrength - second: 1 - - first: - name: _Parallax - second: 0.02 - - first: - name: _SmoothnessTextureChannel - second: 0 - - first: - name: _SpecularHighlights - second: 1 - - first: - name: _SrcBlend - second: 1 - - first: - name: _UVSec - second: 0 - - first: - name: _ZWrite - second: 0 + - _Alpha: 1 + - _BumpScale: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 0.414 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _InvFade: 1 + - _Metallic: 0.256 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 m_Colors: - - first: - name: _Color - second: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - - first: - name: _ColorBottom - second: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 1} - - first: - name: _ColorTop - second: {r: 0.011764706, g: 0.6627451, b: 0.95686275, a: 1} - - first: - name: _EmisColor - second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 0} - - first: - name: _EmissionColor - second: {r: 0, g: 0, b: 0, a: 1} - - first: - name: _SpecColor - second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - - first: - name: _TintColor - second: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + - _Color: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + - _ColorBottom: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 1} + - _ColorTop: {r: 0.011764706, g: 0.6627451, b: 0.95686275, a: 1} + - _EmisColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} diff --git a/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs index a70268e53..0518bca6d 100644 --- a/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs +++ b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs @@ -257,6 +257,9 @@ public string tooltipText { get { + if (!interactable && toolType == typeof(IMainMenu)) + return "Main Menu hidden"; + return tooltip != null ? tooltip.tooltipText : (previewToolType == null ? m_TooltipText : previewToolDescription); } @@ -305,6 +308,12 @@ public bool highlighted } } + public bool interactable + { + get { return m_GradientButton.interactable; } + set { m_GradientButton.interactable = value; } + } + public bool secondaryButtonHighlighted { get { return m_CloseButton.highlighted; } } public bool toolTipVisible @@ -497,6 +506,9 @@ void ActionButtonHoverExit() void OnBackgroundButtonClick() { + if (!interactable) + return; + selectTool(toolType); if (!isMainMenu) diff --git a/Prefabs/UI/Materials/ToolsMenuButtonUIContent.mat b/Prefabs/UI/Materials/ToolsMenuButtonUIContent.mat index 36ac44b10..c64dc603e 100644 --- a/Prefabs/UI/Materials/ToolsMenuButtonUIContent.mat +++ b/Prefabs/UI/Materials/ToolsMenuButtonUIContent.mat @@ -6,7 +6,7 @@ Material: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_Name: PinnedToolButtonUIContent + m_Name: ToolsMenuButtonUIContent m_Shader: {fileID: 10760, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _ALPHABLEND_ON _EMISSION m_LightmapFlags: 1 diff --git a/Prefabs/UI/Materials/ToolsMenuSecondaryButton.mat b/Prefabs/UI/Materials/ToolsMenuSecondaryButton.mat index dd0fa94bf..8b34d3380 100644 --- a/Prefabs/UI/Materials/ToolsMenuSecondaryButton.mat +++ b/Prefabs/UI/Materials/ToolsMenuSecondaryButton.mat @@ -6,149 +6,81 @@ Material: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_Name: PinnedToolSecondaryButton + m_Name: ToolsMenuSecondaryButton m_Shader: {fileID: 4800000, guid: c8cf0b95851289d40aecbbb604f214fd, type: 3} m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 m_CustomRenderQueue: -1 stringTagMap: {} + disabledShaderPasses: [] m_SavedProperties: - serializedVersion: 2 + serializedVersion: 3 m_TexEnvs: - - first: - name: _BumpMap - second: + - _BumpMap: m_Texture: {fileID: 2800000, guid: 06dc8da358c6ebb4dad67b286b513f95, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _DetailAlbedoMap - second: + - _DetailAlbedoMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _DetailMask - second: + - _DetailMask: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _DetailNormalMap - second: + - _DetailNormalMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _EmissionMap - second: + - _EmissionMap: m_Texture: {fileID: 2800000, guid: 3cd61233b718b974e99810df6209b4c4, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _MainTex - second: + - _MainTex: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _MetallicGlossMap - second: + - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _OcclusionMap - second: + - _OcclusionMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _ParallaxMap - second: + - _ParallaxMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - first: - name: _SpecGlossMap - second: + - _SpecGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - - first: - name: _Alpha - second: 1 - - first: - name: _BumpScale - second: 2 - - first: - name: _Cutoff - second: 0.5 - - first: - name: _DetailNormalMapScale - second: 1 - - first: - name: _DstBlend - second: 10 - - first: - name: _GlossMapScale - second: 0.414 - - first: - name: _Glossiness - second: 0.5 - - first: - name: _GlossyReflections - second: 1 - - first: - name: _InvFade - second: 1 - - first: - name: _Metallic - second: 0.256 - - first: - name: _Mode - second: 3 - - first: - name: _OcclusionStrength - second: 1 - - first: - name: _Parallax - second: 0.02 - - first: - name: _SmoothnessTextureChannel - second: 0 - - first: - name: _SpecularHighlights - second: 1 - - first: - name: _SrcBlend - second: 1 - - first: - name: _UVSec - second: 0 - - first: - name: _ZWrite - second: 0 + - _Alpha: 1 + - _BumpScale: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 0.414 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _InvFade: 1 + - _Metallic: 0.256 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 m_Colors: - - first: - name: _Color - second: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - - first: - name: _ColorBottom - second: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} - - first: - name: _ColorTop - second: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} - - first: - name: _EmisColor - second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 0} - - first: - name: _EmissionColor - second: {r: 0, g: 0, b: 0, a: 1} - - first: - name: _SpecColor - second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - - first: - name: _TintColor - second: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + - _Color: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + - _ColorBottom: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} + - _ColorTop: {r: 0.95686275, g: 0.2627451, b: 0.21176471, a: 1} + - _EmisColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index a11c89696..7093e1098 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -191,9 +191,8 @@ internal void UpdateMenuVisibilities() if (permanentlyHidden || wasPermanentlyHidden || !mainMenu.focus && (temporarilyHidden || wasTemporarilyHidden)) mainMenu.menuHideFlags = mainMenuHideFlags; - //TODO: Disable activator // Disable the main menu activator if any temporary states are set - //deviceData.mainMenuActivator.interactable = (mainMenuHideFlags & MenuHideFlags.Temporary) == 0; + deviceData.ToolsMenu.mainMenuActivatorInteractable = (mainMenuHideFlags & MenuHideFlags.Temporary) == 0; // Show/hide custom menu, if it exists var customMenu = deviceData.customMenu; @@ -354,6 +353,52 @@ internal static void SetAlternateMenuVisibility(Transform rayOrigin, bool visibl }); } + internal static void OnMainMenuActivatorSelected(Transform rayOrigin, Transform targetRayOrigin) + { + foreach (var deviceData in evr.m_DeviceData) + { + var mainMenu = deviceData.mainMenu; + if (mainMenu != null) + { + var customMenu = deviceData.customMenu; + var alternateMenu = deviceData.alternateMenu; + var menuHideData = deviceData.menuHideData; + var mainMenuHideData = menuHideData[mainMenu]; + var alternateMenuVisible = alternateMenu != null + && (menuHideData[alternateMenu].hideFlags & MenuHideFlags.Hidden) == 0; + + // Do not delay when showing via activator + mainMenuHideData.autoShowTime = 0; + + if (deviceData.rayOrigin == rayOrigin) + { + // Toggle main menu hidden flag + mainMenuHideData.hideFlags ^= MenuHideFlags.Hidden; + mainMenu.targetRayOrigin = targetRayOrigin; + } + else + { + mainMenuHideData.hideFlags |= MenuHideFlags.Hidden; + + var customMenuOverridden = customMenu != null && + (menuHideData[customMenu].hideFlags & MenuHideFlags.OtherMenu) != 0; + // Move alternate menu if overriding custom menu + if (customMenuOverridden && alternateMenuVisible) + { + foreach (var otherDeviceData in evr.m_DeviceData) + { + if (deviceData == otherDeviceData) + continue; + + if (otherDeviceData.alternateMenu != null) + SetAlternateMenuVisibility(rayOrigin, true); + } + } + } + } + } + } + static GameObject InstantiateMenuUI(Transform rayOrigin, IMenu prefab) { var ui = evr.GetNestedModule(); diff --git a/Scripts/Core/EditorVR.ToolsMenu.cs b/Scripts/Core/EditorVR.ToolsMenu.cs index 3c57cdb83..259ac8928 100644 --- a/Scripts/Core/EditorVR.ToolsMenu.cs +++ b/Scripts/Core/EditorVR.ToolsMenu.cs @@ -2,7 +2,6 @@ using System; using System.Linq; using UnityEngine; -using UnityEditor.Experimental.EditorVR.Menus; namespace UnityEditor.Experimental.EditorVR.Core { @@ -55,23 +54,7 @@ static void OnToolButtonClicked(Transform rayOrigin, Type toolType) static void OnMainMenuActivatorSelected(Transform rayOrigin) { var targetToolRayOrigin = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin != rayOrigin).rayOrigin; - var deviceData = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin == rayOrigin); - - if (deviceData != null) - { - var mainMenu = deviceData.mainMenu; - if (mainMenu != null) - { - var menuHideFlags = deviceData.menuHideData; - menuHideFlags[mainMenu].hideFlags ^= MenuHideFlags.Hidden; - - var customMenu = deviceData.customMenu; - if (customMenu != null) - menuHideFlags[customMenu].hideFlags &= ~MenuHideFlags.Hidden; - - mainMenu.targetRayOrigin = targetToolRayOrigin; - } - } + Menus.OnMainMenuActivatorSelected(rayOrigin, targetToolRayOrigin); } } } diff --git a/Scripts/Interfaces/Entity/IToolsMenu.cs b/Scripts/Interfaces/Entity/IToolsMenu.cs index 60ef964b4..8d275aea6 100644 --- a/Scripts/Interfaces/Entity/IToolsMenu.cs +++ b/Scripts/Interfaces/Entity/IToolsMenu.cs @@ -36,6 +36,11 @@ public interface IToolsMenu : IUsesMenuOrigins, ICustomActionMap, IUsesNode, ISe /// Then, select the tool button with corresponds to the type of the second parameter. /// Action deleteToolsMenuButton { get; } + + /// + /// Set the interactable state on the main menu activator button + /// + bool mainMenuActivatorInteractable { set; } } public static class IToolsMenuMethods diff --git a/Scripts/Interfaces/Entity/IToolsMenuButton.cs b/Scripts/Interfaces/Entity/IToolsMenuButton.cs index 8349ab3f3..77d0622b8 100644 --- a/Scripts/Interfaces/Entity/IToolsMenuButton.cs +++ b/Scripts/Interfaces/Entity/IToolsMenuButton.cs @@ -40,6 +40,11 @@ public interface IToolsMenuButton /// bool highlighted { get; set; } + /// + /// Bool denoting button interactable state + /// + bool interactable { get; set; } + /// /// Bool denoting the secondary button highlight state /// diff --git a/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs b/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs index ddf02f39d..fff86f5a1 100644 --- a/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs +++ b/Scripts/Interfaces/FunctionalityInjection/IInstantiateUI.cs @@ -12,7 +12,7 @@ public interface IInstantiateUI public static class IInstantiateUIMethods { - internal delegate GameObject InstantiateUIDelegate(GameObject prefab, Transform parent = null, bool worldPositionStays = true, Transform connectInterfacesOverride = null); + internal delegate GameObject InstantiateUIDelegate(GameObject prefab, Transform parent = null, bool worldPositionStays = true, Transform rayOrigin = null); internal static InstantiateUIDelegate instantiateUI { get; set; } diff --git a/Scripts/UI/GradientButton.cs b/Scripts/UI/GradientButton.cs index 304ee63ce..49ddeaafd 100644 --- a/Scripts/UI/GradientButton.cs +++ b/Scripts/UI/GradientButton.cs @@ -123,6 +123,7 @@ public float iconHighlightedLocalZOffset GradientPair m_NormalGradientPair; public GradientPair highlightGradientPair { get { return m_HighlightGradientPair; } set { m_HighlightGradientPair = value; } } + [SerializeField] GradientPair m_HighlightGradientPair; @@ -155,6 +156,9 @@ public float iconHighlightedLocalZOffset [SerializeField] Color m_NormalContentColor; + [SerializeField] + Color m_DisabledColor = Color.gray; + // The color that elements in the HighlightItems collection should inherit during the highlighted state [SerializeField] Color m_HighlightItemColor = UnityBrandColorScheme.light; @@ -163,6 +167,9 @@ public float iconHighlightedLocalZOffset [SerializeField] Graphic[] m_HighlightItems; + [SerializeField] + bool m_Interactable; + [SerializeField] float m_IconHighlightedLocalZOffset = -0.0015f; @@ -203,6 +210,19 @@ public float iconHighlightedLocalZOffset Coroutine m_HighlightCoroutine; Coroutine m_IconHighlightCoroutine; + public bool interactable + { + get { return m_Interactable; } + set + { + if (m_Interactable == value) + return; + + m_Interactable = value; + m_Icon.color = m_Interactable ? m_NormalContentColor : m_DisabledColor; + } + } + void Awake() { m_OriginalIconSprite = m_Icon.sprite; @@ -419,7 +439,7 @@ IEnumerator IconContainerContentsBeginHighlight(bool pressed = false) foreach (var graphic in m_HighlightItems) { - if (graphic) + if (graphic && m_Interactable) graphic.color = Color.Lerp(m_NormalContentColor, m_HighlightItemColor, transitionAmount); } @@ -429,7 +449,7 @@ IEnumerator IconContainerContentsBeginHighlight(bool pressed = false) foreach (var graphic in m_HighlightItems) { - if (graphic) + if (graphic && m_Interactable) graphic.color = m_HighlightItemColor; } @@ -451,7 +471,7 @@ IEnumerator IconContainerContentsEndHighlight() foreach (var graphic in m_HighlightItems) { - if (graphic != null) + if (graphic && m_Interactable) graphic.color = Color.Lerp(m_NormalContentColor, m_HighlightItemColor, transitionAmount); } @@ -461,7 +481,7 @@ IEnumerator IconContainerContentsEndHighlight() foreach (var graphic in m_HighlightItems) { - if (graphic != null) + if (graphic && m_Interactable) graphic.color = m_NormalContentColor; } From 3972d84f4ba1eb68122072bd11569881e3361d31 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 21 Sep 2017 13:16:16 -0700 Subject: [PATCH 852/870] Refactor IBlockUIInteraction to use existing list of raycast sources --- Scripts/Core/EditorVR.Rays.cs | 31 +++++++++++-------- Scripts/Handles/BaseHandle.cs | 2 +- .../MultipleRayInputModule.cs | 9 +++--- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index bf3bc661e..fffe8afdc 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -7,6 +7,7 @@ using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; +using UnityEngine.InputNew; namespace UnityEditor.Experimental.EditorVR.Core { @@ -27,7 +28,7 @@ class Rays : Nested, IInterfaceConnector internal Dictionary defaultRays { get { return m_DefaultRays; } } readonly Dictionary m_DefaultRays = new Dictionary(); - static readonly List m_BlockedUIRayOrigins = new List(); + readonly Dictionary m_RaycastSources = new Dictionary(); readonly List m_Proxies = new List(); StandardManipulator m_StandardManipulator; @@ -204,12 +205,8 @@ void OnProxyActiveChanged(IProxy proxy) deviceData.uiInput = deviceInputModule.CreateActionMapInput(actionMap, device); // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources - inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => + var raycastSource = new MultipleRayInputModule.RaycastSource(proxy, rayOrigin, node, (UIActions)deviceData.uiInput, source => { - // Proceed only for raycast sources that haven't been blocked via IBlockUIInteraction - if (m_BlockedUIRayOrigins.Contains(rayOrigin)) - return false; - // Do not invalidate UI raycasts in the middle of a drag operation if (!source.draggedObject) { @@ -228,8 +225,18 @@ void OnProxyActiveChanged(IProxy proxy) return false; } - return Menus.IsValidHover(source); + if (!Menus.IsValidHover(source)) + return false; + + // Proceed only for raycast sources that haven't been blocked via IBlockUIInteraction + if (source.blocked) + return false; + + return true; }); + + m_RaycastSources[rayOrigin] = raycastSource; + inputModule.AddRaycastSource(raycastSource); } } @@ -515,13 +522,11 @@ static Color GetDefaultRayColor(Transform rayOrigin) return highlightModule.highlightColor; } - static void SetUIBlockedForRayOrigin(Transform rayOrigin, bool blocked) + void SetUIBlockedForRayOrigin(Transform rayOrigin, bool blocked) { - var rayOriginCurrentlyBlocked = m_BlockedUIRayOrigins.Contains(rayOrigin); - if (blocked && !rayOriginCurrentlyBlocked) - m_BlockedUIRayOrigins.Add(rayOrigin); - else if (!blocked && rayOriginCurrentlyBlocked) - m_BlockedUIRayOrigins.Remove(rayOrigin); + MultipleRayInputModule.RaycastSource source; + if (m_RaycastSources.TryGetValue(rayOrigin, out source)) + source.blocked = blocked; } } } diff --git a/Scripts/Handles/BaseHandle.cs b/Scripts/Handles/BaseHandle.cs index 610ad953b..1614c5679 100644 --- a/Scripts/Handles/BaseHandle.cs +++ b/Scripts/Handles/BaseHandle.cs @@ -13,7 +13,7 @@ namespace UnityEditor.Experimental.EditorVR.Handles /// Base class for providing draggable handles in 3D (requires PhysicsRaycaster) /// class BaseHandle : MonoBehaviour, ISelectionFlags, IRayBeginDragHandler, IRayDragHandler, IRayEndDragHandler, - IRayEnterHandler, IRayExitHandler, IRayHoverHandler, IGetRayVisibility, IPointerClickHandler, IDropReceiver, IDroppable + IRayEnterHandler, IRayExitHandler, IRayHoverHandler, IPointerClickHandler, IDropReceiver, IDroppable { protected const int k_DefaultCapacity = 2; // i.e. 2 controllers diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index ea51e0477..911e31cd4 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -21,6 +21,7 @@ public class RaycastSource public RayEventData eventData; public GameObject hoveredObject; public GameObject draggedObject; + public bool blocked; public Func isValid; public GameObject currentObject { get { return hoveredObject ? hoveredObject : draggedObject; } } @@ -29,6 +30,8 @@ public class RaycastSource public RaycastSource(IProxy proxy, Transform rayOrigin, Node node, UIActions actionMapInput, Func validationCallback) { + UIActions actions = (UIActions)actionMapInput; + actions.active = false; this.proxy = proxy; this.rayOrigin = rayOrigin; this.node = node; @@ -69,11 +72,9 @@ protected override void Awake() m_TempRayEvent = new RayEventData(eventSystem); } - public void AddRaycastSource(IProxy proxy, Node node, ActionMapInput actionMapInput, Transform rayOrigin, Func validationCallback = null) + public void AddRaycastSource(RaycastSource source) { - UIActions actions = (UIActions)actionMapInput; - actions.active = false; - m_RaycastSources.Add(rayOrigin, new RaycastSource(proxy, rayOrigin, node, actions, validationCallback)); + m_RaycastSources.Add(source.rayOrigin, source); } public void RemoveRaycastSource(Transform rayOrigin) From c552dfbcae19b574901120c82da5950f9638573b Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 21 Sep 2017 13:50:56 -0700 Subject: [PATCH 853/870] Re-refactor IBlockUIInteraction as a service provided by the input module --- Scripts/Core/EditorVR.Rays.cs | 15 +-------------- .../MultipleRayInputModule.cs | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Scripts/Core/EditorVR.Rays.cs b/Scripts/Core/EditorVR.Rays.cs index 9591e76b7..ff97d9396 100644 --- a/Scripts/Core/EditorVR.Rays.cs +++ b/Scripts/Core/EditorVR.Rays.cs @@ -7,7 +7,6 @@ using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.Utilities; using UnityEngine; -using UnityEngine.InputNew; namespace UnityEditor.Experimental.EditorVR.Core { @@ -28,7 +27,6 @@ class Rays : Nested, IInterfaceConnector internal Dictionary defaultRays { get { return m_DefaultRays; } } readonly Dictionary m_DefaultRays = new Dictionary(); - readonly Dictionary m_RaycastSources = new Dictionary(); readonly List m_Proxies = new List(); StandardManipulator m_StandardManipulator; @@ -52,7 +50,6 @@ public Rays() INodeToRayMethods.requestRayOriginFromNode = RequestRayOriginFromNode; IGetRayVisibilityMethods.isRayVisible = IsRayActive; IGetRayVisibilityMethods.isConeVisible = IsConeActive; - IBlockUIInteractionMethods.setUIBlockedForRayOrigin = SetUIBlockedForRayOrigin; } internal override void OnDestroy() @@ -207,7 +204,7 @@ void OnProxyActiveChanged(IProxy proxy) deviceData.uiInput = deviceInputModule.CreateActionMapInput(actionMap, device); // Add RayOrigin transform, proxy and ActionMapInput references to input module list of sources - var raycastSource = new MultipleRayInputModule.RaycastSource(proxy, rayOrigin, node, (UIActions)deviceData.uiInput, source => + inputModule.AddRaycastSource(proxy, node, deviceData.uiInput, rayOrigin, source => { // Do not invalidate UI raycasts in the middle of a drag operation if (!source.draggedObject) @@ -236,9 +233,6 @@ void OnProxyActiveChanged(IProxy proxy) return true; }); - - m_RaycastSources[rayOrigin] = raycastSource; - inputModule.AddRaycastSource(raycastSource); } } @@ -556,13 +550,6 @@ static Color GetDefaultRayColor(Transform rayOrigin) var highlightModule = evr.GetModule(); return highlightModule.highlightColor; } - - void SetUIBlockedForRayOrigin(Transform rayOrigin, bool blocked) - { - MultipleRayInputModule.RaycastSource source; - if (m_RaycastSources.TryGetValue(rayOrigin, out source)) - source.blocked = blocked; - } } } } diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index 29b9fbf40..dde424972 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -70,11 +70,15 @@ protected override void Awake() s_LayerMask = LayerMask.GetMask("UI"); m_TempRayEvent = new RayEventData(eventSystem); + + IBlockUIInteractionMethods.setUIBlockedForRayOrigin = SetUIBlockedForRayOrigin; } - public void AddRaycastSource(RaycastSource source) + public void AddRaycastSource(IProxy proxy, Node node, ActionMapInput actionMapInput, Transform rayOrigin, Func validationCallback = null) { - m_RaycastSources.Add(source.rayOrigin, source); + UIActions actions = (UIActions)actionMapInput; + actions.active = false; + m_RaycastSources.Add(rayOrigin, new RaycastSource(proxy, rayOrigin, node, actions, validationCallback)); } public void RemoveRaycastSource(Transform rayOrigin) @@ -458,6 +462,13 @@ public bool IsHoveringOverUI(Transform rayOrigin) RaycastSource source; return m_RaycastSources.TryGetValue(rayOrigin, out source) && source.hasObject; } + + void SetUIBlockedForRayOrigin(Transform rayOrigin, bool blocked) + { + RaycastSource source; + if (m_RaycastSources.TryGetValue(rayOrigin, out source)) + source.blocked = blocked; + } } } #endif From b82aaceb2e23a00638a5e398187edd8559e1214d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 21 Sep 2017 14:20:56 -0700 Subject: [PATCH 854/870] Fix merge issues --- Menus/PinnedToolButton.meta | 9 +++++++++ Scripts/Core/EditorVR.Tools.cs | 6 +++--- Tools/AnnotationTool/AnnotationTool.cs | 12 ++++++++---- Tools/AnnotationTool/Prefabs/AnnotationUI.prefab | 6 +++--- .../UserInterface/ColorPickerActivator.cs | 11 ++++++++++- libs/UnityOctree | 2 +- libs/VRLineRenderer | 2 +- 7 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 Menus/PinnedToolButton.meta diff --git a/Menus/PinnedToolButton.meta b/Menus/PinnedToolButton.meta new file mode 100644 index 000000000..403732562 --- /dev/null +++ b/Menus/PinnedToolButton.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7746387eca80e444a883a4e9337c4769 +folderAsset: yes +timeCreated: 1496975208 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 197031d1d..3378e1349 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -236,8 +236,8 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn // Spawn tool and collect all devices that this tool will need HashSet usedDevices; var device = deviceData.inputDevice; - var toolData = SpawnTool(toolType, out usedDevices, device); - var multiTool = toolData.tool as IMultiDeviceTool; + var newTool = SpawnTool(toolType, out usedDevices, device); + var multiTool = newTool.tool as IMultiDeviceTool; if (multiTool != null) { multiTool.primary = true; @@ -263,7 +263,7 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn } // Exclusive mode tools always take over all tool stacks - if (toolData.tool is IExclusiveMode) + if (newTool.tool is IExclusiveMode) { foreach (var dev in evrDeviceData) { diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 4dfff2fad..9bb586bff 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -19,7 +19,8 @@ [MainMenuItem("Annotation", "Create", "Draw in 3D")] public class AnnotationTool : MonoBehaviour, ITool, ICustomActionMap, IUsesRayOrigin, IRayVisibilitySettings, IUsesRayOrigins, IInstantiateUI, IUsesMenuOrigins, IUsesCustomMenuOrigins, IUsesViewerScale, IUsesSpatialHash, - IIsHoveringOverUI, IMultiDeviceTool, IUsesProxyType, ISettingsMenuItemProvider, ISerializePreferences, ILinkedObject + IIsHoveringOverUI, IMultiDeviceTool, IUsesProxyType, ISettingsMenuItemProvider, ISerializePreferences, ILinkedObject, + IUsesNode { [Serializable] class Preferences @@ -102,6 +103,7 @@ class Preferences public ActionMap actionMap { get { return m_ActionMap; } } public List linkedObjects { private get; set; } + public Node? node { private get; set; } public GameObject settingsMenuItemPrefab { get { return m_SettingsMenuItemPrefab; } } public GameObject settingsMenuItemInstance @@ -153,7 +155,7 @@ public GameObject settingsMenuItemInstance void OnDestroy() { - if (m_Preferences.meshGroupingMode) + if (m_Preferences != null && m_Preferences.meshGroupingMode) CombineGroups(); CleanUpNames(); @@ -205,9 +207,10 @@ void Start() var otherRayOrigin = otherRayOrigins.First(); var otherAltMenu = this.GetCustomAlternateMenuOrigin(otherRayOrigin); - m_ColorPickerActivator.transform.SetParent(otherAltMenu.GetComponentInChildren().transform); + const float UIOffset = 0.1f; + m_ColorPickerActivator.transform.SetParent(otherAltMenu); m_ColorPickerActivator.transform.localRotation = Quaternion.identity; - m_ColorPickerActivator.transform.localPosition = Vector3.right * 0.05f; + m_ColorPickerActivator.transform.localPosition = (node == Node.LeftHand ? Vector3.left : Vector3.right) * UIOffset; m_ColorPickerActivator.transform.localScale = Vector3.one; var activator = m_ColorPickerActivator.GetComponentInChildren(); @@ -218,6 +221,7 @@ void Start() m_ColorPicker.onColorPicked = OnColorPickerValueChanged; OnColorPickerValueChanged(m_Preferences.annotationColor); + activator.node = node.Value; activator.rayOrigin = otherRayOrigin; activator.showColorPicker = ShowColorPicker; activator.hideColorPicker = HideColorPicker; diff --git a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab index 0b4673e5f..09bc58cb9 100644 --- a/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab +++ b/Tools/AnnotationTool/Prefabs/AnnotationUI.prefab @@ -608,7 +608,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014121892912} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0.015, y: 0.0008, z: 0} + m_LocalPosition: {x: 0, y: 0.0008, z: 0} m_LocalScale: {x: 0.029, y: 0.029, z: 0.029} m_Children: - {fileID: 4000010924652800} @@ -636,7 +636,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000013722987470} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.015, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4663617041298854} @@ -764,7 +764,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1136647751248060} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.015, y: 0.0004, z: 0} + m_LocalPosition: {x: 0, y: 0.0004, z: 0} m_LocalScale: {x: 0.5, y: 0.25, z: 0.5} m_Children: [] m_Father: {fileID: 4000012336507532} diff --git a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs index 0dbb6a7eb..76dacb2c9 100644 --- a/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs +++ b/Tools/AnnotationTool/UserInterface/ColorPickerActivator.cs @@ -1,6 +1,7 @@ #if UNITY_EDITOR using System; using System.Collections; +using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Extensions; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; @@ -21,6 +22,9 @@ public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointe [SerializeField] GameObject m_Redo; + [SerializeField] + float m_PickerOffset = 0.045f; + Coroutine m_HighlightCoroutine; GradientButton m_UndoButton; GradientButton m_RedoButton; @@ -28,6 +32,7 @@ public class ColorPickerActivator : MonoBehaviour, IPointerClickHandler, IPointe public Transform rayOrigin { private get; set; } public Action showColorPicker { private get; set; } public Action hideColorPicker { private get; set; } + public Node node { private get; set; } public event Action undoButtonClick { @@ -87,12 +92,16 @@ IEnumerator Highlight(bool transitionIn) var amount = 0f; var currentScale = m_Icon.localScale; var targetScale = transitionIn ? m_TargetScale.localScale : Vector3.one; + var currentPosition = m_Icon.localPosition; + var targetPosition = transitionIn ? (node == Node.LeftHand ? Vector3.left : Vector3.right) * m_PickerOffset : Vector3.zero; var speed = (currentScale.x + 0.5f / targetScale.x) * 4; while (amount < 1f) { amount += Time.unscaledDeltaTime * speed; - m_Icon.localScale = Vector3.Lerp(currentScale, targetScale, Mathf.SmoothStep(0f, 1f, amount)); + var t = Mathf.SmoothStep(0f, 1f, amount); + m_Icon.localScale = Vector3.Lerp(currentScale, targetScale, t); + m_Icon.localPosition = Vector3.Lerp(currentPosition, targetPosition, t); yield return null; } diff --git a/libs/UnityOctree b/libs/UnityOctree index f6d18bfda..ebf38ec9d 160000 --- a/libs/UnityOctree +++ b/libs/UnityOctree @@ -1 +1 @@ -Subproject commit f6d18bfda9e24e354d6924b2875ebfb7b19eabdc +Subproject commit ebf38ec9d6d16c6af124faecc5034eaf5a4166a3 diff --git a/libs/VRLineRenderer b/libs/VRLineRenderer index 1f06feb84..19473f5bc 160000 --- a/libs/VRLineRenderer +++ b/libs/VRLineRenderer @@ -1 +1 @@ -Subproject commit 1f06feb849a2fb993bbf6021733b25274cb1a799 +Subproject commit 19473f5bc5fbe8211a08bf969d7c2fcfebdf5f74 From 9eeb4392a34922245c7df71364c78f30eb44d2e4 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 21 Sep 2017 14:45:45 -0700 Subject: [PATCH 855/870] Deselect everything as you open Annotation and Create Primitive tools --- Tools/AnnotationTool/AnnotationTool.cs | 3 +++ Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 9bb586bff..ab2823fd4 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -194,6 +194,9 @@ void CleanUpNames() void Start() { + // Clear selection so we can't manipulate things + Selection.activeGameObject = null; + SetupPreferences(); this.AddRayVisibilitySettings(rayOrigin, this, false, false); diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs index da21aa7fc..dc0c2cd55 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveTool.cs @@ -43,6 +43,9 @@ enum PrimitiveCreationStates void Start() { + // Clear selection so we can't manipulate things + Selection.activeGameObject = null; + m_ToolMenu = this.InstantiateMenuUI(rayOrigin, m_MenuPrefab); var createPrimitiveMenu = m_ToolMenu.GetComponent(); this.ConnectInterfaces(createPrimitiveMenu, rayOrigin); From f271e9412581f57722156dfe7983c61b31dfced5 Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Fri, 22 Sep 2017 14:10:41 -0700 Subject: [PATCH 856/870] Prevent ray from hiding on the device(hand) hosting the Annotation Tool UI --- Tools/AnnotationTool/AnnotationTool.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index ab2823fd4..760c0c151 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -199,10 +199,9 @@ void Start() SetupPreferences(); - this.AddRayVisibilitySettings(rayOrigin, this, false, false); - if (primary) { + this.AddRayVisibilitySettings(rayOrigin, this, false, false); SetupBrushUI(); HandleBrushSize(m_Preferences.brushSize); From 8c4b2be00b11d352a08488e696d1f3ce3c3fc2f6 Mon Sep 17 00:00:00 2001 From: andrewm Date: Fri, 22 Sep 2017 15:57:58 -0700 Subject: [PATCH 857/870] Pruning an unneeded meta file --- Menus/PinnedToolButton.meta | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 Menus/PinnedToolButton.meta diff --git a/Menus/PinnedToolButton.meta b/Menus/PinnedToolButton.meta deleted file mode 100644 index 403732562..000000000 --- a/Menus/PinnedToolButton.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 7746387eca80e444a883a4e9337c4769 -folderAsset: yes -timeCreated: 1496975208 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: From 38646396225067e3e67c16ee6e9c8f9d9f28e4cf Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 27 Sep 2017 22:20:50 -0700 Subject: [PATCH 858/870] Fix processing and consuming of input to avoid tools getting a wasJustReleased without ever getting wasJustPressed; The issue comes up when using the ToolsMenu. Hold grip, then hold trigger, switch tools, release grip, and your new tool instance will get a wasJustReleased on the trigger when you eventually release it. The fix is to reset AMIs to zero when they're created, and unlock controls in AMIs that are no longer active, because they no longer receive events and can get "stuck" on. --- Scripts/Core/EditorVR.Tools.cs | 11 ++++++++--- Scripts/Modules/DeviceInputModule.cs | 10 +++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 3378e1349..002fa21af 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -162,6 +162,8 @@ static ToolData SpawnTool(Type toolType, out HashSet usedDevices, I { usedDevices.UnionWith(actionMapInput.GetCurrentlyUsedDevices()); InputUtils.CollectDeviceSlotsFromActionMapInput(actionMapInput, ref deviceSlots); + + actionMapInput.Reset(false); } if (usedDevices.Count == 0) @@ -308,7 +310,8 @@ static void DespawnTool(DeviceData deviceData, ITool tool) return; } - deviceData.toolData.Pop(); + var oldTool = deviceData.toolData.Pop(); + oldTool.input.active = false; topTool = deviceData.toolData.Peek(); deviceData.currentTool = topTool.tool; @@ -321,7 +324,8 @@ static void DespawnTool(DeviceData deviceData, ITool tool) var otherTool = otherDeviceData.currentTool; if (otherTool == tool) { - otherDeviceData.toolData.Pop(); + oldTool = otherDeviceData.toolData.Pop(); + oldTool.input.active = false; var otherToolData = otherDeviceData.toolData.Peek(); if (otherToolData != null) otherDeviceData.currentTool = otherToolData.tool; @@ -335,7 +339,8 @@ static void DespawnTool(DeviceData deviceData, ITool tool) { if (otherTool.GetType() == toolType) { - otherDeviceData.toolData.Pop(); + oldTool = otherDeviceData.toolData.Pop(); + oldTool.input.active = false; var otherToolData = otherDeviceData.toolData.Peek(); if (otherToolData != null) { diff --git a/Scripts/Modules/DeviceInputModule.cs b/Scripts/Modules/DeviceInputModule.cs index 2676f8989..d3e3e97a5 100644 --- a/Scripts/Modules/DeviceInputModule.cs +++ b/Scripts/Modules/DeviceInputModule.cs @@ -67,7 +67,8 @@ public void ProcessInput() var removeList = new List(); foreach (var lockedControl in m_LockedControls) { - if (Mathf.Approximately(lockedControl.rawValue, lockedControl.provider.GetControlData(lockedControl.index).defaultValue)) + if (!lockedControl.provider.active || Mathf.Approximately(lockedControl.rawValue, + lockedControl.provider.GetControlData(lockedControl.index).defaultValue)) removeList.Add(lockedControl); else ConsumeControl(lockedControl); @@ -76,6 +77,9 @@ public void ProcessInput() // Remove separately, since we cannot remove while iterating foreach (var inputControl in removeList) { + if (!inputControl.provider.active) + ResetControl(inputControl); + m_LockedControls.Remove(inputControl); } @@ -211,7 +215,11 @@ void ConsumeControl(InputControl control) // another AMI to pick up a wasPressed the next frame, since it's own input would have been cleared. The // control is released when it returns to it's default value m_LockedControls.Add(control); + ResetControl(control); + } + void ResetControl(InputControl control) + { var ami = control.provider as ActionMapInput; var playerHandleMaps = m_PlayerHandle.maps; for (int i = 0; i < playerHandleMaps.Count; i++) From bbcb02efa729aa8ec08ec84c5d59204624687be8 Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Thu, 28 Sep 2017 11:03:21 -0700 Subject: [PATCH 859/870] fix blink locomotion when changing player scale --- Tools/LocomotionTool/LocomotionTool.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 96b68cd51..8a3b22600 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -199,7 +199,12 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon this.SetUIBlockedForRayOrigin(rayOrigin, true); if (DoTwoHandedScaling(consumeControl)) + { + if (m_Preferences.blinkMode) + if (DoBlink(consumeControl)) + return; return; + } if (DoRotating(consumeControl)) return; From da37b358ff351e542716d7efb89703196b42f8ae Mon Sep 17 00:00:00 2001 From: Stella Cannefax Date: Thu, 28 Sep 2017 13:22:10 -0700 Subject: [PATCH 860/870] cancel blink when caling instead of allowing it --- Tools/LocomotionTool/LocomotionTool.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/LocomotionTool/LocomotionTool.cs b/Tools/LocomotionTool/LocomotionTool.cs index 8a3b22600..91a1a0332 100644 --- a/Tools/LocomotionTool/LocomotionTool.cs +++ b/Tools/LocomotionTool/LocomotionTool.cs @@ -201,8 +201,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon if (DoTwoHandedScaling(consumeControl)) { if (m_Preferences.blinkMode) - if (DoBlink(consumeControl)) - return; + if (m_LocomotionInput.blink.isHeld) + m_BlinkVisuals.visible = false; return; } From c249a904feb0dda332bd05ff73dd0c374e79dd89 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 28 Sep 2017 13:43:10 -0700 Subject: [PATCH 861/870] Fix hidden MainMenuItems --- Menus/MainMenu/MainMenu.cs | 3 +++ Tools/AnnotationTool/AnnotationTool.cs | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index 2cf72fa6e..c02b25e42 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -157,6 +157,9 @@ void CreateFaceButtons() foreach (var type in types) { var customMenuAttribute = (MainMenuItemAttribute)type.GetCustomAttributes(typeof(MainMenuItemAttribute), false).FirstOrDefault(); + if (customMenuAttribute != null && !customMenuAttribute.shown) + continue; + var isTool = typeof(ITool).IsAssignableFrom(type) && menuTools.Contains(type); var isWorkspace = typeof(Workspace).IsAssignableFrom(type); var isSettingsProvider = typeof(ISettingsMenuProvider).IsAssignableFrom(type); diff --git a/Tools/AnnotationTool/AnnotationTool.cs b/Tools/AnnotationTool/AnnotationTool.cs index 760c0c151..a72c5362c 100644 --- a/Tools/AnnotationTool/AnnotationTool.cs +++ b/Tools/AnnotationTool/AnnotationTool.cs @@ -7,7 +7,6 @@ using UnityEditor.Experimental.EditorVR; using UnityEditor.Experimental.EditorVR.Core; using UnityEditor.Experimental.EditorVR.Extensions; -using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Proxies; using UnityEditor.Experimental.EditorVR.UI; using UnityEditor.Experimental.EditorVR.Utilities; From c4e308e0b7cf50a63e44d362a6e02309acc5b715 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 28 Sep 2017 14:20:14 -0700 Subject: [PATCH 862/870] Hide main menu when selecting tools with custom menus --- Menus/MainMenu/MainMenu.cs | 5 ++++- Scripts/Core/EditorVR.Menus.cs | 1 - Scripts/Core/EditorVR.Tools.cs | 5 +++-- Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs | 7 ++++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Menus/MainMenu/MainMenu.cs b/Menus/MainMenu/MainMenu.cs index c02b25e42..aecebb20b 100644 --- a/Menus/MainMenu/MainMenu.cs +++ b/Menus/MainMenu/MainMenu.cs @@ -189,11 +189,14 @@ void CreateFaceButtons() { if (targetRayOrigin) { - this.SelectTool(targetRayOrigin, selectedType); + this.SelectTool(targetRayOrigin, selectedType, + hideMenu: typeof(IInstantiateMenuUI).IsAssignableFrom(selectedType)); UpdateToolButtons(); } }); + m_ToolButtons[type] = mainMenuButton; + // Assign Tools Menu button preview properties if (mainMenuButton != null) mainMenuButton.toolType = selectedType; diff --git a/Scripts/Core/EditorVR.Menus.cs b/Scripts/Core/EditorVR.Menus.cs index 86e0a490e..28fae9d47 100644 --- a/Scripts/Core/EditorVR.Menus.cs +++ b/Scripts/Core/EditorVR.Menus.cs @@ -5,7 +5,6 @@ using UnityEditor.Experimental.EditorVR.Menus; using UnityEditor.Experimental.EditorVR.Modules; using UnityEditor.Experimental.EditorVR.Utilities; -using UnityEditor.Experimental.EditorVR.Workspaces; using UnityEngine; using UnityEngine.InputNew; diff --git a/Scripts/Core/EditorVR.Tools.cs b/Scripts/Core/EditorVR.Tools.cs index 002fa21af..d2604eb06 100644 --- a/Scripts/Core/EditorVR.Tools.cs +++ b/Scripts/Core/EditorVR.Tools.cs @@ -195,7 +195,7 @@ static bool IsToolActive(Transform targetRayOrigin, Type toolType) return result; } - internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawnOnReselect = true) + internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawnOnReselect = true, bool hideMenu = false) { var result = false; var deviceInputModule = evr.GetModule(); @@ -289,7 +289,8 @@ internal static bool SelectTool(Transform rayOrigin, Type toolType, bool despawn deviceInputModule.UpdatePlayerHandleMaps(); result = spawnTool; - } + } else if (hideMenu) + deviceData.menuHideData[deviceData.mainMenu].hideFlags |= MenuHideFlags.Hidden; }); return result; diff --git a/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs b/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs index 31e098583..fe77e4b39 100644 --- a/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs +++ b/Scripts/Interfaces/FunctionalityInjection/ISelectTool.cs @@ -13,7 +13,7 @@ public interface ISelectTool public static class ISelectToolMethods { - internal static Func selectTool { get; set; } + internal static Func selectTool { get; set; } internal static Func isToolActive { get; set; } /// @@ -23,9 +23,10 @@ public static class ISelectToolMethods /// The rayOrigin that the tool should spawn under /// Type of tool to spawn/select /// Despawn the tool, if re-selected while already the current tool - public static bool SelectTool(this ISelectTool obj, Transform rayOrigin, Type toolType, bool despawnOnReselect = true) + /// Whether to hide the menu after selecting this tool + public static bool SelectTool(this ISelectTool obj, Transform rayOrigin, Type toolType, bool despawnOnReselect = true, bool hideMenu = false) { - return selectTool(rayOrigin, toolType, despawnOnReselect); + return selectTool(rayOrigin, toolType, despawnOnReselect, hideMenu); } /// From ab139d0dce7f5239d9df9465a7d629e7c0ec00ad Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 28 Sep 2017 14:47:23 -0700 Subject: [PATCH 863/870] Clear submenus when hiding the main menu --- Menus/MainMenu/Scripts/MainMenuFace.cs | 8 ++++++++ Menus/MainMenu/Scripts/MainMenuUI.cs | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Menus/MainMenu/Scripts/MainMenuFace.cs b/Menus/MainMenu/Scripts/MainMenuFace.cs index 17a80d4a5..459c99cf6 100644 --- a/Menus/MainMenu/Scripts/MainMenuFace.cs +++ b/Menus/MainMenu/Scripts/MainMenuFace.cs @@ -181,6 +181,14 @@ public void RemoveSubmenu() else visible = true; } + + public void ClearSubmenus() + { + foreach (var submenu in m_Submenus) + { + ObjectUtils.Destroy(submenu); + } + } } } #endif diff --git a/Menus/MainMenu/Scripts/MainMenuUI.cs b/Menus/MainMenu/Scripts/MainMenuUI.cs index ba5ddb2f3..32a2ef263 100644 --- a/Menus/MainMenu/Scripts/MainMenuUI.cs +++ b/Menus/MainMenu/Scripts/MainMenuUI.cs @@ -378,7 +378,9 @@ IEnumerator AnimateHide() foreach (var kvp in m_Faces) { - kvp.Value.visible = false; + var face = kvp.Value; + face.visible = false; + face.ClearSubmenus(); } this.RestartCoroutine(ref m_FrameRevealCoroutine, AnimateFrameReveal(m_VisibilityState)); From b4f7423f9e386dbb4d6a5fbd867d5f11d65269e4 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 28 Sep 2017 15:27:56 -0700 Subject: [PATCH 864/870] Don't select tool until both grip and trigger are released --- Menus/ToolsMenu/ToolsMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Menus/ToolsMenu/ToolsMenu.cs b/Menus/ToolsMenu/ToolsMenu.cs index 665a3103f..86633948d 100644 --- a/Menus/ToolsMenu/ToolsMenu.cs +++ b/Menus/ToolsMenu/ToolsMenu.cs @@ -200,7 +200,7 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_ToolsMenuUI.HighlightSingleButtonWithoutMenu((int)(buttonCount * normalizedRepeatingPosition) + 1); } } - else if (toolslMenuInput.show.wasJustReleased) + else if (spatialScrollData != null && !toolslMenuInput.show.isHeld && !toolslMenuInput.select.isHeld) { consumeControl(toolslMenuInput.show); consumeControl(toolslMenuInput.select); From a04eb4dc81610a4e99bf2993ad79efd15c0998e5 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Thu, 28 Sep 2017 16:49:51 -0700 Subject: [PATCH 865/870] Catch input release to end drags when raycasts are invalidated --- .../MultipleRayInputModule/MultipleRayInputModule.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs index dde424972..c33000220 100644 --- a/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Scripts/Modules/MultipleRayInputModule/MultipleRayInputModule.cs @@ -141,6 +141,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon eventData.rayOrigin = rayOrigin; eventData.pointerLength = this.GetPointerLength(eventData.rayOrigin); + var sourceAMI = source.actionMapInput; + var select = sourceAMI.select; + if (source.isValid != null && !source.isValid(source)) { var currentRaycast = eventData.pointerCurrentRaycast; @@ -148,6 +151,9 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon eventData.pointerCurrentRaycast = currentRaycast; source.hoveredObject = null; HandlePointerExitAndEnter(eventData, null, true); // Send only exit events + + if (select.wasJustReleased) + OnSelectReleased(source); continue; } @@ -155,10 +161,8 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon var hasObject = source.hasObject; var hasScrollHandler = false; - var sourceAMI = source.actionMapInput; - sourceAMI.active = hasObject && ShouldActivateInput(eventData, source.currentObject, out hasScrollHandler); - var select = sourceAMI.select; + sourceAMI.active = hasObject && ShouldActivateInput(eventData, source.currentObject, out hasScrollHandler); // Proceed only if pointer is interacting with something if (!sourceAMI.active) From 4bfeef3b29542f7a2f7b9759fdaeb66117a2ba8e Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 28 Sep 2017 19:04:04 -0700 Subject: [PATCH 866/870] Fix materials and shader queues in CreatePrimitiveMenu --- .../Materials/PrimitiveMenuFaceBlur.mat | 88 + .../Materials/PrimitiveMenuFaceBlur.mat.meta | 8 + .../Materials/PrimitiveMenuFaceTitleIcon.mat | 83 + .../PrimitiveMenuFaceTitleIcon.mat.meta | 8 + .../CreatePrimitiveFace.prefab | 2054 ++++++++--------- Tools/CreatePrimitiveTool/Materials.meta | 9 + .../Materials/PrimitiveHighlightMaterial.mat | 86 + .../PrimitiveHighlightMaterial.mat.meta | 8 + 8 files changed, 1317 insertions(+), 1027 deletions(-) create mode 100644 Menus/MainMenu/Materials/PrimitiveMenuFaceBlur.mat create mode 100644 Menus/MainMenu/Materials/PrimitiveMenuFaceBlur.mat.meta create mode 100644 Menus/MainMenu/Materials/PrimitiveMenuFaceTitleIcon.mat create mode 100644 Menus/MainMenu/Materials/PrimitiveMenuFaceTitleIcon.mat.meta create mode 100644 Tools/CreatePrimitiveTool/Materials.meta create mode 100644 Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat create mode 100644 Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat.meta diff --git a/Menus/MainMenu/Materials/PrimitiveMenuFaceBlur.mat b/Menus/MainMenu/Materials/PrimitiveMenuFaceBlur.mat new file mode 100644 index 000000000..d193aa22a --- /dev/null +++ b/Menus/MainMenu/Materials/PrimitiveMenuFaceBlur.mat @@ -0,0 +1,88 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: PrimitiveMenuFaceBlur + m_Shader: {fileID: 4800000, guid: 1bc55feb3f493374ca90e594b518edb9, type: 3} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _METALLICGLOSSMAP + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: 9002 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: 06dc8da358c6ebb4dad67b286b513f95, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 2800000, guid: 3cd61233b718b974e99810df6209b4c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 79e3d026b08ce624a8e621c78501dcc8, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Blur: 1.75 + - _BumpAmt: 128 + - _BumpScale: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 0.414 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Height: 0.5 + - _InvFade: 1 + - _Metallic: 0.256 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Size: 2.4 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _VerticalOffset: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.67058825, g: 0.6784314, b: 0.68235296, a: 1} + - _EmisColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} diff --git a/Menus/MainMenu/Materials/PrimitiveMenuFaceBlur.mat.meta b/Menus/MainMenu/Materials/PrimitiveMenuFaceBlur.mat.meta new file mode 100644 index 000000000..3eac0657d --- /dev/null +++ b/Menus/MainMenu/Materials/PrimitiveMenuFaceBlur.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 29ebc77a4af34af4ba81bd2023ccff42 +timeCreated: 1469840733 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Menus/MainMenu/Materials/PrimitiveMenuFaceTitleIcon.mat b/Menus/MainMenu/Materials/PrimitiveMenuFaceTitleIcon.mat new file mode 100644 index 000000000..3b88ca4bf --- /dev/null +++ b/Menus/MainMenu/Materials/PrimitiveMenuFaceTitleIcon.mat @@ -0,0 +1,83 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: MenuFaceTitleIcon + m_Shader: {fileID: 4800000, guid: 269bee83d6b662e489c098a4f0d9af32, type: 3} + m_ShaderKeywords: _EMISSION _METALLICGLOSSMAP _NORMALMAP + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: 9001 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 2800000, guid: b2816b0a15efb7b4c9d7b0c9658cce91, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRamp: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 2800000, guid: 79598c28225d2d34b8302226bd9eef22, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: e3d142da281fe8c44a8ad1f5804bcab3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 2800000, guid: 5041e241ded3448438f63bdf4bef11fd, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1.5 + - _ColorRampOffset: 0 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 0.539 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _Scale: 4.4 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorBottom: {r: 1, g: 0, b: 0, a: 1} + - _ColorTop: {r: 1, g: 0.9724138, b: 0, a: 1} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Menus/MainMenu/Materials/PrimitiveMenuFaceTitleIcon.mat.meta b/Menus/MainMenu/Materials/PrimitiveMenuFaceTitleIcon.mat.meta new file mode 100644 index 000000000..279d8c78b --- /dev/null +++ b/Menus/MainMenu/Materials/PrimitiveMenuFaceTitleIcon.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d545179c863a727439708c70dbede63b +timeCreated: 1469832225 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/CreatePrimitiveTool/CreatePrimitiveFace.prefab b/Tools/CreatePrimitiveTool/CreatePrimitiveFace.prefab index fda3f1835..63d6fa607 100644 --- a/Tools/CreatePrimitiveTool/CreatePrimitiveFace.prefab +++ b/Tools/CreatePrimitiveTool/CreatePrimitiveFace.prefab @@ -120,24 +120,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!1 &1000010644996180 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000011005368084} - - component: {fileID: 222000011904075462} - - component: {fileID: 114000010267272198} - - component: {fileID: 114000011887283096} - m_Layer: 5 - m_Name: DarkBorder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000010661137776 GameObject: m_ObjectHideFlags: 1 @@ -213,23 +195,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!1 &1000011059673408 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000011376320242} - - component: {fileID: 222000010499700408} - - component: {fileID: 114000010109055550} - m_Layer: 5 - m_Name: BottomGradient - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000011089437460 GameObject: m_ObjectHideFlags: 0 @@ -266,41 +231,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000011110417906 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000014210877960} - - component: {fileID: 222000011641771042} - - component: {fileID: 114000011739519648} - - component: {fileID: 114000013325619148} - m_Layer: 5 - m_Name: DarkBorder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000011310853734 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000010235863198} - - component: {fileID: 222000011561633750} - - component: {fileID: 114000011284868134} - m_Layer: 5 - m_Name: BottomGradient - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000011333211488 GameObject: m_ObjectHideFlags: 1 @@ -318,24 +248,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000011498448642 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000014229136954} - - component: {fileID: 222000010018270640} - - component: {fileID: 114000013158287060} - - component: {fileID: 114000012099471514} - m_Layer: 5 - m_Name: DarkBorder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000011517943824 GameObject: m_ObjectHideFlags: 0 @@ -390,24 +302,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000011999998658 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000014172343144} - - component: {fileID: 222000013538525208} - - component: {fileID: 114000011197410516} - - component: {fileID: 114000013178525608} - m_Layer: 5 - m_Name: DarkBorder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000012000597718 GameObject: m_ObjectHideFlags: 1 @@ -481,58 +375,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000012373485310 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000010764480566} - - component: {fileID: 222000011218114644} - - component: {fileID: 114000010170039818} - m_Layer: 5 - m_Name: BottomGradient - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000012390287034 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000012588483764} - - component: {fileID: 222000010128789308} - - component: {fileID: 114000010875122166} - - component: {fileID: 114000014241057256} - m_Layer: 5 - m_Name: DarkBorder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1000012517550804 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000010987116282} - - component: {fileID: 222000013019011836} - - component: {fileID: 114000012955332070} - m_Layer: 5 - m_Name: BottomGradient - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000012544754942 GameObject: m_ObjectHideFlags: 1 @@ -568,23 +410,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000012696244014 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000013424581814} - - component: {fileID: 222000012518087542} - - component: {fileID: 114000012801542556} - m_Layer: 5 - m_Name: BottomGradient - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000012725394446 GameObject: m_ObjectHideFlags: 1 @@ -641,24 +466,6 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000012907630404 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 224000011246906016} - - component: {fileID: 222000010694922734} - - component: {fileID: 114000010666244620} - - component: {fileID: 114000011193706580} - m_Layer: 5 - m_Name: DarkBorder - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 --- !u!1 &1000013092056910 GameObject: m_ObjectHideFlags: 0 @@ -766,16 +573,33 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000014147571280 +--- !u!1 &1000014239997716 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224000014196820934} + - component: {fileID: 222000010610842614} + - component: {fileID: 114000013332581618} + m_Layer: 5 + m_Name: ButtonTitleText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1196469452683946 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224000011628721146} - - component: {fileID: 222000011816285162} - - component: {fileID: 114000010385304600} + - component: {fileID: 224419238837156718} + - component: {fileID: 222461720622656372} + - component: {fileID: 114900267004840132} m_Layer: 5 m_Name: BottomGradient m_TagString: Untagged @@ -783,87 +607,263 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!1 &1000014239997716 +--- !u!1 &1209618943477620 GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 224000014196820934} - - component: {fileID: 222000010610842614} - - component: {fileID: 114000013332581618} + - component: {fileID: 224997655154928476} + - component: {fileID: 222042780215141314} + - component: {fileID: 114653397756992388} + - component: {fileID: 114605978151146428} m_Layer: 5 - m_Name: ButtonTitleText + m_Name: DarkBorder m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4000010318890162 -Transform: +--- !u!1 &1362684020872496 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010335982858} - m_LocalRotation: {x: -0.67187977, y: 0.25905934, z: 0.24962868, w: 0.64741904} - m_LocalPosition: {x: -0.0009918213, y: 0.0002746582, z: -24.63913} - m_LocalScale: {x: 7.0261793, y: 5.000002, z: 5.0000014} - m_Children: [] - m_Father: {fileID: 224000013145140612} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: -92.145, y: 0, z: 42.300995} ---- !u!4 &4000010637833178 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 224461694288040006} + - component: {fileID: 222980656194473178} + - component: {fileID: 114761637686007526} + - component: {fileID: 114194033113860186} + m_Layer: 5 + m_Name: DarkBorder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1367211610219000 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012544754942} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -7.4} - m_LocalScale: {x: 30, y: 30, z: 30} - m_Children: [] - m_Father: {fileID: 224000011121755254} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000010954741666 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 224723325700454700} + - component: {fileID: 222472815541221404} + - component: {fileID: 114638578530556636} + m_Layer: 5 + m_Name: BottomGradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1376517711373532 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012760086958} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.0009918213, y: -0.000061035156, z: -7.4005127} - m_LocalScale: {x: 30, y: 30, z: 30} - m_Children: [] - m_Father: {fileID: 224000011121755254} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000011769013704 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 224171136284902724} + - component: {fileID: 222556451076432210} + - component: {fileID: 114782616143408774} + - component: {fileID: 114655998014461066} + m_Layer: 5 + m_Name: DarkBorder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1393210497505692 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013092056910} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 2000, y: 2000, z: 1} - m_Children: [] - m_Father: {fileID: 224000011229100770} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4000011953800812 -Transform: + serializedVersion: 5 + m_Component: + - component: {fileID: 224654219393241866} + - component: {fileID: 222215196683496190} + - component: {fileID: 114266947676094728} + m_Layer: 5 + m_Name: BottomGradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1538715559639108 +GameObject: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012315570892} - m_LocalRotation: {x: -0.67187977, y: 0.25905934, z: 0.24962868, w: 0.64741904} - m_LocalPosition: {x: 0.00091552734, y: 0.000030517578, z: -24.64} - m_LocalScale: {x: 7.026179, y: 5, z: 5} - m_Children: [] - m_Father: {fileID: 224000013145140612} - m_RootOrder: 1 + serializedVersion: 5 + m_Component: + - component: {fileID: 224740489758857944} + - component: {fileID: 222549219171442644} + - component: {fileID: 114262155110737228} + - component: {fileID: 114026895163728776} + m_Layer: 5 + m_Name: DarkBorder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1608864552122780 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224469818084784240} + - component: {fileID: 222693740761696298} + - component: {fileID: 114576608685551192} + - component: {fileID: 114174430136067288} + m_Layer: 5 + m_Name: DarkBorder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1769629075932732 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224911716276251332} + - component: {fileID: 222924110203291088} + - component: {fileID: 114900307023338552} + m_Layer: 5 + m_Name: BottomGradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1867019978743886 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224015015573571334} + - component: {fileID: 222007368942781106} + - component: {fileID: 114358614626430760} + m_Layer: 5 + m_Name: BottomGradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1883261798485468 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224378105422357862} + - component: {fileID: 222442778402104128} + - component: {fileID: 114649564416260658} + - component: {fileID: 114418284321204994} + m_Layer: 5 + m_Name: DarkBorder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1973720247898706 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 224597714034194014} + - component: {fileID: 222174212506385880} + - component: {fileID: 114047456196411236} + m_Layer: 5 + m_Name: BottomGradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4000010318890162 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010335982858} + m_LocalRotation: {x: -0.67187977, y: 0.25905934, z: 0.24962868, w: 0.64741904} + m_LocalPosition: {x: -0.0009918213, y: 0.0002746582, z: -24.63913} + m_LocalScale: {x: 7.0261793, y: 5.000002, z: 5.0000014} + m_Children: [] + m_Father: {fileID: 224000013145140612} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: -92.145, y: 0, z: 42.300995} +--- !u!4 &4000010637833178 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012544754942} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -7.4} + m_LocalScale: {x: 30, y: 30, z: 30} + m_Children: [] + m_Father: {fileID: 224000011121755254} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000010954741666 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012760086958} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.0009918213, y: -0.000061035156, z: -7.4005127} + m_LocalScale: {x: 30, y: 30, z: 30} + m_Children: [] + m_Father: {fileID: 224000011121755254} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011769013704 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013092056910} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2000, y: 2000, z: 1} + m_Children: [] + m_Father: {fileID: 224000011229100770} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4000011953800812 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012315570892} + m_LocalRotation: {x: -0.67187977, y: 0.25905934, z: 0.24962868, w: 0.64741904} + m_LocalPosition: {x: 0.00091552734, y: 0.000030517578, z: -24.64} + m_LocalScale: {x: 7.026179, y: 5, z: 5} + m_Children: [] + m_Father: {fileID: 224000013145140612} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: -92.145, y: 0, z: 42.300995} --- !u!4 &4000012196926090 Transform: @@ -872,7 +872,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010923335932} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -0.00018310547, z: -1.9989014} + m_LocalPosition: {x: 0, y: -0.00018310547, z: -1.9989004} m_LocalScale: {x: 69.375, y: 13.1249895, z: 30} m_Children: [] m_Father: {fileID: 224000012053660648} @@ -898,7 +898,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010327171912} m_LocalRotation: {x: -0, y: -1, z: -0, w: 0} - m_LocalPosition: {x: -112.00004, y: 461.50934, z: 0.909} + m_LocalPosition: {x: -112.00004, y: 461.50934, z: 0.54} m_LocalScale: {x: 2000.0004, y: 2000, z: 12.33198} m_Children: [] m_Father: {fileID: 224000011229100770} @@ -1072,7 +1072,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_Materials: - - {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, type: 2} + - {fileID: 2100000, guid: 757c41cd0c235a545b96e031fcc52dd9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1104,7 +1104,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_Materials: - - {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, type: 2} + - {fileID: 2100000, guid: 757c41cd0c235a545b96e031fcc52dd9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1168,7 +1168,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_Materials: - - {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, type: 2} + - {fileID: 2100000, guid: 757c41cd0c235a545b96e031fcc52dd9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1200,7 +1200,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_Materials: - - {fileID: 2100000, guid: 28e9fbed519bbbe42a7cdf1ef9f917b0, type: 2} + - {fileID: 2100000, guid: 29ebc77a4af34af4ba81bd2023ccff42, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1232,7 +1232,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_Materials: - - {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, type: 2} + - {fileID: 2100000, guid: 757c41cd0c235a545b96e031fcc52dd9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1264,7 +1264,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_Materials: - - {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, type: 2} + - {fileID: 2100000, guid: 757c41cd0c235a545b96e031fcc52dd9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1424,7 +1424,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_Materials: - - {fileID: 2100000, guid: 126c02ff78e41384a9ea90e2e8d351ad, type: 2} + - {fileID: 2100000, guid: 757c41cd0c235a545b96e031fcc52dd9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1616,33 +1616,6 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.17, y: 0.2677734, z: 0.001} m_Center: {x: 0, y: 0.1233885, z: 0} ---- !u!114 &114000010109055550 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011059673408} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 --- !u!114 &114000010118303946 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1684,33 +1657,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!114 &114000010170039818 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012373485310} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 --- !u!114 &114000010260101998 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1763,33 +1709,6 @@ MonoBehaviour: m_CallState: 1 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null ---- !u!114 &114000010267272198 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010644996180} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 --- !u!114 &114000010289911076 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1804,33 +1723,6 @@ MonoBehaviour: m_Button: {fileID: 114000010260101998} m_ButtonDescription: {fileID: 0} m_ButtonTitle: {fileID: 0} ---- !u!114 &114000010385304600 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014147571280} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 --- !u!114 &114000010422884470 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1916,7 +1808,7 @@ MonoBehaviour: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012169470594} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: @@ -1940,85 +1832,31 @@ MonoBehaviour: - {fileID: 1000012000597718} - {fileID: 1000010335982858} - {fileID: 1000010923335932} ---- !u!114 &114000010666244620 +--- !u!114 &114000010690029698 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012907630404} + m_GameObject: {fileID: 1000010025584264} m_Enabled: 1 m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SelectionFlags: 3 +--- !u!114 &114000010887635516 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011089437460} + m_Enabled: 0 + m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114000010690029698 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010025584264} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_SelectionFlags: 3 ---- !u!114 &114000010875122166 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012390287034} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114000010887635516 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011089437460} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.128, g: 0.128, b: 0.128, a: 1} + m_Color: {r: 0.128, g: 0.128, b: 0.128, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: @@ -2096,7 +1934,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -2187,72 +2025,6 @@ MonoBehaviour: m_Spacing: {x: 5.67, y: 11} m_Constraint: 1 m_ConstraintCount: 1 ---- !u!114 &114000011193706580 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012907630404} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 ---- !u!114 &114000011197410516 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011999998658} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114000011284868134 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011310853734} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 --- !u!114 &114000011327615652 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2305,33 +2077,6 @@ MonoBehaviour: m_CallState: 1 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null ---- !u!114 &114000011739519648 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011110417906} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 --- !u!114 &114000011782961426 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2343,7 +2088,7 @@ MonoBehaviour: m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -2376,7 +2121,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -2398,7 +2143,7 @@ MonoBehaviour: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012169470594} - m_Enabled: 1 + m_Enabled: 0 m_EditorHideFlags: 0 m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: @@ -2419,18 +2164,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!114 &114000011887283096 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010644996180} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 --- !u!114 &114000011903463060 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2510,18 +2243,6 @@ MonoBehaviour: m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 ---- !u!114 &114000012099471514 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011498448642} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 --- !u!114 &114000012099991742 MonoBehaviour: m_ObjectHideFlags: 1 @@ -2568,7 +2289,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -2622,72 +2343,63 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_ShowMaskGraphic: 0 ---- !u!114 &114000012801542556 +--- !u!114 &114000013063745336 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012696244014} + m_GameObject: {fileID: 1000010089145424} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} - m_RaycastTarget: 1 + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114000012955332070 + m_FontData: + m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} + m_FontSize: 10 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 300 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Draw 3D rectangles of any dimension +--- !u!114 &114000013154046198 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012517550804} + m_GameObject: {fileID: 1000013224359186} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114000013063745336 + m_SelectionFlags: 3 +--- !u!114 &114000013332581618 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010089145424} + m_GameObject: {fileID: 1000014239997716} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 0 m_OnCullStateChanged: @@ -2697,7 +2409,7 @@ MonoBehaviour: Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} - m_FontSize: 10 + m_FontSize: 24 m_FontStyle: 0 m_BestFit: 0 m_MinSize: 0 @@ -2706,125 +2418,29 @@ MonoBehaviour: m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 - m_VerticalOverflow: 1 + m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Draw 3D rectangles of any dimension ---- !u!114 &114000013154046198 + m_Text: Freeform Cuboid +--- !u!114 &114000013352514132 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013224359186} + m_GameObject: {fileID: 1000012793610504} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4fb8f7696afa96048aa938286d04f96c, type: 3} + m_Script: {fileID: 11500000, guid: d6fdf9e0896ac3f4e94809a2cb14ceb8, type: 3} m_Name: m_EditorClassIdentifier: - m_SelectionFlags: 3 ---- !u!114 &114000013158287060 + m_Button: {fileID: 114000013405031928} + m_ButtonDescription: {fileID: 0} + m_ButtonTitle: {fileID: 0} +--- !u!114 &114000013405031928 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011498448642} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!114 &114000013178525608 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011999998658} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 ---- !u!114 &114000013325619148 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011110417906} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ShowMaskGraphic: 0 ---- !u!114 &114000013332581618 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014239997716} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 0 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_FontData: - m_Font: {fileID: 12800000, guid: 013679fd6ee2085428a7f896aa7b50cc, type: 3} - m_FontSize: 24 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 0 - m_MaxSize: 300 - m_Alignment: 3 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Freeform Cuboid ---- !u!114 &114000013352514132 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012793610504} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d6fdf9e0896ac3f4e94809a2cb14ceb8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Button: {fileID: 114000013405031928} - m_ButtonDescription: {fileID: 0} - m_ButtonTitle: {fileID: 0} ---- !u!114 &114000013405031928 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012793610504} + m_GameObject: {fileID: 1000012793610504} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} @@ -2909,7 +2525,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -2952,7 +2568,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -2979,7 +2595,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -3043,7 +2659,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} + m_Material: {fileID: 2100000, guid: dec2d25be9058334c91a0402762efa61, type: 2} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -3125,100 +2741,484 @@ MonoBehaviour: m_Button: {fileID: 114000010903254168} m_ButtonDescription: {fileID: 0} m_ButtonTitle: {fileID: 0} ---- !u!114 &114000014241057256 +--- !u!114 &114026895163728776 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012390287034} + m_GameObject: {fileID: 1538715559639108} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: m_ShowMaskGraphic: 0 ---- !u!135 &135000012577857280 -SphereCollider: +--- !u!114 &114047456196411236 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013224359186} - m_Material: {fileID: 0} - m_IsTrigger: 0 + m_GameObject: {fileID: 1973720247898706} m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} ---- !u!135 &135000014035549988 -SphereCollider: + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114174430136067288 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010025584264} - m_Material: {fileID: 0} - m_IsTrigger: 0 + m_GameObject: {fileID: 1608864552122780} m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} ---- !u!136 &136000010592068232 -CapsuleCollider: + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!114 &114194033113860186 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012544754942} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!136 &136000010898941284 -CapsuleCollider: + m_GameObject: {fileID: 1362684020872496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!114 &114262155110737228 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013300499198} + m_GameObject: {fileID: 1538715559639108} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!136 &136000011426748216 -CapsuleCollider: + m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114266947676094728 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013855096706} + m_GameObject: {fileID: 1393210497505692} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!136 &136000013013544458 -CapsuleCollider: + m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114358614626430760 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012760086958} + m_GameObject: {fileID: 1867019978743886} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 0 - m_Radius: 0.5 - m_Height: 2 - m_Direction: 1 - m_Center: {x: 0, y: 0, z: 0} ---- !u!137 &137000011730458282 -SkinnedMeshRenderer: + m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114418284321204994 +MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010327171912} + m_GameObject: {fileID: 1883261798485468} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!114 &114576608685551192 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1608864552122780} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114605978151146428 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1209618943477620} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!114 &114638578530556636 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1367211610219000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114649564416260658 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1883261798485468} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114653397756992388 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1209618943477620} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114655998014461066 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1376517711373532} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1200242548, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 +--- !u!114 &114761637686007526 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1362684020872496} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114782616143408774 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1376517711373532} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.441, g: 0.441, b: 0.441, a: 0.584} + m_RaycastTarget: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114900267004840132 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1196469452683946} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!114 &114900307023338552 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1769629075932732} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.2205882, g: 0.2205882, b: 0.2205882, a: 0.184} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: 869a6814efca00640a42b89a77defac3, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!135 &135000012577857280 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013224359186} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!135 &135000014035549988 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010025584264} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!136 &136000010592068232 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012544754942} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!136 &136000010898941284 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013300499198} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!136 &136000011426748216 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000013855096706} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!136 &136000013013544458 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012760086958} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!137 &137000011730458282 +SkinnedMeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000010327171912} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -3258,24 +3258,12 @@ SkinnedMeshRenderer: m_Center: {x: 0, y: -0.00000000721775, z: 0.072960004} m_Extent: {x: 0.006922297, y: 0.0069223046, z: 0.0000000037252903} m_DirtyAABB: 0 ---- !u!222 &222000010018270640 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011498448642} --- !u!222 &222000010044153732 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000012641942662} ---- !u!222 &222000010128789308 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012390287034} --- !u!222 &222000010211594450 CanvasRenderer: m_ObjectHideFlags: 1 @@ -3294,24 +3282,12 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000011832179620} ---- !u!222 &222000010499700408 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011059673408} --- !u!222 &222000010610842614 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000014239997716} ---- !u!222 &222000010694922734 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012907630404} --- !u!222 &222000010755667978 CanvasRenderer: m_ObjectHideFlags: 1 @@ -3330,12 +3306,6 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010275943082} ---- !u!222 &222000011218114644 -CanvasRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012373485310} --- !u!222 &222000011259795686 CanvasRenderer: m_ObjectHideFlags: 1 @@ -3348,84 +3318,114 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1000010914632010} ---- !u!222 &222000011561633750 +--- !u!222 &222000011578616410 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011310853734} ---- !u!222 &222000011578616410 + m_GameObject: {fileID: 1000012725394446} +--- !u!222 &222000012223792130 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012725394446} ---- !u!222 &222000011641771042 + m_GameObject: {fileID: 1000010661137776} +--- !u!222 &222000012423865254 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011110417906} ---- !u!222 &222000011816285162 + m_GameObject: {fileID: 1000011101126812} +--- !u!222 &222000012552548132 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014147571280} ---- !u!222 &222000011904075462 + m_GameObject: {fileID: 1000012793610504} +--- !u!222 &222000013482066022 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010644996180} ---- !u!222 &222000012223792130 + m_GameObject: {fileID: 1000012169470594} +--- !u!222 &222000013816290066 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010661137776} ---- !u!222 &222000012423865254 + m_GameObject: {fileID: 1000013922948544} +--- !u!222 &222007368942781106 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011101126812} ---- !u!222 &222000012518087542 + m_GameObject: {fileID: 1867019978743886} +--- !u!222 &222042780215141314 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012696244014} ---- !u!222 &222000012552548132 + m_GameObject: {fileID: 1209618943477620} +--- !u!222 &222174212506385880 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012793610504} ---- !u!222 &222000013019011836 + m_GameObject: {fileID: 1973720247898706} +--- !u!222 &222215196683496190 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012517550804} ---- !u!222 &222000013482066022 + m_GameObject: {fileID: 1393210497505692} +--- !u!222 &222442778402104128 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012169470594} ---- !u!222 &222000013538525208 + m_GameObject: {fileID: 1883261798485468} +--- !u!222 &222461720622656372 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011999998658} ---- !u!222 &222000013816290066 + m_GameObject: {fileID: 1196469452683946} +--- !u!222 &222472815541221404 CanvasRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000013922948544} + m_GameObject: {fileID: 1367211610219000} +--- !u!222 &222549219171442644 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1538715559639108} +--- !u!222 &222556451076432210 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1376517711373532} +--- !u!222 &222693740761696298 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1608864552122780} +--- !u!222 &222924110203291088 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1769629075932732} +--- !u!222 &222980656194473178 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1362684020872496} --- !u!223 &223000012660392470 Canvas: m_ObjectHideFlags: 1 @@ -3464,24 +3464,6 @@ RectTransform: m_AnchoredPosition: {x: -0.0000038146973, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000010235863198 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011310853734} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000011916117714} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: -0.0043692775, y: 0.00665834} - m_AnchorMax: {x: 1.0043693, y: 0.99995816} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010359583578 RectTransform: m_ObjectHideFlags: 1 @@ -3492,7 +3474,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000011005368084} + - {fileID: 224997655154928476} - {fileID: 224000014196820934} - {fileID: 224000010235177336} m_Father: {fileID: 224000012595526064} @@ -3503,24 +3485,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000010764480566 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012373485310} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000011246906016} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: -0.0043692775, y: 0.00665834} - m_AnchorMax: {x: 1.0043693, y: 0.99995816} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000010952075314 RectTransform: m_ObjectHideFlags: 1 @@ -3531,25 +3495,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 224000014172343144} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: -0.0043692775, y: 0.00665834} - m_AnchorMax: {x: 1.0043693, y: 0.99995816} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000010987116282 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012517550804} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000014210877960} + m_Father: {fileID: 224171136284902724} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: -0.0043692775, y: 0.00665834} @@ -3557,25 +3503,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000011005368084 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000010644996180} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000013424581814} - m_Father: {fileID: 224000010359583578} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: -0.020258093} - m_AnchorMax: {x: 1, y: 0.95507276} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011121755254 RectTransform: m_ObjectHideFlags: 1 @@ -3586,7 +3513,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0.000579834} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000011246906016} + - {fileID: 224740489758857944} - {fileID: 4000010637833178} - {fileID: 4000010954741666} m_Father: {fileID: 224000012161918328} @@ -3605,7 +3532,7 @@ RectTransform: m_GameObject: {fileID: 1000012291599038} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.0005, y: 0.0005, z: 0.0005} + m_LocalScale: {x: 0.0005091887, y: 0.0005091887, z: 0.0005091887} m_Children: - {fileID: 4000013417422256} - {fileID: 224000012161918328} @@ -3619,28 +3546,9 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchoredPosition: {x: -0.0000052452087, y: 0} m_SizeDelta: {x: 299.422, y: 505.702} m_Pivot: {x: 0.5, y: -0.0000000037252903} ---- !u!224 &224000011246906016 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012907630404} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000010764480566} - m_Father: {fileID: 224000011121755254} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: -0.020258093} - m_AnchorMax: {x: 1, y: 0.95507276} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011268075268 RectTransform: m_ObjectHideFlags: 1 @@ -3651,7 +3559,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0.000579834} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000012588483764} + - {fileID: 224171136284902724} - {fileID: 4000012326591154} - {fileID: 4000014107605000} m_Father: {fileID: 224000012161918328} @@ -3662,42 +3570,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000011376320242 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011059673408} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000014229136954} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: -0.0043692775, y: 0.00665834} - m_AnchorMax: {x: 1.0043693, y: 0.99995816} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000011628721146 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014147571280} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000012588483764} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: -0.0043692775, y: 0.00665834} - m_AnchorMax: {x: 1.0043693, y: 0.99995816} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000011916117714 RectTransform: m_ObjectHideFlags: 1 @@ -3708,8 +3580,8 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000010235863198} - m_Father: {fileID: 224000012613887384} + - {fileID: 224654219393241866} + m_Father: {fileID: 224000013747587530} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: -0.020258093} @@ -3727,7 +3599,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0.000579834} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000014210877960} + - {fileID: 224469818084784240} - {fileID: 4000013601339108} - {fileID: 4000012196926090} m_Father: {fileID: 224000012161918328} @@ -3759,7 +3631,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.03276894, y: 0.034720626} m_AnchorMax: {x: 0.96723104, y: 0.8348801} - m_AnchoredPosition: {x: 0, y: 106.3} + m_AnchoredPosition: {x: 0, y: 106.29999} m_SizeDelta: {x: 0, y: -212.6} m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012254771036 @@ -3777,28 +3649,9 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0.0000000052683564} + m_AnchoredPosition: {x: 0, y: 0.0000000055879354} m_SizeDelta: {x: 0.05, y: 0.05} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000012588483764 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012390287034} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 224000011628721146} - m_Father: {fileID: 224000011268075268} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: -0.020258093} - m_AnchorMax: {x: 1, y: 0.95507276} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000012595526064 RectTransform: m_ObjectHideFlags: 1 @@ -3828,7 +3681,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0.000579834} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000011916117714} + - {fileID: 224378105422357862} - {fileID: 4000013146384874} - {fileID: 4000013207186296} m_Father: {fileID: 224000012161918328} @@ -3849,7 +3702,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0.000579834} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000014229136954} + - {fileID: 224461694288040006} - {fileID: 4000011953800812} - {fileID: 4000010318890162} m_Father: {fileID: 224000012161918328} @@ -3860,24 +3713,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000013424581814 -RectTransform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012696244014} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000011005368084} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: -0.0043692775, y: 0.00665834} - m_AnchorMax: {x: 1.0043693, y: 0.99995816} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0.5, y: 0.5} --- !u!224 &224000013747587530 RectTransform: m_ObjectHideFlags: 1 @@ -3888,7 +3723,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0.000579834} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000014172343144} + - {fileID: 224000011916117714} - {fileID: 4000013941714776} - {fileID: 4000013993254404} m_Father: {fileID: 224000012161918328} @@ -3915,21 +3750,75 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 258.6, y: -20.2} + m_AnchoredPosition: {x: 258.6, y: -20.200012} m_SizeDelta: {x: 0.05, y: 0.05} m_Pivot: {x: 0.5, y: 1} ---- !u!224 &224000014172343144 +--- !u!224 &224000014196820934 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000014239997716} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000010359583578} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.054141335, y: 0.3430812} + m_AnchorMax: {x: 0.94585866, y: 0.89544195} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224000014210530896 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000012641942662} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.25} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011229100770} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.0415801, y: 0.8602893} + m_AnchorMax: {x: 0.9584199, y: 0.96668} + m_AnchoredPosition: {x: -0.000005722046, y: 0} + m_SizeDelta: {x: -97.9, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224015015573571334 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1867019978743886} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224461694288040006} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: -0.0043692775, y: 0.00665834} + m_AnchorMax: {x: 1.0043693, y: 0.99995816} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224171136284902724 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011999998658} + m_GameObject: {fileID: 1376517711373532} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 224000010952075314} - m_Father: {fileID: 224000013747587530} + m_Father: {fileID: 224000011268075268} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: -0.020258093} @@ -3937,53 +3826,73 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000014196820934 +--- !u!224 &224378105422357862 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000014239997716} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_GameObject: {fileID: 1883261798485468} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 224000010359583578} - m_RootOrder: 1 + m_Children: + - {fileID: 224911716276251332} + m_Father: {fileID: 224000012613887384} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.054141335, y: 0.3430812} - m_AnchorMax: {x: 0.94585866, y: 0.89544195} + m_AnchorMin: {x: 0, y: -0.020258093} + m_AnchorMax: {x: 1, y: 0.95507276} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000014210530896 +--- !u!224 &224419238837156718 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000012641942662} + m_GameObject: {fileID: 1196469452683946} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 224000011229100770} - m_RootOrder: 4 + m_Father: {fileID: 224740489758857944} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.0415801, y: 0.8602893} - m_AnchorMax: {x: 0.9584199, y: 0.96668} - m_AnchoredPosition: {x: -0.000005722046, y: 0} - m_SizeDelta: {x: -97.9, y: 0} + m_AnchorMin: {x: -0.0043692775, y: 0.00665834} + m_AnchorMax: {x: 1.0043693, y: 0.99995816} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224461694288040006 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1362684020872496} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224015015573571334} + m_Father: {fileID: 224000013145140612} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: -0.020258093} + m_AnchorMax: {x: 1, y: 0.95507276} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000014210877960 +--- !u!224 &224469818084784240 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011110417906} + m_GameObject: {fileID: 1608864552122780} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000010987116282} + - {fileID: 224723325700454700} m_Father: {fileID: 224000012053660648} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -3992,18 +3901,109 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!224 &224000014229136954 +--- !u!224 &224597714034194014 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1973720247898706} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224997655154928476} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: -0.0043692775, y: 0.00665834} + m_AnchorMax: {x: 1.0043693, y: 0.99995816} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224654219393241866 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1393210497505692} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224000011916117714} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: -0.0043692775, y: 0.00665834} + m_AnchorMax: {x: 1.0043693, y: 0.99995816} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224723325700454700 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1367211610219000} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224469818084784240} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: -0.0043692775, y: 0.00665834} + m_AnchorMax: {x: 1.0043693, y: 0.99995816} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224740489758857944 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1538715559639108} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 224419238837156718} + m_Father: {fileID: 224000011121755254} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: -0.020258093} + m_AnchorMax: {x: 1, y: 0.95507276} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224911716276251332 +RectTransform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1769629075932732} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 224378105422357862} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: -0.0043692775, y: 0.00665834} + m_AnchorMax: {x: 1.0043693, y: 0.99995816} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &224997655154928476 RectTransform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1000011498448642} + m_GameObject: {fileID: 1209618943477620} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 224000011376320242} - m_Father: {fileID: 224000013145140612} + - {fileID: 224597714034194014} + m_Father: {fileID: 224000010359583578} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: -0.020258093} diff --git a/Tools/CreatePrimitiveTool/Materials.meta b/Tools/CreatePrimitiveTool/Materials.meta new file mode 100644 index 000000000..5f5586339 --- /dev/null +++ b/Tools/CreatePrimitiveTool/Materials.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d281a92b69feb8b41a09bc6868c34f18 +folderAsset: yes +timeCreated: 1506641039 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat b/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat new file mode 100644 index 000000000..8c7fc4851 --- /dev/null +++ b/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat @@ -0,0 +1,86 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: PrimitiveHighlightMaterial + m_Shader: {fileID: 4800000, guid: 9c58ee7b67645404e9542c09f160ccb9, type: 3} + m_ShaderKeywords: ROTATE_GRADIENT _ALPHAPREMULTIPLY_ON _EMISSION _GLOSSYREFLECTIONS_OFF + _SPECULARHIGHLIGHTS_OFF + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_CustomRenderQueue: 9002 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 1 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 3 + - _ObjectScale: -0.05 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _RotateGradient: 1 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _StencilRef: 2 + - _Thickness: 0.25 + - _UVSec: 0 + - _ZWrite: 0 + - g_flCornerAdjust: 1.3 + - g_flOutlineWidth: 0.003 + m_Colors: + - _Color: {r: 1, g: 0.4, b: 0, a: 0} + - _ColorBottom: {r: 0, g: 0.76256925, b: 0.83137256, a: 1} + - _ColorTop: {r: 0, g: 0.79697084, b: 0.83137256, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - g_vOutlineColor: {r: 0.011764706, g: 0.6627451, b: 0.95686275, a: 1} diff --git a/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat.meta b/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat.meta new file mode 100644 index 000000000..23d96b9b0 --- /dev/null +++ b/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 757c41cd0c235a545b96e031fcc52dd9 +timeCreated: 1468622805 +licenseType: Pro +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: From 0d364b1e5bc7be8dcdecbd1f53bf590398ffd8dc Mon Sep 17 00:00:00 2001 From: Dylan Urquidi Date: Thu, 28 Sep 2017 19:17:15 -0700 Subject: [PATCH 867/870] Set new material queue for the primitive menu object highlights --- .../Materials/PrimitiveHighlightMaterial.mat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat b/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat index 8c7fc4851..9cc70edc9 100644 --- a/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat +++ b/Tools/CreatePrimitiveTool/Materials/PrimitiveHighlightMaterial.mat @@ -12,7 +12,7 @@ Material: _SPECULARHIGHLIGHTS_OFF m_LightmapFlags: 1 m_EnableInstancingVariants: 0 - m_CustomRenderQueue: 9002 + m_CustomRenderQueue: 9104 stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: @@ -79,7 +79,7 @@ Material: - g_flCornerAdjust: 1.3 - g_flOutlineWidth: 0.003 m_Colors: - - _Color: {r: 1, g: 0.4, b: 0, a: 0} + - _Color: {r: 1, g: 0.39999998, b: 0, a: 1} - _ColorBottom: {r: 0, g: 0.76256925, b: 0.83137256, a: 1} - _ColorTop: {r: 0, g: 0.79697084, b: 0.83137256, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} From d92b50419cf33101e8acc374a012395cc8aad0ac Mon Sep 17 00:00:00 2001 From: andrewm Date: Fri, 29 Sep 2017 13:24:46 -0700 Subject: [PATCH 868/870] Fixed an inactive close button from being toggled --- Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs index 0518bca6d..2f3560540 100644 --- a/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs +++ b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs @@ -519,6 +519,10 @@ void OnBackgroundButtonClick() void OnSecondaryButtonClicked() { + if (!implementsSecondaryButton) + { + return; + } this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); closeButton(); ActionButtonHoverExit(); From 640bf46bef5f74a0465ef1f86fe1d51376b4d24c Mon Sep 17 00:00:00 2001 From: andrewm Date: Fri, 29 Sep 2017 13:31:29 -0700 Subject: [PATCH 869/870] tabs --- Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs index 2f3560540..658508b4c 100644 --- a/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs +++ b/Menus/ToolsMenu/ToolsMenuButton/ToolsMenuButton.cs @@ -519,10 +519,10 @@ void OnBackgroundButtonClick() void OnSecondaryButtonClicked() { - if (!implementsSecondaryButton) - { - return; - } + if (!implementsSecondaryButton) + { + return; + } this.RestartCoroutine(ref m_VisibilityCoroutine, AnimateHideAndDestroy()); closeButton(); ActionButtonHoverExit(); From b5a96770f8558155a0598901468225d335352fa0 Mon Sep 17 00:00:00 2001 From: andrewm Date: Fri, 29 Sep 2017 13:40:38 -0700 Subject: [PATCH 870/870] Merged in hamburger icon --- Menus/ToolsMenu/Textures/MenuIcon.png | 3 +++ .../Textures/{UnityIcon.png.meta => MenuIcon.png.meta} | 0 Menus/ToolsMenu/Textures/UnityIcon.png | 3 --- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 Menus/ToolsMenu/Textures/MenuIcon.png rename Menus/ToolsMenu/Textures/{UnityIcon.png.meta => MenuIcon.png.meta} (100%) delete mode 100644 Menus/ToolsMenu/Textures/UnityIcon.png diff --git a/Menus/ToolsMenu/Textures/MenuIcon.png b/Menus/ToolsMenu/Textures/MenuIcon.png new file mode 100644 index 000000000..791a25173 --- /dev/null +++ b/Menus/ToolsMenu/Textures/MenuIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35eb9d0eea3f283a10aae75094d2df7ed2f5c1414398fd942e59bbd63942bf02 +size 1802 diff --git a/Menus/ToolsMenu/Textures/UnityIcon.png.meta b/Menus/ToolsMenu/Textures/MenuIcon.png.meta similarity index 100% rename from Menus/ToolsMenu/Textures/UnityIcon.png.meta rename to Menus/ToolsMenu/Textures/MenuIcon.png.meta diff --git a/Menus/ToolsMenu/Textures/UnityIcon.png b/Menus/ToolsMenu/Textures/UnityIcon.png deleted file mode 100644 index e5639fdc2..000000000 --- a/Menus/ToolsMenu/Textures/UnityIcon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e84e553e4a6e78eafdea2d5422af8d235041f8267abc10b1bf93ba6db12c0439 -size 18354